OpenNSL API Guide and Reference Manual
Data Structures | Macros | Typedefs | Enumerations | Functions
types.h File Reference
#include <sal/types.h>
#include <sal/commdefs.h>
#include <shared/bitop.h>
#include <shared/pbmp.h>
#include <shared/gport.h>
#include <shared/types.h>
#include <shared/util.h>
#include <opennsl/typesX.h>

Go to the source code of this file.

Data Structures

struct  opennsl_etag_s
 ETAG structure. More...
 
struct  opennsl_flow_logical_field_s
 Flow Logical Field. More...
 
struct  opennsl_priority_mapping_s
 
struct  opennsl_vlan_action_set_s
 Initialize a VLAN tag action set structure. More...
 
struct  opennsl_vntag_s
 VNTAG structure. More...
 

Macros

#define OPENNSL_COS_COUNT   8
 
#define OPENNSL_COS_DEFAULT   4
 
#define OPENNSL_COS_INVALID   -1
 
#define OPENNSL_COS_MAX   7
 
#define OPENNSL_COS_MIN   0
 
#define OPENNSL_DSCP_ECN   0x100
 
#define OPENNSL_FIELD_STAT_ID_COUNTER_GET(_stat_id)   _SHR_FIELD_STAT_ID_COUNTER_GET(_stat_id)
 
#define OPENNSL_FIELD_STAT_ID_PROCESSOR_GET(_stat_id)   _SHR_FIELD_STAT_ID_PROCESSOR_GET(_stat_id)
 
#define OPENNSL_FIELD_STAT_ID_SET(_stat_id, _proc, _ctr)   _SHR_FIELD_STAT_ID_SET(_stat_id, _proc, _ctr)
 
#define OPENNSL_FLOW_MAX_NOF_LOGICAL_FIELDS   20
 
#define OPENNSL_GPORT_INVALID   _SHR_GPORT_INVALID
 
#define OPENNSL_GPORT_IS_COSQ(_gport)   _SHR_GPORT_IS_COSQ(_gport)
 
#define OPENNSL_GPORT_IS_MCAST_QUEUE_GROUP(_gport)   _SHR_GPORT_IS_MCAST_QUEUE_GROUP(_gport)
 
#define OPENNSL_GPORT_IS_SCHEDULER(_gport)   _SHR_GPORT_IS_SCHEDULER(_gport)
 
#define OPENNSL_GPORT_IS_TRAP(_gport)   _SHR_GPORT_IS_TRAP(_gport)
 
#define OPENNSL_GPORT_IS_TRUNK(_gport)   _SHR_GPORT_IS_TRUNK(_gport)
 
#define OPENNSL_GPORT_IS_UCAST_QUEUE_GROUP(_gport)   _SHR_GPORT_IS_UCAST_QUEUE_GROUP(_gport)
 
#define OPENNSL_GPORT_LOCAL_CPU   _SHR_GPORT_LOCAL_CPU
 
#define OPENNSL_GPORT_LOCAL_GET(_gport)
 
#define OPENNSL_GPORT_LOCAL_SET(_gport, _port)   _SHR_GPORT_LOCAL_SET(_gport, _port)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_CORE_GET(_gport)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_CORE_QUEUE_SET(_gport, _core, _qid)   _SHR_GPORT_MCAST_QUEUE_GROUP_CORE_QUEUE_SET(_gport, _core, _qid)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_GET(_gport)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_QID_GET(_gport)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_QUEUE_GET(_gport)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_QUEUE_SET(_gport, _qid)   _SHR_GPORT_MCAST_QUEUE_GROUP_QUEUE_SET(_gport, _qid)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_SET(_gport, _qid)   _SHR_GPORT_MCAST_QUEUE_GROUP_SET(_gport, _qid)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_SYSPORTID_GET(_gport)
 
#define OPENNSL_GPORT_MCAST_QUEUE_GROUP_SYSQID_SET(_gport, _sysport_id, _qid)   _SHR_GPORT_MCAST_QUEUE_GROUP_SYSQID_SET(_gport, _sysport_id, _qid)
 
