snmpstructfiller(3) | Library Functions Manual | snmpstructfiller(3) |
NAME¶
snmpstrucfiller - snmpkit functions for taking making snmp requests based upon a structure.SYNOPSIS¶
#include <snmpkit.h>SNMPSTRUCTFILLER *new_snmpstructfiller(SNMPSESSION *session); void delete_snmpstructfiller(SNMPSTRUCTFILLER *doomed); void snmpstructfiller_append(SNMPSTRUCTFILLER *sf, const char *oidstr,Tags tag, unsigned int offset); void snmpstructfiller_remove(SNMPSTRUCTFILLER *sf,const char *oidstr); void *snmpstructfiller_get(SNMPSTRUCTFILLER *sf,void *tobefilled); void *snmpstructfiller_get_next(SNMPSTRUCTFILLER *sf, void *tobefilled);
DESCRIPTION¶
A snmpstructfiller is an opaque data structure used fill C structures with data from the snmp requests.- INT_TAG long
- STRING_TAG char*
- IPADDR_TAG unsigned long
- You get the IPADDR back in binary format. You must translate it byte for byte to get an IPADDR in the format that is usually expected.
- COUNTER_TAG long
- This could concievably be an unsigned long but enough implementations of MIBS are fouled up in such that even though the mib specifies a counter, the device returns an integer. That it is best to store this number in an integer rather than an unsigned..
- TIME_TICK_TAG long
struct info {
char *descr; char *contact;
} foo; Then the offset of descr would be (char*)&(foo.descr)-(char*)&foo and the offset of contact would be (char*)&(foo.contact)-(char*)&foo I know that this is a very bad way of doing things and I intend to change it in the future. Probably what I will do is change this to a function pointer which when called takes the pointer to the structure that it is supposed to insert the data in as well as the value of the data and it will insert it into the data into the structure.
AUTHOR¶
Ben Woodard <ben@users.sourceforge.net>BUGS¶
The library can possibly throw different kinds of C++ exceptions that won't be caught by the glue code and therefore it can cause your program to crash inexplicably.SEE ALSO¶
libsnmpkit(3), snmpsession(3), snmpsock(3), snmptable(3)November 2000 | GNU snmpkit 0.4 |