|
From: | Dirk Ziegelmeier |
Subject: | Re: [lwip-users] SNMP MIB CREATE |
Date: | Mon, 11 Dec 2017 10:41:10 +0100 |
Hi All
Been looking at the examples for MIB setup but one thing in the example
confused me:
Ref:
https://github.com/yarrick/lwip-contrib/blob/master/ examples/snmp/snmp_priva
te_mib/lwip_prvmib.c
Option 1 for the base MIB node is:
------------------------------------------------------------ ----------------
-
/* example .1.3.6.1.4.1.26381.1 */
static const struct snmp_tree_node example_node = SNMP_CREATE_TREE_NODE(1,
example_nodes);
static const u32_t prvmib_base_oid[] = { 1,3,6,1,4,1,26381,1 };
const struct snmp_mib mib_private = SNMP_MIB_CREATE(prvmib_base_oid,
&example_node.node);
------------------------------------------------------------ ----------------
-
In this case the base oid ends in 1, and the tree node create uses 1 as the
oid node. Makes sense.
The code then gives an alternate example which builds up the base from
higher up the tree. The base node create is now:
------------------------------------------------------------ ----------------
-
/* private .1.3.6.1.4 */
static const struct snmp_node* const private_nodes[] = {
&enterprises_node.node
};
static const struct snmp_tree_node private_root = SNMP_CREATE_TREE_NODE(0,
private_nodes);
static const u32_t prvmib_base_oid[] = { 1,3,6,1,4 };
const struct snmp_mib mib_private = SNMP_MIB_CREATE(prvmib_base_oid,
&private_root.node);
------------------------------------------------------------ ----------------
-
Here the base node ends in 4, and I would have expected the tree node create
to use 4 as the node id, but it uses 0.
Which one is correct?
Thx
Z
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |