Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Macros | Enumerations | Functions
Switch MFDB [OPENAPI_MFDB]

Macros

#define OPEN_MATCH_EXACT   1
 
#define OPEN_MATCH_FREE   3
 
#define OPEN_MATCH_GETNEXT   2
 
#define OPEN_MFDB_INTF_LIST_LENGTH   4096
 
#define OPEN_MFDB_MAC_LENGTH   18
 
#define OPEN_MFDB_VIDMAC_LENGTH   24
 
#define OPENAPI_MFDB_DESCR_LEN   16
 

Enumerations

enum  OPEN_MFDB_ENTRY_TYPE_t { OPEN_MFDB_TYPE_STATIC = 0, OPEN_MFDB_TYPE_DYNAMIC = 1 }
 OpEN uses this enumeration to define type of MFDB entry. More...
 
enum  OPEN_MFDB_PROTOCOL_TYPE_t {
  OPEN_MFDB_PROTOCOL_STATIC = 1, OPEN_MFDB_PROTOCOL_GMRP = 2, OPEN_MFDB_PROTOCOL_IGMP = 3, OPEN_MFDB_PROTOCOL_MLD = 4,
  OPEN_MFDB_PROTOCOL_MVR = 5, OPEN_MFDB_PROTOCOL_MMRP = 6, OPEN_MFDB_PROTOCOL_MSRP = 7, OPEN_MFDB_TOTAL_NUM_PROTOCOLS
}
 OpEN uses this enumeration to define type of MFDB protocol. More...
 

Functions

open_error_t openapiMfdbComponentEntryGetNext (openapiClientHandle_t *client_handle, open_buffdesc *vidMac, OPEN_MFDB_PROTOCOL_TYPE_t compId, OPEN_MFDB_PROTOCOL_TYPE_t *nextCompId, OPEN_MFDB_ENTRY_TYPE_t *type, open_buffdesc *desc, open_buffdesc *frwdPortMask, open_buffdesc *fltPortMask)
 Returns the next VLANID-MAC entry of the same user. More...
 
open_error_t openapiMfdbCurrEntriesGet (openapiClientHandle_t *client_handle, uint32_t *currEntries)
 Returns the number of current entries in the MFDB table. More...
 
open_error_t openapiMfdbEntryDataGet (openapiClientHandle_t *client_handle, open_buffdesc *vidMac, OPEN_MFDB_PROTOCOL_TYPE_t nextProt, open_buffdesc *mac, uint32_t *vlanId, OPEN_MFDB_PROTOCOL_TYPE_t *compId, OPEN_MFDB_ENTRY_TYPE_t *type, open_buffdesc *desc, open_buffdesc *frwdIntMask, open_buffdesc *fltIntMask, open_buffdesc *absPortMask)
 Returns the MFDB Entry data. More...
 
open_error_t openapiMfdbEntryFwdIntfGetExact (openapiClientHandle_t *client_handle, open_buffdesc *vidMac)
 Checks if a VLANID-MAC entry exists in the MFDB table. More...
 
open_error_t openapiMfdbEntryFwdIntfGetNext (openapiClientHandle_t *client_handle, open_buffdesc *vidMac, uint32_t matchType, open_buffdesc *absMask)
 Returns the forwarding interfaces of the next VLANID-MAC entry. More...
 
open_error_t openapiMfdbEntryGetFirst (openapiClientHandle_t *client_handle, open_buffdesc *vidMac, OPEN_MFDB_PROTOCOL_TYPE_t *prot)
 Returns the first VLANID-MAC entry. More...
 
open_error_t openapiMfdbEntryGetNext (openapiClientHandle_t *client_handle, open_buffdesc *vidMac, OPEN_MFDB_PROTOCOL_TYPE_t *nextProt)
 Returns the next VLANID-MAC entry. More...
 
open_error_t openapiMfdbEntryLearntIntfGetNext (openapiClientHandle_t *client_handle, open_buffdesc *vidMac, uint32_t matchType, open_buffdesc *absMask)
 Returns the forwarding interfaces of the next learned VLANID-MAC entry. More...
 
