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

Data Structures

struct  opennsl_field_action_width_s
 Holds which action to set width for, and the size of width to set. More...
 
struct  opennsl_field_aset_s
 Used to specify the actions that can be taken by the entries in a group. More...
 
struct  opennsl_field_group_status_s
 Field Group Status structure. More...
 
struct  opennsl_field_presel_set_s
 Bitmap of all possible preselection specification IDs. More...
 
struct  opennsl_field_qset_s
 Field qset defines the set of fields used for lookup. More...
 

Files

file  field.h
 
file  fieldX.h
 

Macros

#define OPENNSL_FIELD_ASET_ADD(aset, q)   SHR_BITSET(((aset).w), (q))
 
#define OPENNSL_FIELD_ASET_INIT(aset)   memset(&(aset), 0, sizeof(opennsl_field_aset_t))
 
#define OPENNSL_FIELD_ASET_REMOVE(aset, q)   SHR_BITCLR(((aset).w), (q))
 
#define OPENNSL_FIELD_ASET_TEST(aset, q)   SHR_BITGET(((aset).w), (q))
 
#define OPENNSL_FIELD_COLOR_BLACK   4
 
#define OPENNSL_FIELD_COLOR_GREEN   1
 
#define OPENNSL_FIELD_COLOR_PRESERVE   0
 
#define OPENNSL_FIELD_COLOR_RED   3
 
#define OPENNSL_FIELD_COLOR_YELLOW   2
 
#define OPENNSL_FIELD_EXACT_MATCH_MASK   (~0)
 Mask parameter value.
 
#define OPENNSL_FIELD_GROUP_PRIO_ANY   -0x7fffffff
 
#define OPENNSL_FIELD_PKT_RES_CONTROL   0x1
 Ethernet control (8808).
 
#define OPENNSL_FIELD_PKT_RES_L2BC   0x3
 L2 broadcast.
 
#define OPENNSL_FIELD_PKT_RES_L2UC   0x4
 L2 unicast.
 
#define OPENNSL_FIELD_PKT_RES_L3MCKNOWN   0x7
 Known L3 multicast.
 
#define OPENNSL_FIELD_PKT_RES_L3MCUNKNOWN   0x6
 Unknown L3 multicast.
 
#define OPENNSL_FIELD_PKT_RES_L3UCKNOWN   0xa
 Known L3 unicast.
 
#define OPENNSL_FIELD_PKT_RES_L3UCUNKNOWN   0xb
 Unknown L3 unicast.
 
#define OPENNSL_FIELD_PKT_RES_UNKNOWN   0x0
 No resolution.
 
#define OPENNSL_FIELD_PRESEL_ADD(presel_set, presel_id)   SHR_BITSET(((presel_set).w), (presel_id))
 
#define OPENNSL_FIELD_PRESEL_INIT(presel_set)   memset(&(presel_set), 0, sizeof(opennsl_field_presel_set_t))
 
#define OPENNSL_FIELD_PRESEL_REMOVE(presel_set, presel_id)   SHR_BITCLR(((presel_set).w), (presel_id))
 
#define OPENNSL_FIELD_PRESEL_SEL_MAX   1024
 Maximum Preselection entries supported.
 
#define OPENNSL_FIELD_PRESEL_TEST(presel_set, presel_id)   SHR_BITGET(((presel_set).w), (presel_id))
 
#define OPENNSL_FIELD_QSET_ADD(qset, q)   SHR_BITSET(((qset).w), (q))
 
#define OPENNSL_FIELD_QSET_INIT(qset)   memset(&(qset), 0, sizeof(opennsl_field_qset_t))
 
#define OPENNSL_FIELD_QSET_REMOVE(qset, q)   SHR_BITCLR(((qset).w), (q))
 
#define OPENNSL_FIELD_QSET_TEST(qset, q)   SHR_BITGET(((qset).w), (q))
 
#define OPENNSL_FIELD_QUALIFY_MAX   (opennslFieldQualifyCount + OPENNSL_FIELD_USER_NUM_UDFS)
 Must be >= opennslFieldQualifyCount.
 
#define OPENNSL_FIELD_QUALIFY_PRESEL   0x40000000
 OR with ID when calling opennsl_field_qualify_* functions to indicate ID is a preselector instead of an entry.
 
#define OPENNSL_FIELD_RANGE_DSTPORT   0x00000002
 Check dest port range.
 
#define OPENNSL_FIELD_RANGE_INNER_VLAN   0x00000080
 Check inner VLAN ID range.
 
#define OPENNSL_FIELD_RANGE_INVERT   0x00000010
 Check for match outside specified port range.
 
#define OPENNSL_FIELD_RANGE_OUTER_VLAN   0x00000040
 Check outer VLAN ID range.
 
#define OPENNSL_FIELD_RANGE_PACKET_LENGTH   0x00000100
 Check packet length range.
 
#define OPENNSL_FIELD_RANGE_REPLACE   0x00000800
 Modify configurations of an existing range checker.
 
#define OPENNSL_FIELD_RANGE_SRCPORT   0x00000001
 Check source port range.
 
#define OPENNSL_FIELD_RANGE_TCP   0x00000004
 Check TCP port range.
 
#define OPENNSL_FIELD_RANGE_UDP   0x00000008
 Check UDP port range.
 
#define OPENNSL_FIELD_TCPCONTROL_ACK   0x10
 Ack field valid.
 
#define OPENNSL_FIELD_TCPCONTROL_FIN   0x01
 No more data.
 
#define OPENNSL_FIELD_TCPCONTROL_MASK   0x3f
 All non-reserved bits.
 
#define OPENNSL_FIELD_TCPCONTROL_PSH   0x08
 Push.
 
#define OPENNSL_FIELD_TCPCONTROL_R40   0x40
 Reserved.
 
#define OPENNSL_FIELD_TCPCONTROL_R80   0x80
 Reserved.
 
#define OPENNSL_FIELD_TCPCONTROL_RST   0x04
 Reset connection.
 
#define OPENNSL_FIELD_TCPCONTROL_SYN   0x02
 Sync seq numbers.
 
#define OPENNSL_FIELD_TCPCONTROL_URG   0x20
 Urgent field valid.
 
#define OPENNSL_FIELD_USER_NUM_UDFS   277
 

Typedefs

typedef enum opennsl_field_action_e opennsl_field_action_t
 opennsl_field_action_e
 
typedef struct
opennsl_field_action_width_s 
opennsl_field_action_width_t
 Holds which action to set width for, and the size of width to set.
 
typedef struct opennsl_field_aset_s opennsl_field_aset_t
 Used to specify the actions that can be taken by the entries in a group.
 
typedef int opennsl_field_entry_t
 Opaque handle to a field entry.
 
typedef enum
opennsl_field_group_mode_e 
opennsl_field_group_mode_t
 Group Modes (single, double or triple wide).
 
typedef struct
opennsl_field_group_status_s 
opennsl_field_group_status_t
 Field Group Status structure.
 
typedef int opennsl_field_group_t
 Opaque handle to a field group.
 
typedef int(* opennsl_field_group_traverse_cb )(int unit, opennsl_field_group_t group, void *user_data)
 
typedef enum opennsl_field_IpFrag_e opennsl_field_IpFrag_t
 Field Qualifier IpFrag (for opennsl_field_qualify_IpFrag).
 
typedef enum
opennsl_field_IpProtocolCommon_e 
opennsl_field_IpProtocolCommon_t
 Field Qualifier IpProtocolCommon (for opennsl_field_qualify_IpProtocolCommon).
 
typedef enum opennsl_field_IpType_e opennsl_field_IpType_t
 Field Qualifier IpType (for opennsl_field_qualify_IpType).
 
typedef struct
opennsl_field_presel_set_s 
opennsl_field_presel_set_t
 Bitmap of all possible preselection specification IDs.
 
typedef int opennsl_field_presel_t
 Opaque handle to a field presel.
 
typedef struct opennsl_field_qset_s opennsl_field_qset_t
 Field qset defines the set of fields used for lookup.
 
typedef enum
opennsl_field_qualify_e 
opennsl_field_qualify_t
 Field Qualifiers.
 
typedef uint32 opennsl_field_range_t
 Opaque handle to a field range.
 
typedef enum opennsl_field_stage_e opennsl_field_stage_t
 Field Stage Type.
 

Enumerations

enum  opennsl_field_action_e {
  opennslFieldActionCosQNew = 0,
  opennslFieldActionCosQCpuNew = 1,
  opennslFieldActionPrioIntNew = 14,
  opennslFieldActionDscpNew = 20,
  opennslFieldActionDscpCancel = 21,
  opennslFieldActionCopyToCpu = 23,
  opennslFieldActionCopyToCpuCancel = 24,
  opennslFieldActionRedirectPort = 29,
  opennslFieldActionRedirectTrunk = 30,
  opennslFieldActionDrop = 39,
  opennslFieldActionDropCancel = 40,
  opennslFieldActionMirrorOverride = 41,
  opennslFieldActionMirrorIngress = 42,
  opennslFieldActionMirrorEgress = 43,
  opennslFieldActionL3Switch = 48,
  opennslFieldActionRpDrop = 52,
  opennslFieldActionRpDropCancel = 53,
  opennslFieldActionRpCopyToCpu = 55,
  opennslFieldActionRpCopyToCpuCancel = 56,
  opennslFieldActionRpDscpNew = 61,
  opennslFieldActionRpDscpCancel = 62,
  opennslFieldActionRpCosQNew = 72,
  opennslFieldActionYpDrop = 84,
  opennslFieldActionYpDropCancel = 85,
  opennslFieldActionYpCopyToCpu = 87,
  opennslFieldActionYpCopyToCpuCancel = 88,
  opennslFieldActionYpDscpNew = 93,
  opennslFieldActionYpDscpCancel = 94,
  opennslFieldActionYpCosQNew = 104,
  opennslFieldActionClassDestSet = 119,
  opennslFieldActionClassSet = opennslFieldActionClassDestSet,
  opennslFieldActionClassSourceSet = 120,
  opennslFieldActionGpDrop = 136,
  opennslFieldActionGpDropCancel = 137,
  opennslFieldActionGpCopyToCpu = 139,
  opennslFieldActionGpCopyToCpuCancel = 140,
  opennslFieldActionGpDscpNew = 145,
  opennslFieldActionGpDscpCancel = 146,
  opennslFieldActionGpCosQNew = 158,
  opennslFieldActionNewClassId = 178,
  opennslFieldActionRpRedirectPort = 184,
  opennslFieldActionRpMirrorIngress = 185,
  opennslFieldActionGpRedirectPort = 204,
  opennslFieldActionGpMirrorIngress = 205,
  opennslFieldActionEgressClassSelect = 235,
  opennslFieldActionStat0 = 243,
  opennslFieldActionStat = opennslFieldActionStat0,
  opennslFieldActionPolicerLevel0 = 244,
  opennslFieldActionUsePolicerResult = 252,
  opennslFieldActionSnoop = 255,
  opennslFieldActionYpMirrorIngress = 295,
  opennslFieldActionYpRedirectPort = 296,
  opennslFieldActionIngSampleEnable = 315,
  opennslFieldActionEgrSampleEnable = 316,
  opennslFieldActionCount = 515
}
 opennsl_field_action_e More...
 
enum  opennsl_field_group_mode_e {
  opennslFieldGroupModeSingle = 0,
  opennslFieldGroupModeDouble = 1,
  opennslFieldGroupModeAuto = 4
}
 Group Modes (single, double or triple wide). More...
 
enum  opennsl_field_IpFrag_e {
  opennslFieldIpFragNon = 0,
  opennslFieldIpFragFirst = 1,
  opennslFieldIpFragNonOrFirst = 2,
  opennslFieldIpFragNotFirst = 3,
  opennslFieldIpFragAny = 4,
  opennslFieldIpFragCount = 5
}
 Field Qualifier IpFrag (for opennsl_field_qualify_IpFrag). More...
 
enum  opennsl_field_IpProtocolCommon_e {
  opennslFieldIpProtocolCommonTcp = 0,
  opennslFieldIpProtocolCommonUdp = 1,
  opennslFieldIpProtocolCommonIgmp = 2,
  opennslFieldIpProtocolCommonIcmp = 3
}
 Field Qualifier IpProtocolCommon (for opennsl_field_qualify_IpProtocolCommon). More...
 
enum  opennsl_field_IpType_e {
  opennslFieldIpTypeAny = 0,
  opennslFieldIpTypeNonIp = 1,
  opennslFieldIpTypeIpv4Not = 2,
  opennslFieldIpTypeIpv4NoOpts = 3,
  opennslFieldIpTypeIpv4WithOpts = 4,
  opennslFieldIpTypeIpv4Any = 5,
  opennslFieldIpTypeIpv6Not = 6,
  opennslFieldIpTypeIpv6NoExtHdr = 7,
  opennslFieldIpTypeIpv6OneExtHdr = 8,
  opennslFieldIpTypeIpv6TwoExtHdr = 9,
  opennslFieldIpTypeIpv6 = 10,
  opennslFieldIpTypeIp = 11,
  opennslFieldIpTypeArp = 12,
  opennslFieldIpTypeArpRequest = 13,
  opennslFieldIpTypeArpReply = 14
}
 Field Qualifier IpType (for opennsl_field_qualify_IpType). More...
 
