/usr/include/net-snmp/library/oid_stash.h is in libsnmp-dev 5.7.3+dfsg-1.8ubuntu3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | #ifndef OID_STASH_H
#define OID_STASH_H
/*
* designed to store/retrieve information associated with a given oid.
* Storage is done in an efficient tree manner for fast lookups.
*/
#define OID_STASH_CHILDREN_SIZE 31
#ifdef __cplusplus
extern "C" {
#endif
struct netsnmp_oid_stash_node_s;
/* args: buffer, sizeof(buffer), yourdata, stashnode */
typedef int (NetSNMPStashDump) (char *, size_t,
void *,
struct netsnmp_oid_stash_node_s *);
typedef void (NetSNMPStashFreeNode) (void *);
typedef struct netsnmp_oid_stash_node_s {
oid value;
struct netsnmp_oid_stash_node_s **children; /* array of children */
size_t children_size;
struct netsnmp_oid_stash_node_s *next_sibling; /* cache too small links */
struct netsnmp_oid_stash_node_s *prev_sibling;
struct netsnmp_oid_stash_node_s *parent;
void *thedata;
} netsnmp_oid_stash_node;
typedef struct netsnmp_oid_stash_save_info_s {
const char *token;
netsnmp_oid_stash_node **root;
NetSNMPStashDump *dumpfn;
} netsnmp_oid_stash_save_info;
NETSNMP_IMPORT
int netsnmp_oid_stash_add_data(netsnmp_oid_stash_node **root,
const oid * lookup,
size_t lookup_len,
void *mydata);
SNMPCallback netsnmp_oid_stash_store_all;
netsnmp_oid_stash_node
*netsnmp_oid_stash_get_node(netsnmp_oid_stash_node *root,
const oid * lookup, size_t lookup_len);
NETSNMP_IMPORT
void *netsnmp_oid_stash_get_data(netsnmp_oid_stash_node *root,
const oid * lookup,
size_t lookup_len);
NETSNMP_IMPORT
netsnmp_oid_stash_node *
netsnmp_oid_stash_getnext_node(netsnmp_oid_stash_node *root,
oid * lookup, size_t lookup_len);
netsnmp_oid_stash_node *netsnmp_oid_stash_create_sized_node(size_t
mysize);
netsnmp_oid_stash_node *netsnmp_oid_stash_create_node(void); /* returns a malloced node */
void netsnmp_oid_stash_store(netsnmp_oid_stash_node *root,
const char *tokenname,
NetSNMPStashDump *dumpfn,
oid *curoid, size_t curoid_len);
/* frees all data in the stash and cleans it out. Sets root = NULL */
NETSNMP_IMPORT
void netsnmp_oid_stash_free(netsnmp_oid_stash_node **root,
NetSNMPStashFreeNode *freefn);
/* a noop function that can be passed to netsnmp_oid_stash_node to
NOT free the data */
NetSNMPStashFreeNode netsnmp_oid_stash_no_free;
#ifdef __cplusplus
}
#endif
#endif /* OID_STASH_H */
|