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 22, 2015
1 parent 90d4d66 commit 90283fa
Showing 1 changed file with 23 additions and 76 deletions.
99 changes: 23 additions & 76 deletions mpls/mplsTeStdMIB.c
Original file line number Diff line number Diff line change
Expand Up @@ -3924,7 +3924,7 @@ gmplsTunnelTable_getNext (
snmp_set_var_typed_integer (idx, ASN_UNSIGNED, poEntry->u32IngressLSRId);
idx = idx->next_variable;
snmp_set_var_typed_integer (idx, ASN_UNSIGNED, poEntry->u32EgressLSRId);
*my_data_context = (void*) &poEntry->oG;
*my_data_context = (void*) poEntry;
*my_loop_context = (void*) xBTree_nodeGetNext (&poEntry->oBTreeNode, &oMplsTunnelTable_BTree);
return put_index_data;
}
Expand All @@ -3950,7 +3950,7 @@ gmplsTunnelTable_get (
return false;
}

*my_data_context = (void*) &poEntry->oG;
*my_data_context = (void*) poEntry;
return true;
}

Expand All @@ -3965,6 +3965,7 @@ gmplsTunnelTable_mapper (
netsnmp_request_info *request;
netsnmp_table_request_info *table_info;
gmplsTunnelEntry_t *table_entry;
register mplsTunnelEntry_t *poEntry = NULL;
void *pvOldDdata = NULL;
int ret;

Expand All @@ -3976,13 +3977,14 @@ gmplsTunnelTable_mapper (
case MODE_GET:
for (request = requests; request != NULL; request = request->next)
{
table_entry = (gmplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
poEntry = (mplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
table_info = netsnmp_extract_table_info (request);
if (table_entry == NULL)
if (poEntry == NULL)
{
netsnmp_set_request_error (reqinfo, request, SNMP_NOSUCHINSTANCE);
continue;
}
table_entry = &poEntry->oG;

switch (table_info->colnum)
{
Expand Down Expand Up @@ -4054,8 +4056,9 @@ gmplsTunnelTable_mapper (
case MODE_SET_RESERVE1:
for (request = requests; request != NULL; request = request->next)
{
table_entry = (gmplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
poEntry = (mplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
table_info = netsnmp_extract_table_info (request);
table_entry = &poEntry->oG;

switch (table_info->colnum)
{
Expand Down Expand Up @@ -4214,12 +4217,14 @@ gmplsTunnelTable_mapper (
case MODE_SET_RESERVE2:
for (request = requests; request != NULL; request = request->next)
{
table_entry = (gmplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
poEntry = (mplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
table_info = netsnmp_extract_table_info (request);
register netsnmp_variable_list *idx1 = table_info->indexes;
register netsnmp_variable_list *idx2 = idx1->next_variable;
register netsnmp_variable_list *idx3 = idx2->next_variable;
register netsnmp_variable_list *idx4 = idx3->next_variable;
if (poEntry == NULL)
{
netsnmp_set_request_error (reqinfo, request, SNMP_NOSUCHINSTANCE);
continue;
}
table_entry = &poEntry->oG;

switch (table_info->colnum)
{
Expand All @@ -4241,85 +4246,26 @@ gmplsTunnelTable_mapper (
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENTTYPE:
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENT:
case GMPLSTUNNELADMINSTATUSFLAGS:
if (table_entry == NULL)
{
if (/* TODO */ TOBE_REPLACED != TOBE_REPLACED)
{
netsnmp_set_request_error (reqinfo, request, SNMP_ERR_INCONSISTENTVALUE);
return SNMP_ERR_NOERROR;
}

table_entry = gmplsTunnelTable_createEntry (
*idx1->val.integer,
*idx2->val.integer,
*idx3->val.integer,
*idx4->val.integer);
if (table_entry != NULL)
{
netsnmp_insert_iterator_context (request, table_entry);
netsnmp_request_add_list_data (request, netsnmp_create_data_list (ROLLBACK_BUFFER, table_entry, &xBuffer_free));
}
else
{
netsnmp_set_request_error (reqinfo, request, SNMP_ERR_RESOURCEUNAVAILABLE);
return SNMP_ERR_NOERROR;
}
}
break;
default:
if (table_entry == NULL)
if (poEntry->u8RowStatus == xRowStatus_active_c || poEntry->u8RowStatus == xRowStatus_notReady_c)
{
netsnmp_set_request_error (reqinfo, request, SNMP_NOSUCHINSTANCE);
netsnmp_set_request_error (reqinfo, request, SNMP_ERR_RESOURCEUNAVAILABLE);
return SNMP_ERR_NOERROR;
}
break;
}
}
break;

case MODE_SET_FREE:
for (request = requests; request != NULL; request = request->next)
{
pvOldDdata = netsnmp_request_get_list_data (request, ROLLBACK_BUFFER);
table_entry = (gmplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
table_info = netsnmp_extract_table_info (request);
if (table_entry == NULL || pvOldDdata == NULL)
{
continue;
}

switch (table_info->colnum)
{
case GMPLSTUNNELUNNUMIF:
case GMPLSTUNNELATTRIBUTES:
case GMPLSTUNNELLSPENCODING:
case GMPLSTUNNELSWITCHINGTYPE:
case GMPLSTUNNELLINKPROTECTION:
case GMPLSTUNNELGPID:
case GMPLSTUNNELSECONDARY:
case GMPLSTUNNELDIRECTION:
case GMPLSTUNNELPATHCOMP:
case GMPLSTUNNELUPSTREAMNOTIFYRECIPIENTTYPE:
case GMPLSTUNNELUPSTREAMNOTIFYRECIPIENT:
case GMPLSTUNNELSENDRESVNOTIFYRECIPIENTTYPE:
case GMPLSTUNNELSENDRESVNOTIFYRECIPIENT:
case GMPLSTUNNELDOWNSTREAMNOTIFYRECIPIENTTYPE:
case GMPLSTUNNELDOWNSTREAMNOTIFYRECIPIENT:
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENTTYPE:
case GMPLSTUNNELSENDPATHNOTIFYRECIPIENT:
case GMPLSTUNNELADMINSTATUSFLAGS:
gmplsTunnelTable_removeEntry (table_entry);
netsnmp_request_remove_list_entry (request, ROLLBACK_BUFFER);
break;
}
}
break;

case MODE_SET_ACTION:
for (request = requests; request != NULL; request = request->next)
{
pvOldDdata = netsnmp_request_get_list_data (request, ROLLBACK_BUFFER);
table_entry = (gmplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
poEntry = (mplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
table_info = netsnmp_extract_table_info (request);
table_entry = &poEntry->oG;

switch (table_info->colnum)
{
Expand Down Expand Up @@ -4611,12 +4557,13 @@ gmplsTunnelTable_mapper (
for (request = requests; request != NULL; request = request->next)
{
pvOldDdata = netsnmp_request_get_list_data (request, ROLLBACK_BUFFER);
table_entry = (gmplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
poEntry = (mplsTunnelEntry_t*) netsnmp_extract_iterator_context (request);
table_info = netsnmp_extract_table_info (request);
if (table_entry == NULL || pvOldDdata == NULL)
if (poEntry == NULL || pvOldDdata == NULL)
{
continue;
}
table_entry = &poEntry->oG;

switch (table_info->colnum)
{
Expand Down

0 comments on commit 90283fa

Please sign in to comment.