#define OPENNSL_GPORT_MIRROR_GET(_gport)
 
#define OPENNSL_GPORT_MIRROR_SET(_gport, _value)   _SHR_GPORT_MIRROR_SET(_gport, _value)
 
#define OPENNSL_GPORT_MODPORT_MODID_GET(_gport)
 
#define OPENNSL_GPORT_MODPORT_PORT_GET(_gport)
 
#define OPENNSL_GPORT_MODPORT_SET(_gport, _module, _port)   _SHR_GPORT_MODPORT_SET(_gport, _module, _port)
 
#define OPENNSL_GPORT_SCHEDULER_CORE_GET(_gport)   _SHR_GPORT_SCHEDULER_CORE_GET(_gport)
 
#define OPENNSL_GPORT_SCHEDULER_CORE_SET(_gport, _scheduler_id, _core_id)   _SHR_GPORT_SCHEDULER_CORE_SET(_gport, _scheduler_id, _core_id)
 
#define OPENNSL_GPORT_SCHEDULER_GET(_gport)   _SHR_GPORT_SCHEDULER_GET(_gport)
 
#define OPENNSL_GPORT_SCHEDULER_NODE_SET(_gport, _scheduler_level, _scheduler_id)   _SHR_GPORT_SCHEDULER_NODE_SET(_gport, _scheduler_level,_scheduler_id)
 
#define OPENNSL_GPORT_SCHEDULER_SET(_gport, _scheduler_id)   _SHR_GPORT_SCHEDULER_SET(_gport, _scheduler_id)
 
#define OPENNSL_GPORT_TRAP_GET_ID(_gport)
 
#define OPENNSL_GPORT_TRAP_GET_SNOOP_STRENGTH(_gport)   _SHR_GPORT_TRAP_GET_SNOOP_STRENGTH(_gport)
 
#define OPENNSL_GPORT_TRAP_GET_STRENGTH(_gport)   _SHR_GPORT_TRAP_GET_STRENGTH(_gport)
 
#define OPENNSL_GPORT_TRAP_SET(_gport, _trap_id, _trap_strength, _snoop_strength)   _SHR_GPORT_TRAP_SET(_gport, _trap_id, _trap_strength, _snoop_strength)
 
#define OPENNSL_GPORT_TRUNK_GET(_gport)
 
#define OPENNSL_GPORT_TRUNK_SET(_gport, _trunk_id)   _SHR_GPORT_TRUNK_SET(_gport, _trunk_id)
 
#define OPENNSL_GPORT_TUNNEL_ID_GET(_gport)
 
#define OPENNSL_GPORT_TUNNEL_ID_SET(_gport, _tunnel_id)   (_SHR_GPORT_TUNNEL_ID_SET(_gport, _tunnel_id))
 
#define OPENNSL_GPORT_TYPE_CHILD   _SHR_GPORT_TYPE_CHILD
 
#define OPENNSL_GPORT_TYPE_COSQ   _SHR_GPORT_TYPE_COSQ
 
#define OPENNSL_GPORT_TYPE_DESTMOD_QUEUE_GROUP   _SHR_GPORT_TYPE_DESTMOD_QUEUE_GROUP
 
#define OPENNSL_GPORT_TYPE_EGRESS_CHILD   _SHR_GPORT_TYPE_EGRESS_CHILD
 
#define OPENNSL_GPORT_TYPE_EGRESS_GROUP   _SHR_GPORT_TYPE_EGRESS_GROUP
 
#define OPENNSL_GPORT_TYPE_EGRESS_MODPORT   _SHR_GPORT_TYPE_EGRESS_MODPORT
 
#define OPENNSL_GPORT_TYPE_LOCAL   _SHR_GPORT_TYPE_LOCAL
 
#define OPENNSL_GPORT_TYPE_MCAST   _SHR_GPORT_TYPE_MCAST
 
#define OPENNSL_GPORT_TYPE_MCAST_QUEUE_GROUP   _SHR_GPORT_TYPE_MCAST_QUEUE_GROUP
 
