SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide134249
2-71
SNMPSET
11. The value of peertype, which holds the Manager Services representation of the
SNMP data type for the target MIB object, is used to determine how to create a
variable binding for the object. Variable bindings are bound using Manager Services
functions tailored to support MIB objects of specific SNMP data types. Each
function accepts a pointer to the unencoded-packet structure, an integer identifying
the relative position of the OID in the packet, the total number of OID components
in the object’s OID, the OID components themselves, and the value of the object.
12. If the MIB object is of type INTEGER, binding is done using the
SNMP_Bind_Integer() function.
13. If the MIB object is of type TimeTicks, Gauge, or Counter, the
SNMP_Bind_Unsigned_Integer() function is called.
14. If the MIB object is of type IpAddress and the IP address value was specified at
invocation using dotted numeric notation, SNMPSET calls the TCP/IP function
inet_addr() to convert the value into binary format. If a node name was specified,
SNMPSET calls gethostbyname() to convert the name into an IP address. Then the
SNMP_Bind_IP_Address() function is called.
15. If the MIB object is of type OBJECT_IDENTIFIER, the common utility function
oidstr_to_oid() is used to put the OID value into the format required for the
SNMP_Bind_Object_ID() function call.
16. If the MIB object is of type OCTET_STRING, DisplayString, or Opaque, the
SNMP_Bind_String() function is called. The common utility function hexcheck() is
used to compute the number of bytes in the MIB object value.
17. If the MIB object is of type NULL, the SNMP_Bind_Null() function is called.
18. SNMP_WriteRead_() is called.