Template:FAQ:Applications 15b

From Net-SNMP Wiki
Revision as of 16:39, 28 December 2006 by Dts12 (Talk | contribs) (New (post-5.4) entry)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There are two ways of encoding variable-length string index values within an OID. The first approach (which can be used anywhere in a list of index values) is to give the length of the string value, followed by the individual characters:

   "wes"   =   3 'w' 'e' 's'

The other approach (which can only be used with the very last index object of a table) is simply to list the individual characters directly:

   "wes"   =   'w' 'e' 's'

This second approach is indicated by the token IMPLIED in the INDEX clause in the MIB table definition. This is also used for fixed-length index values, where the number of characters is explicitly specified in the MIB file.

When working with string index values, the Net-SNMP client tools use double quotes (i.e. "wes") to indicate the first (explicit-length) form, and single quotes (i.e. 'wes') to indicate the second (implicit-length) form.