#define OPENNSL_GPORT_TYPE_MCAST_SUBSCRIBER_QUEUE_GROUP   _SHR_GPORT_TYPE_MCAST_SUBSCRIBER_QUEUE_GROUP
 
#define OPENNSL_GPORT_TYPE_MODPORT   _SHR_GPORT_TYPE_MODPORT
 
#define OPENNSL_GPORT_TYPE_NONE   _SHR_GPORT_NONE
 
#define OPENNSL_GPORT_TYPE_PROFILE   _SHR_GPORT_TYPE_PROFILE
 
#define OPENNSL_GPORT_TYPE_SCHEDULER   _SHR_GPORT_TYPE_SCHEDULER
 
#define OPENNSL_GPORT_TYPE_UCAST_QUEUE_GROUP   _SHR_GPORT_TYPE_UCAST_QUEUE_GROUP
 
#define OPENNSL_GPORT_TYPE_UCAST_SUBSCRIBER_QUEUE_GROUP   _SHR_GPORT_TYPE_UCAST_SUBSCRIBER_QUEUE_GROUP
 
#define OPENNSL_GPORT_UCAST_QUEUE_GROUP_QID_GET(_gport)
 
#define OPENNSL_GPORT_UCAST_QUEUE_GROUP_SET(_gport, _qid)   _SHR_GPORT_UCAST_QUEUE_GROUP_SET(_gport, _qid)
 
#define OPENNSL_GPORT_UCAST_QUEUE_GROUP_SYSPORTID_GET(_gport)
 
#define OPENNSL_GPORT_UCAST_QUEUE_GROUP_SYSQID_SET(_gport, _sysport_id, _qid)   _SHR_GPORT_UCAST_QUEUE_GROUP_SYSQID_SET(_gport, _sysport_id, _qid)
 
#define opennsl_htonl(_l)   (_l)
 
#define opennsl_htons(_s)   (_s)
 
#define opennsl_ntohl(_l)   (_l)
 
#define opennsl_ntohs(_s)   (_s)
 
#define OPENNSL_PBMP_AND(pbm_a, pbm_b)   _SHR_PBMP_AND(pbm_a, pbm_b)
 
#define OPENNSL_PBMP_ASSIGN(dst, src)   _SHR_PBMP_ASSIGN(dst, src)
 
#define OPENNSL_PBMP_CLEAR(pbm)   _SHR_PBMP_CLEAR(pbm)
 
#define OPENNSL_PBMP_COUNT(pbm, count)   _SHR_PBMP_COUNT(pbm, count)
 
#define OPENNSL_PBMP_EQ(pbm_a, pbm_b)   _SHR_PBMP_EQ(pbm_a, pbm_b)
 
#define OPENNSL_PBMP_IS_NULL(pbm)   _SHR_PBMP_IS_NULL(pbm)
 
#define OPENNSL_PBMP_ITER(bmp, port)   _SHR_PBMP_ITER((bmp), (port))
 
#define OPENNSL_PBMP_MEMBER(bmp, port)   _SHR_PBMP_MEMBER((bmp), (port))
 
#define OPENNSL_PBMP_NEGATE(pbm_a, pbm_b)   _SHR_PBMP_NEGATE(pbm_a, pbm_b)
 
#define OPENNSL_PBMP_NEQ(pbm_a, pbm_b)   _SHR_PBMP_NEQ(pbm_a, pbm_b)
 
#define OPENNSL_PBMP_NOT_NULL(pbm)   _SHR_PBMP_NOT_NULL(pbm)
 
#define OPENNSL_PBMP_OR(pbm_a, pbm_b)   _SHR_PBMP_OR(pbm_a, pbm_b)
 
#define OPENNSL_PBMP_PORT_ADD(pbm, port)   _SHR_PBMP_PORT_ADD(pbm, port)
 
#define OPENNSL_PBMP_PORT_FLIP(pbm, port)   _SHR_PBMP_PORT_FLIP(pbm, port)
 
#define OPENNSL_PBMP_PORT_MAX   _SHR_PBMP_PORT_MAX
 
