OpenNSL API Guide and Reference Manual
Data Structures | Macros | Typedefs | Enumerations | Functions
vlan.h File Reference
#include <opennsl/types.h>
#include <opennsl/port.h>
#include <opennsl/vlanX.h>

Go to the source code of this file.

Data Structures

struct  opennsl_vlan_data_s
 Initialize a VLAN data information structure. More...
 
struct  opennsl_vlan_port_s
 Layer 2 Logical port type. More...
 

Macros

#define OPENNSL_VLAN_LEARN_DISABLE   0x00000001
 
#define OPENNSL_VLAN_PORT_INNER_VLAN_PRESERVE   0x00000004
 Preserve the inner VLAN tag (by default it is stripped).
 
#define OPENNSL_VLAN_PORT_OUTER_VLAN_PRESERVE   0x00000100
 Preserve the outer VLAN tag (by default it is stripped).
 
#define OPENNSL_VLAN_PORT_REPLACE   0x00000001
 Replace existing entry.
 
#define OPENNSL_VLAN_PORT_WITH_ID   0x00000002
 Add using the specified ID.
 
#define OPENNSL_VLAN_PROTO_PKT_DROP_ENABLE   0x00000004
 
#define OPENNSL_VLAN_PROTO_PKT_FLOOD_ENABLE   0x00000008
 
#define OPENNSL_VLAN_PROTO_PKT_FORWARD_ENABLE   0x00000002
 
#define OPENNSL_VLAN_PROTO_PKT_TOCPU_ENABLE   0x00000001
 

Typedefs

typedef enum
opennsl_vlan_control_port_e 
opennsl_vlan_control_port_t
 opennsl_vlan_control_port_t
 
typedef enum opennsl_vlan_control_e opennsl_vlan_control_t
 opennsl_vlan_control_t
 
typedef struct opennsl_vlan_data_s opennsl_vlan_data_t
 Initialize a VLAN data information structure.
 
typedef enum opennsl_vlan_forward_e opennsl_vlan_forward_t
 Per VLAN forwarding behavior.
 
typedef enum
opennsl_vlan_mcast_flood_e 
opennsl_vlan_mcast_flood_t
 VLAN multicast flood modes.
 
typedef enum
opennsl_vlan_port_match_e 
opennsl_vlan_port_match_t
 Logical layer 2 port match criteria.
 
typedef struct opennsl_vlan_port_s opennsl_vlan_port_t
 Layer 2 Logical port type.
 
typedef enum opennsl_vlan_stat_e opennsl_vlan_stat_t
 Types of statistics that are maintained per VLAN.
 
typedef enum
opennsl_vlan_urpf_mode_e 
opennsl_vlan_urpf_mode_t
 Per VLAN URPF Mode setting.
 
typedef enum
opennsl_vlan_vp_mc_ctrl_e 
opennsl_vlan_vp_mc_ctrl_t
 Per VLAN VP Mode control.
 

Enumerations

enum  opennsl_vlan_control_e {
  opennslVlanDropUnknown = 0,
  opennslVlanShared = 3,
  opennslVlanSharedID = 4,
  opennslVlanTranslate = 5,
  opennslVlanIgnorePktTag = 6,
  opennslVlanMemberMismatchToCpu = 21
}
 opennsl_vlan_control_t More...
 
enum  opennsl_vlan_control_port_e {
  opennslVlanTranslateIngressEnable = 2,
  opennslVlanTranslateIngressMissDrop = 4,
  opennslVlanTranslateEgressEnable = 5,
  opennslVlanTranslateEgressMissDrop = 6
}
 opennsl_vlan_control_port_t More...
 
enum  opennsl_vlan_forward_e {
  opennslVlanForwardBridging = 0,
  opennslVlanForwardSingleCrossConnect = 1,
  opennslVlanForwardDoubleCrossConnect = 2
}
 Per VLAN forwarding behavior. More...
 
