Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

IXP425 Ethernet Database (IxEthDB) API

ethDB is a library that does provides a MAC address database learning/filtering capability More...

Data Structures

struct  IxEthDBMacAddr
 The IEEE 802.3 Ethernet MAC address structure. More...


Defines

#define INLINE
#define IX_ETH_DB_PRIVATE
#define IX_ETH_DB_PUBLIC
#define IX_ETH_DB_PORT_ID_TO_NPE(id)
 port ID => message handler NPE id conversion (0 => NPE_B, 1 => NPE_C)

#define IX_ETH_DB_NPE_TO_PORT_ID(npe)
 message handler NPE id => port ID conversion (NPE_B => 0, NPE_C => 1)

#define IX_IEEE803_MAC_ADDRESS_SIZE
 The size of the MAC address.

#define IX_ETH_DB_MAINTENANCE_TIME
 The ixEthDBDatabaseMaintenance must be called by the user at a frequency of IX_ETH_DB_MAINTENANCE_TIME.

#define IX_ETH_DB_LEARNING_ENTRY_AGE_TIME
 The define specifies the filtering database age entry time. Static entries older than IX_ETH_DB_LEARNING_ENTRY_AGE_TIME +/- IX_ETH_DB_MAINTENANCE_TIME shall be removed.


Typedefs

typedef UINT32 IxEthDBPortId
 Definition of an IXP425 port.

typedef UINT32 IxEthDBPortMap
 Port dependency map definition.


Enumerations

enum  IxEthDBStatus {
  IX_ETH_DB_SUCCESS,
  IX_ETH_DB_FAIL,
  IX_ETH_DB_INVALID_PORT,
  IX_ETH_DB_PORT_UNINITIALIZED,
  IX_ETH_DB_MAC_UNINITIALIZED,
  IX_ETH_DB_INVALID_ARG,
  IX_ETH_DB_NO_SUCH_ADDR,
  IX_ETH_DB_NOMEM,
  IX_ETH_DB_BUSY,
  IX_ETH_DB_END
}
 Ethernet database status. More...


Functions

IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBInit (void)
 Initializes the Ethernet learning/filtering database.

IX_ETH_DB_PUBLIC void ixEthDBPortInit (IxEthDBPortId portID)
 Initializes a port.

IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortEnable (IxEthDBPortId portID)
 enable a port

IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortDisable (IxEthDBPortId portID)
 disable processing on a port

IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBPortAddressSet (IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
 set the port MAC address

IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet (IxEthDBPortId portID, UINT32 maximumFrameSize)
 Set the maximum frame size supported on the given port ID.

IxEthDBStatus ixEthDBFilteringStaticEntryProvision (IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
 Populate the Ethernet learning/filtering database with a static MAC address.

IxEthDBStatus ixEthDBFilteringDynamicEntryProvision (IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
 Populate the Ethernet learning/filtering database with a dynamic MAC address.

IxEthDBStatus ixEthDBFilteringEntryDelete (IxEthDBMacAddr *macAddr)
 Remove a MAC address entry from the Ethernet learning/filtering database.

IxEthDBStatus ixEthDBFilteringPortSearch (IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
 Search the Ethernet learning/filtering database for the given MAC address and port ID.

IxEthDBStatus ixEthDBFilteringDatabaseSearch (IxEthDBPortId *portID, IxEthDBMacAddr *macAddr)
 Search the Ethernet learning/filtering database for a MAC address and return the port ID.

IxEthDBStatus ixEthDBFilteringPortUpdatingSearch (IxEthDBPortId *portID, IxEthDBMacAddr *macAddr)
 Search the filtering database for a MAC address, return the port ID and reset the record age.

IxEthDBStatus ixEthDBPortAgingDisable (IxEthDBPortId port)
 Disable the aging function for a specific port.

IxEthDBStatus ixEthDBPortAgingEnable (IxEthDBPortId portID)
 Enable the aging function for a specific port.

void ixEthDBDatabaseMaintenance (void)
 Performs a maintenance operation on the Ethernet learning/filtering database.

IxEthDBStatus ixEthDBFilteringDatabaseShow (IxEthDBPortId portID)
 This function displays the Mac Ethernet MAC address filtering tables.

void ixEthDBFilteringDatabaseShowAll (void)
 Displays the MAC address recorded in the filtering database for all registered ports (see IxEthDBPortDefs.h), grouped by port ID.


Detailed Description

ethDB is a library that does provides a MAC address database learning/filtering capability


Define Documentation

#define IX_ETH_DB_LEARNING_ENTRY_AGE_TIME
 

The define specifies the filtering database age entry time. Static entries older than IX_ETH_DB_LEARNING_ENTRY_AGE_TIME +/- IX_ETH_DB_MAINTENANCE_TIME shall be removed.

Definition at line 421 of file IxEthDB.h.

#define IX_ETH_DB_MAINTENANCE_TIME
 

The ixEthDBDatabaseMaintenance must be called by the user at a frequency of IX_ETH_DB_MAINTENANCE_TIME.

Definition at line 410 of file IxEthDB.h.

#define IX_ETH_DB_NPE_TO_PORT_ID npe   ) 
 

message handler NPE id => port ID conversion (NPE_B => 0, NPE_C => 1)

Definition at line 76 of file IxEthDB.h.

#define IX_ETH_DB_PORT_ID_TO_NPE id   ) 
 

port ID => message handler NPE id conversion (0 => NPE_B, 1 => NPE_C)

Definition at line 70 of file IxEthDB.h.

#define IX_IEEE803_MAC_ADDRESS_SIZE
 

The size of the MAC address.

Definition at line 82 of file IxEthDB.h.


Typedef Documentation

typedef UINT32 IxEthDBPortId
 

Definition of an IXP425 port.

Definition at line 120 of file IxEthDB.h.

typedef UINT32 IxEthDBPortMap
 

Port dependency map definition.

Definition at line 127 of file IxEthDB.h.


Enumeration Type Documentation

enum IxEthDBStatus
 

Ethernet database status.

Enumeration values:
IX_ETH_DB_SUCCESS  Return success.
IX_ETH_DB_FAIL  Return fail.
IX_ETH_DB_INVALID_PORT  invalid port
IX_ETH_DB_PORT_UNINITIALIZED  port uninitialized
IX_ETH_DB_MAC_UNINITIALIZED  MAC uninitialized.
IX_ETH_DB_INVALID_ARG  invalid arg
IX_ETH_DB_NO_SUCH_ADDR  Address not found for search or delete operations.
IX_ETH_DB_NOMEM  Learning database memory full.
IX_ETH_DB_BUSY  Learning database is busy.
IX_ETH_DB_END  Database browser passed the end.

Definition at line 88 of file IxEthDB.h.


Function Documentation

void ixEthDBDatabaseMaintenance void   ) 
 

Performs a maintenance operation on the Ethernet learning/filtering database.

In order to perform a database maintenance this function must be called every seconds. It should be called regardless of whether learning is enabled or not.

  • Reentrant - no
  • ISR Callable - no

Return values:
void 

IxEthDBStatus ixEthDBFilteringDatabaseSearch IxEthDBPortId portID,
IxEthDBMacAddr macAddr
 

Search the Ethernet learning/filtering database for a MAC address and return the port ID.

Searches the database for a MAC address. The function returns the portID for the MAC address record, if found. If no match is found the function returns IX_ETH_DB_NO_SUCH_ADDR. The portID is only valid if the function finds a match.

  • Reentrant - yes
  • ISR Callable - no

Parameters:
portID port ID the address belongs to (populated only on a successful search)
macAddr MAC address to search for
Return values:
IX_ETH_DB_SUCCESS the record exists in the database
IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database

IxEthDBStatus ixEthDBFilteringDatabaseShow IxEthDBPortId  portID  ) 
 

This function displays the Mac Ethernet MAC address filtering tables.

It displays the MAC address, port ID, entry type (dynamic/static),and age for the given port ID.

  • Reentrant - yes
  • ISR Callable - no

Parameters:
portID port ID to display the MAC address entries
Return values:
IX_ETH_DB_SUCCESS operation completed successfully
IX_ETH_DB_INVALID_PORT portID is invalid
IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized

void ixEthDBFilteringDatabaseShowAll void   ) 
 

Displays the MAC address recorded in the filtering database for all registered ports (see IxEthDBPortDefs.h), grouped by port ID.

Return values:
void 
  • Reentrant - yes
  • ISR Callable - no

IxEthDBStatus ixEthDBFilteringDynamicEntryProvision IxEthDBPortId  portID,
IxEthDBMacAddr macAddr
 

Populate the Ethernet learning/filtering database with a dynamic MAC address.

Populates the Ethernet learning/filtering database with a dynamic MAC address. This entry will be subject to normal aging function, if aging is enabled on its port. If there is an entry (static or dynamic) with the same MAC address on any port this entry will take precedence. Any other entry with the same MAC address will be removed.

  • Reentrant - yes
  • ISR Callable - no

Parameters:
portID port ID to add the dynamic address to
macAddr static MAC address to add
Return values:
IX_ETH_DB_SUCCESS the add was successful
IX_ETH_DB_FAIL failed to populate the database entry
IX_ETH_DB_INVALID_PORT portID is invalid
IX_ETH_DB_PORT_UNINITIALIZED port is not initialized

IxEthDBStatus ixEthDBFilteringEntryDelete IxEthDBMacAddr macAddr  ) 
 

