Skip to content

Commit

Permalink
[nes]: BRIDGE changes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nes-repo committed Dec 12, 2014
1 parent 446a6bd commit dc17d3f
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 7 deletions.
23 changes: 23 additions & 0 deletions bridge/bridgeUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,29 @@ ieee8021PbbPipTable_attachComponent (
return bRetCode;
}

bool
ieee8021PbbPipRowStatus_update (
ieee8021PbbPipEntry_t *poEntry, uint8_t u8RowStatus)
{
register bool bRetCode = false;
ifData_t *poPipIfData = NULL;

if (!ifData_createReference (poEntry->u32IfIndex, 0, 0, false, false, false, &poPipIfData) ||
!ifAdminStatus_handler (&poPipIfData->oIf, u8RowStatus == xRowStatus_active_c ? ifAdminStatus_up_c: ifAdminStatus_down_c, false))
{
goto ieee8021PbbPipRowStatus_update_cleanup;
}

/* TODO */

bRetCode = true;

ieee8021PbbPipRowStatus_update_cleanup:

poPipIfData != NULL ? ifData_unLock (poPipIfData): false;
return bRetCode;
}

bool
ieee8021PbbVipToPipMappingRowStatus_update (
ieee8021PbbVipToPipMappingEntry_t *poEntry, uint8_t u8RowStatus)
Expand Down
3 changes: 3 additions & 0 deletions bridge/bridgeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ bool
ieee8021PbbPipTable_attachComponent (
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021PbbPipEntry_t *poEntry);
bool
ieee8021PbbPipRowStatus_update (
ieee8021PbbPipEntry_t *poEntry, uint8_t u8RowStatus);
bool
ieee8021PbbVipToPipMappingRowStatus_update (
ieee8021PbbVipToPipMappingEntry_t *poEntry, uint8_t u8RowStatus);
Expand Down
56 changes: 49 additions & 7 deletions bridge/ieee8021PbbMib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1676,17 +1676,61 @@ ieee8021PbbPipRowStatus_handler (
ieee8021PbbPipEntry_t *poEntry, uint8_t u8RowStatus)
{
register bool bRetCode = false;
ifData_t *poPipIfData = NULL;
register uint8_t u8RealStatus = u8RowStatus & xRowStatus_mask_c;

if (poEntry->u8RowStatus == u8RowStatus)
if (poEntry->u8RowStatus == u8RealStatus)
{
goto ieee8021PbbPipRowStatus_handler_success;
}
if (u8RowStatus & xRowStatus_fromParent_c &&
((u8RealStatus == xRowStatus_active_c && poEntry->u8RowStatus != xRowStatus_notReady_c) ||
(u8RealStatus == xRowStatus_notInService_c && poEntry->u8RowStatus != xRowStatus_active_c)))
{
goto ieee8021PbbPipRowStatus_handler_success;
}


if (!ifData_createReference (poEntry->u32IfIndex, 0, 0, false, false, false, &poPipIfData) ||
!neIfRowStatus_handler (&poPipIfData->oNe, u8RowStatus))
switch (u8RealStatus)
{
case xRowStatus_active_c:
if (poEntry->u32IComponentId == 0)
{
u8RealStatus = xRowStatus_notReady_c;
}

if (!ieee8021PbbPipRowStatus_update (poEntry, u8RealStatus))
{
goto ieee8021PbbPipRowStatus_handler_cleanup;
}

poEntry->u8RowStatus = u8RealStatus;
break;

case xRowStatus_notInService_c:
if (!ieee8021PbbPipRowStatus_update (poEntry, u8RealStatus))
{
goto ieee8021PbbPipRowStatus_handler_cleanup;
}

poEntry->u8RowStatus =
poEntry->u8RowStatus == xRowStatus_active_c && (u8RowStatus & xRowStatus_fromParent_c) ? xRowStatus_notReady_c: xRowStatus_notInService_c;
break;

case xRowStatus_createAndGo_c:
goto ieee8021PbbPipRowStatus_handler_cleanup;

case xRowStatus_createAndWait_c:
poEntry->u8RowStatus = xRowStatus_notInService_c;
break;

case xRowStatus_destroy_c:
if (!ieee8021PbbPipRowStatus_update (poEntry, u8RealStatus))
{
goto ieee8021PbbPipRowStatus_handler_cleanup;
}

poEntry->u8RowStatus = xRowStatus_notInService_c;
break;
}

ieee8021PbbPipRowStatus_handler_success:
Expand All @@ -1695,9 +1739,7 @@ ieee8021PbbPipRowStatus_handler (

ieee8021PbbPipRowStatus_handler_cleanup:

poPipIfData != NULL ? ifData_unLock (poPipIfData): false;

return bRetCode;
return bRetCode || (u8RowStatus & xRowStatus_fromParent_c);
}

/* example iterator hook routines - using 'getNext' to do most of the work */
Expand Down

0 comments on commit dc17d3f

Please sign in to comment.