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

Data Structures

struct  opennsl_mpls_egress_label_s
 opennsl_mpls_egress_label_s More...
 
struct  opennsl_mpls_entropy_identifier_s
 MPLS Entropy identifier Config Structure. More...
 
struct  opennsl_mpls_exp_map_s
 MPLS EXP Map Structure. More...
 
struct  opennsl_mpls_port_s
 MPLS port type. More...
 
struct  opennsl_mpls_range_action_s
 MPLS range action. More...
 
struct  opennsl_mpls_tunnel_switch_s
 MPLS tunnel switch structure. More...
 
struct  opennsl_mpls_vpn_config_s
 MPLS VPN Config Structure. More...
 

Files

file  mpls.h
 
file  mplsX.h
 

Macros

#define OPENNSL_MPLS_EGRESS_LABEL_ACTION_VALID   0x00002000
 When set action is taken from action field.
 
#define OPENNSL_MPLS_EGRESS_LABEL_REPLACE   0x00004000
 Replace existing entry.
 
#define OPENNSL_MPLS_EGRESS_LABEL_TTL_COPY   0x00000002
 
#define OPENNSL_MPLS_EGRESS_LABEL_TTL_DECREMENT   0x00000004
 
#define OPENNSL_MPLS_EGRESS_LABEL_TTL_SET   0x00000001
 
#define OPENNSL_MPLS_EGRESS_LABEL_WITH_ID   0x00008000
 Add using the specified ID.
 
#define OPENNSL_MPLS_SWITCH_INNER_TTL   0x00000100
 (POP/PHP) Get TTL from header following popped label.
 
#define OPENNSL_MPLS_SWITCH_TTL_DECREMENT   0x00000200
 Decrement the TTL value by 1.
 
#define OPENNSL_MPLS_VPN_L3   0x00000001
 
#define OPENNSL_MPLS_VPN_REPLACE   0x00000008
 
#define OPENNSL_MPLS_VPN_VPLS   0x00000004
 
#define OPENNSL_MPLS_VPN_VPWS   0x00000002
 
#define OPENNSL_MPLS_VPN_WITH_ID   0x00000010
 

Typedefs

typedef enum
opennsl_mpls_egress_action_e 
opennsl_mpls_egress_action_t
 MPLS label egress actions.
 
typedef struct
opennsl_mpls_egress_label_s 
opennsl_mpls_egress_label_t
 opennsl_mpls_egress_label_s
 
typedef struct
opennsl_mpls_entropy_identifier_s 
opennsl_mpls_entropy_identifier_t
 MPLS Entropy identifier Config Structure.
 
typedef int(* opennsl_mpls_entropy_identifier_traverse_cb )(int unit, opennsl_mpls_entropy_identifier_t *info, void *user_data)
 
typedef struct
opennsl_mpls_exp_map_s 
opennsl_mpls_exp_map_t
 MPLS EXP Map Structure.
 
typedef enum
opennsl_mpls_port_control_channel_type_e 
opennsl_mpls_port_control_channel_type_t
 VCCV Control Channel Type.
 
typedef enum
opennsl_mpls_port_match_e 
opennsl_mpls_port_match_t
 MPLS port match criteria.
 
typedef enum
opennsl_mpls_port_stat_e 
opennsl_mpls_port_stat_t
 Types of statistics that are maintained per MPLS gport.
 
typedef struct opennsl_mpls_port_s opennsl_mpls_port_t
 MPLS port type.
 
typedef struct
opennsl_mpls_range_action_s 
opennsl_mpls_range_action_t
 MPLS range action.
 
typedef enum opennsl_mpls_stat_e opennsl_mpls_stat_t
 MPLS statistics counters.
 
typedef enum
opennsl_mpls_switch_action_e 
opennsl_mpls_switch_action_t
 MPLS label actions.
 
typedef struct
opennsl_mpls_tunnel_switch_s 
opennsl_mpls_tunnel_switch_t
 MPLS tunnel switch structure.
 
typedef int(* opennsl_mpls_tunnel_switch_traverse_cb )(int unit, opennsl_mpls_tunnel_switch_t *info, void *user_data)
 
typedef struct
opennsl_mpls_vpn_config_s 
opennsl_mpls_vpn_config_t
 MPLS VPN Config Structure.
 
typedef int(* opennsl_mpls_vpn_traverse_cb )(int unit, opennsl_mpls_vpn_config_t *info, void *user_data)
 

Enumerations

enum  opennsl_mpls_egress_action_e {
  OPENNSL_MPLS_EGRESS_ACTION_SWAP = 0,
  OPENNSL_MPLS_EGRESS_ACTION_PHP = 1,
  OPENNSL_MPLS_EGRESS_ACTION_PUSH = 2,
  OPENNSL_MPLS_EGRESS_ACTION_NOP = 3,
  OPENNSL_MPLS_EGRESS_ACTION_SWAP_OR_PUSH = 4
}
 MPLS label egress actions. More...
 
enum  opennsl_mpls_port_control_channel_type_e {
  opennslMplsPortControlChannelNone = 0,
  opennslMplsPortControlChannelAch = 1,
  opennslMplsPortControlChannelRouterAlert = 2,
  opennslMplsPortControlChannelTtl = 3,
  opennslMplsPortControlChannelGalUnderPw = 4
}
 VCCV Control Channel Type. More...
 
enum  opennsl_mpls_port_match_e {
  OPENNSL_MPLS_PORT_MATCH_INVALID = 0,
  OPENNSL_MPLS_PORT_MATCH_NONE = 1,
  OPENNSL_MPLS_PORT_MATCH_PORT = 2,
  OPENNSL_MPLS_PORT_MATCH_PORT_VLAN = 3,
  OPENNSL_MPLS_PORT_MATCH_PORT_INNER_VLAN = 4,
  OPENNSL_MPLS_PORT_MATCH_PORT_VLAN_STACKED = 5,
  OPENNSL_MPLS_PORT_MATCH_VLAN_PRI = 6,
  OPENNSL_MPLS_PORT_MATCH_LABEL = 7,
  OPENNSL_MPLS_PORT_MATCH_LABEL_PORT = 8,
  OPENNSL_MPLS_PORT_MATCH_LABEL_VLAN = 9,
  OPENNSL_MPLS_PORT_MATCH_PORT_SUBPORT_PKT_VID = 10,
  OPENNSL_MPLS_PORT_MATCH_PORT_SUBPORT_PKT_VID_OUTER_VLAN = 11,
  OPENNSL_MPLS_PORT_MATCH_PORT_SUBPORT_PKT_VID_INNER_VLAN = 12,
  OPENNSL_MPLS_PORT_MATCH_SHARE = 13,
  OPENNSL_MPLS_PORT_MATCH_PORT_VLAN_TAG = 14,
  OPENNSL_MPLS_PORT_MATCH_PORT_INNER_VLAN_TAG = 15,
  OPENNSL_MPLS_PORT_MATCH_COUNT = 16
}
 MPLS port match criteria. More...
 
enum  opennsl_mpls_port_stat_e {
  opennslMplsPortStatUnicastPackets = 0,
  opennslMplsPortStatUnicastBytes = 1,
  opennslMplsPortStatNonUnicastPackets = 2,
  opennslMplsPortStatNonUnicastBytes = 3,
  opennslMplsPortStatDropPackets = 4,
  opennslMplsPortStatDropBytes = 5,
  opennslMplsPortStatFloodPackets = 6,
  opennslMplsPortStatFloodBytes = 7,
  opennslMplsPortStatFloodDropPackets = 8,
  opennslMplsPortStatFloodDropBytes = 9,
  opennslMplsPortStatGreenPackets = 10,
  opennslMplsPortStatGreenBytes = 11,
  opennslMplsPortStatYellowPackets = 12,
  opennslMplsPortStatYellowBytes = 13,
  opennslMplsPortStatRedPackets = 14,
  opennslMplsPortStatRedBytes = 15
}
 Types of statistics that are maintained per MPLS gport. More...
 
