2008/6/27 Need Help <[EMAIL PROTECTED]>:
> I am writing a MIB for my company and one of the fields needs to pass back
> text but I am not sure whether to use the "SnmpAdminString" or
> "DisplayString" field type.
>
> Will someone explain the difference for me?
Have you tried reading the descriptions of these two types
in the relevant MIB files?
SNMPv2-TC:DisplayString ::= TEXTUAL-CONVENTION
DISPLAY-HINT "255a"
DESCRIPTION
"Represents textual information taken from the NVT ASCII
character set, as defined in pages 4, 10-11 of RFC 854...."
SYNTAX OCTET STRING (SIZE (0..255))
SNMP-FRAMEWORK-MIB::SnmpAdminString ::= TEXTUAL-CONVENTION
DISPLAY-HINT "255t"
STATUS current
DESCRIPTION "An octet string containing administrative
information, preferably in human-readable form.
.... represented using the ISO/IEC
IS 10646-1 character set, encoded as an octet
string using the UTF-8 transformation format
described in [RFC2279]....."
SYNTAX OCTET STRING (SIZE (0..255))
So they are both printable strings, of max length 255.
But DisplayString can only take 7-bit ASCII string values,
while SnmpAdminString can handle UTF-8-encoded
internationalised strings.
Hence if you're geographically-blinkered, and assume that
USA==TheWorld, you'll probably use DisplayString.
If you've twigged the fact that not everyone works in
English, and some other languages can contain other
characters that don't appear on a US keyboard, then
you use SnmpAdminString.
:-)
Dave
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders