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 Oct 16, 2015
1 parent 32be665 commit 3302d18
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 27 deletions.
31 changes: 21 additions & 10 deletions lag/lagMIB.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@ dot3adAggTable_createHier (
goto dot3adAggTable_createHier_cleanup;
}

if (dot3adAggPortListTable_getByIndex (poEntry->u32Index) == NULL &&
dot3adAggPortListTable_createEntry (poEntry->u32Index) == NULL)
if (dot3adAggPortListTable_createEntry (poEntry->u32Index) == NULL)
{
goto dot3adAggTable_createHier_cleanup;
}
Expand Down Expand Up @@ -1527,20 +1526,17 @@ dot3adAggPortTable_createHier (
goto dot3adAggPortTable_createHier_cleanup;
}

if (dot3adAggPortStatsTable_getByIndex (poEntry->u32Index) == NULL &&
dot3adAggPortStatsTable_createEntry (poEntry->u32Index) == NULL)
if (dot3adAggPortStatsTable_createEntry (poEntry->u32Index) == NULL)
{
goto dot3adAggPortTable_createHier_cleanup;
}

if (dot3adAggPortDebugTable_getByIndex (poEntry->u32Index) == NULL &&
dot3adAggPortDebugTable_createEntry (poEntry->u32Index) == NULL)
if (dot3adAggPortDebugTable_createEntry (poEntry->u32Index) == NULL)
{
goto dot3adAggPortTable_createHier_cleanup;
}

if (dot3adAggPortXTable_getByIndex (poEntry->u32Index) == NULL &&
dot3adAggPortXTable_createEntry (poEntry->u32Index) == NULL)
if (dot3adAggPortXTable_createEntry (poEntry->u32Index) == NULL)
{
goto dot3adAggPortTable_createHier_cleanup;
}
Expand Down Expand Up @@ -2669,7 +2665,7 @@ dot3adAggPortXTable_getNext (
poEntry = xBTree_entry (*my_loop_context, dot3adAggPortEntry_t, oBTreeNode);

snmp_set_var_typed_integer (idx, ASN_INTEGER, poEntry->u32Index);
*my_data_context = (void*) &poEntry->oX;
*my_data_context = (void*) poEntry;
*my_loop_context = (void*) xBTree_nodeGetNext (&poEntry->oBTreeNode, &oDot3adAggPortTable_BTree);
return put_index_data;
}
Expand All @@ -2689,7 +2685,7 @@ dot3adAggPortXTable_get (
return false;
}

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

Expand Down Expand Up @@ -2969,6 +2965,21 @@ neAggRowStatus_handler (
switch (u8RowStatus)
{
case xRowStatus_active_c:
if (poEntry->i32GroupType == neAggGroupType_internal_c && poEntry->u32GroupIndex == 0)
{
poEntry->u32GroupIndex = poAgg->u32Index;
}
if (poAgg->i32ActorAdminKey == 0)
{
poAgg->i32ActorAdminKey = (poEntry->u32GroupIndex & 0xFFFF) ^ (poEntry->u32GroupIndex >> 16) ^ poEntry->i32GroupType;
}

poAgg->oK.i32GroupType = poEntry->i32GroupType;
poAgg->oK.u32GroupIndex = poEntry->u32GroupIndex;
poAgg->oK.i32ActorAdminKey = poAgg->i32ActorAdminKey;

xBTree_nodeAdd (&poAgg->oGroup_BTreeNode, &oDot3adAggTable_Group_BTree);
xBTree_nodeAdd (&poAgg->oKey_BTreeNode, &oDot3adAggTable_Key_BTree);

/* TODO */

Expand Down
31 changes: 14 additions & 17 deletions lag/lagMIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,8 @@ Netsnmp_Node_Handler dot3adAggPortXTable_mapper;
enum
{
/* enums for column neAggGroupType */
neAggGroupType_none_c = 1,
neAggGroupType_if_c = 2,
neAggGroupType_entity_c = 3,
neAggGroupType_lsr_c = 4,
neAggGroupType_rg_c = 5,
neAggGroupType_other_c = 6,
neAggGroupType_internal_c = 1,
neAggGroupType_external_c = 2,

/* enums for column neAggRowStatus */
neAggRowStatus_active_c = 1,
Expand Down Expand Up @@ -346,11 +342,6 @@ neAggEntry_t * neAggTable_getByIndex (
neAggEntry_t * neAggTable_getNextIndex (
uint32_t u32Dot3adAggIndex);
void neAggTable_removeEntry (neAggEntry_t *poEntry);
neAggEntry_t * neAggTable_createExt (
uint32_t u32Dot3adAggIndex);
bool neAggTable_removeExt (neAggEntry_t *poEntry);
bool neAggTable_createHier (neAggEntry_t *poEntry);
bool neAggTable_removeHier (neAggEntry_t *poEntry);
bool neAggRowStatus_handler (
neAggEntry_t *poEntry, uint8_t u8RowStatus);
#ifdef SNMP_SRC
Expand Down Expand Up @@ -468,12 +459,8 @@ Netsnmp_Node_Handler neAggPortListTable_mapper;
enum
{
/* enums for column neAggPortGroupType */
neAggPortGroupType_none_c = 1,
neAggPortGroupType_if_c = 2,
neAggPortGroupType_entity_c = 3,
neAggPortGroupType_lsr_c = 4,
neAggPortGroupType_rg_c = 5,
neAggPortGroupType_other_c = 6,
neAggPortGroupType_internal_c = 1,
neAggPortGroupType_external_c = 2,

/* enums for column neAggPortFlags */
neAggPortFlags_lacp_c = 0,
Expand Down Expand Up @@ -689,6 +676,16 @@ dot3adAggEntry_t * dot3adAggTable_getByIndex (
uint32_t u32Index);
dot3adAggEntry_t * dot3adAggTable_getNextIndex (
uint32_t u32Index);
dot3adAggEntry_t * dot3adAggTable_Group_getByIndex (
int32_t i32GroupType,
uint32_t u32GroupIndex,
uint32_t u32Index);
dot3adAggEntry_t * dot3adAggTable_Group_getNextIndex (
int32_t i32GroupType,
uint32_t u32GroupIndex,
uint32_t u32Index);
#define dot3adAggTable_getByNeEntry(poEntry) ((poEntry) == NULL ? NULL: xGetParentByMemberPtr ((poEntry), dot3adAggEntry_t, oNe))
#define dot3adAggTable_getByPortListEntry(poEntry) ((poEntry) == NULL ? NULL: xGetParentByMemberPtr ((poEntry), dot3adAggEntry_t, oPortList))
void dot3adAggTable_removeEntry (dot3adAggEntry_t *poEntry);
dot3adAggEntry_t * dot3adAggTable_createExt (
uint32_t u32Index);
Expand Down

0 comments on commit 3302d18

Please sign in to comment.