#include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> #define MAX_ASN_STR_LEN int snmp_get (struct snmp_session *ss, const char *objid, struct snmp_value *value); int snmp_set (struct snmp_session *ss, char *objid, struct snmp_value value); |
These SNMP wrapper utility functions where created to hide the more complex logic needed to use straight net-snmp calls from plugin developers.
int snmp_get (struct snmp_session *ss, const char *objid, struct snmp_value *value); |
Gets a single value indicated by the objectid using snmp. In the case of multiple values being returned, the type in value will be ASN_NULL (0x05). Nothing else in value will be filled in.
a handle to the snmp session needed to make an snmp transaction.
string containing the OID entry.
the value received from snmp will be put in this union.
0 if successful, -1 if there was an error.
int snmp_set (struct snmp_session *ss, char *objid, struct snmp_value value); |
Sets a value where indicated by the objectid using snmp.
a handle to the snmp session needed to make an snmp transaction.
string containing the OID to set.
the value to set the oid with.
0 if Success, less than 0 if Failure.