enum  opennsl_mpls_stat_e {
  opennslMplsInBytes = 0,
  opennslMplsOutBytes = 1,
  opennslMplsInPkts = 2,
  opennslMplsOutPkts = 3
}
 MPLS statistics counters. More...
 
enum  opennsl_mpls_switch_action_e {
  OPENNSL_MPLS_SWITCH_ACTION_SWAP = 0,
  OPENNSL_MPLS_SWITCH_ACTION_PHP = 1,
  OPENNSL_MPLS_SWITCH_ACTION_POP = 2,
  OPENNSL_MPLS_SWITCH_ACTION_POP_DIRECT = 3,
  OPENNSL_MPLS_SWITCH_ACTION_NOP = 4,
  OPENNSL_MPLS_SWITCH_EGRESS_ACTION_PUSH = 5,
  OPENNSL_MPLS_SWITCH_ACTION_INVALID = 6
}
 MPLS label actions. More...
 

Functions

int opennsl_mpls_cleanup (int unit) LIB_DLL_EXPORTED
 Detach the MPLS software module.
 
void opennsl_mpls_egress_label_t_init (opennsl_mpls_egress_label_t *label) LIB_DLL_EXPORTED
 Initialize the MPLS egress label structure.
 
int opennsl_mpls_entropy_identifier_add (int unit, uint32 options, opennsl_mpls_entropy_identifier_t *info) LIB_DLL_EXPORTED
 Add an MPLS Entropy Label Identifier.
 
int opennsl_mpls_entropy_identifier_delete (int unit, opennsl_mpls_entropy_identifier_t *info) LIB_DLL_EXPORTED
 Delete an MPLS Entropy Label Identifier.
 
int opennsl_mpls_entropy_identifier_delete_all (int unit) LIB_DLL_EXPORTED
 Delete all MPLS Entropy Label Identifiers.
 
int opennsl_mpls_entropy_identifier_get (int unit, opennsl_mpls_entropy_identifier_t *info) LIB_DLL_EXPORTED
 Get information about an MPLS Entropy Label Identifier.
 
void opennsl_mpls_entropy_identifier_t_init (opennsl_mpls_entropy_identifier_t *info) LIB_DLL_EXPORTED
 Initialize MPLS Entropy label identifier structure.
 
