SNMP Manager Programmer's Guide
Constructing and Interpreting Packets
SNMP Manager Programmer’s Guide–134249
5-25
SNMP_Bind_Object_ID()
The value of peertype, which holds the Manager Services representation for the SNMP
data type for the target MIB object, is used to determine which SNMP_Bind_ function
to call. The function SNMP_Bind_Null() is called when the value of peertype is
VT_EMPTY:
switch (peertype)
{
case VT_EMPTY:
rcode = SNMP_Bind_Null(send_pkt, i,
base_oid.num_components,
base_oid.component_list);
break;
SNMP_Bind_Object_ID()
This function associates a variable binding of type OBJECT_IDENTIFIER with a
packet previously initialized with SNMP_Create_Request() or SNMP_Create_Trap().
rcode
is a return integer indicating whether the call succeeded. A value of 0 indicates
success, and -1 indicates failure.
packet
is a pointer to an initialized request or trap packet.
index
is a zero-based index value indicating the position into which to bind the MIB
variable in a list of variable bindings. A value of 0 binds the variable at the front of
the list, 1 binds the variable into the second position, and so forth. The order in
which you assign variable bindings to a list is irrelevant. For example, if you have
two variable bindings, you can use an index value of 1 in the first SNMP_Bind_ call
and a value of 0 in the second call to bind the variables into the second and first
positions, respectively.
rcode = SNMP_Bind_Object_ID(packet,
index,
instance-count,
instance-components,
value-count,
value-components);
int SNMP_Bind_Object_ID(SNMP_PKT_T *packet,
int index,
int instance-count,
OIDC_T *instance-components,
int value-count,
OIDC_T value-components);