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 Sep 21, 2015
1 parent 39d7d5a commit 90d4d66
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 65 deletions.
48 changes: 2 additions & 46 deletions mpls/mplsTeStdMIB.c
Original file line number Diff line number Diff line change
Expand Up @@ -3802,7 +3802,7 @@ gmplsTunnelTable_init (void)
ASN_UNSIGNED /* index: mplsTunnelEgressLSRId */,
0);
table_info->min_column = GMPLSTUNNELUNNUMIF;
table_info->max_column = GMPLSTUNNELEXTRAPARAMSPTR;
table_info->max_column = GMPLSTUNNELADMINSTATUSFLAGS;

iinfo = xBuffer_cAlloc (sizeof (netsnmp_iterator_info));
iinfo->get_first_data_point = &gmplsTunnelTable_getFirst;
Expand Down Expand Up @@ -3834,7 +3834,7 @@ gmplsTunnelTable_createEntry (
poEntry = &poTunnel->oG;

poEntry->u8UnnumIf = gmplsTunnelUnnumIf_false_c;
poEntry->i32LSPEncoding = gmplsTunnelLSPEncoding_tunnelLspNotGmpls_c;
poEntry->i32LSPEncoding = gmplsTunnelLSPEncoding_notGmpls_c;
poEntry->i32SwitchingType = gmplsTunnelSwitchingType_unknown_c;
poEntry->i32GPid = gmplsTunnelGPid_unknown_c;
poEntry->u8Secondary = gmplsTunnelSecondary_false_c;
Expand All @@ -3848,7 +3848,6 @@ gmplsTunnelTable_createEntry (
/*poEntry->au8DownstreamNotifyRecipient = 0*/;
poEntry->i32SendPathNotifyRecipientType = gmplsTunnelSendPathNotifyRecipientType_unknown_c;
/*poEntry->au8SendPathNotifyRecipient = 0*/;
/*poEntry->aoExtraParamsPtr = zeroDotZero*/;

return poEntry;
}
Expand Down Expand Up @@ -4041,9 +4040,6 @@ gmplsTunnelTable_mapper (
case GMPLSTUNNELADMINSTATUSFLAGS:
snmp_set_var_typed_value (request->requestvb, ASN_OCTET_STR, (u_char*) table_entry->au8AdminStatusFlags, table_entry->u16AdminStatusFlags_len);
break;
case GMPLSTUNNELEXTRAPARAMSPTR:
snmp_set_var_typed_value (request->requestvb, ASN_OBJECT_ID, (u_char*) table_entry->aoExtraParamsPtr, table_entry->u16ExtraParamsPtr_len);
break;

default:
netsnmp_set_request_error (reqinfo, request, SNMP_NOSUCHOBJECT);
Expand Down Expand Up @@ -4207,14 +4203,6 @@ gmplsTunnelTable_mapper (
return SNMP_ERR_NOERROR;
}
break;
case GMPLSTUNNELEXTRAPARAMSPTR:
ret = netsnmp_check_vb_type_and_max_size (request->requestvb, ASN_OBJECT_ID, sizeof (table_entry->aoExtraParamsPtr));
if (ret != SNMP_ERR_NOERROR)
{
netsnmp_set_request_error (reqinfo, request, ret);
return SNMP_ERR_NOERROR;
}
break;

default:
netsnmp_set_request_error (reqinfo, request, SNMP_ERR_NOTWRITABLE);
Expand Down Expand Up @@ -4253,7 +4241,6 @@ gmplsTunnelTable_mapper (
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENTTYPE:
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENT:
case GMPLSTUNNELADMINSTATUSFLAGS:
case GMPLSTUNNELEXTRAPARAMSPTR:
if (table_entry == NULL)
{
if (/* TODO */ TOBE_REPLACED != TOBE_REPLACED)
Expand Down Expand Up @@ -4320,7 +4307,6 @@ gmplsTunnelTable_mapper (
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENTTYPE:
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENT:
case GMPLSTUNNELADMINSTATUSFLAGS:
case GMPLSTUNNELEXTRAPARAMSPTR:
gmplsTunnelTable_removeEntry (table_entry);
netsnmp_request_remove_list_entry (request, ROLLBACK_BUFFER);
break;
Expand Down Expand Up @@ -4617,24 +4603,6 @@ gmplsTunnelTable_mapper (
memcpy (table_entry->au8AdminStatusFlags, request->requestvb->val.string, request->requestvb->val_len);
table_entry->u16AdminStatusFlags_len = request->requestvb->val_len;
break;
case GMPLSTUNNELEXTRAPARAMSPTR:
if (pvOldDdata == NULL && (pvOldDdata = xBuffer_cAlloc (sizeof (xOctetString_t) + sizeof (table_entry->aoExtraParamsPtr))) == NULL)
{
netsnmp_set_request_error (reqinfo, request, SNMP_ERR_RESOURCEUNAVAILABLE);
return SNMP_ERR_NOERROR;
}
else if (pvOldDdata != table_entry)
{
((xOctetString_t*) pvOldDdata)->pData = pvOldDdata + sizeof (xOctetString_t);
((xOctetString_t*) pvOldDdata)->u16Len = table_entry->u16ExtraParamsPtr_len;
memcpy (((xOctetString_t*) pvOldDdata)->pData, table_entry->aoExtraParamsPtr, sizeof (table_entry->aoExtraParamsPtr));
netsnmp_request_add_list_data (request, netsnmp_create_data_list (ROLLBACK_BUFFER, pvOldDdata, &xBuffer_free));
}

memset (table_entry->aoExtraParamsPtr, 0, sizeof (table_entry->aoExtraParamsPtr));
memcpy (table_entry->aoExtraParamsPtr, request->requestvb->val.string, request->requestvb->val_len);
table_entry->u16ExtraParamsPtr_len = request->requestvb->val_len;
break;
}
}
break;
Expand Down Expand Up @@ -4857,18 +4825,6 @@ gmplsTunnelTable_mapper (
table_entry->u16AdminStatusFlags_len = ((xOctetString_t*) pvOldDdata)->u16Len;
}
break;
case GMPLSTUNNELEXTRAPARAMSPTR:
if (pvOldDdata == table_entry)
{
gmplsTunnelTable_removeEntry (table_entry);
netsnmp_request_remove_list_entry (request, ROLLBACK_BUFFER);
}
else
{
memcpy (table_entry->aoExtraParamsPtr, ((xOctetString_t*) pvOldDdata)->pData, ((xOctetString_t*) pvOldDdata)->u16Len);
table_entry->u16ExtraParamsPtr_len = ((xOctetString_t*) pvOldDdata)->u16Len;
}
break;
}
}
break;
Expand Down
35 changes: 16 additions & 19 deletions mpls/mplsTeStdMIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ Netsnmp_Node_Handler mplsTunnelPerfTable_mapper;
#define GMPLSTUNNELSENDPATHNOTIFYRECIPIENTTYPE 16
#define GMPLSTUNNELSENDPATHNOTIFYRECIPIENT 17
#define GMPLSTUNNELADMINSTATUSFLAGS 18
#define GMPLSTUNNELEXTRAPARAMSPTR 19

enum
{
Expand All @@ -292,18 +291,18 @@ enum
gmplsTunnelAttributes_labelRecordingDesired_c = 0,

/* enums for column gmplsTunnelLSPEncoding */
gmplsTunnelLSPEncoding_tunnelLspNotGmpls_c = 0,
gmplsTunnelLSPEncoding_tunnelLspPacket_c = 1,
gmplsTunnelLSPEncoding_tunnelLspEthernet_c = 2,
gmplsTunnelLSPEncoding_tunnelLspAnsiEtsiPdh_c = 3,
gmplsTunnelLSPEncoding_tunnelLspSdhSonet_c = 5,
gmplsTunnelLSPEncoding_tunnelLspDigitalWrapper_c = 7,
gmplsTunnelLSPEncoding_tunnelLspLambda_c = 8,
gmplsTunnelLSPEncoding_tunnelLspFiber_c = 9,
gmplsTunnelLSPEncoding_tunnelLspFiberChannel_c = 11,
gmplsTunnelLSPEncoding_tunnelDigitalPath_c = 12,
gmplsTunnelLSPEncoding_tunnelOpticalChannel_c = 13,
gmplsTunnelLSPEncoding_tunnelLine_c = 14,
gmplsTunnelLSPEncoding_notGmpls_c = 0,
gmplsTunnelLSPEncoding_packet_c = 1,
gmplsTunnelLSPEncoding_ethernet_c = 2,
gmplsTunnelLSPEncoding_ansiEtsiPdh_c = 3,
gmplsTunnelLSPEncoding_sdhSonet_c = 5,
gmplsTunnelLSPEncoding_digitalWrapper_c = 7,
gmplsTunnelLSPEncoding_lambda_c = 8,
gmplsTunnelLSPEncoding_fiber_c = 9,
gmplsTunnelLSPEncoding_fiberChannel_c = 11,
gmplsTunnelLSPEncoding_digitalPath_c = 12,
gmplsTunnelLSPEncoding_opticalChannel_c = 13,
gmplsTunnelLSPEncoding_line_c = 14,

/* enums for column gmplsTunnelSwitchingType */
gmplsTunnelSwitchingType_unknown_c = 0,
Expand Down Expand Up @@ -497,21 +496,19 @@ typedef struct gmplsTunnelEntry_t
int32_t i32Direction;
int32_t i32PathComp;
int32_t i32UpstreamNotifyRecipientType;
uint8_t au8UpstreamNotifyRecipient[255];
uint8_t au8UpstreamNotifyRecipient[20];
size_t u16UpstreamNotifyRecipient_len; /* # of uint8_t elements */
int32_t i32SendResvNotifyRecipientType;
uint8_t au8SendResvNotifyRecipient[255];
uint8_t au8SendResvNotifyRecipient[20];
size_t u16SendResvNotifyRecipient_len; /* # of uint8_t elements */
int32_t i32DownstreamNotifyRecipientType;
uint8_t au8DownstreamNotifyRecipient[255];
uint8_t au8DownstreamNotifyRecipient[20];
size_t u16DownstreamNotifyRecipient_len; /* # of uint8_t elements */
int32_t i32SendPathNotifyRecipientType;
uint8_t au8SendPathNotifyRecipient[255];
uint8_t au8SendPathNotifyRecipient[20];
size_t u16SendPathNotifyRecipient_len; /* # of uint8_t elements */
uint8_t au8AdminStatusFlags[4];
size_t u16AdminStatusFlags_len; /* # of uint8_t elements */
xOid_t aoExtraParamsPtr[128];
size_t u16ExtraParamsPtr_len; /* # of xOid_t elements */

// xBTree_Node_t oBTreeNode;
} gmplsTunnelEntry_t;
Expand Down

0 comments on commit 90d4d66

Please sign in to comment.