5 * designed to store/retrieve information associated with a given oid.
6 * * Storage is done in an efficient manner for fast lookups.
9 #define OID_STASH_CHILDREN_SIZE 31
15 struct netsnmp_oid_stash_node_s;
17 /* args: buffer, sizeof(buffer), yourdata, stashnode */
18 typedef int (NetSNMPStashDump) (char *, size_t,
20 struct netsnmp_oid_stash_node_s *);
22 typedef struct netsnmp_oid_stash_node_s {
24 struct netsnmp_oid_stash_node_s **children; /* array of children */
26 struct netsnmp_oid_stash_node_s *next_sibling; /* cache too small links */
27 struct netsnmp_oid_stash_node_s *prev_sibling;
29 * struct netsnmp_oid_stash_node_s *parent;
35 } netsnmp_oid_stash_node;
37 typedef struct netsnmp_oid_stash_save_info_s {
39 netsnmp_oid_stash_node **root;
40 NetSNMPStashDump *dumpfn;
41 } netsnmp_oid_stash_save_info;
43 int netsnmp_oid_stash_add_data(netsnmp_oid_stash_node
47 SNMPCallback netsnmp_oid_stash_store_all;
50 netsnmp_oid_stash_node
51 *netsnmp_oid_stash_get_node(netsnmp_oid_stash_node *root,
52 oid * lookup, size_t lookup_len);
53 void *netsnmp_oid_stash_get_data(netsnmp_oid_stash_node
57 netsnmp_oid_stash_node *netsnmp_oid_stash_create_sized_node(size_t
59 netsnmp_oid_stash_node *netsnmp_oid_stash_create_node(void); /* returns a malloced node */
61 void netsnmp_oid_stash_store(netsnmp_oid_stash_node *root,
62 const char *tokenname, NetSNMPStashDump *dumpfn,
63 oid *curoid, size_t curoid_len);
68 #endif /* OID_STASH_H */