OpenNSL API Guide and Reference Manual
Data Structures | Files | Macros | Typedefs | Enumerations | Functions
Tunnelling

Data Structures

struct  opennsl_tunnel_initiator_s
 L3 tunneling initiator. More...
 
struct  opennsl_tunnel_terminator_s
 L3 tunneling terminator. More...
 

Files

file  tunnel.h
 
file  tunnelX.h
 

Macros

#define OPENNSL_TUNNEL_INIT_USE_INNER_DF   0x00000080
 Copy DF from inner header.
 
#define OPENNSL_TUNNEL_REPLACE   0x00010000
 Update existing tunnel.
 
#define OPENNSL_TUNNEL_TERM_TUNNEL_WITH_ID   0x00000040
 Create tunnel with ID.
 
#define OPENNSL_TUNNEL_WITH_ID   0x00080000
 Add using the specified ID.
 

Typedefs

typedef enum
opennsl_tunnel_dscp_select_e 
opennsl_tunnel_dscp_select_t
 opennsl_tunnel_dscp_select_e
 
typedef struct
opennsl_tunnel_initiator_s 
opennsl_tunnel_initiator_t
 L3 tunneling initiator.
 
typedef int(* opennsl_tunnel_initiator_traverse_cb )(int unit, opennsl_tunnel_initiator_t *info, void *user_data)
 
typedef struct
opennsl_tunnel_terminator_s 
opennsl_tunnel_terminator_t
 L3 tunneling terminator.
 
typedef int(* opennsl_tunnel_terminator_traverse_cb )(int unit, opennsl_tunnel_terminator_t *info, void *user_data)
 
typedef enum opennsl_tunnel_type_e opennsl_tunnel_type_t
 Tunnel types.
 

Enumerations

enum  opennsl_tunnel_dscp_select_e {
  opennslTunnelDscpAssign = 0,
  opennslTunnelDscpPacket = 1,
  opennslTunnelDscpMap = 2,
  opennslTunnelDscpCount = 3
}
 opennsl_tunnel_dscp_select_e More...
 
enum  opennsl_tunnel_type_e { opennslTunnelTypeVxlan = 30 }
 Tunnel types. More...
 

Functions

int opennsl_tunnel_initiator_clear (int unit, opennsl_l3_intf_t *intf) LIB_DLL_EXPORTED
 Delete the tunnel association for the given L3 interface.
 
int opennsl_tunnel_initiator_create (int unit, opennsl_l3_intf_t *intf, opennsl_tunnel_initiator_t *tunnel) LIB_DLL_EXPORTED
 Set the tunneling initiator parameters on an L3 interface.
 
int opennsl_tunnel_initiator_get (int unit, opennsl_l3_intf_t *intf, opennsl_tunnel_initiator_t *tunnel) LIB_DLL_EXPORTED
 Get the tunnel property for the given L3 interface.
 
int opennsl_tunnel_initiator_set (int unit, opennsl_l3_intf_t *intf, opennsl_tunnel_initiator_t *tunnel) LIB_DLL_EXPORTED
 Set the tunneling initiator parameters on an L3 interface.
 
void opennsl_tunnel_initiator_t_init (opennsl_tunnel_initiator_t *tunnel_init) LIB_DLL_EXPORTED
 Initialize a opennsl_tunnel_initiator_t structure.
 