Remove a MAC address entry from the Ethernet learning/filtering database.

* - Reentrant - yes

  • ISR Callable - no

Parameters:
macAddr MAC address to remove
Return values:
IX_ETH_DB_SUCCESS the removal was successful
IX_ETH_DB_NO_SUCH_ADDR failed to remove the address (not in the database)

IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet IxEthDBPortId  portID,
UINT32  maximumFrameSize
 

Set the maximum frame size supported on the given port ID.

This functions set the maximum frame size supported on a specific port ID

  • Reentrant - yes
  • ISR Callable - no

Parameters:
portID port ID to configure
maximumFrameSize maximum frame size to configure
Return values:
IX_ETH_DB_SUCCESS the port is configured
IX_ETH_DB_INVALID_PORT portID is invalid
IX_ETH_DB_INVALID_ARG parameter is out of range
Note:
This maximum frame size is used to filter the frames based on their destination addresses and the capabilities of the destination port. The mximum value that can be set for a NPE port is 16320. (IX_ETHNPE_ACC_FRAME_LENGTH_MAX)

IxEthDBStatus ixEthDBFilteringPortSearch IxEthDBPortId  portID,
IxEthDBMacAddr macAddr
 

Search the Ethernet learning/filtering database for the given MAC address and port ID.

This functions searches the database for a specific port ID and MAC address. Both the port ID and the MAC address have to match in order for the record to be reported as found.

  • Reentrant - yes
  • ISR Callable - no

Parameters:
portID port ID to search for
macAddr MAC address to search for
Return values:
IX_ETH_DB_SUCCESS the record exists in the database
IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database
IX_ETH_DB_INVALID_PORT portID is invalid
IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized

IxEthDBStatus ixEthDBFilteringPortUpdatingSearch IxEthDBPortId portID,
IxEthDBMacAddr macAddr
 

Search the filtering database for a MAC address, return the port ID and reset the record age.

Searches the database for a MAC address. The function returns the portID for the MAC address record and resets the entry age to 0, if found. If no match is found the function returns IX_ETH_DB_NO_SUCH_ADDR. The portID is only valid if the function finds a match.

  • Reentrant - yes
  • ISR Callable - no

Return values:
IX_ETH_DB_SUCCESS the MAC address was found
IX_ETH_DB_NO_SUCH_ADDR the MAC address was not found

IxEthDBStatus ixEthDBFilteringStaticEntryProvision IxEthDBPortId  portID,
IxEthDBMacAddr macAddr
 

Populate the Ethernet learning/filtering database with a static MAC address.

Populates the Ethernet learning/filtering database with a static MAC address. The entry will not be subject to aging. If there is an entry (static or dynamic) with the corresponding MAC address on any port this entry will take precedence. Any other entry with the same MAC address will be removed.

  • Reentrant - yes
  • ISR Callable - no

Parameters:
portID port ID to add the static address to
macAddr static MAC address to add
Return values:
IX_ETH_DB_SUCCESS the add was successful
IX_ETH_DB_FAIL failed to populate the database entry
IX_ETH_DB_INVALID_PORT portID is invalid
IX_ETH_DB_PORT_UNINITIALIZED port is not initialized

