OpenNSL API Guide and Reference Manual
|
Data Structures | |
struct | opennsl_l2_addr_s |
Device-independent L2 address structure. More... | |
struct | opennsl_l2_cache_addr_s |
Device-independent L2 cache address structure. More... | |
struct | opennsl_l2_learn_limit_s |
L2 learn limit structure. More... | |
struct | opennsl_l2_station_s |
L2 Station address info. More... | |
Files | |
file | l2.h |
file | l2X.h |
Macros | |
#define | OPENNSL_L2_CACHE_BPDU 0x00000010 |
Packet is BPDU. | |
#define | OPENNSL_L2_CACHE_CPU 0x00000001 |
Packet is copied to CPU. | |
#define | OPENNSL_L2_CACHE_DISCARD 0x00000002 |
Packet is not switched. | |
#define | OPENNSL_L2_CALLBACK_ADD 1 |
#define | OPENNSL_L2_CALLBACK_AGE_EVENT 4 |
#define | OPENNSL_L2_CALLBACK_DELETE 0 |
#define | OPENNSL_L2_CALLBACK_LEARN_EVENT 3 |
#define | OPENNSL_L2_CALLBACK_MOVE_EVENT 5 |
#define | OPENNSL_L2_CALLBACK_REPORT 2 |
#define | OPENNSL_L2_COPY_TO_CPU 0x00000008 |
#define | OPENNSL_L2_DELETE_NO_CALLBACKS 0x00000004 |
#define | OPENNSL_L2_DELETE_PENDING 0x00000002 |
#define | OPENNSL_L2_DELETE_STATIC 0x00000001 |
#define | OPENNSL_L2_DES_HIT 0x00000800 |
#define | OPENNSL_L2_DISCARD_DST 0x00000004 |
#define | OPENNSL_L2_DISCARD_SRC 0x00000002 |
#define | OPENNSL_L2_HIT 0x00000040 |
#define | OPENNSL_L2_L3LOOKUP 0x00000010 |
#define | OPENNSL_L2_LEARN_LIMIT_SYSTEM 0x00000001 |
Limit is system wide. | |
#define | OPENNSL_L2_LOCAL_CPU 0x00200000 |
Entry is for the local CPU on the device. | |
#define | OPENNSL_L2_MCAST 0x00000100 |
#define | OPENNSL_L2_MOVE_PORT 0x00100000 |
#define | OPENNSL_L2_REPLACE_DELETE 0x00000100 |
L2 replace will perform delete operation instead of replace on matching entries. | |
#define | OPENNSL_L2_REPLACE_MATCH_DEST 0x00000008 |
Replace all L2 entries matching given modid port/tgid. | |
#define | OPENNSL_L2_REPLACE_MATCH_MAC 0x00000002 |
Replace all L2 entries matching given MAC address. | |
#define | OPENNSL_L2_REPLACE_MATCH_STATIC 0x00000001 |
Replace L2 static entries. | |
#define | OPENNSL_L2_REPLACE_MATCH_VLAN 0x00000004 |
Replace all L2 entries matching given VLAN id. | |
#define | OPENNSL_L2_REPLACE_NO_CALLBACKS 0x00000800 |
Replace L2 entries without callbacks. | |
#define | OPENNSL_L2_SRC_HIT 0x00000400 |
#define | OPENNSL_L2_STATIC 0x00000020 |
#define | OPENNSL_L2_STATION_ARP_RARP (1 << 4) |
Subject packets matching this entry to ARP/RARP processing. | |
#define | OPENNSL_L2_STATION_IPV4 (1 << 2) |
Subject packets matching this entry to L3 processing. | |
#define | OPENNSL_L2_STATION_IPV6 (1 << 3) |
Subject packets matching this entry to L3 processing. | |
#define | OPENNSL_L2_STATION_WITH_ID (1 << 0) |
Use the specified Station ID. | |
#define | OPENNSL_L2_TRUNK_MEMBER 0x00000080 |
Typedefs | |
typedef void(* | opennsl_l2_addr_callback_t )(int unit, opennsl_l2_addr_t *l2addr, int operation, void *userdata) |
Callback function used for receiving notification about insertions into and deletions from the L2 table dynamically as they occur. | |
typedef struct opennsl_l2_addr_s | opennsl_l2_addr_t |
Device-independent L2 address structure. | |
typedef struct opennsl_l2_cache_addr_s | opennsl_l2_cache_addr_t |
Device-independent L2 cache address structure. | |
typedef struct opennsl_l2_learn_limit_s | opennsl_l2_learn_limit_t |
L2 learn limit structure. | |
typedef struct opennsl_l2_station_s | opennsl_l2_station_t |
L2 Station address info. | |
typedef int(* | opennsl_l2_traverse_cb )(int unit, opennsl_l2_addr_t *info, void *user_data) |
Functions | |
int | opennsl_l2_addr_add (int unit, opennsl_l2_addr_t *l2addr) LIB_DLL_EXPORTED |
Add an L2 address entry to the specified device. | |
int | opennsl_l2_addr_delete (int unit, opennsl_mac_t mac, opennsl_vlan_t vid) LIB_DLL_EXPORTED |
Delete an L2 address entry from the specified device. | |
int | opennsl_l2_addr_delete_by_mac (int unit, opennsl_mac_t mac, uint32 flags) LIB_DLL_EXPORTED |
Delete L2 entries associated with a MAC address. | |
int | opennsl_l2_addr_delete_by_mac_port (int unit, opennsl_mac_t mac, opennsl_module_t mod, opennsl_port_t port, uint32 flags) LIB_DLL_EXPORTED |
Delete L2 entries associated with a MAC address and a destination module/port. | |
int | opennsl_l2_addr_delete_by_port (int unit, opennsl_module_t mod, opennsl_port_t port, uint32 flags) LIB_DLL_EXPORTED |
Delete L2 entries associated with a destination module/port. | |
int | opennsl_l2_addr_delete_by_trunk (int unit, opennsl_trunk_t tid, uint32 flags) LIB_DLL_EXPORTED |
Delete L2 entries associated with a trunk. | |
int | opennsl_l2_addr_delete_by_vlan (int unit, opennsl_vlan_t vid, uint32 flags) LIB_DLL_EXPORTED |
Delete L2 entries associated with a VLAN. | |
int | opennsl_l2_addr_delete_by_vlan_port (int unit, opennsl_vlan_t vid, opennsl_module_t mod, opennsl_port_t port, uint32 flags) LIB_DLL_EXPORTED |
Delete L2 entries associated with a VLAN and a destination module/port. | |
int | opennsl_l2_addr_delete_by_vlan_trunk (int unit, opennsl_vlan_t vid, opennsl_trunk_t tid, uint32 flags) LIB_DLL_EXPORTED |
Delete L2 entries associated with a VLAN and a destination module/port. | |
int | opennsl_l2_addr_freeze (int unit) LIB_DLL_EXPORTED |
Temporarily stop/restore L2 table from changing. | |
int | opennsl_l2_addr_get (int unit, opennsl_mac_t mac_addr, opennsl_vlan_t vid, opennsl_l2_addr_t *l2addr) LIB_DLL_EXPORTED |
Check if an L2 entry is present in the L2 table. | |
int | opennsl_l2_addr_register (int unit, opennsl_l2_addr_callback_t callback, void *userdata) LIB_DLL_EXPORTED |
Register/Unregister a callback routine for OPENNSL L2 subsystem. | |
void | opennsl_l2_addr_t_init (opennsl_l2_addr_t *l2addr, const opennsl_mac_t mac_addr, opennsl_vlan_t vid) LIB_DLL_EXPORTED |
Initialize an L2 address structure to a specified MAC address and VLAN ID. | |
int | opennsl_l2_addr_thaw (int unit) LIB_DLL_EXPORTED |
Temporarily stop/restore L2 table from changing. | |
int | opennsl_l2_addr_unregister (int unit, opennsl_l2_addr_callback_t callback, void *userdata) LIB_DLL_EXPORTED |
Register/Unregister a callback routine for OPENNSL L2 subsystem. | |
int | opennsl_l2_age_timer_get (int unit, int *age_seconds) LIB_DLL_EXPORTED |
Set/Get the age timer. | |
int | opennsl_l2_age_timer_set (int unit, int age_seconds) LIB_DLL_EXPORTED |
Set/Get the age timer. | |
void | opennsl_l2_cache_addr_t_init (opennsl_l2_cache_addr_t *addr) LIB_DLL_EXPORTED |
Initialize an L2 cache address structure. | |
int | opennsl_l2_cache_delete (int unit, int index) LIB_DLL_EXPORTED |
Clear an L2 cache entry. | |
int | opennsl_l2_cache_delete_all (int unit) LIB_DLL_EXPORTED |
Clear all L2 cache entries. | |
int | opennsl_l2_cache_get (int unit, int index, opennsl_l2_cache_addr_t *addr) LIB_DLL_EXPORTED |
Get an L2 cache entry. | |
int | opennsl_l2_cache_init (int unit) LIB_DLL_EXPORTED |
Initialize the L2 cache. | |
int | opennsl_l2_cache_set (int unit, int index, opennsl_l2_cache_addr_t *addr, int *index_used) LIB_DLL_EXPORTED |
Set an L2 cache entry. | |
int | opennsl_l2_cache_size_get (int unit, int *size) LIB_DLL_EXPORTED |
Get number of L2 cache entries. | |
int | opennsl_l2_learn_limit_get (int unit, opennsl_l2_learn_limit_t *limit) LIB_DLL_EXPORTED |
Set/Get L2 addresses learn limit. | |
int | opennsl_l2_learn_limit_set (int unit, opennsl_l2_learn_limit_t *limit) LIB_DLL_EXPORTED |
Set/Get L2 addresses learn limit. | |
void | opennsl_l2_learn_limit_t_init (opennsl_l2_learn_limit_t *limit) LIB_DLL_EXPORTED |
Initialize an L2 learn limit structure. | |
int | opennsl_l2_replace (int unit, uint32 flags, opennsl_l2_addr_t *match_addr, opennsl_module_t new_module, opennsl_port_t new_port, opennsl_trunk_t new_trunk) LIB_DLL_EXPORTED |
Replace destination (or delete) multiple L2 entries. | |
int | opennsl_l2_station_add (int unit, int *station_id, opennsl_l2_station_t *station) LIB_DLL_EXPORTED |
Add an entry to L2 Station table. | |
int | opennsl_l2_station_delete (int unit, int station_id) LIB_DLL_EXPORTED |
Delete an entry from L2 Station Table. | |
int | opennsl_l2_station_get (int unit, int station_id, opennsl_l2_station_t *station) LIB_DLL_EXPORTED |
Get L2 station entry details from Station Table. | |
void | opennsl_l2_station_t_init (opennsl_l2_station_t *addr) LIB_DLL_EXPORTED |
Initialize L2 Station structure. | |
int | opennsl_l2_traverse (int unit, opennsl_l2_traverse_cb trav_fn, void *user_data) LIB_DLL_EXPORTED |
Iterates over all entries in the L2 table and executes user callback function for each entry. | |
int | opennsl_l2_tunnel_add (int unit, opennsl_mac_t mac, opennsl_vlan_t vlan) LIB_DLL_EXPORTED |
Add a destination L2 address to trigger tunnel processing. | |
#define OPENNSL_L2_CACHE_CPU 0x00000001 |
#define OPENNSL_L2_CACHE_DISCARD 0x00000002 |
#define OPENNSL_L2_DISCARD_DST 0x00000004 |
Definition at line 30 of file l2.h.
Referenced by example_l2_firewall_block_station().
#define OPENNSL_L2_DISCARD_SRC 0x00000002 |
Definition at line 29 of file l2.h.
Referenced by example_l2_firewall_block_station().
#define OPENNSL_L2_L3LOOKUP 0x00000010 |
Definition at line 32 of file l2.h.
Referenced by example_l2_addr_add().
#define OPENNSL_L2_LEARN_LIMIT_SYSTEM 0x00000001 |
#define OPENNSL_L2_LOCAL_CPU 0x00200000 |
#define OPENNSL_L2_MCAST 0x00000100 |
Definition at line 36 of file l2.h.
Referenced by example_l2_entry_add(), example_setup_mac_forwarding(), and example_vxlan().
#define OPENNSL_L2_REPLACE_DELETE 0x00000100 |
#define OPENNSL_L2_REPLACE_MATCH_DEST 0x00000008 |
#define OPENNSL_L2_REPLACE_MATCH_MAC 0x00000002 |
#define OPENNSL_L2_REPLACE_MATCH_STATIC 0x00000001 |
#define OPENNSL_L2_REPLACE_MATCH_VLAN 0x00000004 |
#define OPENNSL_L2_REPLACE_NO_CALLBACKS 0x00000800 |
#define OPENNSL_L2_STATIC 0x00000020 |
Definition at line 33 of file l2.h.
Referenced by add_to_l2_table(), example_l2_addr_add(), example_l2_entry_add(), example_l2_firewall_block_station(), example_setup_mac_forwarding(), and example_vxlan().
#define OPENNSL_L2_STATION_ARP_RARP (1 << 4) |
#define OPENNSL_L2_STATION_IPV4 (1 << 2) |
#define OPENNSL_L2_STATION_IPV6 (1 << 3) |
#define OPENNSL_L2_STATION_WITH_ID (1 << 0) |
typedef void(* opennsl_l2_addr_callback_t)(int unit, opennsl_l2_addr_t *l2addr, int operation, void *userdata) |
typedef struct opennsl_l2_addr_s opennsl_l2_addr_t |
Device-independent L2 address structure.
typedef struct opennsl_l2_cache_addr_s opennsl_l2_cache_addr_t |
Device-independent L2 cache address structure.
typedef struct opennsl_l2_learn_limit_s opennsl_l2_learn_limit_t |
L2 learn limit structure.
typedef struct opennsl_l2_station_s opennsl_l2_station_t |
L2 Station address info.
typedef int(* opennsl_l2_traverse_cb)(int unit, opennsl_l2_addr_t *info, void *user_data) |
int opennsl_l2_addr_add | ( | int | unit, |
opennsl_l2_addr_t * | l2addr | ||
) |
Add an L2 address entry to the specified device.
unit | [IN] Unit number. |
l2addr | [IN] L2 address which is properly initialized |
OPENNSL_E_XXX |
Referenced by add_to_l2_table(), example_create_policy(), example_l2_addr_add(), example_l2_entry_add(), example_l2_firewall_block_station(), example_setup_mac_forwarding(), and example_vxlan().
int opennsl_l2_addr_delete | ( | int | unit, |
opennsl_mac_t | mac, | ||
opennsl_vlan_t | vid | ||
) |
Delete an L2 address entry from the specified device.
unit | [IN] Unit number. |
mac | [IN] 802.3 MAC address |
vid | [IN] VLAN ID |
OPENNSL_E_XXX |
Referenced by example_l2_firewall_allow_station().
int opennsl_l2_addr_delete_by_mac | ( | int | unit, |
opennsl_mac_t | mac, | ||
uint32 | flags | ||
) |
Delete L2 entries associated with a MAC address.
unit | [IN] Unit number. |
mac | [IN] MAC address |
flags | [IN] OPENNSL_L2_DELETE_STATIC for removing static entries ; OPENNSL_L2_DELETE_PENDING for removing pending entries ; OPENNSL_L2_DELETE_NO_CALLBACKS for removing entries faster without registered callbacks being called |
OPENNSL_E_XXX |
int opennsl_l2_addr_delete_by_mac_port | ( | int | unit, |
opennsl_mac_t | mac, | ||
opennsl_module_t | mod, | ||
opennsl_port_t | port, | ||
uint32 | flags | ||
) |
Delete L2 entries associated with a MAC address and a destination module/port.
unit | [IN] Unit number. |
mac | [IN] MAC address |
mod | [IN] Module ID |
port | [IN] Device or logical port number |
flags | [IN] OPENNSL_L2_DELETE_STATIC for removing static entries ; OPENNSL_L2_DELETE_PENDING for removing pending entries ; OPENNSL_L2_DELETE_NO_CALLBACKS for removing entries faster without registered callbacks being called |
OPENNSL_E_XXX |
int opennsl_l2_addr_delete_by_port | ( | int | unit, |
opennsl_module_t | mod, | ||
opennsl_port_t | port, | ||
uint32 | flags | ||
) |
Delete L2 entries associated with a destination module/port.
unit | [IN] Unit number. |
mod | [IN] Module ID (or -1 for local unit) |
port | [IN] Device or logical port number |
flags | [IN] OPENNSL_L2_DELETE_STATIC for removing static entries ; OPENNSL_L2_DELETE_PENDING for removing pending entries ; OPENNSL_L2_DELETE_NO_CALLBACKS for removing entries faster without registered callbacks being called |
OPENNSL_E_XXX |
int opennsl_l2_addr_delete_by_trunk | ( | int | unit, |
opennsl_trunk_t | tid, | ||
uint32 | flags | ||
) |
Delete L2 entries associated with a trunk.
unit | [IN] Unit number. |
tid | [IN] Trunk ID |
flags | [IN] OPENNSL_L2_DELETE_STATIC for removing static entries ; OPENNSL_L2_DELETE_PENDING for removing pending entries ; OPENNSL_L2_DELETE_NO_CALLBACKS for removing entries faster without registered callbacks being called |
OPENNSL_E_XXX |
int opennsl_l2_addr_delete_by_vlan | ( | int | unit, |
opennsl_vlan_t | vid, | ||
uint32 | flags | ||
) |
Delete L2 entries associated with a VLAN.
unit | [IN] Unit number. |
vid | [IN] VLAN ID |
flags | [IN] OPENNSL_L2_DELETE_STATIC for removing static entries ; OPENNSL_L2_DELETE_PENDING for removing pending entries ; OPENNSL_L2_DELETE_NO_CALLBACKS for removing entries faster without registered callbacks being called |
OPENNSL_E_XXX |
int opennsl_l2_addr_delete_by_vlan_port | ( | int | unit, |
opennsl_vlan_t | vid, | ||
opennsl_module_t | mod, | ||
opennsl_port_t | port, | ||
uint32 | flags | ||
) |
Delete L2 entries associated with a VLAN and a destination module/port.
unit | [IN] Unit number. |
vid | [IN] VLAN ID |
mod | [IN] Module ID |
port | [IN] Device or logical port number |
flags | [IN] OPENNSL_L2_DELETE_STATIC for removing static entries ; OPENNSL_L2_DELETE_PENDING for removing pending entries ; OPENNSL_L2_DELETE_NO_CALLBACKS for removing entries faster without registered callbacks being called |
OPENNSL_E_XXX |
int opennsl_l2_addr_delete_by_vlan_trunk | ( | int | unit, |
opennsl_vlan_t | vid, | ||
opennsl_trunk_t | tid, | ||
uint32 | flags | ||
) |
Delete L2 entries associated with a VLAN and a destination module/port.
unit | [IN] Unit number. |
vid | [IN] VLAN ID |
tid | [IN] Trunk ID |
flags | [IN] OPENNSL_L2_DELETE_STATIC for removing static entries ; OPENNSL_L2_DELETE_PENDING for removing pending entries ; OPENNSL_L2_DELETE_NO_CALLBACKS for removing entries faster without registered callbacks being called |
OPENNSL_E_XXX |
int opennsl_l2_addr_freeze | ( | int | unit | ) |
Temporarily stop/restore L2 table from changing.
unit | [IN] Unit number. |
OPENNSL_E_XXX |
int opennsl_l2_addr_get | ( | int | unit, |
opennsl_mac_t | mac_addr, | ||
opennsl_vlan_t | vid, | ||
opennsl_l2_addr_t * | l2addr | ||
) |
Check if an L2 entry is present in the L2 table.
unit | [IN] Unit number. |
mac_addr | [IN] Input MAC address to search |
vid | [IN] Input VLAN ID to search |
l2addr | [OUT] Pointer to L2 address structure to receive results |
OPENNSL_E_XXX |
Referenced by example_l2_firewall_allow_station().
int opennsl_l2_addr_register | ( | int | unit, |
opennsl_l2_addr_callback_t | callback, | ||
void * | userdata | ||
) |
Register/Unregister a callback routine for OPENNSL L2 subsystem.
unit | [IN] Unit number. |
callback | [IN] Callback function of type opennsl_l2_addr_callback_t |
userdata | [IN] Arbitrary value passed to callback along with messages |
OPENNSL_E_XXX |
void opennsl_l2_addr_t_init | ( | opennsl_l2_addr_t * | l2addr, |
const opennsl_mac_t | mac_addr, | ||
opennsl_vlan_t | vid | ||
) |
Initialize an L2 address structure to a specified MAC address and VLAN ID.
l2addr | [IN,OUT] Pointer to layer 2 address type |
mac_addr | [IN,OUT] |
vid | [IN] VLAN ID |
None. |
Referenced by add_to_l2_table(), example_create_policy(), example_l2_addr_add(), example_l2_entry_add(), example_l2_firewall_block_station(), example_setup_mac_forwarding(), and example_vxlan().
int opennsl_l2_addr_thaw | ( | int | unit | ) |
Temporarily stop/restore L2 table from changing.
unit | [IN] Unit number. |
OPENNSL_E_XXX |
int opennsl_l2_addr_unregister | ( | int | unit, |
opennsl_l2_addr_callback_t | callback, | ||
void * | userdata | ||
) |
Register/Unregister a callback routine for OPENNSL L2 subsystem.
unit | [IN] Unit number. |
callback | [IN] Callback function of type opennsl_l2_addr_callback_t |
userdata | [IN] Arbitrary value passed to callback along with messages |
OPENNSL_E_XXX |
int opennsl_l2_age_timer_get | ( | int | unit, |
int * | age_seconds | ||
) |
Set/Get the age timer.
unit | [IN] Unit number. |
age_seconds | [OUT] Age timer value in seconds (0 to disable) |
OPENNSL_E_XXX |
Referenced by main().
int opennsl_l2_age_timer_set | ( | int | unit, |
int | age_seconds | ||
) |
Set/Get the age timer.
unit | [IN] Unit number. |
age_seconds | [IN] Age timer value in seconds (0 to disable) |
OPENNSL_E_XXX |
Referenced by main().
void opennsl_l2_cache_addr_t_init | ( | opennsl_l2_cache_addr_t * | addr | ) |
Initialize an L2 cache address structure.
addr | [IN,OUT] L2 cache address to initialize |
Nothing. |
int opennsl_l2_cache_delete | ( | int | unit, |
int | index | ||
) |
Clear an L2 cache entry.
unit | [IN] Unit number. |
index | [IN] L2 cache entry index |
OPENNSL_E_XXX |
int opennsl_l2_cache_delete_all | ( | int | unit | ) |
Clear all L2 cache entries.
unit | [IN] Unit number. |
OPENNSL_E_XXX |
int opennsl_l2_cache_get | ( | int | unit, |
int | index, | ||
opennsl_l2_cache_addr_t * | addr | ||
) |
Get an L2 cache entry.
unit | [IN] Unit number. |
index | [IN] L2 cache entry index |
addr | [OUT] L2 cache address |
OPENNSL_E_XXX |
int opennsl_l2_cache_init | ( | int | unit | ) |
Initialize the L2 cache.
unit | [IN] Unit number. |
OPENNSL_E_XXX |
int opennsl_l2_cache_set | ( | int | unit, |
int | index, | ||
opennsl_l2_cache_addr_t * | addr, | ||
int * | index_used | ||
) |
Set an L2 cache entry.
unit | [IN] Unit number. |
index | [IN] L2 cache entry number (or -1) |
addr | [IN] L2 cache address |
index_used | [OUT] l2 cache entry number actually used |
OPENNSL_E_XXX |
int opennsl_l2_cache_size_get | ( | int | unit, |
int * | size | ||
) |
Get number of L2 cache entries.
unit | [IN] Unit number. |
size | [OUT] Number of entries in cache |
OPENNSL_E_XXX |
int opennsl_l2_learn_limit_get | ( | int | unit, |
opennsl_l2_learn_limit_t * | limit | ||
) |
Set/Get L2 addresses learn limit.
unit | [IN] Unit number. |
limit | [IN,OUT] (for _set) Pointer to L2 address learn limit info structure |
OPENNSL_E_XXX |
int opennsl_l2_learn_limit_set | ( | int | unit, |
opennsl_l2_learn_limit_t * | limit | ||
) |
Set/Get L2 addresses learn limit.
unit | [IN] Unit number. |
limit | [IN] (for _set) Pointer to L2 address learn limit info structure |
OPENNSL_E_XXX |
void opennsl_l2_learn_limit_t_init | ( | opennsl_l2_learn_limit_t * | limit | ) |
Initialize an L2 learn limit structure.
limit | [IN,OUT] Pointer to L2 learn limit structure to initialize |
Nothing |
int opennsl_l2_replace | ( | int | unit, |
uint32 | flags, | ||
opennsl_l2_addr_t * | match_addr, | ||
opennsl_module_t | new_module, | ||
opennsl_port_t | new_port, | ||
opennsl_trunk_t | new_trunk | ||
) |
Replace destination (or delete) multiple L2 entries.
unit | [IN] Unit number. |
flags | [IN] Replace/delete flags OPENNSL_L2_REPLACE_* |
match_addr | [IN] L2 parameters to match on delete/replace |
new_module | [IN] New module ID for a replace |
new_port | [IN] New port for a replace |
new_trunk | [IN] New trunk ID for a replace |
OPENNSL_E_XXX |
int opennsl_l2_station_add | ( | int | unit, |
int * | station_id, | ||
opennsl_l2_station_t * | station | ||
) |
Add an entry to L2 Station table.
unit | [IN] Unit number. |
station_id | [IN,OUT] Station ID |
station | [IN] Station ID |
OPENNSL_E_XXX |
Referenced by example_create_l3_intf(), and example_l3_intf_rif_create().
int opennsl_l2_station_delete | ( | int | unit, |
int | station_id | ||
) |
Delete an entry from L2 Station Table.
unit | [IN] Unit number. |
station_id | [IN] L2 station ID |
OPENNSL_E_XXX |
int opennsl_l2_station_get | ( | int | unit, |
int | station_id, | ||
opennsl_l2_station_t * | station | ||
) |
Get L2 station entry details from Station Table.
unit | [IN] Unit number. |
station_id | [IN] L2 station ID |
station | [OUT] L2 station ID |
OPENNSL_E_XXX |
void opennsl_l2_station_t_init | ( | opennsl_l2_station_t * | addr | ) |
Initialize L2 Station structure.
addr | [IN,OUT] Pointer to L2 station structure |
OPENNSL_E_XXX |
Referenced by example_create_l3_intf(), and example_l3_intf_rif_create().
int opennsl_l2_traverse | ( | int | unit, |
opennsl_l2_traverse_cb | trav_fn, | ||
void * | user_data | ||
) |
Iterates over all entries in the L2 table and executes user callback function for each entry.
unit | [IN] Unit number. |
trav_fn | [IN] Call back function provided by API caller |
user_data | [IN] Pointer to any data provided by API caller |
OPENNSL_E_XXX |
Referenced by main().
int opennsl_l2_tunnel_add | ( | int | unit, |
opennsl_mac_t | mac, | ||
opennsl_vlan_t | vlan | ||
) |
Add a destination L2 address to trigger tunnel processing.
unit | [IN] Unit number. |
mac | [IN] MAC address |
vlan | [IN] VLAN ID |
OPENNSL_E_XXX |