|
net-snmp 5.7
|
This is essentially a way of storing data associated with a given OID. More...
Functions | |
| NETSNMP_INLINE netsnmp_oid_stash_node * | netsnmp_oid_stash_create_node (void) |
| Creates a netsnmp_oid_stash_node. | |
| netsnmp_feature_child_of (oid_stash_add_data, oid_stash_all) | |
| netsnmp_oid_stash_node * | netsnmp_oid_stash_get_node (netsnmp_oid_stash_node *root, const oid *lookup, size_t lookup_len) |
| returns a node associated with a given OID. | |
| netsnmp_feature_child_of (oid_stash_iterate, oid_stash_all) | |
| returns the next node associated with a given OID. | |
| netsnmp_feature_child_of (oid_stash_get_data, oid_stash_all) | |
| netsnmp_feature_child_of (oid_stash_store_all, oid_stash_all) | |
| a wrapper around netsnmp_oid_stash_store for use with a snmp_alarm. | |
| void | netsnmp_oid_stash_store (netsnmp_oid_stash_node *root, const char *tokenname, NetSNMPStashDump *dumpfn, oid *curoid, size_t curoid_len) |
| stores data in a starsh tree to peristent storage. | |
| void | oid_stash_dump (netsnmp_oid_stash_node *root, char *prefix) |
| For debugging: dump the netsnmp_oid_stash tree to stdout. | |
| void | netsnmp_oid_stash_free (netsnmp_oid_stash_node **root, NetSNMPStashFreeNode *freefn) |
| Frees the contents of a netsnmp_oid_stash tree. | |
| void | netsnmp_oid_stash_no_free (void *bogus) |
This is essentially a way of storing data associated with a given OID.
It stores a bunch of data pointers within a memory tree that allows fairly efficient lookups with a heavily populated tree.
| netsnmp_feature_child_of | ( | oid_stash_iterate | , |
| oid_stash_all | |||
| ) |
returns the next node associated with a given OID.
INCOMPLETE. This is equivelent to a GETNEXT operation.
Definition at line 200 of file oid_stash.c.
| netsnmp_feature_child_of | ( | oid_stash_store_all | , |
| oid_stash_all | |||
| ) |
a wrapper around netsnmp_oid_stash_store for use with a snmp_alarm.
when calling snmp_alarm, you can list this as a callback. The clientarg should be a pointer to a netsnmp_oid_stash_save_info pointer. It can also be called directly, of course. The last argument (clientarg) is the only one that is used. The rest are ignored by the function.
| majorID | |
| minorID | |
| serverarg | |
| clientarg | A pointer to a netsnmp_oid_stash_save_info structure. |
Definition at line 319 of file oid_stash.c.
| NETSNMP_INLINE netsnmp_oid_stash_node* netsnmp_oid_stash_create_node | ( | void | ) |
Creates a netsnmp_oid_stash_node.
Assumes you want the default OID_STASH_CHILDREN_SIZE hash size for the node.
Definition at line 73 of file oid_stash.c.
| void netsnmp_oid_stash_free | ( | netsnmp_oid_stash_node ** | root, |
| NetSNMPStashFreeNode * | freefn | ||
| ) |
Frees the contents of a netsnmp_oid_stash tree.
| root | the top of the tree (or branch to be freed) |
| freefn | The function to be called on each data (void *) pointer. If left NULL the system free() function will be called |
Definition at line 420 of file oid_stash.c.
| netsnmp_oid_stash_node* netsnmp_oid_stash_get_node | ( | netsnmp_oid_stash_node * | root, |
| const oid * | lookup, | ||
| size_t | lookup_len | ||
| ) |
returns a node associated with a given OID.
| root | the top of the stash tree |
| lookup | the oid to look up a node for. |
| lookup_len | the length of the lookup oid |
Definition at line 164 of file oid_stash.c.
| void netsnmp_oid_stash_store | ( | netsnmp_oid_stash_node * | root, |
| const char * | tokenname, | ||
| NetSNMPStashDump * | dumpfn, | ||
| oid * | curoid, | ||
| size_t | curoid_len | ||
| ) |
stores data in a starsh tree to peristent storage.
This function can be called to save all data in a stash tree to Net-SNMP's percent storage. Make sure you register a parsing function with the read_config system to re-incorperate your saved data into future trees.
| root | the top of the stash to store. |
| tokenname | the file token name to save in (passing "snmpd" will save things into snmpd.conf). |
| dumpfn | A function which can dump the data stored at a particular node into a char buffer. |
| curoid | must be a pointer to a OID array of length MAX_OID_LEN. |
| curoid_len | must be 0 for the top level call. |
Definition at line 353 of file oid_stash.c.
| void oid_stash_dump | ( | netsnmp_oid_stash_node * | root, |
| char * | prefix | ||
| ) |
For debugging: dump the netsnmp_oid_stash tree to stdout.
| root | The top of the tree |
| prefix | a character string prefix printed to the beginning of each line. |
Definition at line 393 of file oid_stash.c.
1.7.4