#define OPENNSL_PBMP_PORT_REMOVE(pbm, port)   _SHR_PBMP_PORT_REMOVE(pbm, port)
 
#define OPENNSL_PBMP_PORT_SET(pbm, port)   _SHR_PBMP_PORT_SET(pbm, port)
 
#define OPENNSL_PBMP_REMOVE(pbm_a, pbm_b)   _SHR_PBMP_REMOVE(pbm_a, pbm_b)
 
#define OPENNSL_PBMP_XOR(pbm_a, pbm_b)   _SHR_PBMP_XOR(pbm_a, pbm_b)
 
#define OPENNSL_PRIO_BLACK   0x1000
 
#define OPENNSL_PRIO_CTAG   0x200
 
#define OPENNSL_PRIO_DROP_FIRST   OPENNSL_PRIO_RED
 
#define OPENNSL_PRIO_DROP_LAST   0x800
 
#define OPENNSL_PRIO_GREEN   0x400
 
#define OPENNSL_PRIO_MASK   0xff
 
#define OPENNSL_PRIO_MAX   7
 
#define OPENNSL_PRIO_MIN   0
 
#define OPENNSL_PRIO_PRESERVE   OPENNSL_PRIO_DROP_LAST
 
#define OPENNSL_PRIO_RED   0x100
 
#define OPENNSL_PRIO_SECONDARY   0x2000
 
#define OPENNSL_PRIO_STAG   0x100
 
#define OPENNSL_PRIO_YELLOW   0x200
 
#define OPENNSL_TRUNK_INVALID   ((opennsl_trunk_t) -1)
 
#define OPENNSL_VLAN_COUNT   (OPENNSL_VLAN_MAX - OPENNSL_VLAN_MIN + 1)
 
#define OPENNSL_VLAN_DEFAULT   ((opennsl_vlan_t)0x0001)
 
#define OPENNSL_VLAN_MAX   4095
 
#define OPENNSL_VLAN_MIN   0
 
#define OPENNSL_VLAN_NONE   ((opennsl_vlan_t)0x0000)
 
#define OPENNSL_VLAN_VEC_CLR(vec, n)   SHR_BITCLR(vec, n)
 
#define OPENNSL_VLAN_VEC_GET(vec, n)   SHR_BITGET(vec, n)
 
#define OPENNSL_VLAN_VEC_SET(vec, n)   SHR_BITSET(vec, n)
 
#define OPENNSL_VLAN_VEC_ZERO(vec)
 

Typedefs

typedef enum opennsl_color_e opennsl_color_t
 opennsl_color_t
 
typedef int opennsl_cos_queue_t
 opennsl_cos_queue_t
 
typedef int opennsl_cos_t
 opennsl_cos_t
 
typedef struct opennsl_etag_s opennsl_etag_t
 ETAG structure.
 
typedef uint16 opennsl_ethertype_t
 opennsl_ethertype_t
 
typedef int opennsl_fabric_distribution_t
 Multicast distribution set.
 
typedef int opennsl_failover_t
 Failover Object.
 
typedef struct
opennsl_flow_logical_field_s 
opennsl_flow_logical_field_t
 Flow Logical Field.
 
typedef int opennsl_gport_t
 GPORT (generic port) definitions.
 
typedef int opennsl_if_group_t
 opennsl_if_group_t
 
typedef int opennsl_if_t
 opennsl_if_t
 
typedef uint8 opennsl_ip6_t [16]
 opennsl_ip6_t
 
typedef uint32 opennsl_ip_t
 opennsl_ip_t
 
typedef int opennsl_l4_port_t
 opennsl_l4_port_t
 
typedef uint8 opennsl_mac_t [6]
 opennsl_mac_t
 
typedef int opennsl_module_t
 opennsl_module_t
 
typedef uint32 opennsl_mpls_label_t
 opennsl_mpls_label_t
 
typedef int opennsl_multicast_t
 opennsl_multicast_t
 
typedef _shr_pbmp_t opennsl_pbmp_t
 opennsl_pbmp_t
 
typedef int opennsl_policer_t
 opennsl_policer_t
 
