Data Structures | |
| struct | nmf_addr_rec |
Defines | |
| #define | NMF_ALL (-1) |
Enumerations | |
| enum | nmf_addr_flags { , NMF_ADDR_STATIC = 2, NMF_ADDR_SECURE = 4 } |
Functions | |
| nmf_status_t | nmf_addr_get (nmf_client_t clid, int slot, struct nmf_addr_rec *adrec) |
| Get a host address. | |
| nmf_status_t | nmf_addr_add (nmf_client_t clid, int slot, struct nmf_addr_rec *adrec) |
| Add an address record to the FIB. | |
| nmf_status_t | nmf_addr_rem (nmf_client_t clid, int slot, int vlan_id, u_char *ethaddr) |
| Remove an address record from the FIB. | |
| nmf_status_t | nmf_addr_flush (nmf_client_t clid, int slot, nm_u32_t flags, int vlan_id, int port) |
| Flush the FDB. | |
The size of the forwarding database is typically a fixed size. For this reason, addresses typically "age". That is, after a period of time, addresses that have not been used are marked as "old" and will be removed if the address database fills up with more recently used host addresses. An address, however, can be locked into the database so that it is never removed. These addresses are referred to as Static. Static and Dynamic addresses are mutually exclusive attributes.
A host address may also be Secure. A packet received with a source address that is in the database and marked Secure must be received on a port that is marked Secure, otherwise, the packet is dropped. Both Static and Dynamic addresses amy be marked Secure.
Addresses indicate the port to which a packet is forwarded. If this port is a mamber of a LAG, then the specified port may not be the port that is used to actually forward the packet. Instead, the port used depends on the distribution rules configured for the LAG.
| #define NMF_ALL (-1) |
| enum nmf_addr_flags |
| nmf_status_t nmf_addr_add | ( | nmf_client_t | clid, | |
| int | slot, | |||
| struct nmf_addr_rec * | adrec | |||
| ) |
Add an address record to the FIB.
Adds an address record to the Forwarding Information Base (FIB). If there is an existing record with the same ethernet address and VLAN, it will be replaced with this record.
| clid | The client handle. | |
| slot | The slot number | |
| adrec | Pointer to address record to add. |
-NMF_ENOENT The specified VLAN has not been created.
-NMF_EINVAL A parameter, such as the slot number or port number is invalid.
| nmf_status_t nmf_addr_flush | ( | nmf_client_t | clid, | |
| int | slot, | |||
| nm_u32_t | flags, | |||
| int | vlan_id, | |||
| int | port | |||
| ) |
Flush the FDB.
| clid | The client handle. | |
| slot | The slot number | |
| flags | If NMF_ADDR_STATIC is set, all addresses are flushed, otherwise, only dynamic addresses are flushed. | |
| vlan_id | If specified, only flush addresses on this VLAN. Use NMF_ALL to specify all VLANs. | |
| port | If specified, only flush addresses on this port. Use NMF_ALL to specify all ports. |
| nmf_status_t nmf_addr_get | ( | nmf_client_t | clid, | |
| int | slot, | |||
| struct nmf_addr_rec * | adrec | |||
| ) |
Get a host address.
Search the host address database for the specified Ethernet address in the table for a vlan.
| clid | The client handle. | |
| slot | The slot number | |
| adrec | Pointer to an nmf_addr_rec. The vlan and eth_addr fields of this record must be filled in and identify the record to be fetched. |
NMF_ENOENT No record exists for the specified address and vlan.
| nmf_status_t nmf_addr_rem | ( | nmf_client_t | clid, | |
| int | slot, | |||
| int | vlan_id, | |||
| u_char * | ethaddr | |||
| ) |
Remove an address record from the FIB.
| clid | The client handle. | |
| slot | The slot number | |
| vlan_id | The VLAN id (1-4095). | |
| ethaddr | The 6B ethernet address of the host |
-NMF_ENOENT An informative return code indicating that the record to be deleted was not found.
-NMF_EINVAL A paraemter such as the slot number or client id is invalid.
1.5.6