int opennsl_mpls_entropy_identifier_traverse (int unit, opennsl_mpls_entropy_identifier_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse all valid MPLS entropy label identifier entries and call the supplied callback routine.
 
int opennsl_mpls_exp_map_create (int unit, uint32 flags, int *exp_map_id) LIB_DLL_EXPORTED
 Create an MPLS EXP map instance.
 
int opennsl_mpls_exp_map_destroy (int unit, int exp_map_id) LIB_DLL_EXPORTED
 Destroy an MPLS EXP map instance.
 
int opennsl_mpls_exp_map_get (int unit, int exp_map_id, opennsl_mpls_exp_map_t *exp_map) LIB_DLL_EXPORTED
 Get the EXP mapping parameters for the specified EXP map.
 
int opennsl_mpls_exp_map_set (int unit, int exp_map_id, opennsl_mpls_exp_map_t *exp_map) LIB_DLL_EXPORTED
 Set the EXP mapping parameters for the specified EXP map.
 
void opennsl_mpls_exp_map_t_init (opennsl_mpls_exp_map_t *exp_map) LIB_DLL_EXPORTED
 Initialize the MPLS EXP map structure.
 
int opennsl_mpls_init (int unit) LIB_DLL_EXPORTED
 Initialize the OPENNSL MPLS subsystem.
 
int opennsl_mpls_label_stat_attach (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, uint32 stat_counter_id) LIB_DLL_EXPORTED
 Attach counters entries to the given MPLS label and gport.
 
int opennsl_mpls_label_stat_clear (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat) LIB_DLL_EXPORTED
 Clear MPLS Stats.
 
int opennsl_mpls_label_stat_counter_get (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Get counter statistic values for specific MPLS label and gport.
 
int opennsl_mpls_label_stat_counter_set (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Set counter statistic values for specific MPLS label and gport.
 
int opennsl_mpls_label_stat_counter_sync_get (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Force an immediate counter update and retrieve counter statistic values for specific MPLS label and gport.
 
int opennsl_mpls_label_stat_detach (int unit, opennsl_mpls_label_t label, opennsl_gport_t port) LIB_DLL_EXPORTED
 Detach counters entries to the given MPLS label and gport.
 
int opennsl_mpls_label_stat_enable_set (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, int enable) LIB_DLL_EXPORTED
 Enable/disable statistics collection for MPLS label or MPLS gport.
 
int opennsl_mpls_label_stat_get (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint64 *val) LIB_DLL_EXPORTED
 Get MPLS Stats.
 
int opennsl_mpls_label_stat_get32 (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 *val) LIB_DLL_EXPORTED
 Get MPLS Stats.
 
int opennsl_mpls_label_stat_id_get (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 *stat_counter_id) LIB_DLL_EXPORTED
 Get stat counter ID associated with given MPLS label and gport.
 
int opennsl_mpls_label_stat_sync_get (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint64 *val) LIB_DLL_EXPORTED
 Force an immediate counter update and retrieve MPLS Stats.
 
int opennsl_mpls_label_stat_sync_get32 (int unit, opennsl_mpls_label_t label, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 *val) LIB_DLL_EXPORTED
 Force an immediate counter update and retrieve MPLS Stats.
 
int opennsl_mpls_port_add (int unit, opennsl_vpn_t vpn, opennsl_mpls_port_t *mpls_port) LIB_DLL_EXPORTED
 Add an MPLS port to an L2 VPN.
 
int opennsl_mpls_port_delete (int unit, opennsl_vpn_t vpn, opennsl_gport_t mpls_port_id) LIB_DLL_EXPORTED
 Delete an MPLS port from an L2 VPN.
 
int opennsl_mpls_port_delete_all (int unit, opennsl_vpn_t vpn) LIB_DLL_EXPORTED
 Delete an MPLS port from an L2 VPN.
 
int opennsl_mpls_port_get (int unit, opennsl_vpn_t vpn, opennsl_mpls_port_t *mpls_port) LIB_DLL_EXPORTED
 Get an MPLS port from an L2 VPN.
 
int opennsl_mpls_port_get_all (int unit, opennsl_vpn_t vpn, int port_max, opennsl_mpls_port_t *port_array, int *port_count) LIB_DLL_EXPORTED
 Get all MPLS ports from an L2 VPN.
 
int opennsl_mpls_port_stat_attach (int unit, opennsl_vpn_t vpn, opennsl_gport_t port, uint32 stat_counter_id) LIB_DLL_EXPORTED
 Attach counters entries to the given MPLS gport and vpn.
 
int opennsl_mpls_port_stat_counter_get (int unit, opennsl_vpn_t vpn, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Get counter statistic values for specific vpn and gport.
 
int opennsl_mpls_port_stat_counter_set (int unit, opennsl_vpn_t vpn, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Set counter statistic values for specific vpn and gport.
 
int opennsl_mpls_port_stat_counter_sync_get (int unit, opennsl_vpn_t vpn, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Force an immediate counter update and retrieve get counter statistic values for specific vpn and gport.
 
int opennsl_mpls_port_stat_detach (int unit, opennsl_vpn_t vpn, opennsl_gport_t port) LIB_DLL_EXPORTED
 Detach counters entries to the given MPLS port and vpn.
 
int opennsl_mpls_port_stat_enable_set (int unit, opennsl_gport_t mpls_port, int enable) LIB_DLL_EXPORTED
 Enable or disable collection of MPLS port statistics.
 
int opennsl_mpls_port_stat_get (int unit, opennsl_gport_t mpls_port, opennsl_cos_t cos, opennsl_mpls_port_stat_t stat, uint64 *val) LIB_DLL_EXPORTED
 Get the specified statistics per MPLS/MEF port.
 
int opennsl_mpls_port_stat_get32 (int unit, opennsl_gport_t mpls_port, opennsl_cos_t cos, opennsl_mpls_port_stat_t stat, uint32 *val) LIB_DLL_EXPORTED
 Get the specified statistics per MPLS/MEF port.
 
int opennsl_mpls_port_stat_id_get (int unit, opennsl_vpn_t vpn, opennsl_gport_t port, opennsl_mpls_stat_t stat, uint32 *stat_counter_id) LIB_DLL_EXPORTED
 Get stat counter ID associated with given MPLS gport and VPN.
 
int opennsl_mpls_port_stat_set (int unit, opennsl_gport_t mpls_port, opennsl_cos_t cos, opennsl_mpls_port_stat_t stat, uint64 val) LIB_DLL_EXPORTED
 Set the specified statistic to the indicated value.
 
int opennsl_mpls_port_stat_set32 (int unit, opennsl_gport_t mpls_port, opennsl_cos_t cos, opennsl_mpls_port_stat_t stat, uint32 val) LIB_DLL_EXPORTED
 
void opennsl_mpls_port_t_init (opennsl_mpls_port_t *mpls_port) LIB_DLL_EXPORTED
 Initialize the MPLS port structure.
 
int opennsl_mpls_range_action_add (int unit, opennsl_mpls_label_t label_low, opennsl_mpls_label_t label_high, opennsl_mpls_range_action_t *action) LIB_DLL_EXPORTED
 Set range of labels per in lif.
 
int opennsl_mpls_range_action_get (int unit, opennsl_mpls_label_t label_low, opennsl_mpls_label_t label_high, opennsl_mpls_range_action_t *action) LIB_DLL_EXPORTED
 Get range of labels per in lif.
 
int opennsl_mpls_range_action_remove (int unit, opennsl_mpls_label_t label_low, opennsl_mpls_label_t label_high) LIB_DLL_EXPORTED
 Remove range of labels per in lif.
 
void opennsl_mpls_range_action_t_init (opennsl_mpls_range_action_t *label) LIB_DLL_EXPORTED
 Initialize the MPLS range action structure.
 
int opennsl_mpls_tunnel_initiator_clear (int unit, opennsl_if_t intf) LIB_DLL_EXPORTED
 Clear the MPLS tunnel initiator parameters for an L3 interface.
 
int opennsl_mpls_tunnel_initiator_clear_all (int unit) LIB_DLL_EXPORTED
 Clear all MPLS tunnel initiator information.
 
int opennsl_mpls_tunnel_initiator_create (int unit, opennsl_if_t intf, int num_labels, opennsl_mpls_egress_label_t *label_array) LIB_DLL_EXPORTED
 
int opennsl_mpls_tunnel_initiator_get (int unit, opennsl_if_t intf, int label_max, opennsl_mpls_egress_label_t *label_array, int *label_count) LIB_DLL_EXPORTED
 Get the MPLS tunnel initiator parameters from an L3 interface.
 
int opennsl_mpls_tunnel_initiator_set (int unit, opennsl_if_t intf, int num_labels, opennsl_mpls_egress_label_t *label_array) LIB_DLL_EXPORTED
 Set the MPLS tunnel initiator parameters for an L3 interface.
 
int opennsl_mpls_tunnel_stat_attach (int unit, opennsl_if_t intf_id, uint32 stat_counter_id) LIB_DLL_EXPORTED
 Attach statistics entity to the MPLS tunnel derived from the given L3 Egress interface.
 
int opennsl_mpls_tunnel_stat_counter_get (int unit, opennsl_if_t intf_id, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Get counter value for the specified MPLS statistic type and Tunnel interface derived from the given L3 interface ID.
 
int opennsl_mpls_tunnel_stat_counter_set (int unit, opennsl_if_t intf_id, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Set the counter value for the specified MPLS statistic type and Tunnel interface derived derived from the given L3 Interface ID.
 
int opennsl_mpls_tunnel_stat_counter_sync_get (int unit, opennsl_if_t intf_id, opennsl_mpls_stat_t stat, uint32 num_entries, uint32 *counter_indexes, opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED
 Force an immediate counter update and retrieve the specified counter statistic for a MPLS tunnel.
 
int opennsl_mpls_tunnel_stat_detach (int unit, opennsl_if_t intf_id) LIB_DLL_EXPORTED
 Detach statistics entity to the MPLS tunnel derived from the given L3 Egress interface.
 
int opennsl_mpls_tunnel_stat_id_get (int unit, opennsl_if_t intf_id, opennsl_mpls_stat_t stat, uint32 *stat_counter_id) LIB_DLL_EXPORTED
 Get stat counter ID associated with the MPLS tunnel derived from the given L3 interface ID.
 
int opennsl_mpls_tunnel_switch_add (int unit, opennsl_mpls_tunnel_switch_t *info) LIB_DLL_EXPORTED
 Add an MPLS label entry.
 
int opennsl_mpls_tunnel_switch_create (int unit, opennsl_mpls_tunnel_switch_t *info) LIB_DLL_EXPORTED
 Add an MPLS label entry.
 
int opennsl_mpls_tunnel_switch_delete (int unit, opennsl_mpls_tunnel_switch_t *info) LIB_DLL_EXPORTED
 Delete an MPLS label entry.
 
int opennsl_mpls_tunnel_switch_delete_all (int unit) LIB_DLL_EXPORTED
 Delete all MPLS label entries.
 
int opennsl_mpls_tunnel_switch_get (int unit, opennsl_mpls_tunnel_switch_t *info) LIB_DLL_EXPORTED
 Get an MPLS label entry.
 
void opennsl_mpls_tunnel_switch_t_init (opennsl_mpls_tunnel_switch_t *info) LIB_DLL_EXPORTED
 Initialize the MPLS tunnel switch structure.
 
int opennsl_mpls_tunnel_switch_traverse (int unit, opennsl_mpls_tunnel_switch_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse all valid MPLS label entries and call the supplied callback routine.
 
void opennsl_mpls_vpn_config_t_init (opennsl_mpls_vpn_config_t *info) LIB_DLL_EXPORTED
 Initialize the MPLS VPN config structure.
 
int opennsl_mpls_vpn_id_create (int unit, opennsl_mpls_vpn_config_t *info) LIB_DLL_EXPORTED
 Create an MPLS VPN.
 
int opennsl_mpls_vpn_id_destroy (int unit, opennsl_vpn_t vpn) LIB_DLL_EXPORTED
 Destroy an MPLS VPN.
 
int opennsl_mpls_vpn_id_destroy_all (int unit) LIB_DLL_EXPORTED
 Destroy an MPLS VPN.
 
int opennsl_mpls_vpn_id_get (int unit, opennsl_vpn_t vpn, opennsl_mpls_vpn_config_t *info) LIB_DLL_EXPORTED
 Get an MPLS VPN.
 
int opennsl_mpls_vpn_traverse (int unit, opennsl_mpls_vpn_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse all valid MPLS VPN entries and call the supplied callback routine.
 

Detailed Description

Macro Definition Documentation

#define OPENNSL_MPLS_EGRESS_LABEL_ACTION_VALID   0x00002000

When set action is taken from action field.

Definition at line 39 of file mplsX.h.

#define OPENNSL_MPLS_EGRESS_LABEL_REPLACE   0x00004000

Replace existing entry.

Definition at line 42 of file mplsX.h.

#define OPENNSL_MPLS_EGRESS_LABEL_TTL_COPY   0x00000002

Definition at line 37 of file mplsX.h.

#define OPENNSL_MPLS_EGRESS_LABEL_TTL_DECREMENT   0x00000004

Definition at line 38 of file mplsX.h.

#define OPENNSL_MPLS_EGRESS_LABEL_TTL_SET   0x00000001

Definition at line 36 of file mplsX.h.

#define OPENNSL_MPLS_EGRESS_LABEL_WITH_ID   0x00008000

Add using the specified ID.

Definition at line 44 of file mplsX.h.

#define OPENNSL_MPLS_SWITCH_INNER_TTL   0x00000100

(POP/PHP) Get TTL from header following popped label.

Definition at line 196 of file mplsX.h.

#define OPENNSL_MPLS_SWITCH_TTL_DECREMENT   0x00000200

Decrement the TTL value by 1.

Definition at line 199 of file mplsX.h.

#define OPENNSL_MPLS_VPN_L3   0x00000001

Definition at line 356 of file mplsX.h.

#define OPENNSL_MPLS_VPN_REPLACE   0x00000008

Definition at line 359 of file mplsX.h.

#define OPENNSL_MPLS_VPN_VPLS   0x00000004

Definition at line 358 of file mplsX.h.

#define OPENNSL_MPLS_VPN_VPWS   0x00000002

Definition at line 357 of file mplsX.h.

#define OPENNSL_MPLS_VPN_WITH_ID   0x00000010

Definition at line 360 of file mplsX.h.

Typedef Documentation

MPLS label egress actions.

MPLS Entropy identifier Config Structure.

typedef int(* opennsl_mpls_entropy_identifier_traverse_cb)(int unit, opennsl_mpls_entropy_identifier_t *info, void *user_data)

Definition at line 1100 of file mplsX.h.

MPLS EXP Map Structure.

VCCV Control Channel Type.

MPLS port match criteria.

Types of statistics that are maintained per MPLS gport.

MPLS port type.

MPLS range action.

MPLS statistics counters.

MPLS label actions.

MPLS tunnel switch structure.

typedef int(* opennsl_mpls_tunnel_switch_traverse_cb)(int unit, opennsl_mpls_tunnel_switch_t *info, void *user_data)

Definition at line 993 of file mplsX.h.

MPLS VPN Config Structure.

typedef int(* opennsl_mpls_vpn_traverse_cb)(int unit, opennsl_mpls_vpn_config_t *info, void *user_data)

Definition at line 461 of file mplsX.h.

Enumeration Type Documentation

MPLS label egress actions.

Enumerator:
OPENNSL_MPLS_EGRESS_ACTION_SWAP 
OPENNSL_MPLS_EGRESS_ACTION_PHP 
OPENNSL_MPLS_EGRESS_ACTION_PUSH 
OPENNSL_MPLS_EGRESS_ACTION_NOP 
OPENNSL_MPLS_EGRESS_ACTION_SWAP_OR_PUSH 

Definition at line 47 of file mplsX.h.

VCCV Control Channel Type.

Enumerator:
opennslMplsPortControlChannelNone 
opennslMplsPortControlChannelAch 
opennslMplsPortControlChannelRouterAlert 
opennslMplsPortControlChannelTtl 
opennslMplsPortControlChannelGalUnderPw 

Definition at line 117 of file mplsX.h.

MPLS port match criteria.

Enumerator:
OPENNSL_MPLS_PORT_MATCH_INVALID 

Illegal.

OPENNSL_MPLS_PORT_MATCH_NONE 

No source match criteria.

OPENNSL_MPLS_PORT_MATCH_PORT 

{Module, Port} or Trunk.

OPENNSL_MPLS_PORT_MATCH_PORT_VLAN 

Mod/port/trunk + outer VLAN ID.

OPENNSL_MPLS_PORT_MATCH_PORT_INNER_VLAN 

Mod/port/trunk + inner VLAN ID.

OPENNSL_MPLS_PORT_MATCH_PORT_VLAN_STACKED 

Mod/port/trunk + outer/inner VLAN ID.

OPENNSL_MPLS_PORT_MATCH_VLAN_PRI 

Mod/port/trunk + VLAN-PRI + VLAN-CFI.

OPENNSL_MPLS_PORT_MATCH_LABEL 

MPLS label.

OPENNSL_MPLS_PORT_MATCH_LABEL_PORT 

MPLS label + Mod/port/trunk.

OPENNSL_MPLS_PORT_MATCH_LABEL_VLAN 

MPLS label + VLAN.

OPENNSL_MPLS_PORT_MATCH_PORT_SUBPORT_PKT_VID 

Mod/port/trunk + LLTAG VLAN ID.

OPENNSL_MPLS_PORT_MATCH_PORT_SUBPORT_PKT_VID_OUTER_VLAN 

Mod/port/trunk + LLTAG VLAN ID + outer VLAN ID.

OPENNSL_MPLS_PORT_MATCH_PORT_SUBPORT_PKT_VID_INNER_VLAN 

Mod/port/trunk + LLTAG VLAN ID + inner VLAN ID.

OPENNSL_MPLS_PORT_MATCH_SHARE 

Multiple match criteria Share one MPLS logical port.

OPENNSL_MPLS_PORT_MATCH_PORT_VLAN_TAG 

Mod/port/trunk + Outer VLAN-PRI + Outer VLAN-CFI + Outer VLAN ID.

OPENNSL_MPLS_PORT_MATCH_PORT_INNER_VLAN_TAG 

Mod/port/trunk + Inner VLAN-PRI + Inner VLAN-CFI + Inner VLAN ID.

OPENNSL_MPLS_PORT_MATCH_COUNT 

Must be last.

Definition at line 84 of file mplsX.h.

Types of statistics that are maintained per MPLS gport.

Enumerator:
opennslMplsPortStatUnicastPackets 
opennslMplsPortStatUnicastBytes 
opennslMplsPortStatNonUnicastPackets 
opennslMplsPortStatNonUnicastBytes 
opennslMplsPortStatDropPackets 
opennslMplsPortStatDropBytes 
opennslMplsPortStatFloodPackets 
opennslMplsPortStatFloodBytes 
opennslMplsPortStatFloodDropPackets 
opennslMplsPortStatFloodDropBytes 
opennslMplsPortStatGreenPackets 
opennslMplsPortStatGreenBytes 
opennslMplsPortStatYellowPackets 
opennslMplsPortStatYellowBytes 
opennslMplsPortStatRedPackets 
opennslMplsPortStatRedBytes 

Definition at line 1391 of file mplsX.h.

MPLS statistics counters.

Enumerator:
opennslMplsInBytes 
opennslMplsOutBytes 
opennslMplsInPkts 
opennslMplsOutPkts 

Definition at line 592 of file mplsX.h.

MPLS label actions.

Enumerator:
OPENNSL_MPLS_SWITCH_ACTION_SWAP 
OPENNSL_MPLS_SWITCH_ACTION_PHP 
OPENNSL_MPLS_SWITCH_ACTION_POP 
OPENNSL_MPLS_SWITCH_ACTION_POP_DIRECT 
OPENNSL_MPLS_SWITCH_ACTION_NOP 
OPENNSL_MPLS_SWITCH_EGRESS_ACTION_PUSH 
OPENNSL_MPLS_SWITCH_ACTION_INVALID 

Definition at line 183 of file mplsX.h.

Function Documentation

int opennsl_mpls_cleanup ( int  unit)

Detach the MPLS software module.

Description
Detach the MPLS software module, clear all hardware MPLS state.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
void opennsl_mpls_egress_label_t_init ( opennsl_mpls_egress_label_t label)

Initialize the MPLS egress label structure.

Description
Initialize the MPLS egress label structure.
Parameters
label[IN,OUT] Pointer to the struct to be initialized
Return values
None.
int opennsl_mpls_entropy_identifier_add ( int  unit,
uint32  options,
opennsl_mpls_entropy_identifier_t info 
)

Add an MPLS Entropy Label Identifier.

Description
The opennsl_mpls_entropy_identifier_t structure is used to specify an MPLS entropy label identifier. Using this API, user can configure an entropy label identifier which will be used to detect the presence of an entropy label in the label stack. Currently, the only action supported is POP. User would have to ensure not to use any of the forwarding labels as entropy label because then it would qualify as MPLS forwarding label and not entropy label. Returns OPENNSL_E_PARAM if the label or mask passed by user is invalid.
Parameters
unit[IN] Unit number.
options[IN] MPLS_ENTROPY_LABEL_*
info[IN]
Return values
OPENNSL_E_XXX
int opennsl_mpls_entropy_identifier_delete ( int  unit,
opennsl_mpls_entropy_identifier_t info 
)

Delete an MPLS Entropy Label Identifier.

Description
Deletes MLPS entropy configuration corresponding to the passed label+mask+pri key. Returns OPENNSL_E_EMPTY if no entropy label is configured. If label+mask passed by user is invalid, returns OPENNSL_E_PARAM.
Parameters
unit[IN] Unit number.
info[IN]
Return values
OPENNSL_E_XXX
int opennsl_mpls_entropy_identifier_delete_all ( int  unit)

Delete all MPLS Entropy Label Identifiers.

Description
Deletes all MPLS Entropy label identifier entries.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_mpls_entropy_identifier_get ( int  unit,
opennsl_mpls_entropy_identifier_t info 
)

Get information about an MPLS Entropy Label Identifier.

Description
On passing entropy label+mask+pri to this API, returns information of the other fields. Returns OPENNSL_E_EMPTY if no entropy label is configured. If no valid label+mask is passed by the user, information about the only configured label is returned.
Parameters
unit[IN] Unit number.
info[IN,OUT]
Return values
OPENNSL_E_XXX
void opennsl_mpls_entropy_identifier_t_init ( opennsl_mpls_entropy_identifier_t info)

Initialize MPLS Entropy label identifier structure.

Description
Initialize MPLS Entropy label identifier structure.
Parameters
info[IN,OUT] Pointer to the struct to be initialized
Return values
None.
int opennsl_mpls_entropy_identifier_traverse ( int  unit,
opennsl_mpls_entropy_identifier_traverse_cb  cb,
void *  user_data 
)

Traverse all valid MPLS entropy label identifier entries and call the supplied callback routine.

Description
Returns OPENNSL_E_EMPTY if no entropy label is configured. Traverse all valid MPLS entropy label identifier entries and call the supplied callback routine. The callback function is defined as following:.
Parameters
unit[IN] Unit number.
cb[IN] User callback function, called once per MPLS entry
user_data[IN] Cookie
Return values
OPENNSL_E_XXX
int opennsl_mpls_exp_map_create ( int  unit,
uint32  flags,
int *  exp_map_id 
)

Create an MPLS EXP map instance.

Description
Create an EXP map instance. An EXP map can be an ingress or egress EXP map as specified by the flags parameter (see below). For incoming MPLS packets, and ingress EXP map is used to translate MPLS EXP value to internal priority and color. For outgoing MPLS packets, an egress EXP map is used to translate the internal priority and color to an EXP value. The egress_L2 EXP map is used to set the 802.1p priority and CFI values for outgoing MPLS packets.
Parameters
unit[IN] Unit number.
flags[IN] OPENNSL_MPLS_EXP_MAP_*
exp_map_id[IN,OUT] Pointer to integer. If the call is successful, the EXP map ID allocated by the driver is filled into this integer location. If OPENNSL_MPLS_EXP_MAP_WITH_ID flag is set, a valid EXP map ID should be passed in.
Return values
OPENNSL_E_XXX
int opennsl_mpls_exp_map_destroy ( int  unit,
int  exp_map_id 
)

Destroy an MPLS EXP map instance.

Description
Destroy an existing EXP map instance.
Parameters
unit[IN] Unit number.
exp_map_id[IN] EXP map ID to be destroyed.
Return values
OPENNSL_E_XXX
int opennsl_mpls_exp_map_get ( int  unit,
int  exp_map_id,
opennsl_mpls_exp_map_t exp_map 
)

Get the EXP mapping parameters for the specified EXP map.

Description
Get the EXP mapping parameters for the specified EXP map. For ingress EXP maps, the specified EXP value is used to get the EXP-to-{internal priority, color} mapping. For egress EXP maps, the specified internal priority and color values are used to get the {internal priority, color}-to-EXP mapping and the {internal priority, color}-to-{802.1p priority, CFI} mapping. For egress_L2 EXP maps, the specified EXP value is used to get the EXP-to-{802.1p priority, CFI} mapping.
Parameters
unit[IN] Unit number.
exp_map_id[IN] EXP map ID
exp_map[IN,OUT] EXP map ID
Return values
OPENNSL_E_XXX
int opennsl_mpls_exp_map_set ( int  unit,
int  exp_map_id,
opennsl_mpls_exp_map_t exp_map 
)

Set the EXP mapping parameters for the specified EXP map.

Description
Set the EXP mapping parameters for the specified EXP map. For ingress EXP maps, set the EXP-to-{internal priority, color} mapping. For egress EXP maps, set the {internal priority, color}-to-EXP mapping and the {internal priority, color}-to-{802.1p priority, CFI} mapping. For egress_L2 EXP maps, set the EXP-to-{802.1p priority, CFI} mapping.
Parameters
unit[IN] Unit number.
exp_map_id[IN] EXP map ID
exp_map[IN] EXP map ID
Return values
OPENNSL_E_XXX
void opennsl_mpls_exp_map_t_init ( opennsl_mpls_exp_map_t exp_map)

Initialize the MPLS EXP map structure.

Description
Initialize the MPLS EXP map structure.
Parameters
exp_map[IN,OUT] Pointer to the struct to be initialized
Return values
None.
int opennsl_mpls_init ( int  unit)

Initialize the OPENNSL MPLS subsystem.

Description
Initialize the MPLS software module, clear all hardware MPLS state.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_mpls_label_stat_attach ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
uint32  stat_counter_id 
)

Attach counters entries to the given MPLS label and gport.

Description
This API will attach counters entries to the given MPLS label and gport. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] MPLS Gport
stat_counter_id[IN] Stat Counter ID
Return values
OPENNSL_E_xxx
int opennsl_mpls_label_stat_clear ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat 
)

Clear MPLS Stats.

Description
This API is called to clear the L2 MPLS PW Stats. The possible values for the stat parameter are: opennslMplsInBytes, opennslMplsInPkts, opennslMplsOutBytes, opennslMplsOutPkts. When =opennsl_mpls_label_stat_enable_set is available, then ingress statistics (opennslMplsInBytes, opennslMplsInPkts ) may be cleared for an enabled (label, port).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] Gport
stat[IN] Specify the Stat Type
Return values
OPENNSL_E_XXX
int opennsl_mpls_label_stat_counter_get ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Get counter statistic values for specific MPLS label and gport.

Description
This API will retrieve set of counter statistic values for specific MPLS label and gport. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] MPLS Gport
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_mpls_label_stat_counter_set ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Set counter statistic values for specific MPLS label and gport.

Description
This API will set counter statistic values for specific MPLS label and gport. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] MPLS Gport
stat[IN] Type of the counter to set that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[IN] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_mpls_label_stat_counter_sync_get ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Force an immediate counter update and retrieve counter statistic values for specific MPLS label and gport.

Description
Similar to opennsl_mpls_label_stat_counter_get(), value returned is software accumulated counter synced with the hardware counter.
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] MPLS Gport
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_mpls_label_stat_detach ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port 
)

Detach counters entries to the given MPLS label and gport.

Description
This API will detach counters entries to the given MPLS label and gport. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] MPLS Gport
Return values
OPENNSL_E_xxx
int opennsl_mpls_label_stat_enable_set ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
int  enable 
)

Enable/disable statistics collection for MPLS label or MPLS gport.

Description
For switch family switches, this will initialize statistic collection for the given (label, port) (enable=TRUE) or release the HW resources used for the tracking the statistics (enable=FALSE). If the port parameter is an MPLS gport, then this is equivalent to the.
Parameters
unit[IN] Unit number.
label[IN] MPLS label
port[IN] gport
enable[IN] Non-zero to enable counter collection, zero to disable.
Return values
OPENNSL_E_xxx
int opennsl_mpls_label_stat_get ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint64 val 
)

Get MPLS Stats.

Description
This API is called to obtain the L2 MPLS PW Stats. The possible values for the stat parameter are: opennslMplsInBytes, opennslMplsInPkts, opennslMplsOutBytes, opennslMplsOutPkts. When =opennsl_mpls_label_stat_enable_set is available, then ingress statistics (opennslMplsInBytes, opennslMplsInPkts ) may be retrieved for an enabled (label, port).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] Gport
stat[IN] Specify the Stat Type
val[OUT] Pointer to stats value
Return values
OPENNSL_E_XXX
int opennsl_mpls_label_stat_get32 ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32 val 
)

