Skip to content

Commit

Permalink
[nes]: LAG changes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nes-repo committed Sep 26, 2015
1 parent 4e9612d commit aed9770
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 29 deletions.
46 changes: 17 additions & 29 deletions lag/lagMIB.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,64 +2593,52 @@ dot3adAggPortXTable_createEntry (
uint32_t u32Index)
{
register dot3adAggPortXEntry_t *poEntry = NULL;
register dot3adAggPortData_t *poDot3adAggPortData = NULL;
register dot3adAggPortEntry_t *poAggPort = NULL;

if ((poDot3adAggPortData = dot3adAggPortData_getByIndex (u32Index)) == NULL ||
xBitmap_getBit (poDot3adAggPortData->au8Flags, dot3adAggPortFlags_portXCreated_c))
if ((poAggPort = dot3adAggPortTable_getByIndex (u32Index)) == NULL)
{
return NULL;
}
poEntry = &poDot3adAggPortData->oPortX;
poEntry = &poAggPort->oX;

/*poEntry->au8ProtocolDA = 1652522221570*/;
memcpy (poEntry->au8ProtocolDA, IeeeEui_slowProtocolsMulticast, sizeof (poEntry->au8ProtocolDA));

xBitmap_setBit (poDot3adAggPortData->au8Flags, dot3adAggPortFlags_portXCreated_c, 1);
return poEntry;
}

dot3adAggPortXEntry_t *
dot3adAggPortXTable_getByIndex (
uint32_t u32Index)
{
register dot3adAggPortData_t *poDot3adAggPortData = NULL;
register dot3adAggPortEntry_t *poAggPort = NULL;

if ((poDot3adAggPortData = dot3adAggPortData_getByIndex (u32Index)) == NULL ||
!xBitmap_getBit (poDot3adAggPortData->au8Flags, dot3adAggPortFlags_portXCreated_c))
if ((poAggPort = dot3adAggPortTable_getByIndex (u32Index)) == NULL)
{
return NULL;
}

return &poDot3adAggPortData->oPortX;
return &poAggPort->oX;
}

dot3adAggPortXEntry_t *
dot3adAggPortXTable_getNextIndex (
uint32_t u32Index)
{
register dot3adAggPortData_t *poDot3adAggPortData = NULL;
register dot3adAggPortEntry_t *poAggPort = NULL;

if ((poDot3adAggPortData = dot3adAggPortData_getNextIndex (u32Index)) == NULL ||
!xBitmap_getBit (poDot3adAggPortData->au8Flags, dot3adAggPortFlags_portXCreated_c))
if ((poAggPort = dot3adAggPortTable_getNextIndex (u32Index)) == NULL)
{
return NULL;
}

return &poDot3adAggPortData->oPortX;
return &poAggPort->oX;
}

/* remove a row from the table */
void
dot3adAggPortXTable_removeEntry (dot3adAggPortXEntry_t *poEntry)
{
if (poEntry == NULL)
{
return;
}

register dot3adAggPortData_t *poDot3adAggPortData = dot3adAggPortData_getByPortXEntry (poEntry);

xBitmap_setBit (poDot3adAggPortData->au8Flags, dot3adAggPortFlags_portXCreated_c, 0);
return;
}

Expand All @@ -2660,7 +2648,7 @@ dot3adAggPortXTable_getFirst (
void **my_loop_context, void **my_data_context,
netsnmp_variable_list *put_index_data, netsnmp_iterator_info *mydata)
{
*my_loop_context = xBTree_nodeGetFirst (&oDot3adAggPortData_BTree);
*my_loop_context = xBTree_nodeGetFirst (&oDot3adAggPortTable_BTree);
return dot3adAggPortXTable_getNext (my_loop_context, my_data_context, put_index_data, mydata);
}

Expand All @@ -2669,18 +2657,18 @@ dot3adAggPortXTable_getNext (
void **my_loop_context, void **my_data_context,
netsnmp_variable_list *put_index_data, netsnmp_iterator_info *mydata)
{
dot3adAggPortData_t *poEntry = NULL;
dot3adAggPortEntry_t *poEntry = NULL;
netsnmp_variable_list *idx = put_index_data;

if (*my_loop_context == NULL)
{
return NULL;
}
poEntry = xBTree_entry (*my_loop_context, dot3adAggPortData_t, oBTreeNode);
poEntry = xBTree_entry (*my_loop_context, dot3adAggPortEntry_t, oBTreeNode);

snmp_set_var_typed_integer (idx, ASN_INTEGER, poEntry->u32Index);
*my_data_context = (void*) poEntry;
*my_loop_context = (void*) xBTree_nodeGetNext (&poEntry->oBTreeNode, &oDot3adAggPortData_BTree);
*my_data_context = (void*) &poEntry->oX;
*my_loop_context = (void*) xBTree_nodeGetNext (&poEntry->oBTreeNode, &oDot3adAggPortTable_BTree);
return put_index_data;
}

Expand All @@ -2689,17 +2677,17 @@ dot3adAggPortXTable_get (
void **my_data_context,
netsnmp_variable_list *put_index_data, netsnmp_iterator_info *mydata)
{
dot3adAggPortXEntry_t *poEntry = NULL;
dot3adAggPortEntry_t *poEntry = NULL;
register netsnmp_variable_list *idx1 = put_index_data;

poEntry = dot3adAggPortXTable_getByIndex (
poEntry = dot3adAggPortTable_getByIndex (
*idx1->val.integer);
if (poEntry == NULL)
{
return false;
}

*my_data_context = (void*) poEntry;
*my_data_context = (void*) &poEntry->oX;
return true;
}

Expand Down
1 change: 1 addition & 0 deletions lag/lagMIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ typedef struct dot3adAggPortEntry_t

dot3adAggPortStatsEntry_t oStats;
dot3adAggPortDebugEntry_t oDebug;
dot3adAggPortXEntry_t oX;

xBTree_Node_t oBTreeNode;
xBTree_Node_t oGroup_BTreeNode;
Expand Down

0 comments on commit aed9770

Please sign in to comment.