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:
Dirk Ziegelmeier
2015-10-03 20:27:49 +02:00
committed by sg
parent 8891b277c6
commit 5cf4771397
3 changed files with 19 additions and 33 deletions

View File

@@ -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
};

View File

@@ -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;