Get MPLS Stats.

Description
This API is called to obtain the L2 MPLS PW Stats. The possible values for the stat parameter are: opennslMplsInBytes, opennslMplsInPkts, opennslMplsOutBytes, opennslMplsOutPkts. When =opennsl_mpls_label_stat_enable_set is available, then ingress statistics (opennslMplsInBytes, opennslMplsInPkts ) may be retrieved for an enabled (label, port).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] Gport
stat[IN] Specify the Stat Type
val[OUT] Pointer to stats value
Return values
OPENNSL_E_XXX
int opennsl_mpls_label_stat_id_get ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32 stat_counter_id 
)

Get stat counter ID associated with given MPLS label and gport.

Description
This API will provide stat counter IDs associated with MPLS label and gport. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] MPLS Gport
stat[IN] Type of the counter
stat_counter_id[OUT] Stat Counter ID
Return values
OPENNSL_E_xxx
int opennsl_mpls_label_stat_sync_get ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint64 val 
)

Force an immediate counter update and retrieve MPLS Stats.

Description
Similar to opennsl_mpls_label_stat_get(), value returned is software accumulated counter synced with the hardware counter.
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] Gport
stat[IN] Specify the Stat Type
val[OUT] Pointer to stats value
Return values
OPENNSL_E_XXX
int opennsl_mpls_label_stat_sync_get32 ( int  unit,
opennsl_mpls_label_t  label,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32 val 
)