open_error_t openapiMfdbEntryProtocolGetExact (openapiClientHandle_t *client_handle, open_buffdesc *vidMac, OPEN_MFDB_PROTOCOL_TYPE_t protocol)
 Checks if a VLANID-MAC entry, that uses a specific protocol, exists in the MFDB table. More...
 
open_error_t openapiMfdbMaxTableEntriesGet (openapiClientHandle_t *client_handle, uint32_t *maxEntries)
 Returns the maximum number of entries that the MFDB table can hold. More...
 
open_error_t openapiMfdbMostEntriesGet (openapiClientHandle_t *client_handle, uint32_t *mostEntries)
 Returns the most number of entries ever in the MFDB table. More...
 

Detailed Description

Enumeration Type Documentation

OpEN uses this enumeration to define type of MFDB entry.

Enumerator
OPEN_MFDB_TYPE_DYNAMIC 

MFDB entry type is static.

Definition at line 67 of file openapi_mfdb.h.

OpEN uses this enumeration to define type of MFDB protocol.

Enumerator
OPEN_MFDB_PROTOCOL_GMRP 

MFDB potocol type is static.

OPEN_MFDB_PROTOCOL_IGMP 

MFDB potocol type is GMRP.

OPEN_MFDB_PROTOCOL_MLD 

MFDB potocol type is IGMP.

OPEN_MFDB_PROTOCOL_MVR 

MFDB potocol type is MLD.

OPEN_MFDB_PROTOCOL_MMRP 

MFDB potocol type is MVR.

OPEN_MFDB_PROTOCOL_MSRP 

MFDB potocol type is MMRP.

OPEN_MFDB_TOTAL_NUM_PROTOCOLS 

MFDB potocol type is MSRP.

total number of protocols (for error checking)

Definition at line 53 of file openapi_mfdb.h.

Function Documentation

open_error_t openapiMfdbComponentEntryGetNext ( openapiClientHandle_t client_handle,
open_buffdesc vidMac,
OPEN_MFDB_PROTOCOL_TYPE_t  compId,
OPEN_MFDB_PROTOCOL_TYPE_t nextCompId,
OPEN_MFDB_ENTRY_TYPE_t type,
open_buffdesc desc,
open_buffdesc frwdPortMask,
open_buffdesc fltPortMask 
)

Returns the next VLANID-MAC entry of the same user.

Parameters
[in]client_handleclient handle from registration API
[in]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
[in]compIdcomponent id, start
[out]nextCompIdpointer to next component's info
[out]typetype
[out]descdescription
-minimum buffer size 1
-maximum buffer size OPENAPI_MFDB_COMPONENT_DESCR_STRING_LEN
[out]frwdPortMaskforward ports mask
-minimum buffer size 1
-maximum buffer size OPEN_MFDB_INTF_LIST_LENGTHGTH
[out]fltPortMaskfiltering ports mask
-minimum buffer size 1
-maximum buffer size OPEN_MFDB_INTF_LIST_LENGTH
Return values
OPEN_E_NONENext VLANID-MAC entry of the same user returned.
OPEN_E_FAILFailed to get next VLANID-MAC entry of the same user
OPEN_E_PARAMError in parameter passed.
Note
The entry is indexed by VLAN ID, MAC address, and component id.
To get the first entry, the reference entry must be 0 (zero).

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbCurrEntriesGet ( openapiClientHandle_t client_handle,
uint32_t *  currEntries 
)

Returns the number of current entries in the MFDB table.

