Store and retrieve data referenced by an OID.
[The Net-SNMP library]

This is essentially a way of storing data associated with a given OID. [詳細]

関数

netsnmp_oid_stash_nodenetsnmp_oid_stash_create_sized_node (size_t mysize)
 Create an netsnmp_oid_stash node
NETSNMP_INLINE netsnmp_oid_stash_nodenetsnmp_oid_stash_create_node (void)
 Creates a netsnmp_oid_stash_node.
int netsnmp_oid_stash_add_data (netsnmp_oid_stash_node **root, oid *lookup, size_t lookup_len, void *mydata)
 adds data to the stash at a given oid.
netsnmp_oid_stash_nodenetsnmp_oid_stash_get_node (netsnmp_oid_stash_node *root, oid *lookup, size_t lookup_len)
 returns a node associated with a given OID.
netsnmp_oid_stash_nodenetsnmp_oid_stash_getnext_node (netsnmp_oid_stash_node *root, oid *lookup, size_t lookup_len)
 returns the next node associated with a given OID.
void * netsnmp_oid_stash_get_data (netsnmp_oid_stash_node *root, oid *lookup, size_t lookup_len)
 returns a data pointer associated with a given OID.
int netsnmp_oid_stash_store_all (int majorID, int minorID, void *serverarg, void *clientarg)
 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.


関数

int netsnmp_oid_stash_add_data ( netsnmp_oid_stash_node **  root,
oid *  lookup,
size_t  lookup_len,
void *  mydata 
)

adds data to the stash at a given oid.

引数:
root the top of the stash tree
lookup the oid index to store the data at.
lookup_len the length of the lookup oid.
mydata the data to store
戻り値:
SNMPERR_SUCCESS on success, SNMPERR_GENERR if data is already there, SNMPERR_MALLOC on malloc failures or if arguments passed in with NULL values.

oid_stash.c83 行で定義されています。

参照先 netsnmp_oid_stash_node_s::childrennetsnmp_oid_stash_node_s::children_sizenetsnmp_oid_stash_create_node()netsnmp_oid_stash_node_s::next_siblingNULLnetsnmp_oid_stash_node_s::parentnetsnmp_oid_stash_node_s::prev_siblingnetsnmp_oid_stash_node_s::thedatanetsnmp_oid_stash_node_s::value.

参照元 netsnmp_stash_to_next_helper()netsnmp_table_data_set_helper_handler().

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.

戻り値:
NULL on error, otherwise the newly allocated node

oid_stash.c66 行で定義されています。

参照先 netsnmp_oid_stash_create_sized_node().

参照元 netsnmp_oid_stash_add_data().

netsnmp_oid_stash_node* netsnmp_oid_stash_create_sized_node ( size_t  mysize  ) 

Create an netsnmp_oid_stash node

引数:
mysize the size of the child pointer array
戻り値:
NULL on error, otherwise the newly allocated node

oid_stash.c46 行で定義されています。

参照先 netsnmp_oid_stash_node_s::childrennetsnmp_oid_stash_node_s::children_sizeNULLSNMP_MALLOC_TYPEDEF.

参照元 netsnmp_oid_stash_create_node().

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

oid_stash.c401 行で定義されています。

参照先 netsnmp_oid_stash_node_s::childrennetsnmp_oid_stash_free()netsnmp_oid_stash_node_s::next_siblingnetsnmp_oid_stash_node_s::thedata.

参照元 _netsnmp_stash_cache_free()netsnmp_oid_stash_free().

void* netsnmp_oid_stash_get_data ( netsnmp_oid_stash_node root,
oid *  lookup,
size_t  lookup_len 
)

returns a data pointer associated with a given OID.

This is equivelent to netsnmp_oid_stash_get_node, but returns only the data not the entire node.

引数:
root the top of the stash
lookup the oid to search for
lookup_len the length of the search oid.

oid_stash.c282 行で定義されています。

参照先 netsnmp_oid_stash_get_node()NULLnetsnmp_oid_stash_node_s::thedata.

参照元 netsnmp_stash_cache_helper()netsnmp_table_data_set_helper_handler().

netsnmp_oid_stash_node* netsnmp_oid_stash_get_node ( netsnmp_oid_stash_node root,
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

oid_stash.c154 行で定義されています。

参照先 netsnmp_oid_stash_node_s::childrennetsnmp_oid_stash_node_s::children_sizenetsnmp_oid_stash_node_s::next_siblingNULLnetsnmp_oid_stash_node_s::value.

参照元 netsnmp_oid_stash_get_data().

netsnmp_oid_stash_node* netsnmp_oid_stash_getnext_node ( netsnmp_oid_stash_node root,
oid *  lookup,
size_t  lookup_len 
)

returns the next node associated with a given OID.

INCOMPLETE. This is equivelent to a GETNEXT operation.

oid_stash.c191 行で定義されています。

参照先 netsnmp_oid_stash_node_s::childrennetsnmp_oid_stash_node_s::children_sizenetsnmp_oid_stash_node_s::next_siblingNULLnetsnmp_oid_stash_node_s::value.

参照元 netsnmp_stash_cache_helper().

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.

oid_stash.c334 行で定義されています。

参照先 netsnmp_oid_stash_node_s::childrennetsnmp_oid_stash_node_s::children_sizenetsnmp_ds_get_string()netsnmp_oid_stash_store()netsnmp_oid_stash_node_s::next_siblingread_config_save_objid()read_config_store()SNMP_MAXBUFnetsnmp_oid_stash_node_s::thedatanetsnmp_oid_stash_node_s::value.

参照元 netsnmp_oid_stash_store()netsnmp_oid_stash_store_all().

int netsnmp_oid_stash_store_all ( int  majorID,
int  minorID,
void *  serverarg,
void *  clientarg 
)

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.

oid_stash.c304 行で定義されています。

参照先 netsnmp_oid_stash_save_info_s::dumpfnnetsnmp_oid_stash_store()netsnmp_oid_stash_save_info_s::rootnetsnmp_oid_stash_save_info_s::token.

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.

oid_stash.c374 行で定義されています。

参照先 netsnmp_oid_stash_node_s::childrennetsnmp_oid_stash_node_s::children_sizenetsnmp_oid_stash_node_s::next_siblingnetsnmp_oid_stash_node_s::thedatanetsnmp_oid_stash_node_s::value.


net-snmpに対してSat Sep 5 13:14:29 2009に生成されました。  doxygen 1.4.7