Address Management Functions


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.

Detailed Description

These functions are used to add Hosts (Ethernet Addresses) to the Forwarding Database for the switch. These addresses indicate to the switch which port a packet with the specified Ethernet Address will be forwarded to. In most cases, these addresses are learned automatically by the switch, however, then can be added by the software as well.

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 Documentation

#define NMF_ALL   (-1)

NMF_ALL - Use this value to specify all values, e.g. all vlan or all ports.

Definition at line 1202 of file nmf.h.


Enumeration Type Documentation

Host address flags.

Enumerator:
NMF_ADDR_STATIC  The address is dynamic
NMF_ADDR_SECURE  The address is static

Definition at line 1207 of file nmf.h.


Function Documentation

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.

Parameters:
clid The client handle.
slot The slot number
adrec Pointer to address record to add.
Returns:
NMF_OK Success

-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.

Parameters:
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.
Returns:
NMF_OK Success

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.

Parameters:
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.
Returns:
NMF_OK An address record was found for the specified vlan and Ethernet address.

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.

Parameters:
clid The client handle.
slot The slot number
vlan_id The VLAN id (1-4095).
ethaddr The 6B ethernet address of the host
Returns:
NMF_OK Success

-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.


Generated on Wed Sep 1 09:40:57 2010 for NetManage by  doxygen 1.5.6