Skip to content

Commit

Permalink
[nes]: GMPLS changes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nes-repo committed Aug 31, 2015
1 parent 2c1bdea commit d5de357
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
64 changes: 64 additions & 0 deletions mpls/mplsLsrStdMIB.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,70 @@ mplsInSegmentTable_removeHier (
return bRetCode;
}

bool
mplsInSegmentRowStatus_handler (
mplsInSegmentEntry_t *poEntry, uint8_t u8RowStatus)
{
register bool bRetCode = false;
register uint8_t u8RealStatus = u8RowStatus & xRowStatus_mask_c;

if (poEntry->u8RowStatus == u8RealStatus)
{
goto mplsInSegmentRowStatus_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 mplsInSegmentRowStatus_handler_success;
}


switch (u8RealStatus)
{
case xRowStatus_active_c:

/*if (!mplsInSegmentRowStatus_update (poEntry, u8RealStatus))
{
goto mplsInSegmentRowStatus_handler_cleanup;
}*/

poEntry->u8RowStatus = u8RealStatus;
break;

case xRowStatus_notInService_c:
/*if (!mplsInSegmentRowStatus_update (poEntry, u8RealStatus))
{
goto mplsInSegmentRowStatus_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 mplsInSegmentRowStatus_handler_cleanup;

case xRowStatus_createAndWait_c:
case xRowStatus_destroy_c:
/*if (!mplsInSegmentRowStatus_update (poEntry, u8RealStatus))
{
goto mplsInSegmentRowStatus_handler_cleanup;
}*/

poEntry->u8RowStatus = xRowStatus_notInService_c;
break;
}

mplsInSegmentRowStatus_handler_success:

bRetCode = true;

mplsInSegmentRowStatus_handler_cleanup:

return bRetCode || (u8RowStatus & xRowStatus_fromParent_c);
}

/* example iterator hook routines - using 'getNext' to do most of the work */
netsnmp_variable_list *
mplsInSegmentTable_getFirst (
Expand Down
2 changes: 2 additions & 0 deletions mpls/mplsLsrStdMIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ mplsInSegmentEntry_t * mplsInSegmentTable_createExt (
bool mplsInSegmentTable_removeExt (mplsInSegmentEntry_t *poEntry);
bool mplsInSegmentTable_createHier (mplsInSegmentEntry_t *poEntry);
bool mplsInSegmentTable_removeHier (mplsInSegmentEntry_t *poEntry);
bool mplsInSegmentRowStatus_handler (
mplsInSegmentEntry_t *poEntry, uint8_t u8RowStatus);
#ifdef SNMP_SRC
Netsnmp_First_Data_Point mplsInSegmentTable_getFirst;
Netsnmp_Next_Data_Point mplsInSegmentTable_getNext;
Expand Down

0 comments on commit d5de357

Please sign in to comment.