OpenNSL API Guide and Reference Manual
|
Data Structures | |
struct | opennsl_knet_filter_s |
Kernel packet filter structure. More... | |
struct | opennsl_knet_netif_s |
Kernel network interface structure. More... | |
Files | |
file | knet.h |
file | knetX.h |
Macros | |
#define | OPENNSL_KNET_DEST_T_NETIF 1 |
Send packet to virtual network interface. | |
#define | OPENNSL_KNET_DEST_T_OPENNSL_RX_API 2 |
Send packet to OPENNSL Rx API. | |
#define | OPENNSL_KNET_FILTER_DESC_MAX 32 |
#define | OPENNSL_KNET_FILTER_F_STRIP_TAG 0x00000001 |
Strip VLAN tag from packets sent to vitual network interfaces. | |
#define | OPENNSL_KNET_FILTER_M_FP_RULE 0x00000040 |
Match filter processor rule number. | |
#define | OPENNSL_KNET_FILTER_M_INGPORT 0x00000004 |
Match local ingress port. | |
#define | OPENNSL_KNET_FILTER_M_RAW 0x00000001 |
Match raw packet data. | |
#define | OPENNSL_KNET_FILTER_M_REASON 0x00000020 |
Match copy-to-CPU reason code. | |
#define | OPENNSL_KNET_FILTER_M_VLAN 0x00000002 |
Match VLAN ID. | |
#define | OPENNSL_KNET_FILTER_SIZE_MAX 256 |
#define | OPENNSL_KNET_FILTER_T_RX_PKT 1 |
Rx packet filter. | |
#define | OPENNSL_KNET_NETIF_F_ADD_TAG 0x00000001 |
Add VLAN tag to packets sent directly to physical port. | |
#define | OPENNSL_KNET_NETIF_NAME_MAX 16 |
#define | OPENNSL_KNET_NETIF_T_TX_CPU_INGRESS 1 |
Tx packets are sent through CPU port ingress logic. | |
#define | OPENNSL_KNET_NETIF_T_TX_LOCAL_PORT 2 |
Tx packets are sent to local device port bypassing switch logic. | |
Typedefs | |
typedef struct opennsl_knet_filter_s | opennsl_knet_filter_t |
Kernel packet filter structure. | |
typedef int(* | opennsl_knet_filter_traverse_cb )(int unit, opennsl_knet_filter_t *filter, void *user_data) |
typedef struct opennsl_knet_netif_s | opennsl_knet_netif_t |
Kernel network interface structure. | |
typedef int(* | opennsl_knet_netif_traverse_cb )(int unit, opennsl_knet_netif_t *netif, void *user_data) |
Functions | |
int | opennsl_knet_filter_create (int unit, opennsl_knet_filter_t *filter) LIB_DLL_EXPORTED |
Create a kernel packet filter. | |
int | opennsl_knet_filter_destroy (int unit, int filter_id) LIB_DLL_EXPORTED |
Destroy a kernel packet filter. | |
void | opennsl_knet_filter_t_init (opennsl_knet_filter_t *filter) LIB_DLL_EXPORTED |
Initialize a opennsl_knet_filter_t structure. | |
int | opennsl_knet_filter_traverse (int unit, opennsl_knet_filter_traverse_cb trav_fn, void *user_data) LIB_DLL_EXPORTED |
Traverse kernel packet filter objects. | |
int | opennsl_knet_init (int unit) LIB_DLL_EXPORTED |
Initialize the kernel networking subsystem. | |
int | opennsl_knet_netif_create (int unit, opennsl_knet_netif_t *netif) LIB_DLL_EXPORTED |
Create a kernel network interface. | |
int | opennsl_knet_netif_destroy (int unit, int netif_id) LIB_DLL_EXPORTED |
Destroy a kernel network interface. | |
void | opennsl_knet_netif_t_init (opennsl_knet_netif_t *netif) LIB_DLL_EXPORTED |
Initialize a opennsl_knet_netif_t structure. | |
int | opennsl_knet_netif_traverse (int unit, opennsl_knet_netif_traverse_cb trav_fn, void *user_data) LIB_DLL_EXPORTED |
Traverse kernel network interface objects. | |
#define OPENNSL_KNET_DEST_T_NETIF 1 |
Send packet to virtual network interface.
Definition at line 62 of file knet.h.
Referenced by example_linux_interface_create().
#define OPENNSL_KNET_DEST_T_OPENNSL_RX_API 2 |
#define OPENNSL_KNET_FILTER_F_STRIP_TAG 0x00000001 |
Strip VLAN tag from packets sent to vitual network interfaces.
Definition at line 66 of file knet.h.
Referenced by example_linux_interface_create().
#define OPENNSL_KNET_FILTER_M_FP_RULE 0x00000040 |
#define OPENNSL_KNET_FILTER_M_INGPORT 0x00000004 |
Match local ingress port.
Definition at line 73 of file knet.h.
Referenced by example_linux_interface_create().
#define OPENNSL_KNET_FILTER_M_RAW 0x00000001 |
#define OPENNSL_KNET_FILTER_M_REASON 0x00000020 |
#define OPENNSL_KNET_FILTER_T_RX_PKT 1 |
Rx packet filter.
Definition at line 61 of file knet.h.
Referenced by example_linux_interface_create().
#define OPENNSL_KNET_NETIF_F_ADD_TAG 0x00000001 |
#define OPENNSL_KNET_NETIF_NAME_MAX 16 |
Definition at line 40 of file knet.h.
Referenced by example_knet_intf_create(), and example_knet_intf_delete().
#define OPENNSL_KNET_NETIF_T_TX_CPU_INGRESS 1 |
#define OPENNSL_KNET_NETIF_T_TX_LOCAL_PORT 2 |
Tx packets are sent to local device port bypassing switch logic.
Definition at line 33 of file knet.h.
Referenced by example_linux_interface_create().
typedef struct opennsl_knet_filter_s opennsl_knet_filter_t |
Kernel packet filter structure.
typedef int(* opennsl_knet_filter_traverse_cb)(int unit, opennsl_knet_filter_t *filter, void *user_data) |
typedef struct opennsl_knet_netif_s opennsl_knet_netif_t |
Kernel network interface structure.
typedef int(* opennsl_knet_netif_traverse_cb)(int unit, opennsl_knet_netif_t *netif, void *user_data) |
int opennsl_knet_filter_create | ( | int | unit, |
opennsl_knet_filter_t * | filter | ||
) |
Create a kernel packet filter.
unit | [IN] Unit number. |
filter | [IN,OUT] Rx packet filter configuration |
OPENNSL_E_NONE | |
OPENNSL_E_UNAVAIL | |
OPENNSL_E_INTERNAL | |
OPENNSL_E_TIMEOUT | |
OPENNSL_E_PARAM | |
OPENNSL_E_RESOURCE |
Referenced by example_linux_interface_create().
int opennsl_knet_filter_destroy | ( | int | unit, |
int | filter_id | ||
) |
Destroy a kernel packet filter.
unit | [IN] Unit number. |
filter_id | [IN] Rx packet filter ID |
OPENNSL_E_NONE | |
OPENNSL_E_UNAVAIL | |
OPENNSL_E_INTERNAL | |
OPENNSL_E_TIMEOUT | |
OPENNSL_E_PARAM | |
OPENNSL_E_NOT_FOUND |
Referenced by example_knet_intf_delete().
void opennsl_knet_filter_t_init | ( | opennsl_knet_filter_t * | filter | ) |
Initialize a opennsl_knet_filter_t structure.
filter | [IN,OUT] Pointer to struct to be initialized |
None. |
Referenced by example_linux_interface_create().
int opennsl_knet_filter_traverse | ( | int | unit, |
opennsl_knet_filter_traverse_cb | trav_fn, | ||
void * | user_data | ||
) |
Traverse kernel packet filter objects.
unit | [IN] Unit number. |
trav_fn | [IN] User provided callback function |
user_data | [IN] User provided data used as input param for callback function |
OPENNSL_E_NONE | |
OPENNSL_E_UNAVAIL | |
OPENNSL_E_INTERNAL | |
OPENNSL_E_TIMEOUT | |
OPENNSL_E_PARAM | |
OPENNSL_E_NOT_FOUND |
int opennsl_knet_init | ( | int | unit | ) |
Initialize the kernel networking subsystem.
unit | [IN] Unit number. |
OPENNSL_E_NONE | |
OPENNSL_E_UNAVAIL | |
OPENNSL_E_CONFIG | |
OPENNSL_E_INTERNAL | |
OPENNSL_E_TIMEOUT | |
OPENNSL_E_PARAM | |
OPENNSL_E_RESOURCE | |
OPENNSL_E_NOT_FOUND |
int opennsl_knet_netif_create | ( | int | unit, |
opennsl_knet_netif_t * | netif | ||
) |
Create a kernel network interface.
unit | [IN] Unit number. |
netif | [IN,OUT] Network interface configuration |
OPENNSL_E_NONE | |
OPENNSL_E_UNAVAIL | |
OPENNSL_E_INTERNAL | |
OPENNSL_E_TIMEOUT | |
OPENNSL_E_PARAM | |
OPENNSL_E_RESOURCE |
Referenced by example_linux_interface_create().
int opennsl_knet_netif_destroy | ( | int | unit, |
int | netif_id | ||
) |
Destroy a kernel network interface.
unit | [IN] Unit number. |
netif_id | [IN] Network interface ID |
OPENNSL_E_NONE | |
OPENNSL_E_UNAVAIL | |
OPENNSL_E_INTERNAL | |
OPENNSL_E_TIMEOUT | |
OPENNSL_E_PARAM | |
OPENNSL_E_NOT_FOUND |
Referenced by example_knet_intf_delete().
void opennsl_knet_netif_t_init | ( | opennsl_knet_netif_t * | netif | ) |
Initialize a opennsl_knet_netif_t structure.
netif | [IN,OUT] Pointer to struct to be initialized |
None. |
Referenced by example_linux_interface_create().
int opennsl_knet_netif_traverse | ( | int | unit, |
opennsl_knet_netif_traverse_cb | trav_fn, | ||
void * | user_data | ||
) |
Traverse kernel network interface objects.
unit | [IN] Unit number. |
trav_fn | [IN] User provided callback function |
user_data | [IN] User provided data used as input param for callback function |
OPENNSL_E_NONE | |
OPENNSL_E_UNAVAIL | |
OPENNSL_E_INTERNAL | |
OPENNSL_E_TIMEOUT | |
OPENNSL_E_PARAM | |
OPENNSL_E_NOT_FOUND |