OpenNSL API Guide and Reference Manual
Data Structures | Files | Typedefs | Functions
Virtual Switch

Data Structures

struct  opennsl_vswitch_cross_connect_s
 L3 tunneling initiator. More...
 

Files

file  vswitch.h
 
file  vswitchX.h
 

Typedefs

typedef struct
opennsl_vswitch_cross_connect_s 
opennsl_vswitch_cross_connect_t
 L3 tunneling initiator.
 
typedef int(* opennsl_vswitch_port_traverse_cb )(int unit, opennsl_vlan_t vsi, opennsl_gport_t port, void *user_data)
 

Functions

int opennsl_vswitch_create (int unit, opennsl_vlan_t *vsi) LIB_DLL_EXPORTED
 Create a Virtual Switching Instance.
 
int opennsl_vswitch_create_with_id (int unit, opennsl_vlan_t vsi) LIB_DLL_EXPORTED
 Create a Virtual Switching Instance, with a specified ID.
 
int opennsl_vswitch_cross_connect_add (int unit, opennsl_vswitch_cross_connect_t *gports) LIB_DLL_EXPORTED
 Attach two given logical ports in a point-to-point service.
 
int opennsl_vswitch_cross_connect_delete (int unit, opennsl_vswitch_cross_connect_t *gports) LIB_DLL_EXPORTED
 Remove attachment between the given logical ports.
 
int opennsl_vswitch_cross_connect_delete_all (int unit) LIB_DLL_EXPORTED
 Delete all point-to-point services.
 
int opennsl_vswitch_cross_connect_get (int unit, opennsl_vswitch_cross_connect_t *gports) LIB_DLL_EXPORTED
 Return peer, if protected return primary port, invalid gport is populated.
 
void opennsl_vswitch_cross_connect_t_init (opennsl_vswitch_cross_connect_t *cross_connect) LIB_DLL_EXPORTED
 
int opennsl_vswitch_destroy (int unit, opennsl_vlan_t vsi) LIB_DLL_EXPORTED
 Destroy a Virtual Switching Instance.
 
int opennsl_vswitch_detach (int unit) LIB_DLL_EXPORTED
 Detach vswitch module.
 
int opennsl_vswitch_init (int unit) LIB_DLL_EXPORTED
 Initialize vswitch module.
 
int opennsl_vswitch_port_add (int unit, opennsl_vlan_t vsi, opennsl_gport_t port) LIB_DLL_EXPORTED
 Add a logical port to the specified virtual switching instance.
 
int opennsl_vswitch_port_delete (int unit, opennsl_vlan_t vsi, opennsl_gport_t port) LIB_DLL_EXPORTED
 Remove a logical port from the specified virtual switching instance.
 
int opennsl_vswitch_port_delete_all (int unit, opennsl_vlan_t vsi) LIB_DLL_EXPORTED
 Remove all logical port members from the specified virtual switching instance.
 
int opennsl_vswitch_port_get (int unit, opennsl_gport_t port, opennsl_vlan_t *vsi) LIB_DLL_EXPORTED
 Get the virtual switching instance of which the specified logical port is a member.
 
