SNMP Manager Programmer's Guide

Constructing and Interpreting Packets
SNMP Manager Programmer’s Guide–134249
5-9
Associating Variable Bindings With Packets
instance
identifiers
SNMP_Bind_
functions
Agents,
subagents, or
other managers
For request or trap packets you
assemble, you assign an instance
identifier for each variable
binding.
For response packets and trap
packets assembled elsewhere,
instance identifiers are assigned
by the originating entity.
For requests and
responses:
pdu.std_pdu.std_vbl.
vblist.vb_obj_id
For traps:
pdu.trap_pdu.trap_vbl.
vblist.vb_obj_id
values SNMP_Bind_
functions
Agents,
subagents, or
other managers
For Get and GetNext packets,
you use SNMP_Bind_Null.
For Set and Trap packets, you
use the SNMP_Bind_ function
appropriate for the data type of
the variable binding:
For signed integer
(INTEGER) values, you use
SNMP_Bind_Integer().
For unsigned integer
(Counter, Gauge, Timeticks,
or UNINTEGER32) values,
you use SNMP_Bind_
Unsigned_Integer().
For octet string (OCTET_
STRING, Opaque, or
DisplayString) values, you
use SNMP_Bind_String().
For OID (OBJECT_
IDENTIFIER) values, you use
SNMP_Bind_Object_ID().
For network address
(IpAddress) values, you use
SNMP_Bind_IP_Address().
For null (NULL) values, you
use SNMP_Bind_Null().
For response packets or trap
packets assembled elsewhere,
values are assigned by the
originating entity.
For requests and
responses:
pdu.std_pdu.std_vbl.
vblist.field
For traps:
pdu.trap_pdu.trap_vbl.
vblist.field
where field depends
on the data type of the
variable binding:
For signed integers,
v_number
For unsigned integers,
v_counter
For octet strings,
v_string
For OIDs, v_object
For network
addresses, v_network_
address
Table 5-4. Assigning Variable Bindings (page 2 of 3)
Data Item
Assigned
Value By Value Description SNMP_PKT_T Field