44const s32_t prefix[4] = {1, 3, 6, 1};
46#define NODE_STACK_SIZE (LWIP_SNMP_OBJ_ID_LEN)
51 struct mib_node* r_ptr;
57static u8_t node_stack_cnt;
58static struct nse node_stack[NODE_STACK_SIZE];
64push_node(
struct nse*
node)
66 LWIP_ASSERT(
"node_stack_cnt < NODE_STACK_SIZE",node_stack_cnt < NODE_STACK_SIZE);
68 if (node_stack_cnt < NODE_STACK_SIZE)
70 node_stack[node_stack_cnt] = *
node;
79pop_node(
struct nse*
node)
81 if (node_stack_cnt > 0)
84 *
node = node_stack[node_stack_cnt];
102 while ((nif !=
NULL) && (
i < ifidx))
155struct mib_list_node *
156snmp_mib_ln_alloc(
s32_t id)
158 struct mib_list_node *ln;
160 ln = (
struct mib_list_node *)
memp_malloc(MEMP_SNMP_NODE);
172snmp_mib_ln_free(
struct mib_list_node *ln)
177struct mib_list_rootnode *
178snmp_mib_lrn_alloc(
void)
180 struct mib_list_rootnode *lrn;
182 lrn = (
struct mib_list_rootnode*)
memp_malloc(MEMP_SNMP_ROOTNODE);
185 lrn->get_object_def = noleafs_get_object_def;
186 lrn->get_value = noleafs_get_value;
187 lrn->set_test = noleafs_set_test;
188 lrn->set_value = noleafs_set_value;
189 lrn->node_type = MIB_NODE_LR;
199snmp_mib_lrn_free(
struct mib_list_rootnode *lrn)
216snmp_mib_node_insert(
struct mib_list_rootnode *rn,
s32_t objid,
struct mib_list_node **insn)
218 struct mib_list_node *nn;
225 if (rn->head ==
NULL)
229 nn = snmp_mib_ln_alloc(objid);
244 struct mib_list_node *
n;
249 if (
n->objid == objid)
256 else if (
n->objid < objid)
262 nn = snmp_mib_ln_alloc(objid);
290 nn = snmp_mib_ln_alloc(objid);
338snmp_mib_node_find(
struct mib_list_rootnode *rn,
s32_t objid,
struct mib_list_node **
fn)
341 struct mib_list_node *
n;
345 while ((
n !=
NULL) && (
n->objid != objid))
353 else if (
n->nptr ==
NULL)
360 struct mib_list_rootnode *
r;
362 if (
n->nptr->node_type == MIB_NODE_LR)
364 r = (
struct mib_list_rootnode *)
n->nptr;
394struct mib_list_rootnode *
395snmp_mib_node_delete(
struct mib_list_rootnode *rn,
struct mib_list_node *
n)
397 struct mib_list_rootnode *
next;
403 next = (
struct mib_list_rootnode*)(
n->nptr);
412 n->next->prev =
NULL;
415 else if (
n == rn->tail)
428 n->next->prev =
n->prev;
454 u8_t node_type, ext_level;
460 node_type =
node->node_type;
461 if ((node_type == MIB_NODE_AR) || (node_type == MIB_NODE_RA))
463 struct mib_array_node *an;
469 an = (
struct mib_array_node *)
node;
471 while ((i < an->maxlength) && (an->objid[
i] != *
ident))
475 if (i < an->maxlength)
479 if (an->nptr[
i] ==
NULL)
485 return (
struct mib_node*)an;
509 else if(node_type == MIB_NODE_LR)
511 struct mib_list_rootnode *lrn;
512 struct mib_list_node *ln;
517 lrn = (
struct mib_list_rootnode *)
node;
520 while ((ln !=
NULL) && (ln->objid != *
ident))
528 if (ln->nptr ==
NULL)
532 return (
struct mib_node*)lrn;
556 else if(node_type == MIB_NODE_EX)
558 struct mib_external_node *
en;
564 en = (
struct mib_external_node *)
node;
567 len =
en->level_length(
en->addr_inf,ext_level);
568 while ((
i <
len) && (
en->ident_cmp(
en->addr_inf,ext_level,
i,*
ident) != 0))
576 en->get_objid(
en->addr_inf,ext_level,
i,&debug_id);
578 if ((ext_level + 1) ==
en->tree_levels)
582 return (
struct mib_node*)
en;
606 else if (node_type == MIB_NODE_SC)
610 sn = (mib_scalar_node *)
node;
615 return (
struct mib_node*)sn;
640empty_table(
struct mib_node *
node)
647 node_type =
node->node_type;
648 if (node_type == MIB_NODE_LR)
650 struct mib_list_rootnode *lrn;
651 lrn = (
struct mib_list_rootnode *)
node;
652 if ((lrn->count == 0) || (lrn->head ==
NULL))
657 else if ((node_type == MIB_NODE_AR) || (node_type == MIB_NODE_RA))
659 struct mib_array_node *an;
660 an = (
struct mib_array_node *)
node;
661 if ((an->maxlength == 0) || (an->nptr ==
NULL))
666 else if (node_type == MIB_NODE_EX)
668 struct mib_external_node *
en;
669 en = (
struct mib_external_node *)
node;
670 if (
en->tree_levels == 0)
685 u8_t node_type, ext_level, climb_tree;
693 node_type =
node->node_type;
694 if ((node_type == MIB_NODE_AR) || (node_type == MIB_NODE_RA))
696 struct mib_array_node *an;
700 an = (
struct mib_array_node *)
node;
704 while ((i < an->maxlength) && (an->objid[
i] < *
ident))
708 if (i < an->maxlength)
712 oidret->id[oidret->len] = an->objid[
i];
715 if (an->nptr[
i] ==
NULL)
719 if (an->objid[
i] > *
ident)
721 return (
struct mib_node*)an;
723 else if ((
i + 1) < an->maxlength)
727 oidret->id[oidret->len] = an->objid[
i + 1];
729 return (
struct mib_node*)an;
747 while ((j < an->maxlength) && (empty_table(an->nptr[
j])))
751 if (j < an->maxlength)
753 cur_node.r_ptr = an->nptr[
j];
754 cur_node.r_id = an->objid[
j];
759 cur_node.r_ptr =
NULL;
761 push_node(&cur_node);
762 if (an->objid[
i] == *
ident)
787 while ((j < an->maxlength) && empty_table(an->nptr[
j]))
791 if (j < an->maxlength)
794 oidret->id[oidret->len] = an->objid[
j];
796 if (an->nptr[
j] ==
NULL)
799 return (
struct mib_node*)an;
814 else if(node_type == MIB_NODE_LR)
816 struct mib_list_rootnode *lrn;
817 struct mib_list_node *ln;
820 lrn = (
struct mib_list_rootnode *)
node;
825 while ((ln !=
NULL) && (ln->objid < *
ident))
832 oidret->id[oidret->len] = ln->objid;
834 if (ln->nptr ==
NULL)
837 if (ln->objid > *
ident)
839 return (
struct mib_node*)lrn;
841 else if (ln->next !=
NULL)
845 oidret->id[oidret->len] = ln->next->objid;
847 return (
struct mib_node*)lrn;
858 struct mib_list_node *jn;
863 while ((jn !=
NULL) && empty_table(jn->nptr))
869 cur_node.r_ptr = jn->nptr;
870 cur_node.r_id = jn->objid;
875 cur_node.r_ptr =
NULL;
877 push_node(&cur_node);
878 if (ln->objid == *
ident)
901 struct mib_list_node *jn;
904 while ((jn !=
NULL) && empty_table(jn->nptr))
911 oidret->id[oidret->len] = jn->objid;
913 if (jn->nptr ==
NULL)
917 return (
struct mib_node*)lrn;
932 else if(node_type == MIB_NODE_EX)
934 struct mib_external_node *
en;
938 en = (
struct mib_external_node *)
node;
944 len =
en->level_length(
en->addr_inf,ext_level);
945 while ((
i <
len) && (
en->ident_cmp(
en->addr_inf,ext_level,
i,*
ident) < 0))
952 en->get_objid(
en->addr_inf,ext_level,
i,&ex_id);
954 oidret->id[oidret->len] = ex_id;
957 if ((ext_level + 1) ==
en->tree_levels)
963 return (
struct mib_node*)
en;
965 else if ((
i + 1) <
len)
968 en->get_objid(
en->addr_inf,ext_level,
i + 1,&ex_id);
970 oidret->id[oidret->len] = ex_id;
972 return (
struct mib_node*)
en;
993 cur_node.r_ptr =
node;
994 en->get_objid(
en->addr_inf,ext_level,
j,&cur_node.r_id);
995 cur_node.r_nl = ext_level + 1;
999 cur_node.r_ptr =
NULL;
1001 push_node(&cur_node);
1002 if (
en->ident_cmp(
en->addr_inf,ext_level,
i,*
ident) == 0)
1025 en->get_objid(
en->addr_inf,ext_level,0,&ex_id);
1027 oidret->id[oidret->len] = ex_id;
1029 if ((ext_level + 1) ==
en->tree_levels)
1033 return (
struct mib_node*)
en;
1042 else if(node_type == MIB_NODE_SC)
1044 mib_scalar_node *sn;
1047 sn = (mib_scalar_node *)
node;
1056 oidret->id[oidret->len] = 0;
1060 return (
struct mib_node*)sn;
1078 while ((node_stack_cnt > 0) && (
child.r_ptr ==
NULL))
1088 oidret->id[oidret->len] =
child.r_id;
1091 ext_level =
child.r_nl;
1142 const s32_t *prefix_ptr;
1147 prefix_ptr = &prefix[0];
1148 ret_ptr = &oidret->id[0];
1150 while ((
i <
ident_len) && ((*ident) <= (*prefix_ptr)))
1152 *ret_ptr++ = *prefix_ptr++;
1161 *ret_ptr++ = *prefix_ptr++;
static const WCHAR empty[]
#define LWIP_DEBUGF(debug, message)
#define LWIP_ASSERT(message, assertion)
GLdouble GLdouble GLdouble r
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define ip4_addr1(ipaddr)
#define IP4_ADDR(ipaddr, a, b, c, d)
#define ip4_addr4(ipaddr)
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
#define ip4_addr3(ipaddr)
#define ip4_addr2(ipaddr)
void * memp_malloc(memp_t type)
void memp_free(memp_t type, void *mem)
struct netif * netif_list
static unsigned __int64 next
static INT ident_len(LPCTSTR p)
static GLenum _GLUfuncptr fn
_In_ ULONG _In_ ULONG_PTR ident