enum  opennsl_vlan_mcast_flood_e {
  OPENNSL_VLAN_MCAST_FLOOD_ALL = _SHR_PORT_MCAST_FLOOD_ALL,
  OPENNSL_VLAN_MCAST_FLOOD_UNKNOWN = _SHR_PORT_MCAST_FLOOD_UNKNOWN,
  OPENNSL_VLAN_MCAST_FLOOD_NONE = _SHR_PORT_MCAST_FLOOD_NONE,
  OPENNSL_VLAN_MCAST_FLOOD_COUNT = _SHR_PORT_MCAST_FLOOD_COUNT
}
 VLAN multicast flood modes. More...
 
enum  opennsl_vlan_port_match_e {
  OPENNSL_VLAN_PORT_MATCH_INVALID = 0,
  OPENNSL_VLAN_PORT_MATCH_NONE = 1,
  OPENNSL_VLAN_PORT_MATCH_PORT = 2,
  OPENNSL_VLAN_PORT_MATCH_PORT_VLAN = 3
}
 Logical layer 2 port match criteria. More...
 
enum  opennsl_vlan_stat_e {
  opennslVlanStatPackets = 0,
  opennslVlanStatIngressPackets = opennslVlanStatPackets,
  opennslVlanStatBytes = 1,
  opennslVlanStatIngressBytes = opennslVlanStatBytes,
  opennslVlanStatEgressPackets = 2,
  opennslVlanStatEgressBytes = 3,
  opennslVlanStatForwardedPackets = 4,
  opennslVlanStatForwardedBytes = 5,
  opennslVlanStatDropPackets = 6,
  opennslVlanStatDropBytes = 7,
  opennslVlanStatUnicastPackets = 8,
  opennslVlanStatUnicastBytes = 9,
  opennslVlanStatUnicastDropPackets = 10,
  opennslVlanStatUnicastDropBytes = 11,
  opennslVlanStatNonUnicastPackets = 12,
  opennslVlanStatNonUnicastBytes = 13,
  opennslVlanStatNonUnicastDropPackets = 14,
  opennslVlanStatNonUnicastDropBytes = 15,
  opennslVlanStatL3Packets = 16,
  opennslVlanStatL3Bytes = 17,
  opennslVlanStatL3DropPackets = 18,
  opennslVlanStatL3DropBytes = 19,
  opennslVlanStatFloodPackets = 20,
  opennslVlanStatFloodBytes = 21,
  opennslVlanStatFloodDropPackets = 22,
  opennslVlanStatFloodDropBytes = 23,
  opennslVlanStatGreenPackets = 24,
  opennslVlanStatGreenBytes = 25,
  opennslVlanStatYellowPackets = 26,
  opennslVlanStatYellowBytes = 27,
  opennslVlanStatRedPackets = 28,
  opennslVlanStatRedBytes = 29,
  opennslVlanStatCount = 30
}
 Types of statistics that are maintained per VLAN. More...
 
enum  opennsl_vlan_urpf_mode_e {
  opennslVlanUrpfDisable = 0,
  opennslVlanUrpfLoose = 1,
  opennslVlanUrpfStrict = 2
}
 Per VLAN URPF Mode setting. More...
 
enum  opennsl_vlan_vp_mc_ctrl_e {
  opennslVlanVPMcControlAuto = 0,
  opennslVlanVPMcControlEnable = 1,
  opennslVlanVPMcControlDisable = 2
}
 Per VLAN VP Mode control. More...
 

Functions

void opennsl_vlan_action_set_t_init (opennsl_vlan_action_set_t *action) LIB_DLL_EXPORTED
 Initialize a VLAN tag action set structure.
 
int opennsl_vlan_control_port_set (int unit, int port, opennsl_vlan_control_port_t type, int arg) LIB_DLL_EXPORTED
 Set/get miscellaneous port-specific VLAN options.
 
int opennsl_vlan_control_set (int unit, opennsl_vlan_control_t type, int arg) LIB_DLL_EXPORTED
 Set/get miscellaneous VLAN-specific chip options.
 
int opennsl_vlan_create (int unit, opennsl_vlan_t vid) LIB_DLL_EXPORTED
 Allocate and configure a VLAN on the OPENNSL device.
 
int opennsl_vlan_default_get (int unit, opennsl_vlan_t *vid_ptr) LIB_DLL_EXPORTED
 Get the default VLAN ID.
 
int opennsl_vlan_default_set (int unit, opennsl_vlan_t vid) LIB_DLL_EXPORTED
 Set the default VLAN ID.
 
