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 Mar 2, 2015
1 parent 699c4dd commit 22829a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 10 additions & 4 deletions ethernet/ieee8021QBridgeMib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2093,11 +2093,12 @@ ieee8021QBridgeTpGroupEntry_t *
ieee8021QBridgeTpGroupTable_createEntry (
uint32_t u32VlanCurrentComponentId,
uint32_t u32VlanIndex,
uint8_t *pau8Address, size_t u16Address_len)
uint8_t *pau8Address, size_t u16Address_len,
uint16_t u16Ports_len)
{
register ieee8021QBridgeTpGroupEntry_t *poEntry = NULL;

if ((poEntry = xBuffer_cAlloc (sizeof (*poEntry))) == NULL)
if (u16Ports_len == 0 || (poEntry = xBuffer_cAlloc (sizeof (*poEntry) + 2 * u16Ports_len)) == NULL)
{
return NULL;
}
Expand All @@ -2112,6 +2113,11 @@ ieee8021QBridgeTpGroupTable_createEntry (
return NULL;
}

poEntry->pu8EgressPorts = (void *) (poEntry + 1);
poEntry->pu8Learnt = ((void *) (poEntry + 1)) + u16Ports_len;
poEntry->u16EgressPorts_len = u16Ports_len;
poEntry->u16Learnt_len = u16Ports_len;

xBTree_nodeAdd (&poEntry->oBTreeNode, &oIeee8021QBridgeTpGroupTable_BTree);
return poEntry;
}
Expand Down Expand Up @@ -2275,10 +2281,10 @@ ieee8021QBridgeTpGroupTable_mapper (
switch (table_info->colnum)
{
case IEEE8021QBRIDGETPGROUPEGRESSPORTS:
snmp_set_var_typed_value (request->requestvb, ASN_OCTET_STR, (u_char*) table_entry->au8EgressPorts, table_entry->u16EgressPorts_len);
snmp_set_var_typed_value (request->requestvb, ASN_OCTET_STR, (u_char*) table_entry->pu8EgressPorts, table_entry->u16EgressPorts_len);
break;
case IEEE8021QBRIDGETPGROUPLEARNT:
snmp_set_var_typed_value (request->requestvb, ASN_OCTET_STR, (u_char*) table_entry->au8Learnt, table_entry->u16Learnt_len);
snmp_set_var_typed_value (request->requestvb, ASN_OCTET_STR, (u_char*) table_entry->pu8Learnt, table_entry->u16Learnt_len);
break;

default:
Expand Down
8 changes: 5 additions & 3 deletions ethernet/ieee8021QBridgeMib.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern "C" {



#include "neIeee8021BridgeMIB.h"
#include "ethernet_ext.h"

#include "lib/binaryTree.h"
Expand Down Expand Up @@ -325,9 +326,9 @@ typedef struct ieee8021QBridgeTpGroupEntry_t
size_t u16Address_len; /* # of uint8_t elements */

/* Column values */
uint8_t au8EgressPorts[ETHERNET_PORT_MAP_SIZE];
uint8_t *pu8EgressPorts;
size_t u16EgressPorts_len; /* # of uint8_t elements */
uint8_t au8Learnt[ETHERNET_PORT_MAP_SIZE];
uint8_t *pu8Learnt;
size_t u16Learnt_len; /* # of uint8_t elements */

xBTree_Node_t oBTreeNode;
Expand All @@ -340,7 +341,8 @@ void ieee8021QBridgeTpGroupTable_init (void);
ieee8021QBridgeTpGroupEntry_t * ieee8021QBridgeTpGroupTable_createEntry (
uint32_t u32VlanCurrentComponentId,
uint32_t u32VlanIndex,
uint8_t *pau8Address, size_t u16Address_len);
uint8_t *pau8Address, size_t u16Address_len,
uint16_t u16Ports_len);
ieee8021QBridgeTpGroupEntry_t * ieee8021QBridgeTpGroupTable_getByIndex (
uint32_t u32VlanCurrentComponentId,
uint32_t u32VlanIndex,
Expand Down

0 comments on commit 22829a8

Please sign in to comment.