Skip to content

Commit

Permalink
[nes]: ETHERNET changes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nes-repo committed Jun 20, 2015
1 parent 5a61ffb commit f9db64a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
42 changes: 21 additions & 21 deletions ethernet/ieee8021BridgeMib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ ieee8021BridgeBasePortIfIndex_handler (
{
register bool bRetCode = false;
register bool bLocked = false;
register ieee8021BridgePhyData_t *poPhyData = NULL;
register ieee8021BridgePhyPortEntry_t *poPhy = NULL;

if (poEntry->pOldEntry != NULL && poEntry->u32IfIndex == poEntry->pOldEntry->u32IfIndex)
{
Expand All @@ -1408,7 +1408,7 @@ ieee8021BridgeBasePortIfIndex_handler (

if (poEntry->u32IfIndex != 0 || (poEntry->pOldEntry != NULL && poEntry->pOldEntry->u32IfIndex != 0))
{
ieee8021BridgePhyData_wrLock ();
ieee8021BridgePhyPortTable_wrLock ();
bLocked = true;
}

Expand All @@ -1418,17 +1418,17 @@ ieee8021BridgeBasePortIfIndex_handler (
goto ieee8021BridgeBasePortIfIndex_handler_newIfIndex;
}

if ((poPhyData = ieee8021BridgePhyData_getByIndex (poEntry->pOldEntry->u32IfIndex, 0)) == NULL)
if ((poPhy = ieee8021BridgePhyPortTable_getByIndex (poEntry->pOldEntry->u32IfIndex, 0)) == NULL)
{
goto ieee8021BridgeBasePortIfIndex_handler_cleanup;
}

if (!ieee8021BridgeTpPortTable_handler (poComponent, poPhyData, false, false))
if (!ieee8021BridgeTpPortTable_handler (poComponent, poPhy, false, false))
{
goto ieee8021BridgeBasePortIfIndex_handler_cleanup;
}

if (!ieee8021BridgePhyData_detachComponent (poEntry, poPhyData))
if (!ieee8021BridgePhyPortTable_detachComponent (poEntry, poPhy))
{
goto ieee8021BridgeBasePortIfIndex_handler_cleanup;
}
Expand All @@ -1448,21 +1448,21 @@ ieee8021BridgeBasePortIfIndex_handler (
goto ieee8021BridgeBasePortIfIndex_handler_success;
}

if ((poPhyData = ieee8021BridgePhyData_getByIndex (poEntry->u32IfIndex, 0)) == NULL)
if ((poPhy = ieee8021BridgePhyPortTable_getByIndex (poEntry->u32IfIndex, 0)) == NULL)
{
goto ieee8021BridgeBasePortIfIndex_handler_cleanup;
}

if (!xBitmap_getBitRev (poPhyData->au8TypeCapabilities, poEntry->i32Type - 2) ||
!ieee8021BridgePhyData_attachComponent (poComponent, poEntry, poPhyData))
if (!xBitmap_getBitRev (poPhy->au8TypeCapabilities, poEntry->i32Type - 2) ||
!ieee8021BridgePhyPortTable_attachComponent (poComponent, poEntry, poPhy))
{
goto ieee8021BridgeBasePortIfIndex_handler_cleanup;
}

register bool bMacLearn = xBitmap_getBitRev (poPhyData->au8AdminFlags, neIfAdminFlags_macLearn_c);
register bool bMacFwd = xBitmap_getBitRev (poPhyData->au8AdminFlags, neIfAdminFlags_macFwd_c);
register bool bMacLearn = xBitmap_getBitRev (poPhy->au8AdminFlags, neIfAdminFlags_macLearn_c);
register bool bMacFwd = xBitmap_getBitRev (poPhy->au8AdminFlags, neIfAdminFlags_macFwd_c);

if (!ieee8021BridgeTpPortTable_handler (poComponent, poPhyData, bMacLearn, bMacFwd))
if (!ieee8021BridgeTpPortTable_handler (poComponent, poPhy, bMacLearn, bMacFwd))
{
goto ieee8021BridgeBasePortIfIndex_handler_cleanup;
}
Expand All @@ -1478,7 +1478,7 @@ ieee8021BridgeBasePortIfIndex_handler (

ieee8021BridgeBasePortIfIndex_handler_cleanup:

bLocked ? ieee8021BridgePhyData_unLock (): false;
bLocked ? ieee8021BridgePhyPortTable_unLock (): false;
return bRetCode;
}

Expand Down Expand Up @@ -3080,10 +3080,10 @@ ieee8021BridgeTpPortStatus_handler (
ieee8021BridgeBase_wrLock (poIeee8021BridgeBaseEntry);


if (!ieee8021BridgeTpPortTable_handler (poIeee8021BridgeBaseEntry, poPhyData, bMacLearn, bMacFwd))
/*if (!ieee8021BridgeTpPortTable_handler (poIeee8021BridgeBaseEntry, poPhyData, bMacLearn, bMacFwd))
{
goto ieee8021BridgeTpPortStatus_handler_cleanup;
}
}*/

ieee8021BridgeTpPortStatus_handler_success:

Expand All @@ -3107,27 +3107,27 @@ ieee8021BridgeTpPortStatus_handler (
bool
ieee8021BridgeTpPortTable_handler (
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021BridgePhyData_t *poPhyData, bool bMacLearn, bool bMacFwd)
ieee8021BridgePhyPortEntry_t *poPhy, bool bMacLearn, bool bMacFwd)
{
register bool bRetCode = false;
register ieee8021BridgeTpPortEntry_t *poIeee8021BridgeTpPortEntry = NULL;

poIeee8021BridgeTpPortEntry = ieee8021BridgeTpPortTable_getByIndex (poPhyData->u32ComponentId, poPhyData->u32Port);
poIeee8021BridgeTpPortEntry = ieee8021BridgeTpPortTable_getByIndex (poPhy->oIf.u32ComponentId, poPhy->oIf.u32Port);

if (bMacFwd ^ (poIeee8021BridgeTpPortEntry != NULL))
{
goto ieee8021BridgeTpPortTable_handler_success;
}


if (!bMacFwd && !ieee8021BridgeTpPortStatus_update (poPhyData, poIeee8021BridgeTpPortEntry, bMacLearn, bMacFwd))
/*if (!bMacFwd && !ieee8021BridgeTpPortStatus_update (poPhy, poIeee8021BridgeTpPortEntry, bMacLearn, bMacFwd))
{
goto ieee8021BridgeTpPortTable_handler_cleanup;
}
}*/

if (bMacFwd)
{
if ((poIeee8021BridgeTpPortEntry = ieee8021BridgeTpPortTable_createEntry (poPhyData->u32ComponentId, poPhyData->u32Port)) == NULL)
if ((poIeee8021BridgeTpPortEntry = ieee8021BridgeTpPortTable_createEntry (poPhy->oIf.u32ComponentId, poPhy->oIf.u32Port)) == NULL)
{
goto ieee8021BridgeTpPortTable_handler_cleanup;
}
Expand All @@ -3137,10 +3137,10 @@ ieee8021BridgeTpPortTable_handler (
ieee8021BridgeTpPortTable_removeEntry (poIeee8021BridgeTpPortEntry);
}

if (bMacFwd && !ieee8021BridgeTpPortStatus_update (poPhyData, poIeee8021BridgeTpPortEntry, bMacLearn, bMacFwd))
/*if (bMacFwd && !ieee8021BridgeTpPortStatus_update (poPhy, poIeee8021BridgeTpPortEntry, bMacLearn, bMacFwd))
{
goto ieee8021BridgeTpPortTable_handler_cleanup;
}
}*/

ieee8021BridgeTpPortTable_handler_success:

Expand Down
2 changes: 1 addition & 1 deletion ethernet/ieee8021BridgeMib.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ bool ieee8021BridgeTpPortTable_createHier (ieee8021BridgeTpPortEntry_t *poEntry)
bool ieee8021BridgeTpPortTable_removeHier (ieee8021BridgeTpPortEntry_t *poEntry);
bool ieee8021BridgeTpPortTable_handler (
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021BridgePhyData_t *poPhyData, bool bMacLearn, bool bMacFwd);
ieee8021BridgePhyPortEntry_t *poPhy, bool bMacLearn, bool bMacFwd);
#ifdef SNMP_SRC
Netsnmp_First_Data_Point ieee8021BridgeTpPortTable_getFirst;
Netsnmp_Next_Data_Point ieee8021BridgeTpPortTable_getNext;
Expand Down

0 comments on commit f9db64a

Please sign in to comment.