eSNMP API Routines
instance2oid
Example
#include <esnmp.h>
VARBIND *vb; <-- filled in
OBJECT *object; <-- filled in
unsigned int instance[6];
-- Construct the outgoing OID in a GETNEXT --
-- Instance is N.1.A.A.A.A where A’s are IP address --
instance[0] = data->ipNetToMediaIfIndex;
instance[1] = 1;
for (i = 0; i < 4; i++) {
instance[i+2]=((unsigned char *)(&data->ipNetToMediaNetAddress))[i];
}
instance2oid(&vb->name, object, instance, 6);
eSNMP API Routines 5–41