37 #ifndef __LWIP_SNMP_STRUCTS_H__
38 #define __LWIP_SNMP_STRUCTS_H__
49 #include "private_mib.h"
57 #define MIB_OBJECT_NONE 0
58 #define MIB_OBJECT_SCALAR 1
59 #define MIB_OBJECT_TAB 2
62 #define MIB_ACCESS_READ 1
63 #define MIB_ACCESS_WRITE 2
66 #define MIB_OBJECT_READ_ONLY MIB_ACCESS_READ
67 #define MIB_OBJECT_READ_WRITE (MIB_ACCESS_READ | MIB_ACCESS_WRITE)
68 #define MIB_OBJECT_WRITE_ONLY MIB_ACCESS_WRITE
69 #define MIB_OBJECT_NOT_ACCESSIBLE 0
95 #define MIB_NODE_SC 0x01
97 #define MIB_NODE_AR 0x02
99 #define MIB_NODE_RA 0x03
101 #define MIB_NODE_LR 0x04
103 #define MIB_NODE_EX 0x05
109 void (*get_object_def)(
u8_t ident_len,
s32_t *ident,
struct obj_def *od);
112 void (*get_value)(
struct obj_def *od,
u16_t len,
void *value);
114 u8_t (*set_test)(
struct obj_def *od,
u16_t len,
void *value);
116 void (*set_value)(
struct obj_def *od,
u16_t len,
void *value);
124 typedef struct mib_node mib_scalar_node;
128 struct mib_array_node
131 void (*get_object_def)(
u8_t ident_len,
s32_t *ident,
struct obj_def *od);
132 void (*get_value)(
struct obj_def *od,
u16_t len,
void *value);
133 u8_t (*set_test)(
struct obj_def *od,
u16_t len,
void *value);
134 void (*set_value)(
struct obj_def *od,
u16_t len,
void *value);
141 struct mib_node*
const *nptr;
146 struct mib_ram_array_node
149 void (*get_object_def)(
u8_t ident_len,
s32_t *ident,
struct obj_def *od);
150 void (*get_value)(
struct obj_def *od,
u16_t len,
void *value);
151 u8_t (*set_test)(
struct obj_def *od,
u16_t len,
void *value);
152 void (*set_value)(
struct obj_def *od,
u16_t len,
void *value);
159 struct mib_node **nptr;
164 struct mib_list_node *prev;
165 struct mib_list_node *next;
167 struct mib_node *nptr;
172 struct mib_list_rootnode
175 void (*get_object_def)(
u8_t ident_len,
s32_t *ident,
struct obj_def *od);
176 void (*get_value)(
struct obj_def *od,
u16_t len,
void *value);
177 u8_t (*set_test)(
struct obj_def *od,
u16_t len,
void *value);
178 void (*set_value)(
struct obj_def *od,
u16_t len,
void *value);
184 struct mib_list_node *head;
185 struct mib_list_node *tail;
192 struct mib_external_node
195 void (*get_object_def)(
u8_t ident_len,
s32_t *ident,
struct obj_def *od);
196 void (*get_value)(
struct obj_def *od,
u16_t len,
void *value);
197 u8_t (*set_test)(
struct obj_def *od,
u16_t len,
void *value);
198 void (*set_value)(
struct obj_def *od,
u16_t len,
void *value);
210 u16_t (*level_length)(
void* addr_inf,
u8_t level);
214 void (*get_objid)(
void* addr_inf,
u8_t level,
u16_t idx,
s32_t *sub_id);
217 void (*get_object_def_q)(
void* addr_inf,
u8_t rid,
u8_t ident_len,
s32_t *ident);
218 void (*get_value_q)(
u8_t rid,
struct obj_def *od);
219 void (*set_test_q)(
u8_t rid,
struct obj_def *od);
220 void (*set_value_q)(
u8_t rid,
struct obj_def *od,
u16_t len,
void *value);
222 void (*get_object_def_a)(
u8_t rid,
u8_t ident_len,
s32_t *ident,
struct obj_def *od);
223 void (*get_value_a)(
u8_t rid,
struct obj_def *od,
u16_t len,
void *value);
224 u8_t (*set_test_a)(
u8_t rid,
struct obj_def *od,
u16_t len,
void *value);
225 void (*set_value_a)(
u8_t rid,
struct obj_def *od,
u16_t len,
void *value);
228 void (*get_object_def_pc)(
u8_t rid,
u8_t ident_len,
s32_t *ident);
229 void (*get_value_pc)(
u8_t rid,
struct obj_def *od);
230 void (*set_test_pc)(
u8_t rid,
struct obj_def *od);
231 void (*set_value_pc)(
u8_t rid,
struct obj_def *od);
235 extern const struct mib_array_node internet;
238 void noleafs_get_object_def(
u8_t ident_len,
s32_t *ident,
struct obj_def *od);
239 void noleafs_get_value(
struct obj_def *od,
u16_t len,
void *value);
240 u8_t noleafs_set_test(
struct obj_def *od,
u16_t len,
void *value);
241 void noleafs_set_value(
struct obj_def *od,
u16_t len,
void *value);
248 struct mib_list_node* snmp_mib_ln_alloc(
s32_t id);
249 void snmp_mib_ln_free(
struct mib_list_node *ln);
250 struct mib_list_rootnode* snmp_mib_lrn_alloc(
void);
251 void snmp_mib_lrn_free(
struct mib_list_rootnode *lrn);
253 s8_t snmp_mib_node_insert(
struct mib_list_rootnode *rn,
s32_t objid,
struct mib_list_node **insn);
254 s8_t snmp_mib_node_find(
struct mib_list_rootnode *rn,
s32_t objid,
struct mib_list_node **fn);
255 struct mib_list_rootnode *snmp_mib_node_delete(
struct mib_list_rootnode *rn,
struct mib_list_node *n);
257 struct mib_node* snmp_search_tree(
struct mib_node *node,
u8_t ident_len,
s32_t *ident,
struct snmp_name_ptr *np);
258 struct mib_node* snmp_expand_tree(
struct mib_node *node,
u8_t ident_len,
s32_t *ident,
struct snmp_obj_id *oidret);
260 u8_t snmp_iso_prefix_expand(
u8_t ident_len,
s32_t *ident,
struct snmp_obj_id *oidret);