mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-02 14:58:22 +00:00
snmp: eliminiate mib_ram_array_node (it is not necessary: to the agent, the nodes may be const since the actual mib implementation knows the structures behind the nodes which do not have to be const)
This commit is contained in:
parent
8891b277c6
commit
5cf4771397
@ -188,8 +188,8 @@ static struct mib_array_node udpentry = {
|
||||
};
|
||||
|
||||
static struct mib_array_node_entry udptable_node = {1, &udpentry.node};
|
||||
static struct mib_ram_array_node udptable = {
|
||||
{ MIB_NODE_RA },
|
||||
static struct mib_array_node udptable = {
|
||||
{ MIB_NODE_AR },
|
||||
0,
|
||||
&udptable_node
|
||||
};
|
||||
@ -240,8 +240,8 @@ static struct mib_array_node tcpconnentry = {
|
||||
};
|
||||
|
||||
static struct mib_array_node_entry tcpconntable_node = {1, &tcpconnentry.node};
|
||||
static struct mib_ram_array_node tcpconntable = {
|
||||
{ MIB_NODE_RA },
|
||||
static struct mib_array_node tcpconntable = {
|
||||
{ MIB_NODE_AR },
|
||||
/** @todo update maxlength when inserting / deleting from table
|
||||
0 when table is empty, 1 when more than one entry */
|
||||
0,
|
||||
@ -325,8 +325,8 @@ static struct mib_array_node ipntomentry = {
|
||||
};
|
||||
|
||||
static struct mib_array_node_entry ipntomtable_node = {1, &ipntomentry.node};
|
||||
static struct mib_ram_array_node ipntomtable = {
|
||||
{ MIB_NODE_RA },
|
||||
static struct mib_array_node ipntomtable = {
|
||||
{ MIB_NODE_AR },
|
||||
0,
|
||||
&ipntomtable_node
|
||||
};
|
||||
@ -360,8 +360,8 @@ static struct mib_array_node iprteentry = {
|
||||
};
|
||||
|
||||
static struct mib_array_node_entry iprtetable_node = {1, &iprteentry.node};
|
||||
static struct mib_ram_array_node iprtetable = {
|
||||
{ MIB_NODE_RA },
|
||||
static struct mib_array_node iprtetable = {
|
||||
{ MIB_NODE_AR },
|
||||
0,
|
||||
&iprtetable_node
|
||||
};
|
||||
@ -393,8 +393,8 @@ static struct mib_array_node ipaddrentry = {
|
||||
};
|
||||
|
||||
static struct mib_array_node_entry ipaddrtable_node = {1, &ipaddrentry.node};
|
||||
static struct mib_ram_array_node ipaddrtable = {
|
||||
{ MIB_NODE_RA },
|
||||
static struct mib_array_node ipaddrtable = {
|
||||
{ MIB_NODE_AR },
|
||||
0,
|
||||
&ipaddrtable_node
|
||||
};
|
||||
@ -460,8 +460,8 @@ static struct mib_array_node attable = {
|
||||
|
||||
/* at .1.3.6.1.2.1.3 */
|
||||
static struct mib_array_node_entry mib2_at_node = {1, &attable.node};
|
||||
static struct mib_ram_array_node at = {
|
||||
{ MIB_NODE_RA },
|
||||
static struct mib_array_node at = {
|
||||
{ MIB_NODE_AR },
|
||||
0,
|
||||
&mib2_at_node
|
||||
};
|
||||
@ -504,8 +504,8 @@ static struct mib_array_node ifentry = {
|
||||
};
|
||||
|
||||
static struct mib_array_node_entry iftable_node = {1, &ifentry.node};
|
||||
static struct mib_ram_array_node iftable = {
|
||||
{ MIB_NODE_RA },
|
||||
static struct mib_array_node iftable = {
|
||||
{ MIB_NODE_AR },
|
||||
0,
|
||||
&iftable_node
|
||||
};
|
||||
|
@ -458,7 +458,7 @@ snmp_search_tree(const struct mib_node *node, u8_t ident_len, s32_t *ident, stru
|
||||
while (node != NULL)
|
||||
{
|
||||
node_type = node->node_type;
|
||||
if ((node_type == MIB_NODE_AR) || (node_type == MIB_NODE_RA))
|
||||
if (node_type == MIB_NODE_AR)
|
||||
{
|
||||
const struct mib_array_node *an;
|
||||
u16_t i;
|
||||
@ -652,7 +652,7 @@ empty_table(const struct mib_node *node)
|
||||
empty = 1;
|
||||
}
|
||||
}
|
||||
else if ((node_type == MIB_NODE_AR) || (node_type == MIB_NODE_RA))
|
||||
else if (node_type == MIB_NODE_AR)
|
||||
{
|
||||
const struct mib_array_node *an;
|
||||
an = (const struct mib_array_node*)(const void*)node;
|
||||
@ -689,7 +689,7 @@ snmp_expand_tree(const struct mib_node *node, u8_t ident_len, s32_t *ident, stru
|
||||
{
|
||||
climb_tree = 0;
|
||||
node_type = node->node_type;
|
||||
if ((node_type == MIB_NODE_AR) || (node_type == MIB_NODE_RA))
|
||||
if (node_type == MIB_NODE_AR)
|
||||
{
|
||||
const struct mib_array_node *an;
|
||||
u16_t i;
|
||||
|
@ -93,9 +93,7 @@ struct snmp_name_ptr
|
||||
#define MIB_NODE_SC 0x01
|
||||
/** MIB const array node */
|
||||
#define MIB_NODE_AR 0x02
|
||||
/** MIB array node (mem_malloced from RAM) */
|
||||
#define MIB_NODE_RA 0x03
|
||||
/** MIB list root node (mem_malloced from RAM) */
|
||||
/** MIB list root node (memp_malloced from RAM) */
|
||||
#define MIB_NODE_LR 0x04
|
||||
/** MIB node for external objects */
|
||||
#define MIB_NODE_EX 0x05
|
||||
@ -129,7 +127,7 @@ struct mib_array_node_entry
|
||||
const struct mib_node *nptr;
|
||||
};
|
||||
|
||||
/** derived node, points to a fixed size const array
|
||||
/** derived node, points to a fixed size array
|
||||
of sub-identifiers plus a 'child' pointer */
|
||||
struct mib_array_node
|
||||
{
|
||||
@ -141,18 +139,6 @@ struct mib_array_node
|
||||
const struct mib_array_node_entry *entries;
|
||||
};
|
||||
|
||||
/** derived node, points to a fixed size mem_malloced array
|
||||
of sub-identifiers plus a 'child' pointer */
|
||||
struct mib_ram_array_node
|
||||
{
|
||||
/* inherited "base class" members */
|
||||
struct mib_node node;
|
||||
|
||||
/* additional struct members */
|
||||
u16_t maxlength;
|
||||
struct mib_array_node_entry *entries;
|
||||
};
|
||||
|
||||
struct mib_list_node
|
||||
{
|
||||
struct mib_list_node *prev;
|
||||
|
Loading…
Reference in New Issue
Block a user