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 Apr 12, 2015
1 parent 0a8f3f5 commit ee6173e
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 17 deletions.
13 changes: 13 additions & 0 deletions ethernet/ethernetUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,19 @@ ieee8021BridgeBasePortTable_hierUpdate (
return bRetCode;
}

bool
neIeee8021BridgeBasePortAdminFlags_update (
ieee8021BridgeBasePortEntry_t *poEntry, uint8_t *pu8AdminFlags)
{
register bool bRetCode = false;

bRetCode = true;

//neIeee8021BridgeBasePortAdminFlags_update_cleanup:

return bRetCode;
}

bool
ieee8021BridgeBasePortDependentStatus_update (
ieee8021BridgeBaseEntry_t *poComponent,
Expand Down
3 changes: 3 additions & 0 deletions ethernet/ethernetUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ bool
bool
ieee8021BridgeBaseRowStatus_update (
ieee8021BridgeBaseEntry_t *poEntry, uint8_t u8RowStatus);
bool
neIeee8021BridgeBasePortAdminFlags_update (
ieee8021BridgeBasePortEntry_t *poEntry, uint8_t *pu8AdminFlags);
bool
ieee8021BridgeXPortRowStatus_halUpdate (
ieee8021BridgeBaseEntry_t *poComponent,
Expand Down
1 change: 1 addition & 0 deletions ethernet/ieee8021BridgeMib.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ ieee8021BridgeBasePortEntry_t * ieee8021BridgeBasePortTable_getByIndex (
ieee8021BridgeBasePortEntry_t * ieee8021BridgeBasePortTable_getNextIndex (
uint32_t u32ComponentId,
uint32_t u32Port);
#define ieee8021BridgeBasePortTable_getByNeEntry(poEntry) ((poEntry) == NULL ? NULL: xGetParentByMemberPtr ((poEntry), ieee8021BridgeBasePortEntry_t, oNe))
void ieee8021BridgeBasePortTable_removeEntry (ieee8021BridgeBasePortEntry_t *poEntry);
bool ieee8021BridgeBasePortTable_allocateIndex (
ieee8021BridgeBaseEntry_t *poComponent,
Expand Down
34 changes: 17 additions & 17 deletions ethernet/ieee8021QBridgeMib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4626,13 +4626,13 @@ ieee8021QBridgeVlanCurrentTable_removeHier (

bool
ieee8021QBridgeVlanCurrentTable_vlanHandler (
ieee8021BridgeBaseEntry_t *pComponent,
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021QBridgeVlanCurrentEntry_t *poEntry,
uint8_t *pu8EnabledPorts, uint8_t *pu8DisabledPorts, uint8_t *pu8UntaggedPorts)
{
register bool bRetCode = false;

if (!ieee8021QBridgeVlanCurrentTable_vlanUpdate (pComponent, poEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts))
if (!ieee8021QBridgeVlanCurrentTable_vlanUpdate (poComponent, poEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts))
{
goto ieee8021QBridgeVlanCurrentTable_vlanHandler_cleanup;
}
Expand All @@ -4652,7 +4652,7 @@ ieee8021QBridgeVlanCurrentTable_vlanHandler (

bool
ieee8021QBridgeVlanCurrentRowStatus_handler (
ieee8021BridgeBaseEntry_t *pComponent,
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021QBridgeVlanCurrentEntry_t *poEntry, uint8_t u8RowStatus)
{
register bool bRetCode = false;
Expand All @@ -4673,14 +4673,14 @@ ieee8021QBridgeVlanCurrentRowStatus_handler (
switch (u8RealStatus)
{
case xRowStatus_active_c:
if (!(u8RowStatus & xRowStatus_fromParent_c) && pComponent->u8RowStatus != xRowStatus_active_c)
if (!(u8RowStatus & xRowStatus_fromParent_c) && poComponent->u8RowStatus != xRowStatus_active_c)
{
u8RealStatus = xRowStatus_notReady_c;
}

/* TODO */

if (!ieee8021QBridgeVlanCurrentRowStatus_update (pComponent, poEntry, u8RealStatus))
if (!ieee8021QBridgeVlanCurrentRowStatus_update (poComponent, poEntry, u8RealStatus))
{
goto ieee8021QBridgeVlanCurrentRowStatus_handler_cleanup;
}
Expand All @@ -4689,7 +4689,7 @@ ieee8021QBridgeVlanCurrentRowStatus_handler (
break;

case xRowStatus_notInService_c:
if (!ieee8021QBridgeVlanCurrentRowStatus_update (pComponent, poEntry, u8RealStatus))
if (!ieee8021QBridgeVlanCurrentRowStatus_update (poComponent, poEntry, u8RealStatus))
{
goto ieee8021QBridgeVlanCurrentRowStatus_handler_cleanup;
}
Expand All @@ -4707,7 +4707,7 @@ ieee8021QBridgeVlanCurrentRowStatus_handler (
break;

case xRowStatus_destroy_c:
if (!ieee8021QBridgeVlanCurrentRowStatus_update (pComponent, poEntry, u8RealStatus))
if (!ieee8021QBridgeVlanCurrentRowStatus_update (poComponent, poEntry, u8RealStatus))
{
goto ieee8021QBridgeVlanCurrentRowStatus_handler_cleanup;
}
Expand Down Expand Up @@ -5109,7 +5109,7 @@ ieee8021QBridgeVlanStaticTable_removeHier (

bool
ieee8021QBridgeVlanStaticTable_vlanUpdater (
ieee8021BridgeBaseEntry_t *pComponent,
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021QBridgeVlanStaticEntry_t *poEntry,
uint8_t *pu8EnabledPorts, uint8_t *pu8DisabledPorts, uint8_t *pu8UntaggedPorts)
{
Expand All @@ -5121,12 +5121,12 @@ ieee8021QBridgeVlanStaticTable_vlanUpdater (
goto ieee8021QBridgeVlanStaticTable_vlanUpdater_cleanup;
}

if (!ieee8021QBridgeVlanCurrentTable_vlanHandler (pComponent, poIeee8021QBridgeVlanCurrentEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts))
if (!ieee8021QBridgeVlanCurrentTable_vlanHandler (poComponent, poIeee8021QBridgeVlanCurrentEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts))
{
goto ieee8021QBridgeVlanStaticTable_vlanUpdater_cleanup;
}

if (!ieee8021QBridgeVlanStaticTable_vlanUpdate (pComponent, poEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts))
if (!ieee8021QBridgeVlanStaticTable_vlanUpdate (poComponent, poEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts))
{
goto ieee8021QBridgeVlanStaticTable_vlanUpdater_cleanup;
}
Expand All @@ -5140,7 +5140,7 @@ ieee8021QBridgeVlanStaticTable_vlanUpdater (

bool
ieee8021QBridgeVlanStaticTable_handler (
ieee8021BridgeBaseEntry_t *pComponent,
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021QBridgeVlanStaticEntry_t *poEntry,
uint8_t *pu8EgressPorts, uint8_t *pu8ForbiddenEgressPorts, uint8_t *pu8UntaggedPorts)
{
Expand Down Expand Up @@ -5184,7 +5184,7 @@ ieee8021QBridgeVlanStaticTable_handler (
if ((xBitmap_checkBitRange (pu8EnabledPorts, 0, xBitmap_bitLength (poEntry->u16EgressPorts_len) - 1, 1) != xBitmap_index_invalid_c ||
xBitmap_checkBitRange (pu8DisabledPorts, 0, xBitmap_bitLength (poEntry->u16EgressPorts_len) - 1, 1) != xBitmap_index_invalid_c ||
xBitmap_checkBitRange (pu8UntaggedPorts2, 0, xBitmap_bitLength (poEntry->u16EgressPorts_len) - 1, 1) != xBitmap_index_invalid_c) &&
!ieee8021QBridgeVlanStaticTable_vlanUpdater (pComponent, poEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts2))
!ieee8021QBridgeVlanStaticTable_vlanUpdater (poComponent, poEntry, pu8EnabledPorts, pu8DisabledPorts, pu8UntaggedPorts2))
{
goto ieee8021QBridgeVlanStaticTable_handler_cleanup;
}
Expand All @@ -5211,7 +5211,7 @@ ieee8021QBridgeVlanStaticTable_handler (

bool
ieee8021QBridgeVlanStaticRowStatus_handler (
ieee8021BridgeBaseEntry_t *pComponent,
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021QBridgeVlanStaticEntry_t *poEntry, uint8_t u8RowStatus)
{
register bool bRetCode = false;
Expand All @@ -5232,14 +5232,14 @@ ieee8021QBridgeVlanStaticRowStatus_handler (
switch (u8RealStatus)
{
case xRowStatus_active_c:
if (!(u8RowStatus & xRowStatus_fromParent_c) && pComponent->u8RowStatus != xRowStatus_active_c)
if (!(u8RowStatus & xRowStatus_fromParent_c) && poComponent->u8RowStatus != xRowStatus_active_c)
{
u8RealStatus = xRowStatus_notReady_c;
}

/* TODO */

if (!ieee8021QBridgeVlanStaticRowStatus_update (pComponent, poEntry, u8RealStatus))
if (!ieee8021QBridgeVlanStaticRowStatus_update (poComponent, poEntry, u8RealStatus))
{
goto ieee8021QBridgeVlanStaticRowStatus_handler_cleanup;
}
Expand All @@ -5248,7 +5248,7 @@ ieee8021QBridgeVlanStaticRowStatus_handler (
break;

case xRowStatus_notInService_c:
if (!ieee8021QBridgeVlanStaticRowStatus_update (pComponent, poEntry, u8RealStatus))
if (!ieee8021QBridgeVlanStaticRowStatus_update (poComponent, poEntry, u8RealStatus))
{
goto ieee8021QBridgeVlanStaticRowStatus_handler_cleanup;
}
Expand All @@ -5266,7 +5266,7 @@ ieee8021QBridgeVlanStaticRowStatus_handler (
break;

case xRowStatus_destroy_c:
if (!ieee8021QBridgeVlanStaticRowStatus_update (pComponent, poEntry, u8RealStatus))
if (!ieee8021QBridgeVlanStaticRowStatus_update (poComponent, poEntry, u8RealStatus))
{
goto ieee8021QBridgeVlanStaticRowStatus_handler_cleanup;
}
Expand Down
29 changes: 29 additions & 0 deletions ethernet/neIeee8021BridgeMIB.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "system/systemMIB.h"
#include "ethernetUtils.h"
#include "neIeee8021BridgeMIB.h"
#include "ieee8021BridgeMib.h"

Expand Down Expand Up @@ -589,6 +590,34 @@ neIeee8021BridgeBasePortTable_get (
return true;
}

bool
neIeee8021BridgeBasePortAdminFlags_handler (
neIeee8021BridgeBasePortEntry_t *poEntry, uint8_t *pu8AdminFlags, bool bForce)
{
register bool bRetCode = false;
register ieee8021BridgeBasePortEntry_t *poPort = ieee8021BridgeBasePortTable_getByNeEntry (poEntry);

if (memcmp (poEntry->au8AdminFlags, pu8AdminFlags, sizeof (poEntry->au8AdminFlags)) == 0 && !bForce)
{
goto neIeee8021BridgeBasePortAdminFlags_handler_success;
}

if (!neIeee8021BridgeBasePortAdminFlags_update (poPort, pu8AdminFlags))
{
goto neIeee8021BridgeBasePortAdminFlags_handler_cleanup;
}

!bForce ? memcpy (poEntry->au8AdminFlags, pu8AdminFlags, sizeof (poEntry->au8AdminFlags)): false;

neIeee8021BridgeBasePortAdminFlags_handler_success:

bRetCode = true;

neIeee8021BridgeBasePortAdminFlags_handler_cleanup:

return bRetCode;
}

/* neIeee8021BridgeBasePortTable table mapper */
int
neIeee8021BridgeBasePortTable_mapper (
Expand Down
2 changes: 2 additions & 0 deletions ethernet/neIeee8021BridgeMIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ neIeee8021BridgeBasePortEntry_t * neIeee8021BridgeBasePortTable_getNextIndex (
uint32_t u32ComponentId,
uint32_t u32Port);
void neIeee8021BridgeBasePortTable_removeEntry (neIeee8021BridgeBasePortEntry_t *poEntry);
bool neIeee8021BridgeBasePortAdminFlags_handler (
neIeee8021BridgeBasePortEntry_t *poEntry, uint8_t *pu8AdminFlags, bool bForce);
#ifdef SNMP_SRC
Netsnmp_First_Data_Point neIeee8021BridgeBasePortTable_getFirst;
Netsnmp_Next_Data_Point neIeee8021BridgeBasePortTable_getNext;
Expand Down

0 comments on commit ee6173e

Please sign in to comment.