beautypg.com

Compaq AAR04BCTE User Manual

Page 101

background image

eSNMP API Routines

oid2instance

Example

#include
OID

*incoming = &method->varbind->name;

OBJECT

*object

= method->object;

int

instLength;

unsigned int instance[6];

-- in a GET operation --
-- Expected Instance is N.1.A.A.A.A where A’s are IP address --
instLength = oid2instance(incoming, object, instance, 6);
if (instLength != 6)

return ESNMP_MTHD_noSuchInstance;

The N will be in

instance[0]

and the IP address will be in

instance[2]

,

instance[3]

,

instance[4]

, and

instance[5]

.

eSNMP API Routines 5–43