Parameters
[in]client_handleclient handle from registration API
[out]currEntriespointer to the number of current entries
Return values
OPEN_E_NONENumber of current entries returned.
OPEN_E_FAILFailed to get number of current entries.
OPEN_E_PARAMError in parameter passed.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbEntryDataGet ( openapiClientHandle_t client_handle,
open_buffdesc vidMac,
OPEN_MFDB_PROTOCOL_TYPE_t  nextProt,
open_buffdesc mac,
uint32_t *  vlanId,
OPEN_MFDB_PROTOCOL_TYPE_t compId,
OPEN_MFDB_ENTRY_TYPE_t type,
open_buffdesc desc,
open_buffdesc frwdIntMask,
open_buffdesc fltIntMask,
open_buffdesc absPortMask 
)

Returns the MFDB Entry data.

Parameters
[in]client_handleclient handle from registration API
[in]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
[in]nextProtprotocol type (see OPEN_MFDB_PROTOCOL_TYPE_t)
[out]macpointer to MAC address
-buffer size must be OPEN_MFDB_MAC_LENGTH
[out]vlanIdpointer to VLAN ID
[out]compIdpointer to component ID
[out]typepointer to type
[out]descpointer to description
-minimum buffer size 1
-maximum buffer size OPENAPI_MFDB_COMPONENT_DESCR_STRING_LEN
[out]frwdIntMaskforward interface mask
-minimum buffer size 1
-maximum buffer size OPEN_MFDB_INTF_LIST_LENGTH
[out]fltIntMaskfilter interface mask
-minimum buffer size 1
-maximum buffer size OPEN_MFDB_INTF_LIST_LENGTH
[out]absPortMaskabsolute port mask
-minimum buffer size 1
-maximum buffer size OPEN_MFDB_INTF_LIST_LENGTH
Return values
OPEN_E_NONEMFDB Entry data returned.
OPEN_E_FAILFailed to get MFDB Entry data.
OPEN_E_PARAMError in parameter passed.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbEntryFwdIntfGetExact ( openapiClientHandle_t client_handle,
open_buffdesc vidMac 
)

Checks if a VLANID-MAC entry exists in the MFDB table.

Parameters
[in]client_handleclient handle from registration API
[in]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
Return values
OPEN_E_NONEVLANID-MAC entry exists in the MFDB table.
OPEN_E_FAILVLANID-MAC entry doesn't exist in the MFDB table.
OPEN_E_PARAMError in parameter passed.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbEntryFwdIntfGetNext ( openapiClientHandle_t client_handle,
open_buffdesc vidMac,
uint32_t  matchType,
open_buffdesc absMask 
)

Returns the forwarding interfaces of the next VLANID-MAC entry.

Parameters
[in]client_handleclient handle from registration API
[in]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
[in]matchTypeOPEN_MATCH_EXACT or OPEN_MATCH_GETNEXT
[in]absMaskpointer to mask
-minimum buffer size 1
-maximum buffer size OPEN_MFDB_INTF_LIST_LENGTH
Return values
OPEN_E_NONEForwarding interfaces of the next VLANID-MAC entry returned.
OPEN_E_FAILFailed to get forwarding interfaces of the next VLANID-MAC entry.
OPEN_E_PARAMError in parameter passed.
Note
The entry is indexed by VLANID-MAC address combination.
To get the first entry's forwarding interfaces, the reference entry's VLANID-MAC address must be 0 (zero).
To get the forwarding interfaces of a given VLANID-MAC entry, the 'matchType' must be OPEN_MATCH_EXACT.
To get the forwarding interfaces of all VLANID-MAC entries, the 'matchType' must be OPEN_MATCH_GETNEXT.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbEntryGetFirst ( openapiClientHandle_t client_handle,
open_buffdesc vidMac,
OPEN_MFDB_PROTOCOL_TYPE_t prot 
)

Returns the first VLANID-MAC entry.

Parameters
[in]client_handleclient handle from registration API
[out]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
[out]protpointer to protocol type (see OPEN_MFDB_PROTOCOL_TYPE_t)
Return values
OPEN_E_NONEFirst VLANID-MAC entry returned.
OPEN_E_FAILFailed to get first VLANID-MAC entry.
OPEN_E_PARAMError in parameter passed.
Note
The entry is indexed by VLAN ID, MAC address, and the protocol type.