enum  opennsl_field_qualify_e {
  opennslFieldQualifySrcIp6 = 0,
  opennslFieldQualifyDstIp6 = 1,
  opennslFieldQualifySrcMac = 6,
  opennslFieldQualifyDstMac = 7,
  opennslFieldQualifySrcIp = 9,
  opennslFieldQualifyDstIp = 10,
  opennslFieldQualifyInPort = 12,
  opennslFieldQualifyInPorts = 13,
  opennslFieldQualifyOuterVlan = 17,
  opennslFieldQualifyOuterVlanId = 18,
  opennslFieldQualifyInnerVlanId = 22,
  opennslFieldQualifyRangeCheck = 26,
  opennslFieldQualifyL4SrcPort = 27,
  opennslFieldQualifyL4DstPort = 28,
  opennslFieldQualifyEtherType = 29,
  opennslFieldQualifyIpProtocol = 30,
  opennslFieldQualifyIp6NextHeader = opennslFieldQualifyIpProtocol,
  opennslFieldQualifyDSCP = 31,
  opennslFieldQualifyTtl = 32,
  opennslFieldQualifyIp6HopLimit = opennslFieldQualifyTtl,
  opennslFieldQualifySrcPort = 35,
  opennslFieldQualifyDstPort = 40,
  opennslFieldQualifyDstTrunk = 41,
  opennslFieldQualifyTcpControl = 42,
  opennslFieldQualifyPacketRes = 43,
  opennslFieldQualifySrcClassField = 47,
  opennslFieldQualifyDstClassField = 50,
  opennslFieldQualifyIpProtocolCommon = 52,
  opennslFieldQualifyIpType = 61,
  opennslFieldQualifyStage = 67,
  opennslFieldQualifyStageIngress = 68,
  opennslFieldQualifyStageLookup = 71,
  opennslFieldQualifyStageEgress = 72,
  opennslFieldQualifyInterfaceClassPort = 81,
  opennslFieldQualifyL3Routable = 82,
  opennslFieldQualifyIpFrag = 83,
  opennslFieldQualifyL3Ingress = 85,
  opennslFieldQualifyOutPort = 86,
  opennslFieldQualifyIp4 = 87,
  opennslFieldQualifyIp6 = 88,
  opennslFieldQualifyIcmpTypeCode = 125,
  opennslFieldQualifyDstL3Egress = 131,
  opennslFieldQualifyColor = 141,
  opennslFieldQualifyMyStationHit = 153,
  opennslFieldQualifyDstIpLocal = 171,
  opennslFieldQualifyCpuQueue = 194,
  opennslFieldQualifyInterfaceClassProcessingPort = 213,
  opennslFieldQualifyIngressClassField = 269,
  opennslFieldQualifyCount = 759
}
 Field Qualifiers. More...
 
enum  opennsl_field_stage_e {
  opennslFieldStageFirst = 0,
  opennslFieldStageIngressEarly = 1,
  opennslFieldStageIngressLate = 2,
  opennslFieldStageDefault = 3,
  opennslFieldStageLast = 4,
  opennslFieldStageIngress = 5,
  opennslFieldStageEgress = 6,
  opennslFieldStageExternal = 7,
  opennslFieldStageHash = 8,
  opennslFieldStageIngressExactMatch = 9,
  opennslFieldStageIngressFlowtracker = 10,
  opennslFieldStageIngressPMF1 = 11,
  opennslFieldStageIngressPMF2 = 12,
  opennslFieldStageIngressPMF3 = 13,
  opennslFieldStageCount = 14
}
 Field Stage Type. More...
 

Functions

int opennsl_field_action_add (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action, uint32 param0, uint32 param1) LIB_DLL_EXPORTED
 Add an action to a field entry.
 
int opennsl_field_action_delete (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action, uint32 param0, uint32 param1) LIB_DLL_EXPORTED
 Delete an action from a field entry.
 
int opennsl_field_action_get (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action, uint32 *param0, uint32 *param1) LIB_DLL_EXPORTED
 Retrieve the parameters for an action previously added to a field entry.
 
int opennsl_field_action_mac_add (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action, opennsl_mac_t mac) LIB_DLL_EXPORTED
 Add an action to a field entry.
 
int opennsl_field_action_mac_get (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action, opennsl_mac_t *mac) LIB_DLL_EXPORTED
 Retrieve the parameters for an action previously added to a field entry.
 
int opennsl_field_action_ports_add (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action, opennsl_pbmp_t pbmp) LIB_DLL_EXPORTED
 Add an action to a field entry.
 
int opennsl_field_action_ports_get (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action, opennsl_pbmp_t *pbmp) LIB_DLL_EXPORTED
 Retrieve the parameters for an action previously added to a field entry.
 
int opennsl_field_action_remove (int unit, opennsl_field_entry_t entry, opennsl_field_action_t action) LIB_DLL_EXPORTED
 Remove an action from a field entry.
 
int opennsl_field_action_remove_all (int unit, opennsl_field_entry_t entry) LIB_DLL_EXPORTED
 Remove all actions from a field entry.
 
int opennsl_field_detach (int unit) LIB_DLL_EXPORTED
 De-initialize field software subsystem.
 
int opennsl_field_entry_copy (int unit, opennsl_field_entry_t src_entry, opennsl_field_entry_t *dst_entry) LIB_DLL_EXPORTED
 Create a copy of an existing field entry.
 
int opennsl_field_entry_create (int unit, opennsl_field_group_t group, opennsl_field_entry_t *entry) LIB_DLL_EXPORTED
 Create a blank field entry.
 
int opennsl_field_entry_create_id (int unit, opennsl_field_group_t group, opennsl_field_entry_t entry) LIB_DLL_EXPORTED
 Create a blank field entry.
 
int opennsl_field_entry_destroy (int unit, opennsl_field_entry_t entry) LIB_DLL_EXPORTED
 Destroy a field entry.
 
int opennsl_field_entry_destroy_all (int unit) LIB_DLL_EXPORTED
 Destroy all field entries.
 
int opennsl_field_entry_install (int unit, opennsl_field_entry_t entry) LIB_DLL_EXPORTED
 Install a field entry into the hardware tables.
 
int opennsl_field_entry_multi_get (int unit, opennsl_field_group_t group, int entry_size, opennsl_field_entry_t *entry_array, int *entry_count) LIB_DLL_EXPORTED
 Get an array of entry IDs in use in a group.
 
int opennsl_field_entry_policer_attach (int unit, opennsl_field_entry_t entry_id, int level, opennsl_policer_t policer_id) LIB_DLL_EXPORTED
 Attach a policer to a field entry.
 
int opennsl_field_entry_policer_detach (int unit, opennsl_field_entry_t entry_id, int level) LIB_DLL_EXPORTED
 Detach a policer from a field entry.
 
int opennsl_field_entry_policer_get (int unit, opennsl_field_entry_t entry_id, int level, opennsl_policer_t *policer_id) LIB_DLL_EXPORTED
 Get the policer(s) attached to a field entry.
 
int opennsl_field_entry_prio_get (int unit, opennsl_field_entry_t entry, int *prio) LIB_DLL_EXPORTED
 Get/Set the priority for an entry within a group.
 
int opennsl_field_entry_prio_set (int unit, opennsl_field_entry_t entry, int prio) LIB_DLL_EXPORTED
 Get/Set the priority for an entry within a group.
 
int opennsl_field_entry_reinstall (int unit, opennsl_field_entry_t entry) LIB_DLL_EXPORTED
 Re-install a field entry into the hardware tables.
 
int opennsl_field_entry_remove (int unit, opennsl_field_entry_t entry) LIB_DLL_EXPORTED
 Remove a field entry from the hardware tables.
 
int opennsl_field_entry_stat_attach (int unit, opennsl_field_entry_t entry, int stat_id) LIB_DLL_EXPORTED
 Attach statistics entity to Field Processor entry.
 
int opennsl_field_entry_stat_detach (int unit, opennsl_field_entry_t entry, int stat_id) LIB_DLL_EXPORTED
 Detach statistics entity from Field Processor entry.
 
int opennsl_field_entry_stat_get (int unit, opennsl_field_entry_t entry, int *stat_id) LIB_DLL_EXPORTED
 Get statistics entity attached to Field Processor entry.
 
int opennsl_field_group_action_get (int unit, opennsl_field_group_t group, opennsl_field_aset_t *aset) LIB_DLL_EXPORTED
 Change or retrieve the actions for a field group.
 
int opennsl_field_group_action_set (int unit, opennsl_field_group_t group, opennsl_field_aset_t aset) LIB_DLL_EXPORTED
 Change or retrieve the actions for a field group.
 
int opennsl_field_group_create (int unit, opennsl_field_qset_t qset, int pri, opennsl_field_group_t *group) LIB_DLL_EXPORTED
 Create a field group.
 
int opennsl_field_group_create_id (int unit, opennsl_field_qset_t qset, int pri, opennsl_field_group_t group) LIB_DLL_EXPORTED
 Create a field group.
 
int opennsl_field_group_create_mode (int unit, opennsl_field_qset_t qset, int pri, opennsl_field_group_mode_t mode, opennsl_field_group_t *group) LIB_DLL_EXPORTED
 Create a field group.
 
int opennsl_field_group_create_mode_id (int unit, opennsl_field_qset_t qset, int pri, opennsl_field_group_mode_t mode, opennsl_field_group_t group) LIB_DLL_EXPORTED
 Create a field group.
 
int opennsl_field_group_destroy (int unit, opennsl_field_group_t group) LIB_DLL_EXPORTED
 Deallocates a field group.
 
int opennsl_field_group_enable_get (int unit, opennsl_field_group_t group, int *enable) LIB_DLL_EXPORTED
 Get or set the group enable state.
 
int opennsl_field_group_enable_set (int unit, opennsl_field_group_t group, int enable) LIB_DLL_EXPORTED
 Get or set the group enable state.
 
int opennsl_field_group_get (int unit, opennsl_field_group_t group, opennsl_field_qset_t *qset) LIB_DLL_EXPORTED
 Change or retrieve the qualifiers for a field group.
 
int opennsl_field_group_install (int unit, opennsl_field_group_t group) LIB_DLL_EXPORTED
 Install all entries of a field group into the hardware tables.
 
int opennsl_field_group_presel_get (int unit, opennsl_field_group_t group, opennsl_field_presel_set_t *presel) LIB_DLL_EXPORTED
 Get the set of preselectors associated with a Field group.
 
int opennsl_field_group_presel_set (int unit, opennsl_field_group_t group, opennsl_field_presel_set_t *presel) LIB_DLL_EXPORTED
 Associate a set of preselectors with a Field group.
 
int opennsl_field_group_priority_get (int unit, opennsl_field_group_t group, int *priority) LIB_DLL_EXPORTED
 Extract priority for a group.
 
int opennsl_field_group_priority_set (int unit, opennsl_field_group_t group, int priority) LIB_DLL_EXPORTED
 Assign relative priority to a group.
 
int opennsl_field_group_set (int unit, opennsl_field_group_t group, opennsl_field_qset_t qset) LIB_DLL_EXPORTED
 Change or retrieve the qualifiers for a field group.
 
int opennsl_field_group_status_get (int unit, opennsl_field_group_t group, opennsl_field_group_status_t *status) LIB_DLL_EXPORTED
 Retrieve status of a specified field group.
 
int opennsl_field_group_traverse (int unit, opennsl_field_group_traverse_cb callback, void *user_data) LIB_DLL_EXPORTED
 Traverse all the fp groups on the device, calling a specified callback for each valid group.
 
int opennsl_field_init (int unit) LIB_DLL_EXPORTED
 Initialize field software subsystem.
 
int opennsl_field_presel_create (int unit, opennsl_field_presel_t *presel_id) LIB_DLL_EXPORTED
 Create a preselection specification.
 
int opennsl_field_presel_create_id (int unit, opennsl_field_presel_t presel_id) LIB_DLL_EXPORTED
 Create a preselection specification using a specific ID.
 
int opennsl_field_presel_destroy (int unit, opennsl_field_presel_t presel_id) LIB_DLL_EXPORTED
 Destroy a preselection specification.
 
int opennsl_field_qualifier_delete (int unit, opennsl_field_entry_t entry, opennsl_field_qualify_t qual_id) LIB_DLL_EXPORTED
 Remove match criteria from field entry.
 
