eSNMP API Routines
oid2instance
oid2instance
Extracts the instance values from an OID structure and copies them to the
specified array of integers. The routine then returns the number of elements in
the array.
Format
int oid2instance ( oid *oid,
object *obj,
unsigned int *instance,
int *max_len );
Arguments
oid
A pointer to an incoming OID containing an instance or part of an instance.
obj
A pointer to the object table entry for the MIB variable.
instance
A pointer to an array of unsigned integers where the index is placed.
max_len
The number of elements in the
instance
array.
Description
The instance values are the elements of an OID beyond those that identify the
MIB variable. These elements identify a specific instance of a MIB value.
If there are more elements in the OID structure than specified by the
max_len
parameter, the function copies the number of elements specified by
max_len
only
and returns the total number of elements that would have been copied had there
been space.
Return Values
Less than zero
An error occurred. This is not returned if the
object was obtained by looking at this OID.
Zero
No instance elements.
Greater than zero
The returned value indicates the number of
elements in the index. This could be larger than
the
max_len
parameter.
5–42 eSNMP API Routines