typedef int opennsl_port_t
 Set the default tag protocol ID (TPID) for the specified port.
 
typedef struct
opennsl_priority_mapping_s 
opennsl_priority_mapping_t
 
typedef enum
opennsl_reserved_enum_e 
opennsl_reserved_enum_t
 
typedef int opennsl_stg_t
 opennsl_stg_t
 
typedef int opennsl_switch_network_group_t
 Split Horizon Network Group.
 
typedef int opennsl_trill_name_t
 opennsl_trill_name_t
 
typedef int opennsl_trunk_t
 opennsl_trunk_t
 
typedef int opennsl_tsn_flowset_t
 TSN flow set.
 
typedef int opennsl_tsn_pri_map_t
 TSN priority map id.
 
typedef int opennsl_tsn_sr_flowset_t
 SR flow set.
 
typedef uint32 opennsl_tunnel_id_t
 opennsl_tunnel_id_t
 
typedef struct
opennsl_vlan_action_set_s 
opennsl_vlan_action_set_t
 Initialize a VLAN tag action set structure.
 
typedef enum opennsl_vlan_action_e opennsl_vlan_action_t
 VLAN Action definitions.
 
typedef enum
opennsl_vlan_pcp_action_e 
opennsl_vlan_pcp_action_t
 VLAN Pcp Action definitions.
 
typedef uint16 opennsl_vlan_t
 opennsl_vlan_t
 
typedef enum
opennsl_vlan_tpid_action_e 
opennsl_vlan_tpid_action_t
 VLAN TPID Action definitions.
 
typedef uint32 opennsl_vlan_vector_t [_SHR_BITDCLSIZE(OPENNSL_VLAN_COUNT)]
 opennsl_vlan_vector_t
 
typedef struct opennsl_vntag_s opennsl_vntag_t
 VNTAG structure.
 
typedef opennsl_vlan_t opennsl_vpn_t
 opennsl_vpn_t
 
typedef int opennsl_vrf_t
 opennsl_vrf_t
 

Enumerations

enum  opennsl_color_e {
  opennslColorGreen = _SHR_COLOR_GREEN,
  opennslColorYellow = _SHR_COLOR_YELLOW,
  opennslColorRed = _SHR_COLOR_RED,
  opennslColorDropFirst = opennslColorRed,
  opennslColorBlack = _SHR_COLOR_BLACK,
  opennslColorPreserve = _SHR_COLOR_PRESERVE,
  opennslColorCount = _SHR_COLOR_COUNT
}
 opennsl_color_t More...
 
enum  opennsl_reserved_enum_e { opennsl_enum_reserved = 0 }
 
enum  opennsl_vlan_action_e {
  opennslVlanActionNone = 0,
  opennslVlanActionAdd = 1,
  opennslVlanActionReplace = 2,
  opennslVlanActionDelete = 3,
  opennslVlanActionCopy = 4,
  opennslVlanActionCompressed = 5,
  opennslVlanActionMappedAdd = 6,
  opennslVlanActionMappedReplace = 7,
  opennslVlanActionOuterAdd = 8,
  opennslVlanActionInnerAdd = 9
}
 VLAN Action definitions. More...
 
enum  opennsl_vlan_pcp_action_e {
  opennslVlanPcpActionNone = 0,
  opennslVlanPcpActionMapped = 1,
  opennslVlanPcpActionIngressInnerPcp = 2,
  opennslVlanPcpActionIngressOuterPcp = 3,
  opennslVlanPcpActionPortDefault = 4
}
 VLAN Pcp Action definitions. More...
 
enum  opennsl_vlan_tpid_action_e {
  opennslVlanTpidActionNone = 0,
  opennslVlanTpidActionModify = 1,
  opennslVlanTpidActionInner = 2,
  opennslVlanTpidActionOuter = 3
}
 VLAN TPID Action definitions. More...
 

Functions

int opennsl_ip6_mask_create (opennsl_ip6_t ip6, int len) LIB_DLL_EXPORTED
 
opennsl_ip_t opennsl_ip_mask_create (int len) LIB_DLL_EXPORTED