TNM SNMP
Varbind Lists
The SNMP protocol always
operates on a list of MIB variables. This list is called a varbind list.
A varbind list is represented
as a Tcl list. Each element of the varbind list is itself a Tcl list describing
one varbind element.
A fully specified varbind
list element has three elements: an object
identifier, which identifies the MIB variable, the data
type of the MIB variable and the value of the MIB variable.
A fully specified varbind
list might look like:
{
{1.3.6.1.2.1.1.3.0 TimeTicks
20308}
{1.3.6.1. 2.1.2.2.1.3.1
INTEGER softwareLoopback}
{1.3.6.1.2.1.2.2.1.2.1 {OCTET
STRING} lo0}
{1.3.6.1.2.1.2.2.1.8.1 INTEGER
up}
}
It is not necessary to use fully
specified varbind lists when invoking SNMP retrieval operations. It is
possible to omit the type and value fields when retrieving values from
MIB variables.
For example, to retrieve
the fully specified varbind list show above, the following much shorter
varbind list has been used:
{
1.3.6.1.2.1.1.3.0
1.3.6.1.2.1.2.2.1.3.1
1.3.6.1.2.1.2.2.1.2.1
1.3.6.1.2.1.2.2.1.8.1
}
It is possible to replace OBJECT
IDENTIFIER values with labels or names that resolve to an OBJECT IDENTIFIER
value. (See Tnm::mib for details about
legal names.) This further simplifies the varbind list above to:
{
SNMPv2-MIB!sysUpTime.0
IF-MIB!ifType.1
IF-MIB!ifDescr.1
IF-MIB!ifOperStatus.1
}
In order to change the value
of a MIB variable, you have to include the new value in the varbind list.
It is however possible to omit the type element if the type can be obtained
from a MIB definition. This allows using a list like
{
{SNMPv2-MIB!sysContact.0
“schoenw@ibr.cs.tu-bs.de”}
}
to change the value of the sysContact.0
MIB variable. Note, that the Tnm extension always returns fully specified
varbind lists to avoid ambiguities.
SNMPv2c and SNMPv3 varbind
lists may contain exceptions (noSuchObject, noSuchInstance, endOfMibView).
These exceptions are signaled in the type element of a varbind list element.
The value of the varbind
is set to a null value that conforms to the data type of the object type:
{
{1.3.6.1.2.1.2.2.1.3.2 noSuchInstance
0}
{1.3.6.1.2.1.2.2.1.2.2 noSuchInstance
{}}
}
It is the responsibility of
the application to check for exceptions. An application will not necessarily
crash if such a check is missing, but it might get confused while interpreting
null values.
|