Force an immediate counter update and retrieve MPLS Stats.

Description
Similar to opennsl_mpls_label_stat_get(), value returned is software accumulated counter synced with the hardware counter.
Parameters
unit[IN] Unit number.
label[IN] MPLS Label
port[IN] Gport
stat[IN] Specify the Stat Type
val[OUT] Pointer to stats value
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_add ( int  unit,
opennsl_vpn_t  vpn,
opennsl_mpls_port_t mpls_port 
)

Add an MPLS port to an L2 VPN.

Description
Add an MPLS port to an L2 VPN. VPN ID may be a valid ID to add the MPLS port. When VPN ID is OPENNSL_MPLS_VPxS_VPN_INVALID, the MPLS port is added to an inactive VPN. The possible INVALID_VPN values are: OPENNSL_MPLS_VPWS_VPN_INVALID and OPENNSL_MPLS_VPLS_VPN_INVALID, the former is for VPWS VPN while the latter for VPLS VPN. OPENNSL_MPLS_PORT_WITH_ID may be used to attach/detach the mpls_port from VPN. When MPLS backup port is deleted and added back then user should pass failover id with backup port in order to associate it with primary port. Another alternate is to re-program primary port with OPENNSL_MPLS_PORT_REPLACE flag, but this might lead to intermediate traffic loss.
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
mpls_port[IN,OUT] MPLS port information
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_delete ( int  unit,
opennsl_vpn_t  vpn,
opennsl_gport_t  mpls_port_id 
)