int opennsl_vswitch_port_traverse (int unit, opennsl_vlan_t vsi, opennsl_vswitch_port_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse existing ports on vswitch.
 

Detailed Description

Typedef Documentation

L3 tunneling initiator.

typedef int(* opennsl_vswitch_port_traverse_cb)(int unit, opennsl_vlan_t vsi, opennsl_gport_t port, void *user_data)

Definition at line 92 of file vswitchX.h.

Function Documentation

int opennsl_vswitch_create ( int  unit,
opennsl_vlan_t vsi 
)

Create a Virtual Switching Instance.

Description
Create a Virtual Switching Instance.
Parameters
unit[IN] Unit number.
vsi[OUT] Virtual Switching Instance
Return values
OPENNSL_E_XXX
int opennsl_vswitch_create_with_id ( int  unit,
opennsl_vlan_t  vsi 
)

Create a Virtual Switching Instance, with a specified ID.

Description
Create a Virtual Switching Instance, with the specified ID.
Parameters
unit[IN] Unit number.
vsi[IN] Virtual Switching Instance
Return values
OPENNSL_E_XXX

Referenced by example_open_vlan_per_mc().

int opennsl_vswitch_cross_connect_add ( int  unit,
opennsl_vswitch_cross_connect_t gports 
)

Attach two given logical ports in a point-to-point service.

Description
Attach two given logical ports in a point-to-point service. You can also use the following flags:.
Parameters
unit[IN] Unit number.
gports[IN] Logical ports
Return values
OPENNSL_E_XXX

Referenced by initial_qos_service().

int opennsl_vswitch_cross_connect_delete ( int  unit,
opennsl_vswitch_cross_connect_t gports 
)

Remove attachment between the given logical ports.

Description
Remove attachment between the given logical ports.
Parameters
unit[IN] Unit number.
gports[IN] Logical ports
Return values
OPENNSL_E_XXX

Referenced by initial_qos_service_cleanup().

int opennsl_vswitch_cross_connect_delete_all ( int  unit)

Delete all point-to-point services.

Description
Delete all point-to-point services.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_vswitch_cross_connect_get ( int  unit,
opennsl_vswitch_cross_connect_t gports 
)

Return peer, if protected return primary port, invalid gport is populated.

Description
Return peer, if protected return primary port, invalid gport is populated.
Parameters
unit[IN] Unit number.
gports[IN,OUT] Logical ports
Return values
OPENNSL_E_XXX
void opennsl_vswitch_cross_connect_t_init ( opennsl_vswitch_cross_connect_t cross_connect)
Parameters
cross_connect[IN,OUT]
Returns
Nothing

Referenced by initial_qos_service().

int opennsl_vswitch_destroy ( int  unit,
opennsl_vlan_t  vsi 
)

Destroy a Virtual Switching Instance.

Description
Destroy the specified Virtual Switching Instance.
Parameters
unit[IN] Unit number.
vsi[IN] Virtual Switching Instance
Return values
OPENNSL_E_XXX
int opennsl_vswitch_detach ( int  unit)

Detach vswitch module.

Description
Cleans up any data structures used by the vswitch module. Usually called as a part of =opennsl_detach .
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_vswitch_init ( int  unit)

Initialize vswitch module.

Description
This API should be called first, before calling any other APIs in this module. It is usually automatically called as a part of =opennsl_init .
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_vswitch_port_add ( int  unit,
opennsl_vlan_t  vsi,
opennsl_gport_t  port 
)

Add a logical port to the specified virtual switching instance.

Description
Add a logical port to the specified virtual switching instance.
Parameters
unit[IN] Unit number.
vsi[IN] Virtual Switching Instance
port[IN] Port number
Return values
OPENNSL_E_XXX

Referenced by example_add_inLif_to_vswitch().

int opennsl_vswitch_port_delete ( int  unit,
opennsl_vlan_t  vsi,
opennsl_gport_t  port 
)

Remove a logical port from the specified virtual switching instance.

Description
Remove the specified logical port from the specified virtual switching instance.
Parameters
unit[IN] Unit number.
vsi[IN] Virtual Switching Instance
port[IN] Port number
Return values
OPENNSL_E_XXX

Referenced by remove_inLif_from_vswitch().

int opennsl_vswitch_port_delete_all ( int  unit,
opennsl_vlan_t  vsi 
)

Remove all logical port members from the specified virtual switching instance.

Description
Remove all logical port members from the specified virtual switching instance.
Parameters
unit[IN] Unit number.
vsi[IN] Virtual Switching Instance
Return values
OPENNSL_E_XXX
int opennsl_vswitch_port_get ( int  unit,
opennsl_gport_t  port,
opennsl_vlan_t vsi 
)

Get the virtual switching instance of which the specified logical port is a member.

Description
Get the virtual switching instance of which the specified logical port is a member.
Parameters
unit[IN] Unit number.
port[IN] Port number
vsi[OUT] Virtual Switching Instance
Return values
OPENNSL_E_XXX
int opennsl_vswitch_port_traverse ( int  unit,
opennsl_vlan_t  vsi,
opennsl_vswitch_port_traverse_cb  cb,
void *  user_data 
)

Traverse existing ports on vswitch.

Description
Traverse existing ports on vswitch .
Parameters
unit[IN] Unit number.
vsi[IN] Virtual Switching Instance
cb[IN] Vswitch port traverse prototype
user_data[IN] Cookie value supplied by caller during registration of the callout
Return values
OPENNSL_E_xxx