IxEthDBStatus ixEthDBInit void   ) 
 

Initializes the Ethernet learning/filtering database.

Return values:
IX_ETH_DB_SUCCESS initialization was successful
IX_ETH_DB_FAIL initialization failed (OSSL error)

IxEthDBStatus ixEthDBPortAddressSet IxEthDBPortId  portID,
IxEthDBMacAddr macAddr
 

set the port MAC address

This function is to be called from the Ethernet Access component top-level ixEthDBUnicastAddressSet(). Event processing cannot be enabled for a port until its MAC address has been set.

Parameters:
portID ID of the port whose MAC address is set
macAddr port MAC address
Return values:
IX_ETH_DB_SUCCESS MAC address was set successfully
IX_ETH_DB_FAIL MAC address was not set due to a message handler failure
IX_ETH_DB_INVALID_PORT if the port is not an Ethernet NPE
See also:
IxEthDBPortDefs.h for port definitions

IxEthDBStatus ixEthDBPortAgingDisable IxEthDBPortId  port  ) 
 

Disable the aging function for a specific port.

* - Reentrant - yes

  • ISR Callable - no

Parameters:
portID port ID to disable aging on
Return values:
IX_ETH_DB_SUCCESS aging disabled successfully
IX_ETH_DB_INVALID_PORT portID is invalid
IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized

IxEthDBStatus ixEthDBPortAgingEnable IxEthDBPortId  portID  ) 
 

Enable the aging function for a specific port.

Enables the aging of dynamic MAC address entries stored in the learning/filtering database

Note:
The aging function relies on the ixEthDBDatabaseMaintenance being called with a period of IX_ETH_DB_MAINTENANCE_TIME seconds.
  • Reentrant - yes
  • ISR Callable - no

Parameters:
portID port ID to enable aging on
Return values:
IX_ETH_DB_SUCCESS aging enabled successfully
IX_ETH_DB_INVALID_PORT portID is invalid
IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized

IxEthDBStatus ixEthDBPortDisable IxEthDBPortId  portID  ) 
 

disable processing on a port

This function is called automatically from the Ethernet Access component top-level portDisable() routine and should be manually called for any user-defined port (any port that is not one of the two Ethernet NPEs).

Note: After Ethernet NPEs are disabled they are stopped therefore when re-enabled they need to be reset, downloaded with microcode and started. For learning to restart working the user needs to call again ixEthAccPortUnicastMacAddressSet or ixEthDBUnicastAddressSet with the respective port MAC address. Residual MAC addresses learnt before the port was disable will take up to IX_ETH_DB_MAINTENANCE_TIME to be downloaded in the NPE MAC tree after learning is restarted on the port. The dynamic addresses do not dissapear after the disable-enable sequence. They also do not age during the time the port is disabled.

Parameters:
portID ID of the port to disable processing on
Return values:
IX_ETH_DB_SUCCESS if disabling is successful
IX_ETH_DB_FAIL if the disabling was not successful due to a message handler error

IxEthDBStatus ixEthDBPortEnable IxEthDBPortId  portID  ) 
 

enable a port

This function is called automatically from the Ethernet Access component top-level portEnable() routine and should be manually called for any user-defined port (any port that is not one of the two Ethernet NPEs).

Parameters:
portID ID of the port to enable processing on
Return values:
IX_ETH_DB_SUCCESS if enabling is successful
IX_ETH_DB_FAIL if the enabling was not successful due to a message handler error
IX_ETH_DB_MAC_UNINITIALIZED the MAC address of this port was not initialized (only for Ethernet NPEs)
Precondition:
ixEthDBPortAddressSet() needs to be called prior to enabling the port events for Ethernet NPEs
See also:
ixEthDBPortAddressSet()

IxEthDBPortDefs.h for port definitions

void ixEthDBPortInit IxEthDBPortId  portID  ) 
 

Initializes a port.

This function is called automatically by the Ethernet Access component top-level portInit() routine and should be manually called for any user-defined port (any port that is not one of the two Ethernet NPEs).

Parameters:
portID ID of the port to be initialized
Return values:
void 
See also:
IxEthDBPortDefs.h for port definitions

Automatically generated from sources. © Intel Corp. 2003