SNMP Manager Programmer's Guide

Constructing and Interpreting Packets
SNMP Manager Programmer’s Guide–134249
5-17
Functions for Binding MIB Objects
Then the trap packet is initialized:
send-pkt = SNMP_Create_Trap(VERSION_RFC1067,
strlen(community), community,
base_oid.num_components, base_oid.component_list,
(OCTET_T *)&host_addr, generic, specific,
timestamp, oidcnt);
Functions for Binding MIB Objects
After initializing a request or trap packet, you bind variable bindings to it using one
SNMP_Bind_ function per variable binding. The SNMP_Bind function you use
depends on the SNMP data type of the variable binding and the kind of PDU in the
packet:
This subsection describes and provides examples for the six SNMP_Bind_ functions.
PDU Type SNMP Data Type SNMP_Bind_ Function
Get and GetNext unknown SNMP_Bind_Null()
Set and Trap INTEGER
IpAddress
NULL
OBJECT_IDENTIFIER
OCTET_STRING
Opaque
DisplayString
NSAPADDRESS
Counter
Gauge
Timeticks
UINTEGER32
SNMP_Bind_Integer()
SNMP_Bind_IP_Address()
SNMP_Bind_Null()
SNMP_Bind_Object_ID()
SNMP_Bind_String
SNMP_Bind_Unsigned_Integer()