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 Oct 24, 2014
1 parent d497a03 commit 8315ef8
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 63 deletions.
105 changes: 96 additions & 9 deletions ethernet/ethernetUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include "ethernetUtils.h"
#include "ieee8021BridgeMib.h"
#include "ieee8021QBridgeMib.h"
#include "bridge/ieee8021PbMib.h"
#include "bridge/ieee8021PbbMib.h"
#include "bridge/bridgeUtils.h"
#include "if/ifUtils.h"
#include "if/ifMIB.h"
#include "hal/halEthernet.h"
Expand Down Expand Up @@ -125,18 +128,102 @@ ieee8021BridgeBaseRowStatus_update (
{
register bool bRetCode = false;

switch (u8RowStatus)
register uint32_t u32Port = 0;
register ieee8021BridgeBasePortEntry_t *poIeee8021BridgeBasePortEntry = NULL;

while (
(poIeee8021BridgeBasePortEntry = ieee8021BridgeBasePortTable_getNextIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
poIeee8021BridgeBasePortEntry->u32ComponentId == poEntry->u32ComponentId)
{
case xRowStatus_active_c:
/* TODO */
break;
u32Port = poIeee8021BridgeBasePortEntry->u32Port;

case xRowStatus_notInService_c:
break;
switch (poIeee8021BridgeBasePortEntry->i32Type)
{
case ieee8021BridgeBasePortType_customerVlanPort_c:
{
register ieee8021QBridgeCVlanPortEntry_t *poIeee8021QBridgeCVlanPortEntry = NULL;

if ((poIeee8021QBridgeCVlanPortEntry = ieee8021QBridgeCVlanPortTable_getByIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
!ieee8021QBridgeCVlanPortRowStatus_handler (poIeee8021QBridgeCVlanPortEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}
case ieee8021BridgeBasePortType_providerNetworkPort_c:
{
register ieee8021PbPnpEntry_t *poIeee8021PbPnpEntry = NULL;

if ((poIeee8021PbPnpEntry = ieee8021PbPnpTable_getByIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
!ieee8021PbPnpRowStatus_handler (poIeee8021PbPnpEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}
case ieee8021BridgeBasePortType_customerNetworkPort_c:
{
register ieee8021PbCnpEntry_t *poIeee8021PbCnpEntry = NULL;

if ((poIeee8021PbCnpEntry = ieee8021PbCnpTable_getByIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
!ieee8021PbCnpRowStatus_handler (poIeee8021PbCnpEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}
case ieee8021BridgeBasePortType_customerEdgePort_c:
{
register ieee8021PbCepEntry_t *poIeee8021PbCepEntry = NULL;

if ((poIeee8021PbCepEntry = ieee8021PbCepTable_getByIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
!ieee8021PbCepRowStatus_handler (poIeee8021PbCepEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}
case ieee8021BridgeBasePortType_customerBackbonePort_c:
{
register ieee8021PbbCbpEntry_t *poIeee8021PbbCbpEntry = NULL;

if ((poIeee8021PbbCbpEntry = ieee8021PbbCbpTable_getByIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
!ieee8021PbbCbpRowStatus_handler (poIeee8021PbbCbpEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}
case ieee8021BridgeBasePortType_virtualInstancePort_c:
{
register ieee8021PbbVipEntry_t *poIeee8021PbbVipEntry = NULL;

if ((poIeee8021PbbVipEntry = ieee8021PbbVipTable_getByIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
!ieee8021PbbVipRowStatus_handler (poIeee8021PbbVipEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}
case ieee8021BridgeBasePortType_dBridgePort_c:
{
register ieee8021BridgeDot1dPortEntry_t *poIeee8021BridgeDot1dPortEntry = NULL;

if ((poIeee8021BridgeDot1dPortEntry = ieee8021BridgeDot1dPortTable_getByIndex (poEntry->u32ComponentId, u32Port)) != NULL &&
!ieee8021BridgeDot1dPortRowStatus_handler (poIeee8021BridgeDot1dPortEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}

case xRowStatus_destroy_c:
/* TODO */
break;
default:
if (!ieee8021BridgeBasePortRowStatus_handler (poEntry, poIeee8021BridgeBasePortEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_update_cleanup;
}
break;
}
}

register uint8_t u8HalOpCode =
Expand Down
56 changes: 2 additions & 54 deletions ethernet/ieee8021BridgeMib.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,57 +400,23 @@ ieee8021BridgeBaseRowStatus_handler (
goto ieee8021BridgeBaseRowStatus_handler_cleanup;
}

{
register uint32_t u32BasePort = 0;
register ieee8021BridgeDot1dPortEntry_t *poIeee8021BridgeDot1dPortEntry = NULL;

while (
(poIeee8021BridgeDot1dPortEntry = ieee8021BridgeDot1dPortTable_getNextIndex (poEntry->u32ComponentId, u32BasePort)) != NULL &&
poIeee8021BridgeDot1dPortEntry->u32BasePortComponentId == poEntry->u32ComponentId)
{
u32BasePort = poIeee8021BridgeDot1dPortEntry->u32BasePort;

if (!ieee8021BridgeDot1dPortRowStatus_handler (poIeee8021BridgeDot1dPortEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_handler_cleanup;
}
}
}

if (!ieee8021BridgeBaseRowStatus_update (poEntry, u8RowStatus))
{
goto ieee8021BridgeBaseRowStatus_handler_cleanup;
}

poEntry->u8RowStatus = xRowStatus_active_c;
poEntry->u8RowStatus = u8RowStatus;
break;

case xRowStatus_notInService_c:
{
register uint32_t u32BasePort = 0;
register ieee8021BridgeDot1dPortEntry_t *poIeee8021BridgeDot1dPortEntry = NULL;

while (
(poIeee8021BridgeDot1dPortEntry = ieee8021BridgeDot1dPortTable_getNextIndex (poEntry->u32ComponentId, u32BasePort)) != NULL &&
poIeee8021BridgeDot1dPortEntry->u32BasePortComponentId == poEntry->u32ComponentId)
{
u32BasePort = poIeee8021BridgeDot1dPortEntry->u32BasePort;

if (!ieee8021BridgeDot1dPortRowStatus_handler (poIeee8021BridgeDot1dPortEntry, u8RowStatus | xRowStatus_fromParent_c))
{
goto ieee8021BridgeBaseRowStatus_handler_cleanup;
}
}
}

if (!ieee8021BridgeBaseRowStatus_update (poEntry, u8RowStatus))
{
goto ieee8021BridgeBaseRowStatus_handler_cleanup;
}

/* TODO */

poEntry->u8RowStatus = xRowStatus_notInService_c;
poEntry->u8RowStatus = u8RowStatus;
break;

case xRowStatus_createAndGo_c:
Expand All @@ -461,24 +427,6 @@ ieee8021BridgeBaseRowStatus_handler (
break;

case xRowStatus_destroy_c:
{
register uint32_t u32BasePort = 0;
register ieee8021BridgeDot1dPortEntry_t *poIeee8021BridgeDot1dPortEntry = NULL;

while (
(poIeee8021BridgeDot1dPortEntry = ieee8021BridgeDot1dPortTable_getNextIndex (poEntry->u32ComponentId, u32BasePort)) != NULL &&
poIeee8021BridgeDot1dPortEntry->u32BasePortComponentId == poEntry->u32ComponentId)
{
u32BasePort = poIeee8021BridgeDot1dPortEntry->u32BasePort;

if (!ieee8021BridgeDot1dPortRowStatus_handler (poIeee8021BridgeDot1dPortEntry, u8RowStatus | xRowStatus_fromParent_c) ||
!ieee8021BridgeDot1dPortTable_removeExt (poIeee8021BridgeDot1dPortEntry))
{
goto ieee8021BridgeBaseRowStatus_handler_cleanup;
}
}
}

if (!ieee8021BridgeBaseRowStatus_update (poEntry, u8RowStatus))
{
goto ieee8021BridgeBaseRowStatus_handler_cleanup;
Expand Down

0 comments on commit 8315ef8

Please sign in to comment.