Delete an MPLS port from an L2 VPN.

Description
Delete an MPLS port from an L2 VPN.
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
mpls_port_id[IN] Mpls port ID
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_delete_all ( int  unit,
opennsl_vpn_t  vpn 
)

Delete an MPLS port from an L2 VPN.

Description
Delete an MPLS port from an L2 VPN.
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_get ( int  unit,
opennsl_vpn_t  vpn,
opennsl_mpls_port_t mpls_port 
)

Get an MPLS port from an L2 VPN.

Description
Get an MPLS port from an L2 VPN.
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
mpls_port[IN,OUT] MPLS port information
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_get_all ( int  unit,
opennsl_vpn_t  vpn,
int  port_max,
opennsl_mpls_port_t port_array,
int *  port_count 
)

Get all MPLS ports from an L2 VPN.

Description
Get all MPLS ports from an L2 VPN.
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
port_max[IN] Maximum number of ports in array
port_array[OUT] Array of MPLS ports
port_count[OUT] Number of ports returned in array
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_stat_attach ( int  unit,
opennsl_vpn_t  vpn,
opennsl_gport_t  port,
uint32  stat_counter_id 
)

Attach counters entries to the given MPLS gport and vpn.

Description
This API will attach counters entries to the given MPLS gport and VPN. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
port[IN] MPLS Gport
stat_counter_id[IN] Stat Counter ID
Return values
OPENNSL_E_xxx
int opennsl_mpls_port_stat_counter_get ( int  unit,
opennsl_vpn_t  vpn,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Get counter statistic values for specific vpn and gport.

Description
This API will retrieve set of counter statistic values for specific vpn and gport. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
port[IN] MPLS Gport
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_mpls_port_stat_counter_set ( int  unit,
opennsl_vpn_t  vpn,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Set counter statistic values for specific vpn and gport.

Description
This API will counter statistic values for specific vpn and gport. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
port[IN] MPLS Gport
stat[IN] Type of the counter to set that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[IN] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_mpls_port_stat_counter_sync_get ( int  unit,
opennsl_vpn_t  vpn,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Force an immediate counter update and retrieve get counter statistic values for specific vpn and gport.

Description
Similar to opennsl_mpls_port_stat_counter_sync_get(), value returned is software accumulated counter synced with the hardware counter.
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
port[IN] MPLS Gport
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_xxx
int opennsl_mpls_port_stat_detach ( int  unit,
opennsl_vpn_t  vpn,
opennsl_gport_t  port 
)

Detach counters entries to the given MPLS port and vpn.

Description
This API will detach counters entries to the given MPLS port and VPN. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
port[IN] MPLS Gport
Return values
OPENNSL_E_xxx
int opennsl_mpls_port_stat_enable_set ( int  unit,
opennsl_gport_t  mpls_port,
int  enable 
)

Enable or disable collection of MPLS port statistics.

Description
Enable or disable collection of MPLS port statistics.
Parameters
unit[IN] Unit number.
mpls_port[IN] MEF port
enable[IN] Non-zero to enable counter collection, zero to disable.
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_stat_get ( int  unit,
opennsl_gport_t  mpls_port,
opennsl_cos_t  cos,
opennsl_mpls_port_stat_t  stat,
uint64 val 
)

Get the specified statistics per MPLS/MEF port.

Description
Returns the value of the specified counter for the given MEF port.
Parameters
unit[IN] Unit number.
mpls_port[IN] MEF port.
cos[IN] Class of service.
stat[IN] Type of statistics.
val[OUT] Pointer to the retrieved value.
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_stat_get32 ( int  unit,
opennsl_gport_t  mpls_port,
opennsl_cos_t  cos,
opennsl_mpls_port_stat_t  stat,
uint32 val 
)

Get the specified statistics per MPLS/MEF port.

Description
Returns the value of the specified counter for the given MEF port.
Parameters
unit[IN] Unit number.
mpls_port[IN] MEF port.
cos[IN] Class of service.
stat[IN] Type of statistics.
val[OUT] Pointer to the retrieved value.
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_stat_id_get ( int  unit,
opennsl_vpn_t  vpn,
opennsl_gport_t  port,
opennsl_mpls_stat_t  stat,
uint32 stat_counter_id 
)

Get stat counter ID associated with given MPLS gport and VPN.

Description
This API will provide stat counter IDs associated with given MPLS gport and VPN. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
port[IN] MPLS Gport
stat[IN] Type of the counter
stat_counter_id[OUT] Stat Counter ID
Return values
OPENNSL_E_xxx
int opennsl_mpls_port_stat_set ( int  unit,
opennsl_gport_t  mpls_port,
opennsl_cos_t  cos,
opennsl_mpls_port_stat_t  stat,
uint64  val 
)

Set the specified statistic to the indicated value.

Description
Set the specified statistic to the indicated value.
Parameters
unit[IN] Unit number.
mpls_port[IN] MEF port.
cos[IN] COS.
stat[IN] Type of statistics to set.
val[IN] The new value to set.
Return values
OPENNSL_E_XXX
int opennsl_mpls_port_stat_set32 ( int  unit,
opennsl_gport_t  mpls_port,
opennsl_cos_t  cos,
opennsl_mpls_port_stat_t  stat,
uint32  val 
)
Parameters
unit[IN] Unit number.
mpls_port[IN]
cos[IN]
stat[IN]
val[IN]
Return values
OPENNSL_E_xxx
void opennsl_mpls_port_t_init ( opennsl_mpls_port_t mpls_port)

Initialize the MPLS port structure.

Description
Initialize the MPLS port structure.
Parameters
mpls_port[IN,OUT] Pointer to the struct to be initialized
Return values
None.
int opennsl_mpls_range_action_add ( int  unit,
opennsl_mpls_label_t  label_low,
opennsl_mpls_label_t  label_high,
opennsl_mpls_range_action_t action 
)

Set range of labels per in lif.

Description
This API allows allocation of one in-lif per given label range.
Parameters
unit[IN] Unit number.
label_low[IN] lower label
label_high[IN] higher label
action[IN] range action
Return values
OPENNSL_E_xxx
int opennsl_mpls_range_action_get ( int  unit,
opennsl_mpls_label_t  label_low,
opennsl_mpls_label_t  label_high,
opennsl_mpls_range_action_t action 
)

Get range of labels per in lif.

Description
This API gets the action associated to a given label range.
Parameters
unit[IN] Unit number.
label_low[IN] lower label
label_high[IN] higher label
action[IN,OUT] range action
Return values
OPENNSL_E_xxx
int opennsl_mpls_range_action_remove ( int  unit,
opennsl_mpls_label_t  label_low,
opennsl_mpls_label_t  label_high 
)

Remove range of labels per in lif.

Description
This API allows removal of a given label range.
Parameters
unit[IN] Unit number.
label_low[IN] lower label
label_high[IN] higher label
Return values
OPENNSL_E_xxx
void opennsl_mpls_range_action_t_init ( opennsl_mpls_range_action_t label)

Initialize the MPLS range action structure.

Description
Initialize the MPLS range action structure.
Parameters
label[IN,OUT]
Return values
None.
int opennsl_mpls_tunnel_initiator_clear ( int  unit,
opennsl_if_t  intf 
)

Clear the MPLS tunnel initiator parameters for an L3 interface.

Description
Clear the MPLS tunnel initiator parameters for an L3 interface.
Parameters
unit[IN] Unit number.
intf[IN] The egress L3 interface
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_initiator_clear_all ( int  unit)

Clear all MPLS tunnel initiator information.

Description
Clear all MPLS tunnel initiator information.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_initiator_create ( int  unit,
opennsl_if_t  intf,
int  num_labels,
opennsl_mpls_egress_label_t label_array 
)
Parameters
unit[IN] Unit number.
intf[IN]
num_labels[IN]
label_array[IN,OUT]
Return values
OPENNSL_E_xxx
int opennsl_mpls_tunnel_initiator_get ( int  unit,
opennsl_if_t  intf,
int  label_max,
opennsl_mpls_egress_label_t label_array,
int *  label_count 
)

Get the MPLS tunnel initiator parameters from an L3 interface.

Description
Get the MPLS tunnel initiator parameters from an L3 interface.
Parameters
unit[IN] Unit number.
intf[IN] The egress L3 interface
label_max[IN] Number of entries in label_array
label_array[OUT] MPLS header information
label_count[OUT] Actual number of labels returned
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_initiator_set ( int  unit,
opennsl_if_t  intf,
int  num_labels,
opennsl_mpls_egress_label_t label_array 
)

Set the MPLS tunnel initiator parameters for an L3 interface.

Description
This API is called to set the tunnel initiator parameters for an L3 interface. The label_array contains information (label, EXP, TTL) for forming the MPLS label(s) to be pushed onto a packet entering the tunnel. The destination port information for the tunnel is specified by calling opennsl_l3_egress_create() API to create an egress object. For DNX devices, use the _create APIs. For other devices, use the _add APIs. The steps to completely setup an MPLS tunnel initiator are: .
Parameters
unit[IN] Unit number.
intf[IN] The egress L3 interface
num_labels[IN] Number of labels in the array
label_array[IN] Array of MPLS label and header information
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_stat_attach ( int  unit,
opennsl_if_t  intf_id,
uint32  stat_counter_id 
)

Attach statistics entity to the MPLS tunnel derived from the given L3 Egress interface.

Description
This API will attach statistics entity to the given MPLS tunnel derived from the given L3 Egress interface (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object
stat_counter_id[IN] Stat Counter ID
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_stat_counter_get ( int  unit,
opennsl_if_t  intf_id,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Get counter value for the specified MPLS statistic type and Tunnel interface derived from the given L3 interface ID.

Description
This API will retrieve counter values for the specified MPLS statistic type and tunnel interface deroved from the L3 Interface ID. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object.
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_stat_counter_set ( int  unit,
opennsl_if_t  intf_id,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Set the counter value for the specified MPLS statistic type and Tunnel interface derived derived from the given L3 Interface ID.

Description
This API will set counter statistic values for the derived MPLS tunnel. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object.
stat[IN] Type of the counter to set that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[IN] Pointer to counter values
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_stat_counter_sync_get ( int  unit,
opennsl_if_t  intf_id,
opennsl_mpls_stat_t  stat,
uint32  num_entries,
uint32 counter_indexes,
opennsl_stat_value_t counter_values 
)

Force an immediate counter update and retrieve the specified counter statistic for a MPLS tunnel.

Description
Similar to opennsl_mpls_tunnel_stat_counter_get(), value returned is software accumulated counter synced with the hardware counter.
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object.
stat[IN] Type of the counter to retrieve that is, ingress/egress byte/packet
num_entries[IN] Number of counter Entries
counter_indexes[IN] Pointer to Counter indexes entries
counter_values[OUT] Pointer to counter values
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_stat_detach ( int  unit,
opennsl_if_t  intf_id 
)

Detach statistics entity to the MPLS tunnel derived from the given L3 Egress interface.

Description
This API will detach statistics entity to the MPLS tunnel derived from the given L3 Egress interface. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object.
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_stat_id_get ( int  unit,
opennsl_if_t  intf_id,
opennsl_mpls_stat_t  stat,
uint32 stat_counter_id 
)

Get stat counter ID associated with the MPLS tunnel derived from the given L3 interface ID.

Description
This API will provide stat counter IDs associated with the MPLS tunnel derived from the given L3 Interface id. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
intf_id[IN] Interface ID of a egress L3 object.
stat[IN] Type of the counter
stat_counter_id[OUT] stat counter ID
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_switch_add ( int  unit,
opennsl_mpls_tunnel_switch_t info 
)

Add an MPLS label entry.

Description
The opennsl_mpls_tunnel_switch_t structure is used to specify an entry in the MPLS label table. The ingress parameters specify the entry key, action (SWAP, POP, PHP), and QOS settings. The entry key is the MPLS label and optionally the incoming port. (On network switch devices, the key may include two MPLS labels). The action_if_bos and action_if_not_bos parameters can be used on certain devices to specify different label actions for the cases of bottom-of-stack (BOS) labels and non-BOS labels. The vpn parameter is used only if the specified action is POP. This is an L3 VPN used to get the VRF (virtual route table) to use for the IPv4 or IPv6 DIP lookup. The opennsl_mpls_tunnel_switch_create API is replacing the _add API for DNX devices. For other devices, use the _add API. There are 2 modes for SWAP/LSR configuration: Mode-1: The egress parameter egress_label is only used if the action is SWAP. This parameter is used to specify the SWAP label information (label, EXP, TTL). The egress_intf parameter is only used for SWAP and PHP operations. It points to an egress object which was created using opennsl_l3_egress_create(). The egress object can be an MPLS tunnel (see opennsl_mpls_tunnel_initiator_create() API for DNX devices, opennsl_mpls_tunnel_initiator_set for other devices), for example, if the desired operation is SWAP-and-PUSH. The MPLS information (Label, EXP, TTL) within the Egress Object must be initialized to 0. Mode-2: The egress_label must be initialized to 0, and egress_if point to an Egress Object which must contain the SWAP label information (label, EXP, TTL). Although Mode-1 is maintained, Mode-2 is recommended for several reasons. The next-hop allocation happens during the creation of Egress object. No new next hops are allocated during tunnel switch creation. Multiple tunnel switch entries can point to the same egress object. For Point-to-Multipoint (P2MP) label, set flags to OPENNSL_MPLS_SWITCH_P2MP and mc_group to a valid L3 Multicast group.
Parameters
unit[IN] Unit number.
info[IN] Label (switch) information
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_switch_create ( int  unit,
opennsl_mpls_tunnel_switch_t info 
)

Add an MPLS label entry.

Description
The opennsl_mpls_tunnel_switch_t structure is used to specify an entry in the MPLS label table. The ingress parameters specify the entry key, action (SWAP, POP, PHP), and QOS settings. The entry key is the MPLS label and optionally the incoming port. (On network switch devices, the key may include two MPLS labels). The action_if_bos and action_if_not_bos parameters can be used on certain devices to specify different label actions for the cases of bottom-of-stack (BOS) labels and non-BOS labels. The vpn parameter is used only if the specified action is POP. This is an L3 VPN used to get the VRF (virtual route table) to use for the IPv4 or IPv6 DIP lookup. The opennsl_mpls_tunnel_switch_create API is replacing the _add API for DNX devices. For other devices, use the _add API. There are 2 modes for SWAP/LSR configuration: Mode-1: The egress parameter egress_label is only used if the action is SWAP. This parameter is used to specify the SWAP label information (label, EXP, TTL). The egress_intf parameter is only used for SWAP and PHP operations. It points to an egress object which was created using opennsl_l3_egress_create(). The egress object can be an MPLS tunnel (see opennsl_mpls_tunnel_initiator_create() API for DNX devices, opennsl_mpls_tunnel_initiator_set for other devices), for example, if the desired operation is SWAP-and-PUSH. The MPLS information (Label, EXP, TTL) within the Egress Object must be initialized to 0. Mode-2: The egress_label must be initialized to 0, and egress_if point to an Egress Object which must contain the SWAP label information (label, EXP, TTL). Although Mode-1 is maintained, Mode-2 is recommended for several reasons. The next-hop allocation happens during the creation of Egress object. No new next hops are allocated during tunnel switch creation. Multiple tunnel switch entries can point to the same egress object. For Point-to-Multipoint (P2MP) label, set flags to OPENNSL_MPLS_SWITCH_P2MP and mc_group to a valid L3 Multicast group.
Parameters
unit[IN] Unit number.
info[IN,OUT] Label (switch) information
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_switch_delete ( int  unit,
opennsl_mpls_tunnel_switch_t info 
)

Delete an MPLS label entry.

Description
Delete an MPLS label entry.
Parameters
unit[IN] Unit number.
info[IN] Label (switch) information
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_switch_delete_all ( int  unit)

Delete all MPLS label entries.

Description
Delete all MPLS label entries.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_mpls_tunnel_switch_get ( int  unit,
opennsl_mpls_tunnel_switch_t info 
)

Get an MPLS label entry.

Description
Get an MPLS label entry.
Parameters
unit[IN] Unit number.
info[IN,OUT] Label (switch) information
Return values
OPENNSL_E_XXX
void opennsl_mpls_tunnel_switch_t_init ( opennsl_mpls_tunnel_switch_t info)

Initialize the MPLS tunnel switch structure.

Description
Initialize the MPLS tunnel switch structure.
Parameters
info[IN,OUT] Pointer to the struct to be initialized
Return values
None.
int opennsl_mpls_tunnel_switch_traverse ( int  unit,
opennsl_mpls_tunnel_switch_traverse_cb  cb,
void *  user_data 
)

Traverse all valid MPLS label entries and call the supplied callback routine.

Description
Traverse all valid MPLS label entries and call the supplied callback routine. The callback function is defined as following:.
Parameters
unit[IN] Unit number.
cb[IN] User callback function, called once per MPLS entry
user_data[IN] Cookie
Return values
OPENNSL_E_XXX
void opennsl_mpls_vpn_config_t_init ( opennsl_mpls_vpn_config_t info)

Initialize the MPLS VPN config structure.

Description
Initialize the MPLS VPN config structure.
Parameters
info[IN,OUT] Pointer to the struct to be initialized
Return values
None.
int opennsl_mpls_vpn_id_create ( int  unit,
opennsl_mpls_vpn_config_t info 
)

Create an MPLS VPN.

Description
Create an MPLS VPN. The opennsl_mpls_vpn_config_t structure is described below:.
Parameters
unit[IN] Unit number.
info[IN,OUT] VPN info
Return values
OPENNSL_E_XXX
int opennsl_mpls_vpn_id_destroy ( int  unit,
opennsl_vpn_t  vpn 
)

Destroy an MPLS VPN.

Description
Destroy an MPLS VPN. .
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
Return values
OPENNSL_E_XXX
int opennsl_mpls_vpn_id_destroy_all ( int  unit)

Destroy an MPLS VPN.

Description
Destroy an MPLS VPN. .
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_XXX
int opennsl_mpls_vpn_id_get ( int  unit,
opennsl_vpn_t  vpn,
opennsl_mpls_vpn_config_t info 
)

Get an MPLS VPN.

Description
Get an MPLS VPN.
Parameters
unit[IN] Unit number.
vpn[IN] VPN ID
info[OUT] VPN info
Return values
OPENNSL_E_XXX
int opennsl_mpls_vpn_traverse ( int  unit,
opennsl_mpls_vpn_traverse_cb  cb,
void *  user_data 
)

Traverse all valid MPLS VPN entries and call the supplied callback routine.

Description
Traverse all valid MPLS VPN entry and call the supplied callback routine. The callback function is defined as following:.
Parameters
unit[IN] Unit number.
cb[IN] User callback function, called once per MPLS VPN entry
user_data[IN] Cookie
Return values
OPENNSL_E_XXX