SNMP Manager Programmer's Guide

Constructing and Interpreting Packets
SNMP Manager Programmer’s Guide–134249
5-8
Associating Variable Bindings With Packets
Associating Variable Bindings With Packets
As Table 5-4 illustrates, you use one of the Manager Services SNMP_Bind_ functions to
associate variable bindings with packets, making one call per variable binding. The
table indicates which function to use when binding variable bindings of various data
types.
Figure 5-5. Retrieving MIB Objects in Lexicographic Order
Table 5-4. Assigning Variable Bindings (page 1 of 3)
Data Item
Assigned
Value By Value Description SNMP_PKT_T Field
number of
variable
bindings
SNMP_Create
_Request() or
SNMP_Create
_Trap()
Manager
Services
For request or trap packets you
assemble, you assign an integer
value indicating the number of
variable bindings to be bound to
the packet.
For response packets or trap
packets assembled elsewhere,
this value is assigned by
Manager Services.
For requests and
responses:
pdu.std_pdu.std_vbl.
vbl_count
For traps:
pdu.trap_pdu.trap_vbl.
vbl_count
505
iso (1)
identified-organization (3)
dod (6)
internet (1)
mgmt (2)
mib-2 (1)
host (25)
hrSystem (1)
hrSystemUpTime (1)
hrSystemDate (2)
hrSystemInitialLoadDevice (3)
hrSystemInitialLoadParameters (4)
hrSystemNumUsers (5)
hrSystemProcesses (6)
hrSystemMaxProcesses (7)
hrStorage (2)
hrMemorySize (2)
hrStorageTable (3)
hrStorageEntry (1)
hrStorageIndex (1)
hrStorageType (2)
hrStorageDescr (3)
. . .
contains 3 entries
1st object retrieved
2nd object retrieved
3rd object retrieved
4th object retrieved
5th object retrieved
6th object retrieved
7th object retrieved
8th object retrieved
9th-11th objects retrieved
12th-14th objects retrieved
15th-17th objects retrieved