OpEN API Version: 1.7

open_error_t openapiMfdbEntryGetNext ( openapiClientHandle_t client_handle,
open_buffdesc vidMac,
OPEN_MFDB_PROTOCOL_TYPE_t nextProt 
)

Returns the next VLANID-MAC entry.

Parameters
[in]client_handleclient handle from registration API
[in]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
[out]nextProtpointer to protocol type (see OPEN_MFDB_PROTOCOL_TYPE_t)
Return values
OPEN_E_NONENext VLANID-MAC entry returned.
OPEN_E_FAILFailed to get next VLANID-MAC entry.
OPEN_E_PARAMError in parameter passed.
Note
The entry is indexed by VLAN ID, MAC address, and the protocol type.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbEntryLearntIntfGetNext ( openapiClientHandle_t client_handle,
open_buffdesc vidMac,
uint32_t  matchType,
open_buffdesc absMask 
)

Returns the forwarding interfaces of the next learned VLANID-MAC entry.

Parameters
[in]client_handleclient handle from registration API
[in]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
[in]matchTypeOPEN_MATCH_EXACT or OPEN_MATCH_GETNEXT
[out]absMaskpointer to mask
-minimum buffer size 1
-maximum buffer size OPEN_MFDB_INTF_LIST_LENGTH
Return values
OPEN_E_NONEForwarding interfaces of the next learned VLANID-MAC entry returned.
OPEN_E_FAILFailed to get forwarding interfaces of the next learned VLANID-MAC entry.
OPEN_E_PARAMError in parameter passed.
Note
The entry is indexed by VLANID-MAC address combination.
To get the first entry's forwarding interfaces, the reference entry's VLANID-MAC address must be 0 (zero).
To get the forwarding interfaces of a given VLANID-MAC entry, the 'matchType' must be OPEN_MATCH_EXACT.
To get the forwarding interfaces of all VLANID-MAC entries, the 'matchType' must be OPEN_MATCH_GETNEXT.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbEntryProtocolGetExact ( openapiClientHandle_t client_handle,
open_buffdesc vidMac,
OPEN_MFDB_PROTOCOL_TYPE_t  protocol 
)

Checks if a VLANID-MAC entry, that uses a specific protocol, exists in the MFDB table.

Parameters
[in]client_handleclient handle from registration API
[in]vidMacpointer to the VID-MAC combo.
-(2-byte VLAN ID + 6-byte MAC address)
-buffer size must be OPEN_MFDB_VIDMAC_LENGTH
[in]protocolthe protocol type (see OPEN_MFDB_PROTOCOL_TYPE_t)
Return values
OPEN_E_NONEVLANID-MAC entry using that protocol exists in the MFDB table.
OPEN_E_FAILVLANID-MAC entry using that protocol doesn't exist in the MFDB table.
OPEN_E_PARAMError in parameter passed.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbMaxTableEntriesGet ( openapiClientHandle_t client_handle,
uint32_t *  maxEntries 
)

Returns the maximum number of entries that the MFDB table can hold.

Parameters
[in]client_handleclient handle from registration API
[out]maxEntriespointer to the number of total entries
Return values
OPEN_E_NONEMaximum number of entries returned.
OPEN_E_FAILFailed to get maximum number of entries.
OPEN_E_PARAMError in parameter passed.

OpEN API Version: 1.7

Examples:
mfdb_example.c.
open_error_t openapiMfdbMostEntriesGet ( openapiClientHandle_t client_handle,
uint32_t *  mostEntries 
)

Returns the most number of entries ever in the MFDB table.

Parameters
[in]client_handleclient handle from registration API
[out]mostEntriespointer to the number of most entries
Return values
OPEN_E_NONEMost number of entries returned.
OPEN_E_FAILFailed to get most number of entries.
OPEN_E_PARAMError in parameter passed.

OpEN API Version: 1.7

Examples:
mfdb_example.c.