int opennsl_tunnel_initiator_traverse (int unit, opennsl_tunnel_initiator_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse tunnel initiator.
 
int opennsl_tunnel_terminator_add (int unit, opennsl_tunnel_terminator_t *info) LIB_DLL_EXPORTED
 Add a tunnel terminator for DIP-SIP key.
 
int opennsl_tunnel_terminator_create (int unit, opennsl_tunnel_terminator_t *info) LIB_DLL_EXPORTED
 Add a tunnel terminator for DIP-SIP key.
 
int opennsl_tunnel_terminator_delete (int unit, opennsl_tunnel_terminator_t *info) LIB_DLL_EXPORTED
 Delete a tunnel terminator for DIP-SIP key.
 
int opennsl_tunnel_terminator_get (int unit, opennsl_tunnel_terminator_t *info) LIB_DLL_EXPORTED
 Get a tunnel terminator for DIP-SIP key.
 
void opennsl_tunnel_terminator_t_init (opennsl_tunnel_terminator_t *tunnel_term) LIB_DLL_EXPORTED
 Initialize a opennsl_tunnel_terminator_t structure.
 
int opennsl_tunnel_terminator_traverse (int unit, opennsl_tunnel_terminator_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse tunnel terminator.
 
int opennsl_tunnel_terminator_update (int unit, opennsl_tunnel_terminator_t *info) LIB_DLL_EXPORTED
 Update a tunnel terminator for DIP-SIP key.
 

Detailed Description

Macro Definition Documentation

#define OPENNSL_TUNNEL_INIT_USE_INNER_DF   0x00000080

Copy DF from inner header.

Note:flag takes precedence over ipv4_set_df flag.

Definition at line 25 of file tunnelX.h.

#define OPENNSL_TUNNEL_REPLACE   0x00010000

Update existing tunnel.

Definition at line 29 of file tunnelX.h.

#define OPENNSL_TUNNEL_TERM_TUNNEL_WITH_ID   0x00000040

Create tunnel with ID.

Definition at line 24 of file tunnelX.h.

#define OPENNSL_TUNNEL_WITH_ID   0x00080000

Add using the specified ID.

Definition at line 31 of file tunnelX.h.

Referenced by example_ip_tunnel_add().

Typedef Documentation

opennsl_tunnel_dscp_select_e

L3 tunneling initiator.

typedef int(* opennsl_tunnel_initiator_traverse_cb)(int unit, opennsl_tunnel_initiator_t *info, void *user_data)

Definition at line 115 of file tunnelX.h.

L3 tunneling terminator.

typedef int(* opennsl_tunnel_terminator_traverse_cb)(int unit, opennsl_tunnel_terminator_t *info, void *user_data)

Definition at line 120 of file tunnelX.h.

Tunnel types.

Enumeration Type Documentation

opennsl_tunnel_dscp_select_e

Enumerator:
opennslTunnelDscpAssign 

Set outer IP header DSCP to tunnel initiator DSCP value.

opennslTunnelDscpPacket 

Copy packet DSCP to outer header.

opennslTunnelDscpMap 

Use DSCP value from DSCP map.

opennslTunnelDscpCount 

Unused always last.

Definition at line 74 of file tunnelX.h.

Tunnel types.

Enumerator:
opennslTunnelTypeVxlan 

VXLAN Tunnel.

Definition at line 34 of file tunnelX.h.

Function Documentation

int opennsl_tunnel_initiator_clear ( int  unit,
opennsl_l3_intf_t intf 
)

Delete the tunnel association for the given L3 interface.

Description
Delete the tunnel association for the given L3 interface.
Parameters
unit[IN] Unit number.
intf[IN] Interface information, of which only the interface ID is used
Return values
OPENNSL_E_XXX
int opennsl_tunnel_initiator_create ( int  unit,
opennsl_l3_intf_t intf,
opennsl_tunnel_initiator_t tunnel 
)

Set the tunneling initiator parameters on an L3 interface.

Description
Sets the tunnel configuration information for a particular L3 interface. For DNX devices, use opennsl_tunnel_initiator_create. For other devices, use opennsl_tunnel_initiator_set. .
Parameters
unit[IN] Unit number.
intf[IN,OUT] Interface information, of which only the interface ID is used
tunnel[IN,OUT] Individual tunnel configuration state
Return values
OPENNSL_E_XXX

Referenced by example_ip_tunnel_add().

int opennsl_tunnel_initiator_get ( int  unit,
opennsl_l3_intf_t intf,
opennsl_tunnel_initiator_t tunnel 
)

Get the tunnel property for the given L3 interface.

Description
Gets the tunnel configuration information for a particular L3 interface.
Parameters
unit[IN] Unit number.
intf[IN] Interface information, of which only the interface ID is used
tunnel[OUT] Individual tunnel configuration state
Return values
OPENNSL_E_XXX
int opennsl_tunnel_initiator_set ( int  unit,
opennsl_l3_intf_t intf,
opennsl_tunnel_initiator_t tunnel 
)

Set the tunneling initiator parameters on an L3 interface.

Description
Sets the tunnel configuration information for a particular L3 interface. For DNX devices, use opennsl_tunnel_initiator_create. For other devices, use opennsl_tunnel_initiator_set. .
Parameters
unit[IN] Unit number.
intf[IN] Interface information, of which only the interface ID is used
tunnel[IN] Individual tunnel configuration state
Return values
OPENNSL_E_XXX
void opennsl_tunnel_initiator_t_init ( opennsl_tunnel_initiator_t tunnel_init)

Initialize a opennsl_tunnel_initiator_t structure.

Description
Initializes a tunnel initiator structure to default values. This function should be used to initialize any tunnel initiator structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_tunnel_initiator_t structure, and opennsl_tunnel_initiator_t_init will initialize the new members to correct default values.
Parameters
tunnel_init[IN,OUT]
Return values
Nothing

Referenced by example_vxlan_egress_tunnel_create().

int opennsl_tunnel_initiator_traverse ( int  unit,
opennsl_tunnel_initiator_traverse_cb  cb,
void *  user_data 
)

Traverse tunnel initiator.

Description
Traverse tunnel initiator. The callback function is defined as following:.
Parameters
unit[IN] Unit number.
cb[IN] User callback function
user_data[IN] Pointer to user supplied cookie used in parameter in callback function
Return values
OPENNSL_E_XXX
int opennsl_tunnel_terminator_add ( int  unit,
opennsl_tunnel_terminator_t info 
)

Add a tunnel terminator for DIP-SIP key.

Description
Add a tunnel terminator for DIP-SIP key. On some devices, UDP source/dest port values are also used in the key. UDP source/dest port values are set to 0 for no UDP packet. opennsl_tunnel_terminator_create API is used for DNX devices, while opennsl_tunnel_terminator_add API should be used for other devices.
Parameters
unit[IN] Unit number.
info[IN] Pointer to opennsl_tunnel_terminator_t containing fields related to IP tunnel terminator point. Valid fields: =TUNNEL_TERM_ADD_FIELDS_table
Return values
OPENNSL_E_XXX
int opennsl_tunnel_terminator_create ( int  unit,
opennsl_tunnel_terminator_t info 
)

Add a tunnel terminator for DIP-SIP key.

Description
Add a tunnel terminator for DIP-SIP key. On some devices, UDP source/dest port values are also used in the key. UDP source/dest port values are set to 0 for no UDP packet. opennsl_tunnel_terminator_create API is used for DNX devices, while opennsl_tunnel_terminator_add API should be used for other devices.
Parameters
unit[IN] Unit number.
info[IN,OUT] Pointer to opennsl_tunnel_terminator_t containing fields related to IP tunnel terminator point. Valid fields: =TUNNEL_TERM_ADD_FIELDS_table
Return values
OPENNSL_E_XXX

Referenced by example_vxlan_tunnel_terminator_create().

int opennsl_tunnel_terminator_delete ( int  unit,
opennsl_tunnel_terminator_t info 
)

Delete a tunnel terminator for DIP-SIP key.

Description
Delete a tunnel terminator for DIP-SIP key. On some devices, UDP source/dest port values are also used in the key.
Parameters
unit[IN] Unit number.
info[IN] Pointer to opennsl_tunnel_terminator_t containing the keys for IP tunnel terminator point. Valid fields: =TUNNEL_TERM_DEL_FIELDS_table
Return values
OPENNSL_E_XXX
int opennsl_tunnel_terminator_get ( int  unit,
opennsl_tunnel_terminator_t info 
)

Get a tunnel terminator for DIP-SIP key.

Description
Get a tunnel terminator for DIP-SIP key. On some devices, UDP source/dest port values are also used in the key.
Parameters
unit[IN] Unit number.
info[IN,OUT] Pointer to opennsl_tunnel_terminator_t containing fields related to IP tunnel terminator point. Valid fields: =TUNNEL_TERM_GET_FIELDS_table
Return values
OPENNSL_E_XXX
void opennsl_tunnel_terminator_t_init ( opennsl_tunnel_terminator_t tunnel_term)

Initialize a opennsl_tunnel_terminator_t structure.

Description
Initializes a tunnel terminator structure to default values. This function should be used to initialize any tunnel terminator structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_tunnel_terminator_t structure, and opennsl_tunnel_terminator_t_init will initialize the new members to correct default values.
Parameters
tunnel_term[IN,OUT]
Return values
Nothing

Referenced by example_vxlan_tunnel_terminator_create().

int opennsl_tunnel_terminator_traverse ( int  unit,
opennsl_tunnel_terminator_traverse_cb  cb,
void *  user_data 
)

Traverse tunnel terminator.

Description
Traverse tunnel terminator. The callback function is defined as following:.
Parameters
unit[IN] Unit number.
cb[IN] User callback function
user_data[IN] Pointer to user supplied cookie used in parameter in callback function
Return values
OPENNSL_E_XXX
int opennsl_tunnel_terminator_update ( int  unit,
opennsl_tunnel_terminator_t info 
)

Update a tunnel terminator for DIP-SIP key.

Description
Update a tunnel terminator for DIP-SIP key. On some devices, UDP source/dest port values are also used in the key.
Parameters
unit[IN] Unit number.
info[IN] Pointer to opennsl_tunnel_terminator_t containing fields related to IP tunnel terminator point. Valid Fields: =TUNNEL_TERM_UPDATE_FIELDS_table
Return values
OPENNSL_E_XXX