int opennsl_field_qualify_Color (int unit, opennsl_field_entry_t entry, uint8 color) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Color_get (int unit, opennsl_field_entry_t entry, uint8 *color) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_CpuQueue (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_CpuQueue_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DSCP (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DSCP_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstClassField (int unit, opennsl_field_entry_t entry, uint32 data, uint32 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstClassField_get (int unit, opennsl_field_entry_t entry, uint32 *data, uint32 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstIp (int unit, opennsl_field_entry_t entry, opennsl_ip_t data, opennsl_ip_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstIp6 (int unit, opennsl_field_entry_t entry, opennsl_ip6_t data, opennsl_ip6_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstIp6_get (int unit, opennsl_field_entry_t entry, opennsl_ip6_t *data, opennsl_ip6_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstIp_get (int unit, opennsl_field_entry_t entry, opennsl_ip_t *data, opennsl_ip_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstIpLocal (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstIpLocal_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstL3Egress (int unit, opennsl_field_entry_t entry, opennsl_if_t if_id) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstL3Egress_get (int unit, opennsl_field_entry_t entry, opennsl_if_t *if_id) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstMac (int unit, opennsl_field_entry_t entry, opennsl_mac_t data, opennsl_mac_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstMac_get (int unit, opennsl_field_entry_t entry, opennsl_mac_t *data, opennsl_mac_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstPort (int unit, opennsl_field_entry_t entry, opennsl_module_t data_modid, opennsl_module_t mask_modid, opennsl_port_t data_port, opennsl_port_t mask_port) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstPort_get (int unit, opennsl_field_entry_t entry, opennsl_module_t *data_modid, opennsl_module_t *mask_modid, opennsl_port_t *data_port, opennsl_port_t *mask_port) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstTrunk (int unit, opennsl_field_entry_t entry, opennsl_trunk_t data, opennsl_trunk_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_DstTrunk_get (int unit, opennsl_field_entry_t entry, opennsl_trunk_t *data, opennsl_trunk_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_EtherType (int unit, opennsl_field_entry_t entry, uint16 data, uint16 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_EtherType_get (int unit, opennsl_field_entry_t entry, uint16 *data, uint16 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IcmpTypeCode (int unit, opennsl_field_entry_t entry, uint16 data, uint16 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IcmpTypeCode_get (int unit, opennsl_field_entry_t entry, uint16 *data, uint16 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IngressClassField (int unit, opennsl_field_entry_t entry, uint32 data, uint32 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IngressClassField_get (int unit, opennsl_field_entry_t entry, uint32 *data, uint32 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InnerVlanId (int unit, opennsl_field_entry_t entry, opennsl_vlan_t data, opennsl_vlan_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InPort (int unit, opennsl_field_entry_t entry, opennsl_port_t data, opennsl_port_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InPort_get (int unit, opennsl_field_entry_t entry, opennsl_port_t *data, opennsl_port_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InPorts (int unit, opennsl_field_entry_t entry, opennsl_pbmp_t data, opennsl_pbmp_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InPorts_get (int unit, opennsl_field_entry_t entry, opennsl_pbmp_t *data, opennsl_pbmp_t *mask) LIB_DLL_EXPORTED
 Get InPorts qualification match criteria from a field entry.
 
int opennsl_field_qualify_InterfaceClassPort (int unit, opennsl_field_entry_t entry, uint32 data, uint32 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InterfaceClassPort_get (int unit, opennsl_field_entry_t entry, uint32 *data, uint32 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InterfaceClassProcessingPort (int unit, opennsl_field_entry_t entry, uint64 data, uint64 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_InterfaceClassProcessingPort_get (int unit, opennsl_field_entry_t entry, uint64 *data, uint64 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Ip6HopLimit (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Ip6HopLimit_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Ip6NextHeader (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Ip6NextHeader_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpFrag (int unit, opennsl_field_entry_t entry, opennsl_field_IpFrag_t frag_info) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpFrag_get (int unit, opennsl_field_entry_t entry, opennsl_field_IpFrag_t *frag_info) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpProtocol (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpProtocol_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpProtocolCommon (int unit, opennsl_field_entry_t entry, opennsl_field_IpProtocolCommon_t protocol) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpProtocolCommon_get (int unit, opennsl_field_entry_t entry, opennsl_field_IpProtocolCommon_t *protocol) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpType (int unit, opennsl_field_entry_t entry, opennsl_field_IpType_t type) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_IpType_get (int unit, opennsl_field_entry_t entry, opennsl_field_IpType_t *type) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L3Ingress (int unit, opennsl_field_entry_t entry, uint32 intf_id, uint32 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L3Ingress_get (int unit, opennsl_field_entry_t entry, uint32 *data, uint32 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L3Routable (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L3Routable_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L4DstPort (int unit, opennsl_field_entry_t entry, opennsl_l4_port_t data, opennsl_l4_port_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L4DstPort_get (int unit, opennsl_field_entry_t entry, opennsl_l4_port_t *data, opennsl_l4_port_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L4SrcPort (int unit, opennsl_field_entry_t entry, opennsl_l4_port_t data, opennsl_l4_port_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_L4SrcPort_get (int unit, opennsl_field_entry_t entry, opennsl_l4_port_t *data, opennsl_l4_port_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_MyStationHit (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_MyStationHit_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_OuterVlan (int unit, opennsl_field_entry_t entry, opennsl_vlan_t data, opennsl_vlan_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_OuterVlan_get (int unit, opennsl_field_entry_t entry, opennsl_vlan_t *data, opennsl_vlan_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_OuterVlanId (int unit, opennsl_field_entry_t entry, opennsl_vlan_t data, opennsl_vlan_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_OuterVlanId_get (int unit, opennsl_field_entry_t entry, opennsl_vlan_t *data, opennsl_vlan_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_OutPort (int unit, opennsl_field_entry_t entry, opennsl_port_t data, opennsl_port_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_OutPort_get (int unit, opennsl_field_entry_t entry, opennsl_port_t *data, opennsl_port_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_PacketRes (int unit, opennsl_field_entry_t entry, uint32 data, uint32 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_PacketRes_get (int unit, opennsl_field_entry_t entry, uint32 *data, uint32 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_RangeCheck (int unit, opennsl_field_entry_t entry, opennsl_field_range_t range, int invert) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_RangeCheck_get (int unit, opennsl_field_entry_t entry, int max_count, opennsl_field_range_t *range, int *invert, int *count) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcClassField (int unit, opennsl_field_entry_t entry, uint32 data, uint32 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcClassField_get (int unit, opennsl_field_entry_t entry, uint32 *data, uint32 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcIp (int unit, opennsl_field_entry_t entry, opennsl_ip_t data, opennsl_ip_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcIp6 (int unit, opennsl_field_entry_t entry, opennsl_ip6_t data, opennsl_ip6_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcIp6_get (int unit, opennsl_field_entry_t entry, opennsl_ip6_t *data, opennsl_ip6_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcIp_get (int unit, opennsl_field_entry_t entry, opennsl_ip_t *data, opennsl_ip_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcMac (int unit, opennsl_field_entry_t entry, opennsl_mac_t data, opennsl_mac_t mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcMac_get (int unit, opennsl_field_entry_t entry, opennsl_mac_t *data, opennsl_mac_t *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcPort (int unit, opennsl_field_entry_t entry, opennsl_module_t data_modid, opennsl_module_t mask_modid, opennsl_port_t data_port, opennsl_port_t mask_port) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_SrcPort_get (int unit, opennsl_field_entry_t entry, opennsl_module_t *data_modid, opennsl_module_t *mask_modid, opennsl_port_t *data_port, opennsl_port_t *mask_port) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Stage (int unit, opennsl_field_entry_t entry, opennsl_field_stage_t data) LIB_DLL_EXPORTED
 Set qualification on a particular stage.
 
int opennsl_field_qualify_Stage_get (int unit, opennsl_field_entry_t entry, opennsl_field_stage_t *data) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_TcpControl (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_TcpControl_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Ttl (int unit, opennsl_field_entry_t entry, uint8 data, uint8 mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Ttl_get (int unit, opennsl_field_entry_t entry, uint8 *data, uint8 *mask) LIB_DLL_EXPORTED
 
int opennsl_field_qualify_Vrf (int unit, opennsl_field_entry_t entry, uint32 data, uint32 mask) LIB_DLL_EXPORTED
 
int opennsl_field_range_create (int unit, opennsl_field_range_t *range, uint32 flags, opennsl_l4_port_t min, opennsl_l4_port_t max) LIB_DLL_EXPORTED
 Allocate a range checker with specified configuration.
 
int opennsl_field_range_destroy (int unit, opennsl_field_range_t range) LIB_DLL_EXPORTED
 Destroy a virtual range checker.
 
int opennsl_field_range_get (int unit, opennsl_field_range_t range, uint32 *flags, opennsl_l4_port_t *min, opennsl_l4_port_t *max) LIB_DLL_EXPORTED
 Retrieve parameters associated with an existing range checker.
 
int opennsl_field_stat_all_set (int unit, int stat_id, uint64 value) LIB_DLL_EXPORTED
 Set 64-bit counter value to all counters.
 
int opennsl_field_stat_create (int unit, opennsl_field_group_t group, int nstat, opennsl_field_stat_t *stat_arr, int *stat_id) LIB_DLL_EXPORTED
 Create stat collection entity.
 
int opennsl_field_stat_create_id (int unit, opennsl_field_group_t group, int nstat, opennsl_field_stat_t *stat_arr, int stat_id) LIB_DLL_EXPORTED
 Create stat collection entity with specified Statistics entity ID value.
 
int opennsl_field_stat_destroy (int unit, int stat_id) LIB_DLL_EXPORTED
 Destroy stat collection entity.
 
int opennsl_field_stat_detach (int unit, uint32 stat_id) LIB_DLL_EXPORTED
 Detach counters entries to a field group.
 
int opennsl_field_stat_get (int unit, int stat_id, opennsl_field_stat_t stat, uint64 *value) LIB_DLL_EXPORTED
 Get 64-bit counter value for specific statistic type.
 
int opennsl_field_stat_id_get (int unit, opennsl_field_group_t group, uint32 stat_id, uint32 *stat_counter_id) LIB_DLL_EXPORTED
 Get flex stat counter ID associated with given field group and its associated stats ID.
 
int opennsl_field_stat_set (int unit, int stat_id, opennsl_field_stat_t stat, uint64 value) LIB_DLL_EXPORTED
 Set 64-bit counter value for specific statistic type.
 
int opennsl_field_stat_size (int unit, int stat_id, int *stat_size) LIB_DLL_EXPORTED
 Get number of counters associated with statistics entity.
 

Detailed Description

Macro Definition Documentation

#define OPENNSL_FIELD_ASET_ADD (   aset,
 
)    SHR_BITSET(((aset).w), (q))

Definition at line 363 of file fieldX.h.

Referenced by example_create_policy(), and example_fp_redirect().

#define OPENNSL_FIELD_ASET_INIT (   aset)    memset(&(aset), 0, sizeof(opennsl_field_aset_t))

Definition at line 361 of file fieldX.h.

Referenced by example_create_policy(), and example_fp_redirect().

#define OPENNSL_FIELD_ASET_REMOVE (   aset,
 
)    SHR_BITCLR(((aset).w), (q))

Definition at line 364 of file fieldX.h.

#define OPENNSL_FIELD_ASET_TEST (   aset,
 
)    SHR_BITGET(((aset).w), (q))

Definition at line 365 of file fieldX.h.

#define OPENNSL_FIELD_COLOR_BLACK   4

Definition at line 28 of file fieldX.h.

#define OPENNSL_FIELD_COLOR_GREEN   1

Definition at line 25 of file fieldX.h.

#define OPENNSL_FIELD_COLOR_PRESERVE   0

Definition at line 24 of file fieldX.h.

#define OPENNSL_FIELD_COLOR_RED   3

Definition at line 27 of file fieldX.h.

#define OPENNSL_FIELD_COLOR_YELLOW   2

Definition at line 26 of file fieldX.h.

#define OPENNSL_FIELD_EXACT_MATCH_MASK   (~0)

Mask parameter value.

Definition at line 156 of file fieldX.h.

#define OPENNSL_FIELD_GROUP_PRIO_ANY   -0x7fffffff

Definition at line 240 of file fieldX.h.

Referenced by example_create_policer(), example_fp_ip_block(), and example_fp_redirect().

#define OPENNSL_FIELD_PKT_RES_CONTROL   0x1

Ethernet control (8808).

Definition at line 39 of file fieldX.h.

#define OPENNSL_FIELD_PKT_RES_L2BC   0x3

L2 broadcast.

Definition at line 41 of file fieldX.h.

#define OPENNSL_FIELD_PKT_RES_L2UC   0x4

L2 unicast.

Definition at line 42 of file fieldX.h.

#define OPENNSL_FIELD_PKT_RES_L3MCKNOWN   0x7

Known L3 multicast.

Definition at line 44 of file fieldX.h.

#define OPENNSL_FIELD_PKT_RES_L3MCUNKNOWN   0x6

Unknown L3 multicast.

Definition at line 43 of file fieldX.h.

#define OPENNSL_FIELD_PKT_RES_L3UCKNOWN   0xa

Known L3 unicast.

Definition at line 45 of file fieldX.h.

#define OPENNSL_FIELD_PKT_RES_L3UCUNKNOWN   0xb

Unknown L3 unicast.

Definition at line 46 of file fieldX.h.

#define OPENNSL_FIELD_PKT_RES_UNKNOWN   0x0

No resolution.

Definition at line 38 of file fieldX.h.

#define OPENNSL_FIELD_PRESEL_ADD (   presel_set,
  presel_id 
)    SHR_BITSET(((presel_set).w), (presel_id))

Definition at line 368 of file fieldX.h.

#define OPENNSL_FIELD_PRESEL_INIT (   presel_set)    memset(&(presel_set), 0, sizeof(opennsl_field_presel_set_t))

Definition at line 366 of file fieldX.h.

#define OPENNSL_FIELD_PRESEL_REMOVE (   presel_set,
  presel_id 
)    SHR_BITCLR(((presel_set).w), (presel_id))

Definition at line 369 of file fieldX.h.

#define OPENNSL_FIELD_PRESEL_SEL_MAX   1024

Maximum Preselection entries supported.

Definition at line 396 of file fieldX.h.

#define OPENNSL_FIELD_PRESEL_TEST (   presel_set,
  presel_id 
)    SHR_BITGET(((presel_set).w), (presel_id))

Definition at line 370 of file fieldX.h.

#define OPENNSL_FIELD_QSET_ADD (   qset,
 
)    SHR_BITSET(((qset).w), (q))
#define OPENNSL_FIELD_QSET_INIT (   qset)    memset(&(qset), 0, sizeof(opennsl_field_qset_t))
#define OPENNSL_FIELD_QSET_REMOVE (   qset,
 
)    SHR_BITCLR(((qset).w), (q))

Definition at line 238 of file fieldX.h.

#define OPENNSL_FIELD_QSET_TEST (   qset,
 
)    SHR_BITGET(((qset).w), (q))

Definition at line 239 of file fieldX.h.

#define OPENNSL_FIELD_QUALIFY_MAX   (opennslFieldQualifyCount + OPENNSL_FIELD_USER_NUM_UDFS)

Must be >= opennslFieldQualifyCount.

Definition at line 154 of file fieldX.h.

#define OPENNSL_FIELD_QUALIFY_PRESEL   0x40000000

OR with ID when calling opennsl_field_qualify_* functions to indicate ID is a preselector instead of an entry.

Definition at line 1406 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_DSTPORT   0x00000002

Check dest port range.

Definition at line 205 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_INNER_VLAN   0x00000080

Check inner VLAN ID range.

Definition at line 213 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_INVERT   0x00000010

Check for match outside specified port range.

Definition at line 208 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_OUTER_VLAN   0x00000040

Check outer VLAN ID range.

Definition at line 211 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_PACKET_LENGTH   0x00000100

Check packet length range.

Definition at line 215 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_REPLACE   0x00000800

Modify configurations of an existing range checker.

Using this flag, the Range checker's range limits (min/max) and Type can be modified dynamically.

Definition at line 217 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_SRCPORT   0x00000001

Check source port range.

Definition at line 203 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_TCP   0x00000004

Check TCP port range.

Definition at line 206 of file fieldX.h.

#define OPENNSL_FIELD_RANGE_UDP   0x00000008

Check UDP port range.

Definition at line 207 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_ACK   0x10

Ack field valid.

Definition at line 33 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_FIN   0x01

No more data.

Definition at line 29 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_MASK   0x3f

All non-reserved bits.

Definition at line 37 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_PSH   0x08

Push.

Definition at line 32 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_R40   0x40

Reserved.

Definition at line 35 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_R80   0x80

Reserved.

Definition at line 36 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_RST   0x04

Reset connection.

Definition at line 31 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_SYN   0x02

Sync seq numbers.

Definition at line 30 of file fieldX.h.

#define OPENNSL_FIELD_TCPCONTROL_URG   0x20

Urgent field valid.

Definition at line 34 of file fieldX.h.

#define OPENNSL_FIELD_USER_NUM_UDFS   277

Definition at line 47 of file fieldX.h.

Typedef Documentation

opennsl_field_action_e

Holds which action to set width for, and the size of width to set.

Used to specify the actions that can be taken by the entries in a group.

typedef int opennsl_field_entry_t

Opaque handle to a field entry.

Definition at line 49 of file fieldX.h.

Group Modes (single, double or triple wide).

Field Group Status structure.

typedef int opennsl_field_group_t

Opaque handle to a field group.

Definition at line 52 of file fieldX.h.

typedef int(* opennsl_field_group_traverse_cb)(int unit, opennsl_field_group_t group, void *user_data)

Definition at line 613 of file fieldX.h.

Field Qualifier IpFrag (for opennsl_field_qualify_IpFrag).

Field Qualifier IpProtocolCommon (for opennsl_field_qualify_IpProtocolCommon).

Field Qualifier IpType (for opennsl_field_qualify_IpType).

Bitmap of all possible preselection specification IDs.

Opaque handle to a field presel.

Definition at line 3205 of file fieldX.h.

Field qset defines the set of fields used for lookup.

Field Qualifiers.

Field qualifiers are collected into qualifier sets (qsets), which are used to allocate field groups.

Note: These are in order of their bit width. Do not change the order or the field select code algorithm for wide-mode will get slower.

Opaque handle to a field range.

Definition at line 226 of file fieldX.h.

Field Stage Type.

Selects which pipeline stage an entry applies to.

Enumeration Type Documentation

opennsl_field_action_e

Enumerator:
opennslFieldActionCosQNew 

Change CoS Queue; param0: New CoS Queue.

opennslFieldActionCosQCpuNew 

Change CoS Queue when CopyToCpu; param0: New CoS Queue.

opennslFieldActionPrioIntNew 

Internal priority from arg; param0: New priority.

opennslFieldActionDscpNew 

Change DSCP value; param0: New DSCP value.

opennslFieldActionDscpCancel 

Override another rule.

opennslFieldActionCopyToCpu 

Copy to CPU.

opennslFieldActionCopyToCpuCancel 

Override another rule.

opennslFieldActionRedirectPort 

Redirect Packet to single port; param0: Destination modid; param1: Destination port.

opennslFieldActionRedirectTrunk 

Redirect Packet to a trunk; param0: Destination trunk ID.

opennslFieldActionDrop 

Drop.

opennslFieldActionDropCancel 

Override another rule.

opennslFieldActionMirrorOverride 

Override any mirroring for packet.

opennslFieldActionMirrorIngress 

Ingress mirror; param0: Dest modid; param1: Dest port/tgid.

opennslFieldActionMirrorEgress 

Egress mirror; param0: Dest modid; param1: Dest port/tgid.

opennslFieldActionL3Switch 

L3-switch packet; param0: ECMP or next hop info.

opennslFieldActionRpDrop 

Red Priority Drop.

opennslFieldActionRpDropCancel 

Override another rule.

opennslFieldActionRpCopyToCpu 

Red Priority Copy to CPU.

opennslFieldActionRpCopyToCpuCancel 

Override another rule.

opennslFieldActionRpDscpNew 

Red packet change DSCP value; param0: New DSCP value.

opennslFieldActionRpDscpCancel 

Override any changes to DSCP field.

opennslFieldActionRpCosQNew 

Red packet change CoS Queue; param0: New CoS Queue.

opennslFieldActionYpDrop 

Yellow Priority Drop.

opennslFieldActionYpDropCancel 

Override another rule.

opennslFieldActionYpCopyToCpu 

Yellow Priority Copy to CPU.

opennslFieldActionYpCopyToCpuCancel 

Override another rule.

opennslFieldActionYpDscpNew 

Yellow packet change DSCP value; param0: New DSCP value.

opennslFieldActionYpDscpCancel 

Override any changes to DSCP field.

opennslFieldActionYpCosQNew 

Yellow packet change CoS Queue; param0: New CoS Queue.

opennslFieldActionClassDestSet 

Set destination address lookup class ID.

opennslFieldActionClassSet 

Same as opennslFieldActionClassDestSet.

opennslFieldActionClassSourceSet 

Set source address lookup class ID.

opennslFieldActionGpDrop 

Green Priority Drop.

opennslFieldActionGpDropCancel 

Override another rule.

opennslFieldActionGpCopyToCpu 

Green Priority Copy to CPU.

opennslFieldActionGpCopyToCpuCancel 

Override another rule.

opennslFieldActionGpDscpNew 

Green packet change DSCP value; param0: New DSCP value.

opennslFieldActionGpDscpCancel 

Override any changes to DSCP field.

opennslFieldActionGpCosQNew 

Green packet change CoS Queue; param0: New CoS Queue.

opennslFieldActionNewClassId 

Assign new classification ID.

opennslFieldActionRpRedirectPort 

Redirect red packet to single port; param0: Destination modid; param1: Destination port.

opennslFieldActionRpMirrorIngress 

Red packet ingress mirror; param0: Dest modid; param1: Dest port/tgid.

opennslFieldActionGpRedirectPort 

Redirect green packet to single port; param0: Destination modid; param1: Destination port.

opennslFieldActionGpMirrorIngress 

Green packet ingress mirror; param0: Dest modid; param1: Dest port/tgid.

opennslFieldActionEgressClassSelect 

Select class to pass to EFP.

opennslFieldActionStat0 

Update statistics (statId in param0) on entry hit.

See opennsl_field_entry_stat_attach and related APIs.

opennslFieldActionStat 

Alias for opennslFieldActionStat0.

opennslFieldActionPolicerLevel0 

Apply policer (policerId in param0) to traffic hitting this entry.

See opennsl_field_entry_policer_attach and related APIs.

opennslFieldActionUsePolicerResult 

Specify/override where policer result will be used for matched packets.

See OPENNSL_FIELD_USE_POLICER_RESULT_* for flags that go in param0.

opennslFieldActionSnoop 

Snoop matched packets (treat them according to the specified snoop profile)

opennslFieldActionYpMirrorIngress 

Yellow packet ingress mirror; param0: Dest modid; param1: Dest port/tgid.

opennslFieldActionYpRedirectPort 

Redirect yellow packet to single port; param0: Destination modid; param1: Destination port.

opennslFieldActionIngSampleEnable 

Set the SFLOW Ingress Sampling.

opennslFieldActionEgrSampleEnable 

Set the SFLOW Egress Sampling.

opennslFieldActionCount 

Always Last.

Not a usable value.

Definition at line 242 of file fieldX.h.

Group Modes (single, double or triple wide).

Enumerator:
opennslFieldGroupModeSingle 

Single-wide group.

opennslFieldGroupModeDouble 

Double-wide group.

opennslFieldGroupModeAuto 

Auto-expand group based on Qset (default).

Definition at line 388 of file fieldX.h.

Field Qualifier IpFrag (for opennsl_field_qualify_IpFrag).

Enumerator:
opennslFieldIpFragNon 

Non-fragmented packet.

opennslFieldIpFragFirst 

First fragment of fragmented packet.

opennslFieldIpFragNonOrFirst 

Non-fragmented or first fragment.

opennslFieldIpFragNotFirst 

Not the first fragment.

opennslFieldIpFragAny 

Any fragment of fragmented packet.

opennslFieldIpFragCount 

Always last.

Not a usable value.

Definition at line 193 of file fieldX.h.

Field Qualifier IpProtocolCommon (for opennsl_field_qualify_IpProtocolCommon).

Enumerator:
opennslFieldIpProtocolCommonTcp 

TCP Packets (6)

opennslFieldIpProtocolCommonUdp 

UDP Packets (17)

opennslFieldIpProtocolCommonIgmp 

IGMP Packets (2)

opennslFieldIpProtocolCommonIcmp 

ICMP Packets (1)

Definition at line 184 of file fieldX.h.

Field Qualifier IpType (for opennsl_field_qualify_IpType).

Enumerator:
opennslFieldIpTypeAny 

Don't care.

opennslFieldIpTypeNonIp 

Non-Ip packet.

opennslFieldIpTypeIpv4Not 

Anything but IPv4 packets.

opennslFieldIpTypeIpv4NoOpts 

IPv4 without options.

opennslFieldIpTypeIpv4WithOpts 

IPv4 with options.

opennslFieldIpTypeIpv4Any 

Any IPv4 packet.

opennslFieldIpTypeIpv6Not 

Anything but IPv6 packets.

opennslFieldIpTypeIpv6NoExtHdr 

IPv6 packet without any extension header.

opennslFieldIpTypeIpv6OneExtHdr 

IPv6 packet with one extension header.

opennslFieldIpTypeIpv6TwoExtHdr 

IPv6 packet with two or more extension headers.

opennslFieldIpTypeIpv6 

IPv6 packet.

opennslFieldIpTypeIp 

IPv4 and IPv6 packets.

opennslFieldIpTypeArp 

ARP/RARP.

opennslFieldIpTypeArpRequest 

ARP Request.

opennslFieldIpTypeArpReply 

ARP Reply.

Definition at line 158 of file fieldX.h.

Field Qualifiers.

Field qualifiers are collected into qualifier sets (qsets), which are used to allocate field groups.

Note: These are in order of their bit width. Do not change the order or the field select code algorithm for wide-mode will get slower.

Enumerator:
opennslFieldQualifySrcIp6 

Source IPv6 Address.

opennslFieldQualifyDstIp6 

Destination IPv6 Address.

opennslFieldQualifySrcMac 

Source L2 MAC Address.

opennslFieldQualifyDstMac 

Destination L2 MAC Address.

opennslFieldQualifySrcIp 

Source IPv4 Address.

opennslFieldQualifyDstIp 

Destination IPv4 Address.

opennslFieldQualifyInPort 

Single Input Port.

opennslFieldQualifyInPorts 

Input Port Bitmap.

opennslFieldQualifyOuterVlan 

Outer VLAN.

opennslFieldQualifyOuterVlanId 

Outer VLAN Id.

opennslFieldQualifyInnerVlanId 

Inner VLAN Id.

opennslFieldQualifyRangeCheck 

TCP/UDP Port Range Check Results.

opennslFieldQualifyL4SrcPort 

TCP/UDP Source Port.

opennslFieldQualifyL4DstPort 

TCP/UDP Destination Port.

opennslFieldQualifyEtherType 

Ethernet Type.

opennslFieldQualifyIpProtocol 

IP Protocol Field.

opennslFieldQualifyIp6NextHeader 

IPv6 Next Header/IP Protocol.

opennslFieldQualifyDSCP 

Diffserv Code Point.

opennslFieldQualifyTtl 

Time To Live/Hop Limit.

opennslFieldQualifyIp6HopLimit 

IPv6 Hop Limit.

opennslFieldQualifySrcPort 

Source Module ID and Port .

opennslFieldQualifyDstPort 

Destination Module ID and Port .

opennslFieldQualifyDstTrunk 

Destination Trunk Group ID .

opennslFieldQualifyTcpControl 

TCP Control Flags.

opennslFieldQualifyPacketRes 

Pkt resolution (OPENNSL_FIELD_PKT_RES_xxx).

opennslFieldQualifySrcClassField 

Source Class based on opennslFieldStageLookup result.

opennslFieldQualifyDstClassField 

Destination Class based on opennslFieldStageLookup result.

opennslFieldQualifyIpProtocolCommon 

3: Common IP protocols.

opennslFieldQualifyIpType 

IP Type (opennslFieldIpTypeXXX).

opennslFieldQualifyStage 

Field Processor pipeline stage.

opennslFieldQualifyStageIngress 

Field Processor pipeline ingress stage.

opennslFieldQualifyStageLookup 

Field Processor pipeline lookup stage.

opennslFieldQualifyStageEgress 

Field Processor pipeline egress stage.

opennslFieldQualifyInterfaceClassPort 

Port Class Id.

opennslFieldQualifyL3Routable 

L3 routable bit for FB2.

opennslFieldQualifyIpFrag 

IP Fragment info.

opennslFieldQualifyL3Ingress 

L3 ingress interface.

opennslFieldQualifyOutPort 

Single Output Port.

opennslFieldQualifyIp4 

Qualify IpType == IPv4Any.

opennslFieldQualifyIp6 

Qualify IpType == Ipv6Any.

opennslFieldQualifyIcmpTypeCode 

internal use only.

opennslFieldQualifyDstL3Egress 

Egress Object id.

opennslFieldQualifyColor 

Packet color.

opennslFieldQualifyMyStationHit 

When RIOT is not enabled or not supported, qualifies on L2 tunnel termination lookup or Routing hit status (default).

When RIOT is supported and enabled, qualifies on L2 underlay tunnel termination lookup hit status.

opennslFieldQualifyDstIpLocal 

Dest IP is local.

opennslFieldQualifyCpuQueue 

CPU COS Queue value.

opennslFieldQualifyInterfaceClassProcessingPort 

Packet-processing Port Class ID.

opennslFieldQualifyIngressClassField 

Class Id assigned for packet by Ingress Stage.

opennslFieldQualifyCount 

Always Last.

Not a usable value.

Definition at line 63 of file fieldX.h.

Field Stage Type.

Selects which pipeline stage an entry applies to.

Enumerator:
opennslFieldStageFirst 

Earliest Field stage in device.

opennslFieldStageIngressEarly 

Early Ingress Field stage.

opennslFieldStageIngressLate 

Late Ingress Field stage.

opennslFieldStageDefault 

Default stage for device.

opennslFieldStageLast 

Latest Field stage in device.

opennslFieldStageIngress 

Ingress stage, when there is only one such.

opennslFieldStageEgress 

Egress field stage.

opennslFieldStageExternal 

External field stage.

opennslFieldStageHash 

Hashing stage.

opennslFieldStageIngressExactMatch 

Ingress exact match stage.

opennslFieldStageIngressFlowtracker 

Ingress flowtracker stage.

opennslFieldStageIngressPMF1 

Stage Ingress PMF-1.

opennslFieldStageIngressPMF2 

Stage Ingress PMF-2.

opennslFieldStageIngressPMF3 

Stage Ingress PMF-3.

opennslFieldStageCount 

Always Last.

Not a usable value.

Definition at line 134 of file fieldX.h.

Function Documentation

int opennsl_field_action_add ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action,
uint32  param0,
uint32  param1 
)

Add an action to a field entry.

Description
Adds an action to be performed when a packet matches an entry rule. Multiple actions may be added for an entry by calling this function repeatedly. FP action is applied to ports from given list that are local to the devices where packets are ingressing. See =fp_actions for the list of actions and their respective parameters .
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
param0[IN] Action-dependent value; 0 if not used
param1[IN] Action-dependent value; 0 if not used
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_RESOURCECounter not previously created for entry
OPENNSL_E_NOT_FOUNDEntry ID not found
OPENNSL_E_EXISTSAction already added
OPENNSL_E_XXXOther error code

Referenced by example_create_policer(), example_fp_ip_block(), and example_fp_redirect().

int opennsl_field_action_delete ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action,
uint32  param0,
uint32  param1 
)

Delete an action from a field entry.

Description
Deletes an action from a field entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
param0[IN] Action parameter 0.
param1[IN] Action parameter 1.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID or Action not found
OPENNSL_E_PARAMInvalid Action value
OPENNSL_E_XXXOther error code
int opennsl_field_action_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action,
uint32 param0,
uint32 param1 
)

Retrieve the parameters for an action previously added to a field entry.

Description
Retrieves the parameters used for a particular action that was previously added to a field entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
param0[OUT] Action-dependent value
param1[OUT] Action-dependent value
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID or Action not found
OPENNSL_E_PARAM*paramX points to NULL
OPENNSL_E_XXXOther error code
int opennsl_field_action_mac_add ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action,
opennsl_mac_t  mac 
)

Add an action to a field entry.

Description
Adds an action to be performed when a packet matches an entry rule. Multiple actions may be added for an entry by calling this function repeatedly. FP action is applied to ports from given list that are local to the devices where packets are ingressing. See =fp_actions for the list of actions and their respective parameters .
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
mac[IN] MAC address for actions involving src/dst mac.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_RESOURCECounter not previously created for entry
OPENNSL_E_NOT_FOUNDEntry ID not found
OPENNSL_E_EXISTSAction already added
OPENNSL_E_XXXOther error code
int opennsl_field_action_mac_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action,
opennsl_mac_t mac 
)

Retrieve the parameters for an action previously added to a field entry.

Description
Retrieves the parameters used for a particular action that was previously added to a field entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
mac[OUT] MAC address for actions involving src/dst mac.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID or Action not found
OPENNSL_E_PARAM*paramX points to NULL
OPENNSL_E_XXXOther error code
int opennsl_field_action_ports_add ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action,
opennsl_pbmp_t  pbmp 
)

Add an action to a field entry.

Description
Adds an action to be performed when a packet matches an entry rule. Multiple actions may be added for an entry by calling this function repeatedly. FP action is applied to ports from given list that are local to the devices where packets are ingressing. See =fp_actions for the list of actions and their respective parameters .
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
pbmp[IN] pbmp for actions involving port bitmap
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_RESOURCECounter not previously created for entry
OPENNSL_E_NOT_FOUNDEntry ID not found
OPENNSL_E_EXISTSAction already added
OPENNSL_E_XXXOther error code
int opennsl_field_action_ports_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action,
opennsl_pbmp_t pbmp 
)

Retrieve the parameters for an action previously added to a field entry.

Description
Retrieves the parameters used for a particular action that was previously added to a field entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
pbmp[OUT] pbmp for actions involving port bitmap
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID or Action not found
OPENNSL_E_PARAM*paramX points to NULL
OPENNSL_E_XXXOther error code
int opennsl_field_action_remove ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_action_t  action 
)

Remove an action from a field entry.

Description
Removes an action from a field entry. Same as opennsl_field_action_delete for actions without parameters. Can be used on some architectures to remove actions that have parameters, without requiring that the parameters be specified. Also used to remove a direct extraction action from an entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
action[IN] Field action value
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID or Action not found
OPENNSL_E_PARAMInvalid Action value
OPENNSL_E_XXXOther error code
int opennsl_field_action_remove_all ( int  unit,
opennsl_field_entry_t  entry 
)

Remove all actions from a field entry.

Description
Removes all actions from a field entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID not found
int opennsl_field_detach ( int  unit)

De-initialize field software subsystem.

Description
Uninitializes the field software and hardware subsystem. Disables field support in the hardware and releases memory resources held by the software module.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_XXXOther errors
int opennsl_field_entry_copy ( int  unit,
opennsl_field_entry_t  src_entry,
opennsl_field_entry_t dst_entry 
)

Create a copy of an existing field entry.

Description
Creates a copy of an existing field entry. The _id variant requests that a particular entry identifier be assigned. The entry identifier is the same as the priority of the entry. Higher numbers represent higher priority. The value must be in the range prio_min through prio_max (as returned by.
Parameters
unit[IN] Unit number.
src_entry[IN] Field entry ID to copy from
dst_entry[OUT] (for _copy_id) New entry copied from src_entry
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDSource entry ID not found
OPENNSL_E_EXISTSRequested entry ID already exists
OPENNSL_E_XXXOther error code
int opennsl_field_entry_create ( int  unit,
opennsl_field_group_t  group,
opennsl_field_entry_t entry 
)

Create a blank field entry.

Description
Creates an empty field entry based on a field group. The _id variant requests that a particular entry identifier be assigned. Entry IDs 0xFFFFFFFF to 0xFFFFF000 are reserved for internal use. To destroy the field entry, use =opennsl_field_entry_destroy api.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
entry[OUT] (for _create_id) Field entry ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID not found in unit
OPENNSL_E_EXISTSRequested entry ID already exists
OPENNSL_E_BADIDRequested entry ID out-of-range
OPENNSL_E_PARAM*entry points to NULL
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_RESOURCENo unused entries available

Referenced by example_create_policer(), example_create_policy(), and example_fp_ip_block().

int opennsl_field_entry_create_id ( int  unit,
opennsl_field_group_t  group,
opennsl_field_entry_t  entry 
)

Create a blank field entry.

Description
Creates an empty field entry based on a field group. The _id variant requests that a particular entry identifier be assigned. Entry IDs 0xFFFFFFFF to 0xFFFFF000 are reserved for internal use. To destroy the field entry, use =opennsl_field_entry_destroy api.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
entry[IN] (for _create_id) Field entry ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID not found in unit
OPENNSL_E_EXISTSRequested entry ID already exists
OPENNSL_E_BADIDRequested entry ID out-of-range
OPENNSL_E_PARAM*entry points to NULL
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_RESOURCENo unused entries available

Referenced by example_fp_redirect().

int opennsl_field_entry_destroy ( int  unit,
opennsl_field_entry_t  entry 
)

Destroy a field entry.

Description
This API deallocates the memory, which contains a software field entry. If the entry has been installed in hardware, the function would invoke a opennsl_field_entry_remove API to clean up the entry in hardware and free hardware resources. .
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID not found in unit
OPENNSL_E_XXXOther error code

Referenced by main().

int opennsl_field_entry_destroy_all ( int  unit)

Destroy all field entries.

Description
Destroys all field entries.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_XXXOther Error code
int opennsl_field_entry_install ( int  unit,
opennsl_field_entry_t  entry 
)

Install a field entry into the hardware tables.

Description
Installs an entry into the hardware tables. The entry should be configured before installing by adding qualifications using.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID not found
OPENNSL_E_XXXOther error code

Referenced by example_create_policer(), and example_fp_ip_block().

int opennsl_field_entry_multi_get ( int  unit,
opennsl_field_group_t  group,
int  entry_size,
opennsl_field_entry_t entry_array,
int *  entry_count 
)

Get an array of entry IDs in use in a group.

Description
Fills an array with the entry IDs for the specified group. This should first be called with an entry_size of 0 to get the number of entries to be returned, so that an appropriately-sized array can be allocated.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
entry_size[IN] The maximum number of entry IDs to return. If 0, the number of entries is returned
entry_array[OUT] A pointer to a memory buffer to hold the array of IDs
entry_count[OUT] A pointer to store the number of entries returned or, if entry_size is 0, the number of entries available
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID not found in unit
OPENNSL_E_MEMORYMemory allocation failure
int opennsl_field_entry_policer_attach ( int  unit,
opennsl_field_entry_t  entry_id,
int  level,
opennsl_policer_t  policer_id 
)

Attach a policer to a field entry.

Description
Attach a policer to a field entry. Global policers associated with Lookup stage entries are given highest priority over policers associated with other resources (Port, Vlan translate etc) when following flag is specified in level parameter. OPENNSL_FIELD_POLICER_GLOBAL_METER_USE_STAGE_LOOKUP_ACTION 0x1 See opennsl_policer_xxx APIs for policer creation and properties definition.
Parameters
unit[IN] Unit number.
entry_id[IN] Field entry ID.
level[IN] Policer level.
policer_id[IN] Policer ID.
Return values
OPENNSL_E_XXX

Referenced by example_create_policer(), and example_create_policy().

int opennsl_field_entry_policer_detach ( int  unit,
opennsl_field_entry_t  entry_id,
int  level 
)

Detach a policer from a field entry.

When the API is called, the policer is marked as detached but it is not completely detached from the entry. This is because, the policer and meter entries are updated in the hardware during entry re-install. So, this API should always be followed by entry remove or entry re-install to completely detach the policer from the entry.

Description
Detach a policer from a field entry.
Parameters
unit[IN] Unit number.
entry_id[IN] Field entry ID.
level[IN] Policer level.
Return values
OPENNSL_E_XXX
int opennsl_field_entry_policer_get ( int  unit,
opennsl_field_entry_t  entry_id,
int  level,
opennsl_policer_t policer_id 
)

Get the policer(s) attached to a field entry.

Description
Get the policer(s) attached to a field entry.
Parameters
unit[IN] Unit number.
entry_id[IN] Field entry ID.
level[IN] Policer level.
policer_id[OUT] Policer ID.
Return values
OPENNSL_E_XXX
int opennsl_field_entry_prio_get ( int  unit,
opennsl_field_entry_t  entry,
int *  prio 
)

Get/Set the priority for an entry within a group.

Description
Sets or gets the priority class of an entry within a group. Entries with higher priority values take precedence over entries with lower values. Since TCAM lookups start at low indexes, precedence within a physical slice is the reverse of this. The effect of this is that entries with the greatest priority will have the lowest TCAM index. Change in Field entry priority may require movement of the entry in the same or across the slices. Stat, Policer attached to an entry must be moved in hardware during entry move operation if CAP stage does not support global counters and global meters. Entries should have only positive priority values. Negative ones are reserved for pre-defined cases. Currently there are four predefined cases:.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
prio[OUT] (for _set) Entry priority
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit/Field stage not initialized
OPENNSL_E_NOT_FOUND
\retvalGroup ID/Field Entry ID/Field stage not found
inunit
\retvalPolicer ID attached to entry not found.
\retvalStat ID attached to entry not found.
\retvalOPENNSL_E_PARAM
\retval*entry points to NULL (opennsl_field_entry_prio_get)
\retvalPreliminary resource check before actual entry
moveoperation detects that no free entry is
availablein target slice.
\retvalIn device CAP stage that do not support global meter
poolsand global counter pools, entry move requires
aStat, Policer move in hardware and preliminary
resourcecheck before actual entry move operation
detectsthat no free counters, meters are available
intarget slice.
\retvalOPENNSL_E_INTERNAL
\retvalInvalid hardware resource allocation by other
FieldAPI's (could be wrong slice id, policer slice
index),althoughthis should not happen.
\retvalInvalid Field entry id.
\retvalInvalid Policer slice index.
\retvalInvalid hardware meter/counter index.
\retvalOPENNSL_E_CONFIG
\retvalIf change in priority of field entry requires
movementof the entry and there are no free
entriesin any of the slices belonging to
thisgroup,
\retvalInvalid Flex Stat mode in Lookup Stage
\retvalOPENNSL_E_RESOURCE This error code is returned when Stat, Policer
attachedto an entry must be moved in hardware
duringentry move operation as device CAP stage
doesnot support global counters and global
metersand no meters, counters are available
inthe target slice while actual entry move
happens.
OPENNSL_E_UNAVAILUnknown Field external stage (opennsl_field_entry_prio_set).
int opennsl_field_entry_prio_set ( int  unit,
opennsl_field_entry_t  entry,
int  prio 
)

Get/Set the priority for an entry within a group.

Description
Sets or gets the priority class of an entry within a group. Entries with higher priority values take precedence over entries with lower values. Since TCAM lookups start at low indexes, precedence within a physical slice is the reverse of this. The effect of this is that entries with the greatest priority will have the lowest TCAM index. Change in Field entry priority may require movement of the entry in the same or across the slices. Stat, Policer attached to an entry must be moved in hardware during entry move operation if CAP stage does not support global counters and global meters. Entries should have only positive priority values. Negative ones are reserved for pre-defined cases. Currently there are four predefined cases:.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
prio[IN] (for _set) Entry priority
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit/Field stage not initialized
OPENNSL_E_NOT_FOUND
\retvalGroup ID/Field Entry ID/Field stage not found
inunit
\retvalPolicer ID attached to entry not found.
\retvalStat ID attached to entry not found.
\retvalOPENNSL_E_PARAM
\retval*entry points to NULL (opennsl_field_entry_prio_get)
\retvalPreliminary resource check before actual entry
moveoperation detects that no free entry is
availablein target slice.
\retvalIn device CAP stage that do not support global meter
poolsand global counter pools, entry move requires
aStat, Policer move in hardware and preliminary
resourcecheck before actual entry move operation
detectsthat no free counters, meters are available
intarget slice.
\retvalOPENNSL_E_INTERNAL
\retvalInvalid hardware resource allocation by other
FieldAPI's (could be wrong slice id, policer slice
index),althoughthis should not happen.
\retvalInvalid Field entry id.
\retvalInvalid Policer slice index.
\retvalInvalid hardware meter/counter index.
\retvalOPENNSL_E_CONFIG
\retvalIf change in priority of field entry requires
movementof the entry and there are no free
entriesin any of the slices belonging to
thisgroup,
\retvalInvalid Flex Stat mode in Lookup Stage
\retvalOPENNSL_E_RESOURCE This error code is returned when Stat, Policer
attachedto an entry must be moved in hardware
duringentry move operation as device CAP stage
doesnot support global counters and global
metersand no meters, counters are available
inthe target slice while actual entry move
happens.
OPENNSL_E_UNAVAILUnknown Field external stage (opennsl_field_entry_prio_set).
int opennsl_field_entry_reinstall ( int  unit,
opennsl_field_entry_t  entry 
)

Re-install a field entry into the hardware tables.

Description
Re-installs an entry into the hardware tables. This call may only be used to change the actions associated with an entry that is already installed in the hardware table. It avoids the need to completely delete and re-add the entry. Hitless entry install: Hitless entry install provides the capability to apply existing rules of the already installed entry to the incoming traffic while updating new modifications on the entry in the hardware tables. For achieving entry hitless update, it is recommended that the entries created in a group should have unique priority. Eventhough entry installation might not result in hitless update in the following cases 1. Entry hitless update can't be achieved if all the slices are full with entries. 2. Entry installation might not result in hitless update if non-global counters/flex stats or non-global meters are attached to the entry. In the above two cases entry installation might result in error, if config property field_atomic_update is set.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID not found
OPENNSL_E_XXXOther error code
int opennsl_field_entry_remove ( int  unit,
opennsl_field_entry_t  entry 
)

Remove a field entry from the hardware tables.

Description
Removes an entry from the hardware tables. This does not destroy the entry; it only uninstalls it from the hardware tables. Destroy an entry using =opennsl_field_entry_destroy .
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDEntry ID not found
OPENNSL_E_XXXOther error code
int opennsl_field_entry_stat_attach ( int  unit,
opennsl_field_entry_t  entry,
int  stat_id 
)

Attach statistics entity to Field Processor entry.

Description
The purpose of this API is to attach statistics collection entity to a field entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID.
stat_id[IN] Statistics entity ID.
Return values
OPENNSL_E_XXX

Referenced by example_create_policer(), and example_create_policy().

int opennsl_field_entry_stat_detach ( int  unit,
opennsl_field_entry_t  entry,
int  stat_id 
)

Detach statistics entity from Field Processor entry.

Description
The purpose of this API is to detach statistics collection entity from a field entry. To create a stat_id use macro FIELD_STAT_ID_SET(stat_id, engine_id, counter_id).
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID.
stat_id[IN] Statistics entity ID.
Return values
OPENNSL_E_XXX

Referenced by main().

int opennsl_field_entry_stat_get ( int  unit,
opennsl_field_entry_t  entry,
int *  stat_id 
)

Get statistics entity attached to Field Processor entry.

Description
The purpose of this API is to check if any statistics collection entity is attached to field entry. To get the counter engine ID from stat_id use macro OPENNSL_FIELD_STAT_ID_PROCESSOR_GET(stat_id) To get the counter ID from stat_id use macro OPENNSL_FIELD_STAT_ID_COUNTER_GET(stat_id).
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID.
stat_id[OUT] Statistics entity ID.
Return values
OPENNSL_E_XXX

Referenced by main().

int opennsl_field_group_action_get ( int  unit,
opennsl_field_group_t  group,
opennsl_field_aset_t aset 
)

Change or retrieve the actions for a field group.

Description
The set call changes the action set for the specified group. If no entries exist in this group, then updates are always permitted. If entries exist, then updates are permitted only if it can be satisfied with the current selection of field action encodings dependent on chip architecture. It is assumed that existing entries are depending on the Aset present when the entries were created. This means that setting a new Aset will only add actions. If the old Aset contains actions that do not exist in the new Aset, a union of the two Asets will be performed in the setting operation. The get call retrieves the action set for a specified group.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
aset[OUT] (for _set) Field action set
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_PARAMqset points to NULL
int opennsl_field_group_action_set ( int  unit,
opennsl_field_group_t  group,
opennsl_field_aset_t  aset 
)

Change or retrieve the actions for a field group.

Description
The set call changes the action set for the specified group. If no entries exist in this group, then updates are always permitted. If entries exist, then updates are permitted only if it can be satisfied with the current selection of field action encodings dependent on chip architecture. It is assumed that existing entries are depending on the Aset present when the entries were created. This means that setting a new Aset will only add actions. If the old Aset contains actions that do not exist in the new Aset, a union of the two Asets will be performed in the setting operation. The get call retrieves the action set for a specified group.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
aset[IN] (for _set) Field action set
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_PARAMqset points to NULL

Referenced by example_create_policy(), and example_fp_redirect().

int opennsl_field_group_create ( int  unit,
opennsl_field_qset_t  qset,
int  pri,
opennsl_field_group_t group 
)

Create a field group.

Description
Creates a field group with a specified priority and qualifier set. The _id variant requests that a particular group identifier be assigned, and may be useful when handles are desired to be the same across multiple chips. opennsl_field_group_wlan_xxx groups apply to WLAN tunnel terminated frames. Incoming port can not be used as match criteria for WLAN traffic. It is recommended to use opennsl_field_group_config_create API for the devices which support Policy tables in PPD format (policy data stored in an encoded manner). By default, all the actions supported in ingress stage are considered if no action (ASET) is mentioned during group create. And hence the group will be created with intra-slice mode though QSET fits in single-wide mode.
Parameters
unit[IN] Unit number.
qset[IN] Field qualifier set
pri[IN] Priority within allowable range or OPENNSL_FIELD_GROUP_PRIO_ANY to automatically assign a priority. Higher numerical value for priority has better priority for conflict resolution when there is a search hit on multiple slices. See =fp_groups for priority value restrictions.
group[OUT] (for _create_id and _create_mode_id) Field group ID
Return values
OPENNSL_E_NONESuccessful creation of group
OPENNSL_E_INITField module not initialized on unit
OPENNSL_E_RESOURCEHardware slice/port unavailable or no select codes can satisfy Qset.
OPENNSL_E_CONFIGIf device does not support virtual group priority feature, then this error code is returned when specified priority value is already assigned to another group.
OPENNSL_E_PARAMPriority out of range
OPENNSL_E_EXISTSRequested group ID already exists
OPENNSL_E_MEMORYAllocation failure
OPENNSL_E_XXXOther error code

Referenced by example_create_policer(), and example_fp_ip_block().

int opennsl_field_group_create_id ( int  unit,
opennsl_field_qset_t  qset,
int  pri,
opennsl_field_group_t  group 
)

Create a field group.

Description
Creates a field group with a specified priority and qualifier set. The _id variant requests that a particular group identifier be assigned, and may be useful when handles are desired to be the same across multiple chips. opennsl_field_group_wlan_xxx groups apply to WLAN tunnel terminated frames. Incoming port can not be used as match criteria for WLAN traffic. It is recommended to use opennsl_field_group_config_create API for the devices which support Policy tables in PPD format (policy data stored in an encoded manner). By default, all the actions supported in ingress stage are considered if no action (ASET) is mentioned during group create. And hence the group will be created with intra-slice mode though QSET fits in single-wide mode.
Parameters
unit[IN] Unit number.
qset[IN] Field qualifier set
pri[IN] Priority within allowable range or OPENNSL_FIELD_GROUP_PRIO_ANY to automatically assign a priority. Higher numerical value for priority has better priority for conflict resolution when there is a search hit on multiple slices. See =fp_groups for priority value restrictions.
group[IN] (for _create_id and _create_mode_id) Field group ID
Return values
OPENNSL_E_NONESuccessful creation of group
OPENNSL_E_INITField module not initialized on unit
OPENNSL_E_RESOURCEHardware slice/port unavailable or no select codes can satisfy Qset.
OPENNSL_E_CONFIGIf device does not support virtual group priority feature, then this error code is returned when specified priority value is already assigned to another group.
OPENNSL_E_PARAMPriority out of range
OPENNSL_E_EXISTSRequested group ID already exists
OPENNSL_E_MEMORYAllocation failure
OPENNSL_E_XXXOther error code

Referenced by example_fp_redirect().

int opennsl_field_group_create_mode ( int  unit,
opennsl_field_qset_t  qset,
int  pri,
opennsl_field_group_mode_t  mode,
opennsl_field_group_t group 
)

Create a field group.

Description
Creates a field group with a specified priority and qualifier set. The _id variant requests that a particular group identifier be assigned, and may be useful when handles are desired to be the same across multiple chips. opennsl_field_group_wlan_xxx groups apply to WLAN tunnel terminated frames. Incoming port can not be used as match criteria for WLAN traffic. It is recommended to use opennsl_field_group_config_create API for the devices which support Policy tables in PPD format (policy data stored in an encoded manner). By default, all the actions supported in ingress stage are considered if no action (ASET) is mentioned during group create. And hence the group will be created with intra-slice mode though QSET fits in single-wide mode.
Parameters
unit[IN] Unit number.
qset[IN] Field qualifier set
pri[IN] Priority within allowable range or OPENNSL_FIELD_GROUP_PRIO_ANY to automatically assign a priority. Higher numerical value for priority has better priority for conflict resolution when there is a search hit on multiple slices. See =fp_groups for priority value restrictions.
mode[IN] See =fp_group_mode for a list of modes.
group[OUT] (for _create_id and _create_mode_id) Field group ID
Return values
OPENNSL_E_NONESuccessful creation of group
OPENNSL_E_INITField module not initialized on unit
OPENNSL_E_RESOURCEHardware slice/port unavailable or no select codes can satisfy Qset.
OPENNSL_E_CONFIGIf device does not support virtual group priority feature, then this error code is returned when specified priority value is already assigned to another group.
OPENNSL_E_PARAMPriority out of range
OPENNSL_E_EXISTSRequested group ID already exists
OPENNSL_E_MEMORYAllocation failure
OPENNSL_E_XXXOther error code
int opennsl_field_group_create_mode_id ( int  unit,
opennsl_field_qset_t  qset,
int  pri,
opennsl_field_group_mode_t  mode,
opennsl_field_group_t  group 
)

Create a field group.

Description
Creates a field group with a specified priority and qualifier set. The _id variant requests that a particular group identifier be assigned, and may be useful when handles are desired to be the same across multiple chips. opennsl_field_group_wlan_xxx groups apply to WLAN tunnel terminated frames. Incoming port can not be used as match criteria for WLAN traffic. It is recommended to use opennsl_field_group_config_create API for the devices which support Policy tables in PPD format (policy data stored in an encoded manner). By default, all the actions supported in ingress stage are considered if no action (ASET) is mentioned during group create. And hence the group will be created with intra-slice mode though QSET fits in single-wide mode.
Parameters
unit[IN] Unit number.
qset[IN] Field qualifier set
pri[IN] Priority within allowable range or OPENNSL_FIELD_GROUP_PRIO_ANY to automatically assign a priority. Higher numerical value for priority has better priority for conflict resolution when there is a search hit on multiple slices. See =fp_groups for priority value restrictions.
mode[IN] See =fp_group_mode for a list of modes.
group[IN] (for _create_id and _create_mode_id) Field group ID
Return values
OPENNSL_E_NONESuccessful creation of group
OPENNSL_E_INITField module not initialized on unit
OPENNSL_E_RESOURCEHardware slice/port unavailable or no select codes can satisfy Qset.
OPENNSL_E_CONFIGIf device does not support virtual group priority feature, then this error code is returned when specified priority value is already assigned to another group.
OPENNSL_E_PARAMPriority out of range
OPENNSL_E_EXISTSRequested group ID already exists
OPENNSL_E_MEMORYAllocation failure
OPENNSL_E_XXXOther error code

Referenced by example_create_policy().

int opennsl_field_group_destroy ( int  unit,
opennsl_field_group_t  group 
)

Deallocates a field group.

Description
Deallocates a field group. All entries that uses this group must have been destroyed before calling this routine, or the call will fail.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID not found in unit
OPENNSL_E_BUSYEntries still exist in the group

Referenced by example_fp_redirect(), and main().

int opennsl_field_group_enable_get ( int  unit,
opennsl_field_group_t  group,
int *  enable 
)

Get or set the group enable state.

Description
Packet lookup can be enabled or disabled on a group. This allows offline changes to be made to a group, which avoids possibly unwanted intermediate states.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
enable[OUT] (for _set) Packet lookup Enable(1) or Disable (0) state of group
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITField not initialized on unit
OPENNSL_E_NOT_FOUNDGroup ID not found for this unit
OPENNSL_E_UNAVAILOPENNSL device does not have enable/disable feature
int opennsl_field_group_enable_set ( int  unit,
opennsl_field_group_t  group,
int  enable 
)

Get or set the group enable state.

Description
Packet lookup can be enabled or disabled on a group. This allows offline changes to be made to a group, which avoids possibly unwanted intermediate states.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
enable[IN] (for _set) Packet lookup Enable(1) or Disable (0) state of group
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITField not initialized on unit
OPENNSL_E_NOT_FOUNDGroup ID not found for this unit
OPENNSL_E_UNAVAILOPENNSL device does not have enable/disable feature
int opennsl_field_group_get ( int  unit,
opennsl_field_group_t  group,
opennsl_field_qset_t qset 
)

Change or retrieve the qualifiers for a field group.

Description
The set call changes the qualifier set for the specified group. If no entries exist in this group, then updates are always permitted. If entries exist, then updates are permitted only if it can be satisfied with the current selection of field selector encodings dependent on chip architecture. It is assumed that existing entries are depending on the Qset present when the entries were created. This means that setting a new Qset will only add qualifiers. If the old Qset contains qualifiers that does not exist in the new Qset, a union of the two Qsets will be performed in the setting operation. The get call retrieves the qualifier set for a specified group.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
qset[OUT] (for _set) Field qualifier set
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_PARAMqset points to NULL
int opennsl_field_group_install ( int  unit,
opennsl_field_group_t  group 
)

Install all entries of a field group into the hardware tables.

Description
Installs a group of entries into the hardware tables. Will silently reinstall entries already in the hardware tables. The opennsl_field_group_t object is not consumed or destroyed. It can be used to remove or update the entry.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID is not in use
OPENNSL_E_XXXOther error code

Referenced by example_create_policy(), and example_fp_redirect().

int opennsl_field_group_presel_get ( int  unit,
opennsl_field_group_t  group,
opennsl_field_presel_set_t presel 
)

Get the set of preselectors associated with a Field group.

Description
Get the set of preselectors associated with a Field group.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
presel[OUT] A pointer to a presel_set structure
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID not found in unit
OPENNSL_E_MEMORYMemory allocation failure
int opennsl_field_group_presel_set ( int  unit,
opennsl_field_group_t  group,
opennsl_field_presel_set_t presel 
)

Associate a set of preselectors with a Field group.

Description
Associate a set of preselectors with a Field group, operation is OR – if any preselector is matched by the frame, the frame goes to the group. .
Parameters
unit[IN] Unit number.
group[IN] Field group ID
presel[IN] A pointer to a presel_set structure
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID not found in unit
OPENNSL_E_PARAM*presel_set points to NULL (opennsl_field_presel_set_t)
int opennsl_field_group_priority_get ( int  unit,
opennsl_field_group_t  group,
int *  priority 
)

Extract priority for a group.

Description
Extract field group relative priority. Priority is a positive number, where numerically higher value have precedence during conflicting action resolution. .
Parameters
unit[IN] Unit number.
group[IN] Field group ID
priority[OUT] Field group priority
Return values
OPENNSL_E_XXX
int opennsl_field_group_priority_set ( int  unit,
opennsl_field_group_t  group,
int  priority 
)

Assign relative priority to a group.

Description
Assign field group relative priority. Priority is a positive number, where numerically higher value have precedence during conflicting action resolution. .
Parameters
unit[IN] Unit number.
group[IN] Field group ID
priority[IN] Field group priority
Return values
OPENNSL_E_XXX
int opennsl_field_group_set ( int  unit,
opennsl_field_group_t  group,
opennsl_field_qset_t  qset 
)

Change or retrieve the qualifiers for a field group.

Description
The set call changes the qualifier set for the specified group. If no entries exist in this group, then updates are always permitted. If entries exist, then updates are permitted only if it can be satisfied with the current selection of field selector encodings dependent on chip architecture. It is assumed that existing entries are depending on the Qset present when the entries were created. This means that setting a new Qset will only add qualifiers. If the old Qset contains qualifiers that does not exist in the new Qset, a union of the two Qsets will be performed in the setting operation. The get call retrieves the qualifier set for a specified group.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
qset[IN] (for _set) Field qualifier set
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_PARAMqset points to NULL
int opennsl_field_group_status_get ( int  unit,
opennsl_field_group_t  group,
opennsl_field_group_status_t status 
)

Retrieve status of a specified field group.

Description
Retrieves the status of a specified group. See =fp_group_status for a description of the status information returned. For auto-expanding groups, resources from unused slices are included in the counts.
Parameters
unit[IN] Unit number.
group[IN] Field group ID
status[OUT] Status for field group
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDGroup ID not found in unit
OPENNSL_E_PARAMstatus points to NULL
int opennsl_field_group_traverse ( int  unit,
opennsl_field_group_traverse_cb  callback,
void *  user_data 
)

Traverse all the fp groups on the device, calling a specified callback for each valid group.

Description
Traverse all the fp groups on the device, calling a specified callback for each valid group.
Parameters
unit[IN] Unit number.
callback[IN] User provided callback.
user_data[IN] User callback cookie.
Return values
OPENNSL_E_XXX
int opennsl_field_init ( int  unit)

Initialize field software subsystem.

Description
Initializes the field software and hardware subsystem. Enables field support and clears the hardware tables. Initializes the metering function.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILFeature unavailable on this device
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_XXXOther errors
int opennsl_field_presel_create ( int  unit,
opennsl_field_presel_t presel_id 
)

Create a preselection specification.

Description
Create a preselection specification for a preselector set. The preselector indicates which packets are selected for this set. To destroy the preselector, use =opennsl_field_presel_destroy API.
Parameters
unit[IN] Unit number.
presel_id[OUT] presel ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_PARAM*entry points to NULL
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_RESOURCENo unused entries available
int opennsl_field_presel_create_id ( int  unit,
opennsl_field_presel_t  presel_id 
)

Create a preselection specification using a specific ID.

Description
Create a preselection specification for a preselector set using a specific ID. The preselector indicates which packets are selected for this set. To destroy the preselector, use =opennsl_field_presel_destroy API.
Parameters
unit[IN] Unit number.
presel_id[IN] presel ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_EXISTSRequested presel ID already exists
OPENNSL_E_PARAM*entry points to NULL
OPENNSL_E_MEMORYMemory allocation failure
OPENNSL_E_RESOURCENo unused entries available
int opennsl_field_presel_destroy ( int  unit,
opennsl_field_presel_t  presel_id 
)

Destroy a preselection specification.

Description
Destroy a preselection specification. .
Parameters
unit[IN] Unit number.
presel_id[IN]
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL unit not initialized
OPENNSL_E_NOT_FOUNDPresel ID not found in unit
OPENNSL_E_XXXOther error code
int opennsl_field_qualifier_delete ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_qualify_t  qual_id 
)

Remove match criteria from field entry.

Description
Remove match criteria from a field entry.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
qual_id[IN] Field qualifier ID
Return values
OPENNSL_E_XXX
int opennsl_field_qualify_Color ( int  unit,
opennsl_field_entry_t  entry,
uint8  color 
)
Parameters
unit[IN] Unit number.
entry[IN]
color[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Color_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 color 
)
Parameters
unit[IN] Unit number.
entry[IN]
color[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_CpuQueue ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_CpuQueue_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DSCP ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DSCP_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstClassField ( int  unit,
opennsl_field_entry_t  entry,
uint32  data,
uint32  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstClassField_get ( int  unit,
opennsl_field_entry_t  entry,
uint32 data,
uint32 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstIp ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip_t  data,
opennsl_ip_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstIp6 ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip6_t  data,
opennsl_ip6_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstIp6_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip6_t data,
opennsl_ip6_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstIp_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip_t data,
opennsl_ip_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstIpLocal ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstIpLocal_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstL3Egress ( int  unit,
opennsl_field_entry_t  entry,
opennsl_if_t  if_id 
)
Parameters
unit[IN] Unit number.
entry[IN]
if_id[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstL3Egress_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_if_t if_id 
)
Parameters
unit[IN] Unit number.
entry[IN]
if_id[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstMac ( int  unit,
opennsl_field_entry_t  entry,
opennsl_mac_t  data,
opennsl_mac_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx

Referenced by example_create_policy(), and example_fp_redirect().

int opennsl_field_qualify_DstMac_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_mac_t data,
opennsl_mac_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstPort ( int  unit,
opennsl_field_entry_t  entry,
opennsl_module_t  data_modid,
opennsl_module_t  mask_modid,
opennsl_port_t  data_port,
opennsl_port_t  mask_port 
)
Parameters
unit[IN] Unit number.
entry[IN]
data_modid[IN]
mask_modid[IN]
data_port[IN]
mask_port[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstPort_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_module_t data_modid,
opennsl_module_t mask_modid,
opennsl_port_t data_port,
opennsl_port_t mask_port 
)
Parameters
unit[IN] Unit number.
entry[IN]
data_modid[OUT]
mask_modid[OUT]
data_port[OUT]
mask_port[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstTrunk ( int  unit,
opennsl_field_entry_t  entry,
opennsl_trunk_t  data,
opennsl_trunk_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_DstTrunk_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_trunk_t data,
opennsl_trunk_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_EtherType ( int  unit,
opennsl_field_entry_t  entry,
uint16  data,
uint16  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx

Referenced by example_fp_ip_block().

int opennsl_field_qualify_EtherType_get ( int  unit,
opennsl_field_entry_t  entry,
uint16 data,
uint16 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IcmpTypeCode ( int  unit,
opennsl_field_entry_t  entry,
uint16  data,
uint16  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IcmpTypeCode_get ( int  unit,
opennsl_field_entry_t  entry,
uint16 data,
uint16 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IngressClassField ( int  unit,
opennsl_field_entry_t  entry,
uint32  data,
uint32  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IngressClassField_get ( int  unit,
opennsl_field_entry_t  entry,
uint32 data,
uint32 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InnerVlanId ( int  unit,
opennsl_field_entry_t  entry,
opennsl_vlan_t  data,
opennsl_vlan_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InPort ( int  unit,
opennsl_field_entry_t  entry,
opennsl_port_t  data,
opennsl_port_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx

Referenced by example_create_policer().

int opennsl_field_qualify_InPort_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_port_t data,
opennsl_port_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InPorts ( int  unit,
opennsl_field_entry_t  entry,
opennsl_pbmp_t  data,
opennsl_pbmp_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InPorts_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_pbmp_t data,
opennsl_pbmp_t mask 
)

Get InPorts qualification match criteria from a field entry.

Description
Get a match criteria for InPorts qualifier from a field entry. For global groups, no pbmp is configured unless Inports is qualified explicitly. It is done to qualify the rule even on new ports added through flex operation.
Parameters
unit[IN] Unit number.
entry[IN] Field entry ID
data[OUT] Reference to retrieve the Data associated
mask[OUT] Reference to retrieve the Mask associated
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InterfaceClassPort ( int  unit,
opennsl_field_entry_t  entry,
uint32  data,
uint32  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InterfaceClassPort_get ( int  unit,
opennsl_field_entry_t  entry,
uint32 data,
uint32 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InterfaceClassProcessingPort ( int  unit,
opennsl_field_entry_t  entry,
uint64  data,
uint64  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_InterfaceClassProcessingPort_get ( int  unit,
opennsl_field_entry_t  entry,
uint64 data,
uint64 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Ip6HopLimit ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Ip6HopLimit_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Ip6NextHeader ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Ip6NextHeader_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpFrag ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_IpFrag_t  frag_info 
)
Parameters
unit[IN] Unit number.
entry[IN]
frag_info[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpFrag_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_IpFrag_t frag_info 
)
Parameters
unit[IN] Unit number.
entry[IN]
frag_info[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpProtocol ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpProtocol_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpProtocolCommon ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_IpProtocolCommon_t  protocol 
)
Parameters
unit[IN] Unit number.
entry[IN]
protocol[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpProtocolCommon_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_IpProtocolCommon_t protocol 
)
Parameters
unit[IN] Unit number.
entry[IN]
protocol[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpType ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_IpType_t  type 
)
Parameters
unit[IN] Unit number.
entry[IN]
type[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_IpType_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_IpType_t type 
)
Parameters
unit[IN] Unit number.
entry[IN]
type[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L3Ingress ( int  unit,
opennsl_field_entry_t  entry,
uint32  intf_id,
uint32  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
intf_id[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L3Ingress_get ( int  unit,
opennsl_field_entry_t  entry,
uint32 data,
uint32 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L3Routable ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L3Routable_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L4DstPort ( int  unit,
opennsl_field_entry_t  entry,
opennsl_l4_port_t  data,
opennsl_l4_port_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L4DstPort_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_l4_port_t data,
opennsl_l4_port_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L4SrcPort ( int  unit,
opennsl_field_entry_t  entry,
opennsl_l4_port_t  data,
opennsl_l4_port_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_L4SrcPort_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_l4_port_t data,
opennsl_l4_port_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_MyStationHit ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_MyStationHit_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_OuterVlan ( int  unit,
opennsl_field_entry_t  entry,
opennsl_vlan_t  data,
opennsl_vlan_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_OuterVlan_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_vlan_t data,
opennsl_vlan_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_OuterVlanId ( int  unit,
opennsl_field_entry_t  entry,
opennsl_vlan_t  data,
opennsl_vlan_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx

Referenced by example_create_policer().

int opennsl_field_qualify_OuterVlanId_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_vlan_t data,
opennsl_vlan_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_OutPort ( int  unit,
opennsl_field_entry_t  entry,
opennsl_port_t  data,
opennsl_port_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_OutPort_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_port_t data,
opennsl_port_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_PacketRes ( int  unit,
opennsl_field_entry_t  entry,
uint32  data,
uint32  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_PacketRes_get ( int  unit,
opennsl_field_entry_t  entry,
uint32 data,
uint32 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_RangeCheck ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_range_t  range,
int  invert 
)
Parameters
unit[IN] Unit number.
entry[IN]
range[IN]
invert[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_RangeCheck_get ( int  unit,
opennsl_field_entry_t  entry,
int  max_count,
opennsl_field_range_t range,
int *  invert,
int *  count 
)
Parameters
unit[IN] Unit number.
entry[IN]
max_count[IN]
range[OUT]
invert[OUT]
count[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcClassField ( int  unit,
opennsl_field_entry_t  entry,
uint32  data,
uint32  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcClassField_get ( int  unit,
opennsl_field_entry_t  entry,
uint32 data,
uint32 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcIp ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip_t  data,
opennsl_ip_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx

Referenced by example_fp_ip_block().

int opennsl_field_qualify_SrcIp6 ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip6_t  data,
opennsl_ip6_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcIp6_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip6_t data,
opennsl_ip6_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcIp_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_ip_t data,
opennsl_ip_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcMac ( int  unit,
opennsl_field_entry_t  entry,
opennsl_mac_t  data,
opennsl_mac_t  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcMac_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_mac_t data,
opennsl_mac_t mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcPort ( int  unit,
opennsl_field_entry_t  entry,
opennsl_module_t  data_modid,
opennsl_module_t  mask_modid,
opennsl_port_t  data_port,
opennsl_port_t  mask_port 
)
Parameters
unit[IN] Unit number.
entry[IN]
data_modid[IN]
mask_modid[IN]
data_port[IN]
mask_port[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_SrcPort_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_module_t data_modid,
opennsl_module_t mask_modid,
opennsl_port_t data_port,
opennsl_port_t mask_port 
)
Parameters
unit[IN] Unit number.
entry[IN]
data_modid[OUT]
mask_modid[OUT]
data_port[OUT]
mask_port[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Stage ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_stage_t  data 
)

Set qualification on a particular stage.

This feature is normally used for preselectors.

Description
Set qualification on a particular stage. The API is only used for preselector entries. For XGS devices, it is mandatory to call this API specifying the stage (opennslFieldStageIngress/opennslFieldStageIngressExactMatch) before setting any other qualifier to the preselector entry. On Tomahawk, only Stage Ingress and Stage Exact Match supports Preselection, so this API is used to associate the stage to the preselector. Preselector Entry ID can be retrieved using a macro OPENNSL_FIELD_PRESEL_ENTRY_SET.
Parameters
unit[IN] Unit number.
entry[IN] OPENNSL field entry id.
data[IN] Stage on which to qualify
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Stage_get ( int  unit,
opennsl_field_entry_t  entry,
opennsl_field_stage_t data 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_TcpControl ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_TcpControl_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Ttl ( int  unit,
opennsl_field_entry_t  entry,
uint8  data,
uint8  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Ttl_get ( int  unit,
opennsl_field_entry_t  entry,
uint8 data,
uint8 mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[OUT]
mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_field_qualify_Vrf ( int  unit,
opennsl_field_entry_t  entry,
uint32  data,
uint32  mask 
)
Parameters
unit[IN] Unit number.
entry[IN]
data[IN]
mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_field_range_create ( int  unit,
opennsl_field_range_t range,
uint32  flags,
opennsl_l4_port_t  min,
opennsl_l4_port_t  max 
)

Allocate a range checker with specified configuration.

Description
Creates a virtual Layer 4 TCP/UDP port range checker. The required hardware resources are allocated and programmed. The resulting range identifier can be passed to opennsl_field_qualify_RangeCheck. The range can be inverted using the 'invert' argument to opennsl_field_qualify_RangeCheck. In network switch, only an external entry can qualify on an external range checker. In TBx, the control flag OPENNSL_FIELD_RANGE_LOOKUP can be configured for range check in IVM. The opennsl_field_range_create_id call uses an arbitrary user-specified value to identify the range checker. The opennsl_field_range_create call picks an arbitrary non-zero unused identifier.
Parameters
unit[IN] Unit number.
range[OUT] (for _create_id) Range check ID
flags[IN] Range control flags =RANGE_CONTROL_FLAGS_table
min[IN] Lowest port number to match (inclusive)
max[IN] Highest port number to match (inclusive)
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL field module not initialized
OPENNSL_E_EXISTSRange check ID already in use
OPENNSL_E_XXXError code
int opennsl_field_range_destroy ( int  unit,
opennsl_field_range_t  range 
)

Destroy a virtual range checker.

Description
Deallocates a virtual range checker. Associated hardware resources are freed if there are no other virtual range checkers using the same resources.
Parameters
unit[IN] Unit number.
range[IN] Range check ID
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL field module not initialized
OPENNSL_E_NOT_FOUNDRange check ID not found
OPENNSL_E_XXXError code
int opennsl_field_range_get ( int  unit,
opennsl_field_range_t  range,
uint32 flags,
opennsl_l4_port_t min,
opennsl_l4_port_t max 
)

Retrieve parameters associated with an existing range checker.

Description
Retrieves information that was used when a virtual range checker was created.
Parameters
unit[IN] Unit number.
range[IN] Range check ID
flags[OUT] Range control flags =RANGE_CONTROL_FLAGS_RANGE_table
min[OUT] Lowest port number to match (inclusive)
max[OUT] Highest port number to match (inclusive)
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITOPENNSL field module not initialized
OPENNSL_E_NOT_FOUNDRange check ID not found
OPENNSL_E_XXXError code
int opennsl_field_stat_all_set ( int  unit,
int  stat_id,
uint64  value 
)

Set 64-bit counter value to all counters.

Description
Set 64-bit counter value to all counters participating in statistics entity.
Parameters
unit[IN] Unit number.
stat_id[IN] Statistics entity ID.
value[IN] New value for statistics type.
Return values
OPENNSL_E_XXX
int opennsl_field_stat_create ( int  unit,
opennsl_field_group_t  group,
int  nstat,
opennsl_field_stat_t stat_arr,
int *  stat_id 
)

Create stat collection entity.

Description
Creates an aggregated entity describing set of counters. The entity might be attached to field processor entries and used for various counters collection. To get the counter engine ID from stat_id use macro OPENNSL_FIELD_STAT_ID_PROCESSOR_GET(stat_id) To get the counter ID from stat_id use macro OPENNSL_FIELD_STAT_ID_COUNTER_GET(stat_id).
Parameters
unit[IN] Unit number.
group[IN] Field group statistics entity will be associated with in the future.
nstat[IN] Number of elements in stat_arr - counter types array.
stat_arr[IN] Array of counters to be collected in statistics entity.
stat_id[OUT] Statistics entity ID.
Return values
OPENNSL_E_XXX

Referenced by example_create_policer().

int opennsl_field_stat_create_id ( int  unit,
opennsl_field_group_t  group,
int  nstat,
opennsl_field_stat_t stat_arr,
int  stat_id 
)

Create stat collection entity with specified Statistics entity ID value.

Description
Creates an aggregated entity describing set of counters. The entity might be attached to field processor entries and used for various counters collection. To get the counter engine ID from stat_id use macro OPENNSL_FIELD_STAT_ID_PROCESSOR_GET(stat_id) To get the counter ID from stat_id use macro OPENNSL_FIELD_STAT_ID_COUNTER_GET(stat_id).
Parameters
unit[IN] Unit number.
group[IN] Field group statistics entity will be associated with in the future.
nstat[IN] Number of elements in stat_arr - counter types array.
stat_arr[IN] Array of counters to be collected in statistics entity.
stat_id[IN] Statistics entity ID.
Return values
OPENNSL_E_XXX

Referenced by example_create_policy(), and example_fp_redirect().

int opennsl_field_stat_destroy ( int  unit,
int  stat_id 
)

Destroy stat collection entity.

Description
This API comes to destroy an aggregated entity of counters, used for stat collection in field APIs.
Parameters
unit[IN] Unit number.
stat_id[IN] Statistics entity ID.
Return values
OPENNSL_E_XXX

Referenced by main().

int opennsl_field_stat_detach ( int  unit,
uint32  stat_id 
)

Detach counters entries to a field group.

Description
This API will detach counters entries to a field group. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
stat_id[IN] Statistics entity ID
Return values
OPENNSL_E_xxx
int opennsl_field_stat_get ( int  unit,
int  stat_id,
opennsl_field_stat_t  stat,
uint64 value 
)

Get 64-bit counter value for specific statistic type.

Description
Get 64-bit counter value for specific statistic type. To create a stat_id use macro FIELD_STAT_ID_SET(stat_id, engine_id, counter_id).
Parameters
unit[IN] Unit number.
stat_id[IN] Statistics entity ID.
stat[IN] Statistics entity ID.
value[OUT] Counter value for statistics type.
Return values
OPENNSL_E_XXX

Referenced by example_check_rates(), and main().

int opennsl_field_stat_id_get ( int  unit,
opennsl_field_group_t  group,
uint32  stat_id,
uint32 stat_counter_id 
)

Get flex stat counter ID associated with given field group and its associated stats ID.

Description
This API will provide stat counter IDs associated with given field group. (Ref: =FLEXIBLE_COUNTER_s).
Parameters
unit[IN] Unit number.
group[IN] Field Group
stat_id[IN] Statistics entity ID
stat_counter_id[OUT] Flex Stat Counter ID
Return values
OPENNSL_E_xxx
int opennsl_field_stat_set ( int  unit,
int  stat_id,
opennsl_field_stat_t  stat,
uint64  value 
)

Set 64-bit counter value for specific statistic type.

Description
Set 64-bit counter value for specific statistic type.
Parameters
unit[IN] Unit number.
stat_id[IN] Statistics entity ID.
stat[IN] Statistics entity ID.
value[IN] New value for statistics type.
Return values
OPENNSL_E_XXX

Referenced by example_check_rates().

int opennsl_field_stat_size ( int  unit,
int  stat_id,
int *  stat_size 
)

Get number of counters associated with statistics entity.

Description
The purpose of this API is to retrieve number of counters associated with statistics entity.
Parameters
unit[IN] Unit number.
stat_id[IN] Statistics entity ID.
stat_size[OUT] Number of collected counters.
Return values
OPENNSL_E_XXX