int opennsl_vlan_destroy (int unit, opennsl_vlan_t vid) LIB_DLL_EXPORTED
 Deallocate VLAN from the OPENNSL device.
 
int opennsl_vlan_destroy_all (int unit) LIB_DLL_EXPORTED
 Destroy all VLANs except the default VLAN.
 
int opennsl_vlan_gport_add (int unit, opennsl_vlan_t vlan, opennsl_gport_t port, int flags) LIB_DLL_EXPORTED
 Add a virtual or physical port to the specified VLAN.
 
int opennsl_vlan_gport_delete (int unit, opennsl_vlan_t vlan, opennsl_gport_t port) LIB_DLL_EXPORTED
 Remove a virtual or physical port from the specified VLAN.
 
int opennsl_vlan_gport_delete_all (int unit, opennsl_vlan_t vlan) LIB_DLL_EXPORTED
 Removes all virtual and physical port from the specified VLAN.
 
int opennsl_vlan_gport_get (int unit, opennsl_vlan_t vlan, opennsl_gport_t port, int *flags) LIB_DLL_EXPORTED
 Get a virtual or physical port from the specified VLAN.
 
int opennsl_vlan_list (int unit, opennsl_vlan_data_t **listp, int *countp) LIB_DLL_EXPORTED
 Returns an array of defined VLANs and their port bitmaps.
 
int opennsl_vlan_list_destroy (int unit, opennsl_vlan_data_t *list, int count) LIB_DLL_EXPORTED
 Destroy a list returned by opennsl_vlan_list.
 
int opennsl_vlan_port_add (int unit, opennsl_vlan_t vid, opennsl_pbmp_t pbmp, opennsl_pbmp_t ubmp) LIB_DLL_EXPORTED
 Add ports to the specified VLAN.
 
int opennsl_vlan_port_create (int unit, opennsl_vlan_port_t *vlan_port) LIB_DLL_EXPORTED
 Create a layer 2 logical port.
 
int opennsl_vlan_port_destroy (int unit, opennsl_gport_t gport) LIB_DLL_EXPORTED
 Destroy a layer 2 logical port.
 
int opennsl_vlan_port_find (int unit, opennsl_vlan_port_t *vlan_port) LIB_DLL_EXPORTED
 Get/find a layer 2 logical port given the GPORT ID or match criteria.
 
int opennsl_vlan_port_get (int unit, opennsl_vlan_t vid, opennsl_pbmp_t *pbmp, opennsl_pbmp_t *ubmp) LIB_DLL_EXPORTED
 Retrieves a list of the member ports of an existing VLAN.
 
int opennsl_vlan_port_remove (int unit, opennsl_vlan_t vid, opennsl_pbmp_t pbmp) LIB_DLL_EXPORTED
 Remove ports from a specified VLAN.
 
void opennsl_vlan_port_t_init (opennsl_vlan_port_t *vlan_port) LIB_DLL_EXPORTED
 Initialize the VLAN port structure.
 
int opennsl_vlan_stat_get (int unit, opennsl_vlan_t vlan, opennsl_cos_t cos, opennsl_vlan_stat_t stat, uint64 *val) LIB_DLL_EXPORTED
 Extract per-VLAN statistics from the chip.
 
int opennsl_vlan_stat_set (int unit, opennsl_vlan_t vlan, opennsl_cos_t cos, opennsl_vlan_stat_t stat, uint64 val) LIB_DLL_EXPORTED
 Set the specified statistic to the indicated value for the specified VLAN.
 
int opennsl_vlan_translate_egress_action_add (int unit, int port_class, opennsl_vlan_t outer_vlan, opennsl_vlan_t inner_vlan, opennsl_vlan_action_set_t *action) LIB_DLL_EXPORTED
 Add an entry to the egress VLAN Translation table and assign VLAN actions.
 
int opennsl_vlan_translate_egress_action_get (int unit, int port_class, opennsl_vlan_t outer_vlan, opennsl_vlan_t inner_vlan, opennsl_vlan_action_set_t *action) LIB_DLL_EXPORTED
 Get the assigned VLAN actions for egress VLAN translation on the given port class and VLAN tags.