OpenFlow Data Plane Abstraction (OF-DPA) API Guide and Reference Manual
Data Structures | Macros | Typedefs | Enumerations | Functions
OF-DPA API Header [OF-DPA]
API Definitions

Data Structures

struct  ofdpa_buffdesc
 Intrinsic buffer descriptor. More...
 
struct  ofdpaAccessPortConfig_t
 
struct  ofdpaBridgingFlowEntry_s
 Bridging Flow Table Entry. More...
 
struct  ofdpaBridgingFlowMatch_s
 Bridging Flow Table Match. More...
 
struct  ofdpaEndpointConfig_t
 
struct  ofdpaFlowEntry_s
 This structure is used to add a new flow or modify an existing flow. More...
 
struct  ofdpaFlowEntryStats_s
 Flow Stats information. More...
 
struct  ofdpaFlowEvent_s
 Flow events. More...
 
struct  ofdpaFlowTableInfo_s
 Flow table information. More...
 
struct  ofdpaGroupBucketEntry_s
 Group Bucket Table Entry. More...
 
struct  ofdpaGroupEntry_s
 The Group Table contains one entry for each Group. More...
 
struct  ofdpaGroupEntryStats_s
 Group Table Entry Statistics. More...
 
struct  ofdpaGroupTableInfo_s
 Group table information. More...
 
struct  ofdpaIngressPortFlowEntry_s
 Ingress Port Flow Table Entry. More...
 
struct  ofdpaIngressPortFlowMatch_s
 Ingress Port Flow Table Match. More...
 
struct  ofdpaL2InterfaceGroupBucketData_s
 L2 Interface Group Bucket. More...
 
struct  ofdpaL2OverlayGroupBucketData_t
 
struct  ofdpaL2RewriteGroupBucketData_s
 L2 Rewrite Group Bucket. More...
 
struct  ofdpaL3InterfaceGroupBucketData_s
 L3 Interface Group Bucket. More...
 
struct  ofdpaL3UnicastGroupBucketData_s
 L3 Unicast Group Bucket. More...
 
struct  ofdpaMacAddr_s
 MAC address. More...
 
struct  ofdpaMulticastRoutingFlowEntry_s
 Multicast Routing Flow Table Entry. More...
 
struct  ofdpaMulticastRoutingFlowMatch_s
 Multicast Routing Flow Table Match. More...
 
struct  ofdpaNvgreProtoInfo_t
 
struct  ofdpaPacket_s
 Packet. More...
 
struct  ofdpaPolicyAclFlowEntry_s
 Policy ACL Flow Table Entry. More...
 
struct  ofdpaPolicyAclFlowMatch_s
 ACL Flow Table Match. More...
 
struct  ofdpaPortEvent_s
 Port events. More...
 
struct  ofdpaPortFeature_s
 Bitmaps of OFDPA_PORT_FEAT_* that describe features. More...
 
struct  ofdpaPortQueueStats_s
 Queue Stats. More...
 
struct  ofdpaPortStats_s
 Port Statistics. More...
 
struct  ofdpaSrcMacLearnModeCfg_s
 Source MAC Learning Mode. More...
 
struct  ofdpaTerminationMacFlowEntry_s
 Termination MAC Flow Table Entry. More...
 
struct  ofdpaTerminationMacFlowMatch_s
 Termination MAC Flow Table Match. More...
 
struct  ofdpaTunnelEcmpNextHopGroupConfig_t
 
struct  ofdpaTunnelEcmpNextHopGroupStatus_t
 
struct  ofdpaTunnelNextHopConfig_t
 
struct  ofdpaTunnelNextHopStatus_t
 
struct  ofdpaTunnelPortConfig_t
 
struct  ofdpaTunnelPortStatus_t
 
struct  ofdpaTunnelPortTenantStatus_t
 
struct  ofdpaTunnelTenantConfig_t
 
struct  ofdpaTunnelTenantStatus_t
 
struct  ofdpaUnicastRoutingFlowEntry_s
 Unicast Routing Flow Table Entry. More...
 
struct  ofdpaUnicastRoutingFlowMatch_s
 Unicast Routing Flow Table Match. More...
 
struct  ofdpaVlanFlowEntry_s
 VLAN Flow Table Entry. More...
 
struct  ofdpaVlanFlowMatch_s
 VLAN Flow Table Match. More...
 
struct  ofdpaVxlanProtoInfo_t
 

Macros

#define OFDPA_FLOW_TABLE_ID_SA_LOOKUP   254
 Source MAC Lookup Table.
 
#define OFDPA_INPORT_EXACT_MASK   0xffffffffu
 Exact Mask.
 
#define OFDPA_INPORT_FIELD_MASK   0x00000000u
 Field Mask.
 
#define OFDPA_INPORT_INDEX_MASK   0x0000ffffu
 Number Mask.
 
#define OFDPA_INPORT_TYPE_MASK   0xffff0000u
 Type Mask.
 
#define OFDPA_IPV4_ADDR_EXACT_MASK   0xffffffffu
 IPv4 Address Exact Mask.
 
#define OFDPA_IPV4_ADDR_FIELD_MASK   0x00000000u
 IPv4 Address Field Mask.
 
#define OFDPA_MAC_ADDR_IS_NULL(mac)
 Check if MAC address is NULL.
 
#define OFDPA_MAC_ADDR_LEN   6
 MAC address length.
 
#define OFDPA_PKT_LOOKUP   1
 Flags field in ofdpaPktSend()
 
#define OFDPA_PORT_CONTROLLER   0xfffffffdu
 Open Flow Controller port.
 
#define OFDPA_PORT_NAME_STRING_SIZE   16
 Port name maximum string length.
 
#define OFDPA_TABLE_NAME_LEN   32
 Table name maximum string length.
 
#define OFDPA_VID_EXACT_MASK   0x0fff
 VLAN Id Exact Mask.
 
#define OFDPA_VID_FIELD_MASK   0x0000
 VLAN Id Field Mask.
 
#define OFDPA_VID_NONE   0x0000
 VLAN Id None.
 
#define OFDPA_VID_PRESENT   0x1000
 VLAN Id present.
 

Typedefs

typedef struct
ofdpaBridgingFlowEntry_s 
ofdpaBridgingFlowEntry_t
 Bridging Flow Table Entry.
 
typedef struct
ofdpaBridgingFlowMatch_s 
ofdpaBridgingFlowMatch_t
 Bridging Flow Table Match.
 
typedef struct ofdpaFlowEntry_s ofdpaFlowEntry_t
 This structure is used to add a new flow or modify an existing flow.
 
typedef struct
ofdpaFlowEntryStats_s 
ofdpaFlowEntryStats_t
 Flow Stats information.
 
typedef struct ofdpaFlowEvent_s ofdpaFlowEvent_t
 Flow events.
 
typedef struct ofdpaFlowTableInfo_s ofdpaFlowTableInfo_t
 Flow table information.
 
typedef struct
ofdpaGroupBucketEntry_s 
ofdpaGroupBucketEntry_t
 Group Bucket Table Entry.
 
typedef struct ofdpaGroupEntry_s ofdpaGroupEntry_t
 The Group Table contains one entry for each Group.
 
typedef struct
ofdpaGroupEntryStats_s 
ofdpaGroupEntryStats_t
 Group Table Entry Statistics.
 
typedef struct
ofdpaGroupTableInfo_s 
ofdpaGroupTableInfo_t
 Group table information.
 
typedef struct
ofdpaIngressPortFlowEntry_s 
ofdpaIngressPortFlowEntry_t
 Ingress Port Flow Table Entry.
 
typedef struct
ofdpaIngressPortFlowMatch_s 
ofdpaIngressPortFlowMatch_t
 Ingress Port Flow Table Match.
 
typedef struct
ofdpaL2InterfaceGroupBucketData_s 
ofdpaL2InterfaceGroupBucketData_t
 L2 Interface Group Bucket.
 
typedef struct
ofdpaL2RewriteGroupBucketData_s 
ofdpaL2RewriteGroupBucketData_t
 L2 Rewrite Group Bucket.
 
typedef struct
ofdpaL3InterfaceGroupBucketData_s 
ofdpaL3InterfaceGroupBucketData_t
 L3 Interface Group Bucket.
 
typedef struct
ofdpaL3UnicastGroupBucketData_s 
ofdpaL3UnicastGroupBucketData_t
 L3 Unicast Group Bucket.
 
typedef struct ofdpaMacAddr_s ofdpaMacAddr_t
 MAC address.
 
typedef struct
ofdpaMulticastRoutingFlowEntry_s 
ofdpaMulticastRoutingFlowEntry_t
 Multicast Routing Flow Table Entry.
 
typedef struct
ofdpaMulticastRoutingFlowMatch_s 
ofdpaMulticastRoutingFlowMatch_t
 Multicast Routing Flow Table Match.
 
typedef struct ofdpaPacket_s ofdpaPacket_t
 Packet.
 
typedef struct
ofdpaPolicyAclFlowEntry_s 
ofdpaPolicyAclFlowEntry_t
 Policy ACL Flow Table Entry.
 
typedef struct
ofdpaPolicyAclFlowMatch_s 
ofdpaPolicyAclFlowMatch_t
 ACL Flow Table Match.
 
typedef struct ofdpaPortEvent_s ofdpaPortEvent_t
 Port events.
 
typedef struct ofdpaPortFeature_s ofdpaPortFeature_t
 Bitmaps of OFDPA_PORT_FEAT_* that describe features.
 
typedef struct
ofdpaPortQueueStats_s 
ofdpaPortQueueStats_t
 Queue Stats.
 
typedef struct ofdpaPortStats_s ofdpaPortStats_t
 Port Statistics.
 
typedef struct
ofdpaSrcMacLearnModeCfg_s 
ofdpaSrcMacLearnModeCfg_t
 Source MAC Learning Mode.
 
typedef struct
ofdpaTerminationMacFlowEntry_s 
ofdpaTerminationMacFlowEntry_t
 Termination MAC Flow Table Entry.
 
typedef struct
ofdpaTerminationMacFlowMatch_s 
ofdpaTerminationMacFlowMatch_t
 Termination MAC Flow Table Match.
 
typedef struct
ofdpaUnicastRoutingFlowEntry_s 
ofdpaUnicastRoutingFlowEntry_t
 Unicast Routing Flow Table Entry.
 
typedef struct
ofdpaUnicastRoutingFlowMatch_s 
ofdpaUnicastRoutingFlowMatch_t
 Unicast Routing Flow Table Match.
 
typedef struct ofdpaVlanFlowEntry_s ofdpaVlanFlowEntry_t
 VLAN Flow Table Entry.
 
typedef struct ofdpaVlanFlowMatch_s ofdpaVlanFlowMatch_t
 VLAN Flow Table Match.
 

Enumerations

enum  OFDPA_CONTROL_t { OFDPA_DISABLE, OFDPA_ENABLE }
 enable or disable for config or status parameter. More...
 
enum  OFDPA_ERROR_t {
  OFDPA_E_NONE = 0, OFDPA_E_RPC = -20, OFDPA_E_INTERNAL = -21, OFDPA_E_PARAM = -22,
  OFDPA_E_ERROR = -23, OFDPA_E_FULL = -24, OFDPA_E_EXISTS = -25, OFDPA_E_TIMEOUT = -26,
  OFDPA_E_FAIL = -27, OFDPA_E_DISABLED = -28, OFDPA_E_UNAVAIL = -29, OFDPA_E_NOT_FOUND = -30,
  OFDPA_E_EMPTY = -31
}
 OFDPA uses these enumerators to indicate the error codes. More...
 
enum  OFDPA_FLOW_EVENT_MASK_t { OFDPA_FLOW_EVENT_IDLE_TIMEOUT = 1 << 0, OFDPA_FLOW_EVENT_HARD_TIMEOUT = 1 << 1 }
 Flow event type. More...
 
enum  OFDPA_FLOW_TABLE_ID_t {
  OFDPA_FLOW_TABLE_ID_INGRESS_PORT = 0, OFDPA_FLOW_TABLE_ID_VLAN = 10, OFDPA_FLOW_TABLE_ID_TERMINATION_MAC = 20, OFDPA_FLOW_TABLE_ID_UNICAST_ROUTING = 30,
  OFDPA_FLOW_TABLE_ID_MULTICAST_ROUTING = 40, OFDPA_FLOW_TABLE_ID_BRIDGING = 50, OFDPA_FLOW_TABLE_ID_ACL_POLICY = 60
}
 Flow Table Id enumerator. More...
 
enum  OFDPA_GROUP_ENTRY_TYPE_t {
  OFDPA_GROUP_ENTRY_TYPE_L2_INTERFACE = 0, OFDPA_GROUP_ENTRY_TYPE_L2_REWRITE = 1, OFDPA_GROUP_ENTRY_TYPE_L3_UNICAST = 2, OFDPA_GROUP_ENTRY_TYPE_L2_MULTICAST = 3,
  OFDPA_GROUP_ENTRY_TYPE_L2_FLOOD = 4, OFDPA_GROUP_ENTRY_TYPE_L3_INTERFACE = 5, OFDPA_GROUP_ENTRY_TYPE_L3_MULTICAST = 6, OFDPA_GROUP_ENTRY_TYPE_L3_ECMP = 7,
  OFDPA_GROUP_ENTRY_TYPE_L2_OVERLAY = 8, OFDPA_GROUP_ENTRY_TYPE_LAST
}
 Group Type Enumerator. More...
 
enum  OFDPA_L2_OVERLAY_SUBTYPE_t { OFDPA_L2_OVERLAY_FLOOD_UNICAST_TUNNEL = 0, OFDPA_L2_OVERLAY_FLOOD_MULTICAST_TUNNEL = 1, OFDPA_L2_OVERLAY_MULTICAST_UNICAST_TUNNEL = 2, OFDPA_L2_OVERLAY_MULTICAST_MULTICAST_TUNNEL = 3 }
 L2 Overlay Group Sub-type Enumerator. More...
 
enum  OFDPA_PACKET_IN_REASON_t { OFDPA_PACKET_IN_REASON_NO_MATCH = 0, OFDPA_PACKET_IN_REASON_ACTION, OFDPA_PACKET_IN_REASON_INVALID_TTL }
 Packet In reason codes. More...
 
enum  OFDPA_PORT_CONFIG_t { OFDPA_PORT_CONFIG_DOWN = 1 << 0 }
 Flags to indicate behavior of the physical port. More...
 
enum  OFDPA_PORT_EVENT_MASK_t { OFDPA_EVENT_PORT_CREATE = 1 << 0, OFDPA_EVENT_PORT_DELETE = 1 << 1, OFDPA_EVENT_PORT_STATE = 1 << 2 }
 Port event type. More...
 
enum  OFDPA_PORT_FEATURE_t {
  OFDPA_PORT_FEAT_10MB_HD = 1 << 0, OFDPA_PORT_FEAT_10MB_FD = 1 << 1, OFDPA_PORT_FEAT_100MB_HD = 1 << 2, OFDPA_PORT_FEAT_100MB_FD = 1 << 3,
  OFDPA_PORT_FEAT_1GB_HD = 1 << 4, OFDPA_PORT_FEAT_1GB_FD = 1 << 5, OFDPA_PORT_FEAT_10GB_FD = 1 << 6, OFDPA_PORT_FEAT_40GB_FD = 1 << 7,
  OFDPA_PORT_FEAT_100GB_FD = 1 << 8, OFDPA_PORT_FEAT_1TB_FD = 1 << 9, OFDPA_PORT_FEAT_OTHER = 1 << 10, OFDPA_PORT_FEAT_COPPER = 1 << 11,
  OFDPA_PORT_FEAT_FIBER = 1 << 12, OFDPA_PORT_FEAT_AUTONEG = 1 << 13, OFDPA_PORT_FEAT_PAUSE = 1 << 14, OFDPA_PORT_FEAT_PAUSE_ASYM = 1 << 15
}
 Features of ports available in a datapath. More...
 
enum  OFDPA_PORT_STATE_t { OFDPA_PORT_STATE_LINK_DOWN = 1 << 0 }
 Current state of the physical port. More...
 
enum  OFDPA_PORT_TYPE_t { OFDPA_PORT_TYPE_PHYSICAL = 0, OFDPA_PORT_TYPE_LOGICAL_TUNNEL = 1 }
 
enum  OFDPA_TUNNEL_PORT_TYPE_t { OFDPA_TUNNEL_PORT_TYPE_ENDPOINT = 1, OFDPA_TUNNEL_PORT_TYPE_ACCESS }
 
enum  OFDPA_TUNNEL_PROTO_t { OFDPA_TUNNEL_PROTO_VXLAN = 1, OFDPA_TUNNEL_PROTO_NVGRE }
 
enum  ofdpaComponentIds_t {
  OFDPA_COMPONENT_FIRST = 1, OFDPA_COMPONENT_API = OFDPA_COMPONENT_FIRST, OFDPA_COMPONENT_MAPPING, OFDPA_COMPONENT_RPC,
  OFDPA_COMPONENT_OFDB, OFDPA_COMPONENT_DATAPATH, OFDPA_COMPONENT_MAX
}
 Component enumerator. More...
 
enum  ofdpaDebugLevels_t {
  OFDPA_DEBUG_ALWAYS = 0, OFDPA_DEBUG_BASIC, OFDPA_DEBUG_VERBOSE, OFDPA_DEBUG_VERY_VERBOSE,
  OFDPA_DEBUG_TOO_VERBOSE, OFDPA_DEBUG_MAX
}
 Debug verbosity enumerator. More...
 

Functions

int ofdpaBcmCommand (ofdpa_buffdesc buffer)
 Execute a BCM command.
 
int ofdpaClientEventSockFdGet (void)
 Get OF-DPA Client's event socket fd.
 
OFDPA_ERROR_t ofdpaClientInitialize (char *clientName)
 Initialize OF-DPA client or user application.
 
int ofdpaClientPktSockFdGet (void)
 Get OF-DPA Client's packet socket fd.
 
int ofdpaCltDebugBuf (ofdpa_buffdesc functionName, ofdpaComponentIds_t component, ofdpaDebugLevels_t verbosity, ofdpa_buffdesc message)
 Generate a debug message using a preformatted buffer.
 
int ofdpaCltDebugPrintf (const char *functionName, ofdpaComponentIds_t component, ofdpaDebugLevels_t verbosity, const char *format,...)
 Generate a debug message using printf formatting.
 
int ofdpaCltLogBuf (int priority, ofdpa_buffdesc message)
 Generate a log message using a preformatted buffer.
 
int ofdpaCltLogPrintf (int priority, char *fmt,...)
 Generate a log message using printf formatting.
 
int ofdpaComponentNameGet (int component, ofdpa_buffdesc *name)
 Get the Component Name.
 
int ofdpaDebugComponentGet (int component)
 Get Component debugging mode.
 
int ofdpaDebugComponentSet (int component, int enable)
 Enable/Disable the Component for debugging.
 
int ofdpaDebugLvl (int lvl)
 Set the Debug Verbosity.
 
int ofdpaDebugLvlGet (void)
 Get the Debug Verbosity.
 
OFDPA_ERROR_t ofdpaEventReceive (struct timeval *timeout)
 Receive an event.
 
OFDPA_ERROR_t ofdpaFlowAdd (ofdpaFlowEntry_t *flow)
 Add a new entry to a flow table.
 
OFDPA_ERROR_t ofdpaFlowByCookieDelete (uint64_t cookie)
 Delete the flow entry with the specified cookie.
 
OFDPA_ERROR_t ofdpaFlowByCookieGet (uint64_t cookie, ofdpaFlowEntry_t *flow, ofdpaFlowEntryStats_t *flowStats)
 Returns statistics for the flow entry with the specified cookie value.
 
OFDPA_ERROR_t ofdpaFlowDelete (ofdpaFlowEntry_t *flow)
 Delete an entry from a flow table.
 
OFDPA_ERROR_t ofdpaFlowEntryInit (OFDPA_FLOW_TABLE_ID_t tableId, ofdpaFlowEntry_t *flow)
 Initialize Flow entry structure.
 
OFDPA_ERROR_t ofdpaFlowEventNextGet (ofdpaFlowEvent_t *eventData)
 Get the next flow event.
 
OFDPA_ERROR_t ofdpaFlowModify (ofdpaFlowEntry_t *flow)
 Modify an existing entry in a flow table.
 
OFDPA_ERROR_t ofdpaFlowNextGet (ofdpaFlowEntry_t *flow, ofdpaFlowEntry_t *nextFlow)
 Retrieve the next flow entry in the specified flow table.
 
OFDPA_ERROR_t ofdpaFlowStatsGet (ofdpaFlowEntry_t *flow, ofdpaFlowEntryStats_t *flowStats)
 Returns statistics for the flow entry specified.
 
OFDPA_ERROR_t ofdpaFlowTableInfoGet (OFDPA_FLOW_TABLE_ID_t tableId, ofdpaFlowTableInfo_t *info)
 Get Flow Table Info.
 
OFDPA_ERROR_t ofdpaGroupAdd (ofdpaGroupEntry_t *group)
 Add Group.
 
OFDPA_ERROR_t ofdpaGroupBucketEntryAdd (ofdpaGroupBucketEntry_t *bucket)
 Add a Group Bucket entry.
 
OFDPA_ERROR_t ofdpaGroupBucketEntryDelete (uint32_t groupId, uint32_t bucketIndex)
 Delete a Group Bucket entry.
 
OFDPA_ERROR_t ofdpaGroupBucketEntryFirstGet (uint32_t groupId, ofdpaGroupBucketEntry_t *firstGroupBucket)
 Get the first Group Bucket entry.
 
OFDPA_ERROR_t ofdpaGroupBucketEntryGet (uint32_t groupId, uint32_t bucketIndex, ofdpaGroupBucketEntry_t *groupBucket)
 Get the Group Bucket entry.
 
OFDPA_ERROR_t ofdpaGroupBucketEntryInit (OFDPA_GROUP_ENTRY_TYPE_t groupType, ofdpaGroupBucketEntry_t *bucket)
 Initialize Flow entry structure.
 
OFDPA_ERROR_t ofdpaGroupBucketEntryModify (ofdpaGroupBucketEntry_t *bucket)
 Modify Group Bucket entry.
 
OFDPA_ERROR_t ofdpaGroupBucketEntryNextGet (uint32_t groupId, uint32_t bucketIndex, ofdpaGroupBucketEntry_t *nextBucketEntry)
 Get the next Group Bucket entry.
 
OFDPA_ERROR_t ofdpaGroupBucketsDeleteAll (uint32_t groupId)
 Delete all Buckets from a Group.
 
OFDPA_ERROR_t ofdpaGroupDecode (uint32_t groupId, char *outBuf, int bufSize)
 Decode Group Id.
 
OFDPA_ERROR_t ofdpaGroupDelete (uint32_t groupId)
 Delete Group.
 
OFDPA_ERROR_t ofdpaGroupEntryInit (OFDPA_GROUP_ENTRY_TYPE_t groupType, ofdpaGroupEntry_t *group)
 Initialize Flow entry structure.
 
OFDPA_ERROR_t ofdpaGroupIndexGet (uint32_t groupId, uint32_t *index)
 Get the Index encoded in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupIndexSet (uint32_t *groupId, uint32_t index)
 Encode the Index in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupIndexShortGet (uint32_t groupId, uint32_t *index)
 Get the Short Index encoded in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupIndexShortSet (uint32_t *groupId, uint32_t index)
 Encode the Short Index in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupNextGet (uint32_t groupId, ofdpaGroupEntry_t *nextGroup)
 Get the next Group entry.
 
OFDPA_ERROR_t ofdpaGroupOverlayIndexSet (uint32_t *groupId, uint32_t index)
 Encode the Overlay Group index in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupOverlaySubTypeSet (uint32_t *groupId, OFDPA_L2_OVERLAY_SUBTYPE_t subType)
 Encode the Overlay Group Sub-type in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupOverlayTunnelIdSet (uint32_t *groupId, uint32_t tunnelId)
 Encode the tunnel Id in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupPortIdGet (uint32_t groupId, uint32_t *portId)
 Get the Port ID encoded in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupPortIdSet (uint32_t *groupId, uint32_t portId)
 Encode the Port Id in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupStatsGet (uint32_t groupId, ofdpaGroupEntryStats_t *groupStats)
 Get Group statistics.
 
OFDPA_ERROR_t ofdpaGroupTableInfoGet (OFDPA_GROUP_ENTRY_TYPE_t groupType, ofdpaGroupTableInfo_t *info)
 Get Group table info.
 
OFDPA_ERROR_t ofdpaGroupTypeGet (uint32_t groupId, uint32_t *type)
 Get the Group Type encoded in the Group ID.
 
OFDPA_ERROR_t ofdpaGroupTypeNextGet (uint32_t groupId, OFDPA_GROUP_ENTRY_TYPE_t groupType, ofdpaGroupEntry_t *nextGroup)
 Get the next Group entry of a given type.
 
OFDPA_ERROR_t ofdpaGroupTypeSet (uint32_t *groupId, uint32_t type)
 Encode the Group Type in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupVlanGet (uint32_t groupId, uint32_t *vlanId)
 Get the VLAN ID encoded in the Group Id.
 
OFDPA_ERROR_t ofdpaGroupVlanSet (uint32_t *groupId, uint32_t vlanId)
 Encode the VLAN Id in the Group Id.
 
OFDPA_ERROR_t ofdpaMaxPktSizeGet (uint32_t *pktSize)
 Report the size in bytes of the largest packet that can be received.
 
OFDPA_ERROR_t ofdpaNumQueuesGet (uint32_t portNum, uint32_t *numQueues)
 The client calls this function to get the number of COS queues on a port.
 
OFDPA_ERROR_t ofdpaPktReceive (struct timeval *timeout, ofdpaPacket_t *pkt)
 The client calls this function to retrieve a single packet that the hardware has punted to the CPU.
 
OFDPA_ERROR_t ofdpaPktSend (ofdpa_buffdesc *pkt, uint32_t flags, uint32_t outPortNum, uint32_t inPortNum)
 Packet out API.
 
OFDPA_ERROR_t ofdpaPortAdvertiseFeatureSet (uint32_t portNum, uint32_t advertise)
 Set the port features that can be advertized durng Auto-Negotiation.
 
OFDPA_ERROR_t ofdpaPortConfigGet (uint32_t portNum, OFDPA_PORT_CONFIG_t *config)
 Get the port administrative state.
 
OFDPA_ERROR_t ofdpaPortConfigSet (uint32_t portNum, OFDPA_PORT_CONFIG_t config)
 Set the port administrative state.
 
OFDPA_ERROR_t ofdpaPortCurrSpeedGet (uint32_t portNum, uint32_t *currSpeed)
 Get the port current speed.
 
OFDPA_ERROR_t ofdpaPortEventNextGet (ofdpaPortEvent_t *eventData)
 Get the next port event.
 
OFDPA_ERROR_t ofdpaPortFeatureGet (uint32_t portNum, ofdpaPortFeature_t *feature)
 Get the port features.
 
void ofdpaPortIndexGet (uint32_t portNum, uint32_t *index)
 Get the port index encoded in a port number value.
 
void ofdpaPortIndexSet (uint32_t *portNum, uint32_t index)
 Encode the port index in a port number.
 
OFDPA_ERROR_t ofdpaPortMacGet (uint32_t portNum, ofdpaMacAddr_t *mac)
 Get the MAC address of the given port.
 
OFDPA_ERROR_t ofdpaPortMaxSpeedGet (uint32_t portNum, uint32_t *maxSpeed)
 Get the port maximum speed.
 
OFDPA_ERROR_t ofdpaPortNameGet (uint32_t portNum, ofdpa_buffdesc *name)
 Get the port name.
 
OFDPA_ERROR_t ofdpaPortNextGet (uint32_t portNum, uint32_t *nextPortNum)
 Get the next port from the port table.
 
OFDPA_ERROR_t ofdpaPortStateGet (uint32_t portNum, OFDPA_PORT_STATE_t *state)
 Get the port link state.
 
OFDPA_ERROR_t ofdpaPortStatsClear (uint32_t portNum)
 Clear port statistics.
 
OFDPA_ERROR_t ofdpaPortStatsGet (uint32_t portNum, ofdpaPortStats_t *stats)
 Get port statistics.
 
void ofdpaPortTypeGet (uint32_t portNum, uint32_t *type)
 Get the port type encoded in a port number value.
 
void ofdpaPortTypeSet (uint32_t *portNum, uint32_t type)
 Encode the port type in a port number value.
 
OFDPA_ERROR_t ofdpaQueueRateGet (uint32_t portNum, uint32_t queueId, uint32_t *minRate, uint32_t *maxRate)
 The client calls this function to get minimum and maximum bandwidth on a queue on a given port.
 
OFDPA_ERROR_t ofdpaQueueRateSet (uint32_t portNum, uint32_t queueId, uint32_t minRate, uint32_t maxRate)
 The client calls this function to set minimum and maximum bandwidth on a queue on a given port.
 
OFDPA_ERROR_t ofdpaQueueStatsClear (uint32_t portNum, uint32_t queueId)
 The client calls this function to clear all the statistics of a queue on a port.
 
OFDPA_ERROR_t ofdpaQueueStatsGet (uint32_t portNum, uint32_t queueId, ofdpaPortQueueStats_t *stats)
 The client calls this function to get the statistics of a queue on a port.
 
OFDPA_ERROR_t ofdpaSourceMacLearningGet (OFDPA_CONTROL_t *mode, ofdpaSrcMacLearnModeCfg_t *srcMacLearnModeCfg)
 The client calls this function to get the Source Mac Learning Mode with other config parameters.
 
OFDPA_ERROR_t ofdpaSourceMacLearningSet (OFDPA_CONTROL_t mode, ofdpaSrcMacLearnModeCfg_t *srcMacLearnModeCfg)
 The client calls this function to set the Source Mac Learning Mode with other config parameters.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupCreate (uint32_t ecmpNextHopGroupId, ofdpaTunnelEcmpNextHopGroupConfig_t *config)
 Create a tunnel ECMP next hop group entry.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupDelete (uint32_t ecmpNextHopGroupId)
 Delete a tunnel ECMP next hop group entry.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupGet (uint32_t ecmpNextHopGroupId, ofdpaTunnelEcmpNextHopGroupConfig_t *config, ofdpaTunnelEcmpNextHopGroupStatus_t *status)
 Retrieve tunnel ECMP next hop group configuration and/or status.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMaxMembersGet (uint32_t *maxMemberCount)
 Return the number of ECMP next hop group members supported by the switch.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberAdd (uint32_t ecmpNextHopGroupId, uint32_t nextHopId)
 Adds a next hop member to an ECMP next hop group entry.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberDelete (uint32_t ecmpNextHopGroupId, uint32_t nextHopId)
 Adds a next hop member to an ECMP next hop group entry.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberGet (uint32_t ecmpNextHopListGroupId, uint32_t nextHopId)
 Test whether a next hop is a member in the specified ECMP next hop group.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberNextGet (uint32_t ecmpNextHopListGroupId, uint32_t nextHopId, uint32_t *nextNextHopId)
 Gets the next member next hop in the ECMP next hop group.
 
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupNextGet (uint32_t ecmpNextHopGroupId, uint32_t *nextEcmpNextHopGroupId)
 Return the ECMP tunnel next hop group identifier, if any, for the entry after the one specified.
 
OFDPA_ERROR_t ofdpaTunnelNextHopCreate (uint32_t nextHopId, ofdpaTunnelNextHopConfig_t *config)
 Create a tunnel next hop entry.
 
OFDPA_ERROR_t ofdpaTunnelNextHopDelete (uint32_t nextHopId)
 Delete a tunnel next hop entry.
 
OFDPA_ERROR_t ofdpaTunnelNextHopGet (uint32_t nextHopId, ofdpaTunnelNextHopConfig_t *config, ofdpaTunnelNextHopStatus_t *status)
 Retrieve tunnel next hop configuration and/or status.
 
OFDPA_ERROR_t ofdpaTunnelNextHopModify (uint32_t nextHopId, ofdpaTunnelNextHopConfig_t *config)
 Modify a tunnel next hop entry.
 
OFDPA_ERROR_t ofdpaTunnelNextHopNextGet (uint32_t nextHopId, uint32_t *nextNextHopId)
 Return the tunnel next hop identifier, if any, for the entry after the one specified.
 
OFDPA_ERROR_t ofdpaTunnelPortCreate (uint32_t portNum, ofdpa_buffdesc *name, ofdpaTunnelPortConfig_t *config)
 Create a tunnel logical port.
 
OFDPA_ERROR_t ofdpaTunnelPortDelete (uint32_t portNum)
 Delete a tunnel logical port.
 
OFDPA_ERROR_t ofdpaTunnelPortGet (uint32_t portNum, ofdpaTunnelPortConfig_t *config, ofdpaTunnelPortStatus_t *status)
 Retrieve tunnel logical port configuration and/or status.
 
OFDPA_ERROR_t ofdpaTunnelPortNextGet (uint32_t portNum, uint32_t *nextPortNum)
 Return the tunnel logical port identifier, if any, for the logical port after the one specified in the logical port table.
 
OFDPA_ERROR_t ofdpaTunnelPortTenantAdd (uint32_t portNum, uint32_t tunnelId)
 Adds a tenant reference to a logical port tunnel entry.
 
OFDPA_ERROR_t ofdpaTunnelPortTenantDelete (uint32_t portNum, uint32_t tunnelId)
 Deletes a tenant reference to a logical port tunnel entry.
 
OFDPA_ERROR_t ofdpaTunnelPortTenantGet (uint32_t portNum, uint32_t tunnelId, ofdpaTunnelPortTenantStatus_t *status)
 Test whether a tenant reference to a logical port exists for the port and tenant combination.
 
OFDPA_ERROR_t ofdpaTunnelPortTenantNextGet (uint32_t portNum, uint32_t tunnelId, uint32_t *nextTunnelId)
 Gets the next logical port tunnel entry after the port and tenant identified.
 
OFDPA_ERROR_t ofdpaTunnelTenantCreate (uint32_t tunnelId, ofdpaTunnelTenantConfig_t *config)
 Create a tunnel tenant entry.
 
OFDPA_ERROR_t ofdpaTunnelTenantDelete (uint32_t tunnelId)
 Delete a tunnel tenant entry.
 
OFDPA_ERROR_t ofdpaTunnelTenantGet (uint32_t tunnelId, ofdpaTunnelTenantConfig_t *config, ofdpaTunnelTenantStatus_t *status)
 Retrieve tunnel tenant configuration and/or status.
 
OFDPA_ERROR_t ofdpaTunnelTenantNextGet (uint32_t tunnelId, uint32_t *nextTunnelId)
 Return the tunnel identifier, if any, for the entry after the one specified.
 

Detailed Description

Macro Definition Documentation

#define OFDPA_MAC_ADDR_IS_NULL (   mac)
Value:
((mac[0] == 0) && (mac[1] == 0) && (mac[2] == 0) && \
(mac[3] == 0) && (mac[4] == 0) && (mac[5] == 0))

Check if MAC address is NULL.

Definition at line 82 of file ofdpa_datatypes.h.

Typedef Documentation

Flow Stats information.

The Group Table contains one entry for each Group.

The table is indexed by the groupId which identifies the group entry. Data is encoded into the groupId to specify the OF-DPA group entry type and information required by OF-DPA to configure the datapath.

The groupId encoding method is:

L2 Interface type: (MSB to LSB) 4 bits encode the Group Table Entry type | 12 bits of VLAN ID | 16 bits of port identifier

L2 Multicast, L2 Flood and L3 Multicast types: (MSB to LSB) 4 bits encode the Group Table Entry type | 12 bits of VLAN ID | 16 bits of index

L2 Rewrite, L3 Unicast, L3 Interface and L3 ECMP types: (MSB to LSB) 4 bits encode the Group Table Entry type | 28 bits of index

L2 Overlay type (MSB to LSB) 4 bits encode the Group Table Entry type | 16 bits of tunnel ID | 2 bits of sub-type | 10 bits of indexGroup Table Entry

Bitmaps of OFDPA_PORT_FEAT_* that describe features.

All bits zeroed if unsupported or unavailable.

Enumeration Type Documentation

enable or disable for config or status parameter.

Enumerator:
OFDPA_DISABLE 

disable

OFDPA_ENABLE 

enable

Definition at line 141 of file ofdpa_datatypes.h.

OFDPA uses these enumerators to indicate the error codes.

Enumerator:
OFDPA_E_NONE 

Success.

OFDPA_E_RPC 

Error in RPC.

OFDPA_E_INTERNAL 

Internal error.

OFDPA_E_PARAM 

Invalid parameter.

OFDPA_E_ERROR 

Parameter constraint violated.

OFDPA_E_FULL 

Maximum count is already reached or table full.

OFDPA_E_EXISTS 

Already exists.

OFDPA_E_TIMEOUT 

Operation Timeout.

OFDPA_E_FAIL 

Operation Fail.

OFDPA_E_DISABLED 

Disabled.

OFDPA_E_UNAVAIL 

Parameter/feature is not supported.

OFDPA_E_NOT_FOUND 

Parameter not found.

OFDPA_E_EMPTY 

Nothing to report or table is empty.

Definition at line 48 of file ofdpa_datatypes.h.

Flow event type.

Enumerator:
OFDPA_FLOW_EVENT_IDLE_TIMEOUT 

Flow idle timeout event.

OFDPA_FLOW_EVENT_HARD_TIMEOUT 

Flow hard timeout event.

Definition at line 1083 of file ofdpa_datatypes.h.

Flow Table Id enumerator.

Enumerator:
OFDPA_FLOW_TABLE_ID_INGRESS_PORT 

Ingress Port Table.

OFDPA_FLOW_TABLE_ID_VLAN 

VLAN Table.

OFDPA_FLOW_TABLE_ID_TERMINATION_MAC 

Termination MAC Table.

OFDPA_FLOW_TABLE_ID_UNICAST_ROUTING 

Unicast Routing Table.

OFDPA_FLOW_TABLE_ID_MULTICAST_ROUTING 

Multicast Routing Table.

OFDPA_FLOW_TABLE_ID_BRIDGING 

Bridging Table.

OFDPA_FLOW_TABLE_ID_ACL_POLICY 

ACL Table.

Definition at line 207 of file ofdpa_datatypes.h.

Group Type Enumerator.

Enumerator:
OFDPA_GROUP_ENTRY_TYPE_L2_INTERFACE 

Group type L2 Interface.

OFDPA_GROUP_ENTRY_TYPE_L2_REWRITE 

Group type L2 Rewrite.

OFDPA_GROUP_ENTRY_TYPE_L3_UNICAST 

Group type L3 Unicast.

OFDPA_GROUP_ENTRY_TYPE_L2_MULTICAST 

Group type L2 Multicast.

OFDPA_GROUP_ENTRY_TYPE_L2_FLOOD 

Group type L2 Flood.

OFDPA_GROUP_ENTRY_TYPE_L3_INTERFACE 

Group type L3 Interface.

OFDPA_GROUP_ENTRY_TYPE_L3_MULTICAST 

Group type L3 Multicast.

OFDPA_GROUP_ENTRY_TYPE_L3_ECMP 

Group type L3 ECMP.

OFDPA_GROUP_ENTRY_TYPE_L2_OVERLAY 

Group type L2 Overlay.

OFDPA_GROUP_ENTRY_TYPE_LAST 

Must be last.

Definition at line 690 of file ofdpa_datatypes.h.

L2 Overlay Group Sub-type Enumerator.

Enumerator:
OFDPA_L2_OVERLAY_FLOOD_UNICAST_TUNNEL 

send unknown multicast traffic via unicast tunnels

OFDPA_L2_OVERLAY_FLOOD_MULTICAST_TUNNEL 

send unknown multicast traffic via multicast tunnels

OFDPA_L2_OVERLAY_MULTICAST_UNICAST_TUNNEL 

send known multicast traffic via unicast tunnels

OFDPA_L2_OVERLAY_MULTICAST_MULTICAST_TUNNEL 

send known multicast traffic via multicast tunnels

Definition at line 716 of file ofdpa_datatypes.h.

Packet In reason codes.

Enumerator:
OFDPA_PACKET_IN_REASON_NO_MATCH 

No Match.

OFDPA_PACKET_IN_REASON_ACTION 

Action.

OFDPA_PACKET_IN_REASON_INVALID_TTL 

Invalid TTL.

Definition at line 1026 of file ofdpa_datatypes.h.

Flags to indicate behavior of the physical port.

These flags are used in ofp_port to describe the current configuration. They are used in the ofp_port_mod message to configure the port's behavior.

Enumerator:
OFDPA_PORT_CONFIG_DOWN 

Port is administratively down.

Definition at line 895 of file ofdpa_datatypes.h.

Port event type.

Enumerator:
OFDPA_EVENT_PORT_CREATE 

Port created.

OFDPA_EVENT_PORT_DELETE 

Port deleted.

OFDPA_EVENT_PORT_STATE 

Port link state has changed.

Definition at line 1056 of file ofdpa_datatypes.h.

Features of ports available in a datapath.

Enumerator:
OFDPA_PORT_FEAT_10MB_HD 

10 Mb half-duplex rate support.

OFDPA_PORT_FEAT_10MB_FD 

10 Mb full-duplex rate support.

OFDPA_PORT_FEAT_100MB_HD 

100 Mb half-duplex rate support.

OFDPA_PORT_FEAT_100MB_FD 

100 Mb full-duplex rate support.

OFDPA_PORT_FEAT_1GB_HD 

1 Gb half-duplex rate support.

OFDPA_PORT_FEAT_1GB_FD 

1 Gb full-duplex rate support.

OFDPA_PORT_FEAT_10GB_FD 

10 Gb full-duplex rate support.

OFDPA_PORT_FEAT_40GB_FD 

40 Gb full-duplex rate support.

OFDPA_PORT_FEAT_100GB_FD 

100 Gb full-duplex rate support.

OFDPA_PORT_FEAT_1TB_FD 

1 Tb full-duplex rate support.

OFDPA_PORT_FEAT_OTHER 

Other rate, not in the list.

OFDPA_PORT_FEAT_COPPER 

Copper medium.

OFDPA_PORT_FEAT_FIBER 

Fiber medium.

OFDPA_PORT_FEAT_AUTONEG 

Auto-negotiation.

OFDPA_PORT_FEAT_PAUSE 

Pause.

OFDPA_PORT_FEAT_PAUSE_ASYM 

Asymmetric pause.

Definition at line 911 of file ofdpa_datatypes.h.

Current state of the physical port.

These are not configurable from the controller.

Enumerator:
OFDPA_PORT_STATE_LINK_DOWN 

No physical link present.

Definition at line 904 of file ofdpa_datatypes.h.

Enumerator:
OFDPA_PORT_TYPE_PHYSICAL 

Port type Physical.

OFDPA_PORT_TYPE_LOGICAL_TUNNEL 

Port type Logical Tunnel.

Definition at line 99 of file ofdpa_datatypes.h.

Enumerator:
OFDPA_TUNNEL_PORT_TYPE_ENDPOINT 

Tunnel Port type Endpoint.

OFDPA_TUNNEL_PORT_TYPE_ACCESS 

Tunnel Port type Access.

Definition at line 1107 of file ofdpa_datatypes.h.

Enumerator:
OFDPA_TUNNEL_PROTO_VXLAN 

Tunnel Port protocol VxLAN.

OFDPA_TUNNEL_PROTO_NVGRE 

Tunnel Port protocol NVGRE.

Definition at line 1116 of file ofdpa_datatypes.h.

Component enumerator.

Enumerator:
OFDPA_COMPONENT_FIRST 

First Component.

OFDPA_COMPONENT_API 

API Component.

OFDPA_COMPONENT_MAPPING 

Mapping Component.

OFDPA_COMPONENT_RPC 

RPC Component.

OFDPA_COMPONENT_OFDB 

OFDB Component.

OFDPA_COMPONENT_DATAPATH 

Datapath Component.

OFDPA_COMPONENT_MAX 

Must be last.

Definition at line 152 of file ofdpa_datatypes.h.

Debug verbosity enumerator.

Enumerator:
OFDPA_DEBUG_ALWAYS 

Logging Always.

OFDPA_DEBUG_BASIC 

Basic Logging.

OFDPA_DEBUG_VERBOSE 

Verbose Logging.

OFDPA_DEBUG_VERY_VERBOSE 

Very Verbose Logging.

OFDPA_DEBUG_TOO_VERBOSE 

Too Verbose Logging.

OFDPA_DEBUG_MAX 

Must be last.

Definition at line 172 of file ofdpa_datatypes.h.

Function Documentation

int ofdpaBcmCommand ( ofdpa_buffdesc  buffer)

Execute a BCM command.

Parameters
[in]bufferBCM command
Returns
0 success
<0 failure
int ofdpaClientEventSockFdGet ( void  )

Get OF-DPA Client's event socket fd.

Returns
event socket fd
OFDPA_ERROR_t ofdpaClientInitialize ( char *  clientName)

Initialize OF-DPA client or user application.

For OF-DPA Standalone Application mode, sets up the RPC communication channel for the client. For the statically linked User Application, initializes the system.

Parameters
[in]clientNameclient name
Return values
OFDPA_E_NONEsuccess
OFDPA_E_PARAMerror in parameter passed
OFDPA_E_FAILfailure
int ofdpaClientPktSockFdGet ( void  )

Get OF-DPA Client's packet socket fd.

Returns
packet socket fd
int ofdpaCltDebugBuf ( ofdpa_buffdesc  functionName,
ofdpaComponentIds_t  component,
ofdpaDebugLevels_t  verbosity,
ofdpa_buffdesc  message 
)

Generate a debug message using a preformatted buffer.

Parameters
[in]functionNamename of function generating message
[in]componentID of component generating message
[in]verbositymessage severity
[in]messagebuffer containing message
Returns
number of characters in debug message
value less than zero if error
int ofdpaCltDebugPrintf ( const char *  functionName,
ofdpaComponentIds_t  component,
ofdpaDebugLevels_t  verbosity,
const char *  format,
  ... 
)

Generate a debug message using printf formatting.

Parameters
[in]functionNamename of function generating message
[in]componentID of component generating message
[in]verbositymessage severity
[in]formatformat string
[in]parmsoptional parameters for format string
Returns
number of characters in debug message
value less than zero if error
int ofdpaCltLogBuf ( int  priority,
ofdpa_buffdesc  message 
)

Generate a log message using a preformatted buffer.

Parameters
[in]prioritymessage priority (syslog values)
[in]messagebuffer containing message
Returns
number of characters in log message
value less than zero if error
int ofdpaCltLogPrintf ( int  priority,
char *  fmt,
  ... 
)

Generate a log message using printf formatting.

Parameters
[in]prioritymessage priority (syslog values)
[in]fmtformat string
[in]parmsoptional parameters for format string
Returns
number of characters in log message
value less than zero if error
int ofdpaComponentNameGet ( int  component,
ofdpa_buffdesc name 
)

Get the Component Name.

Parameters
[in]componentcomponent number
[out]namecomponent name
Returns
0 success
1 failure to get component
int ofdpaDebugComponentGet ( int  component)

Get Component debugging mode.

Parameters
[in]componentcomponent number (ofdpaComponentIds_t)
Returns
debug mode
int ofdpaDebugComponentSet ( int  component,
int  enable 
)

Enable/Disable the Component for debugging.

Parameters
[in]componentcomponent number (ofdpaComponentIds_t)
[in]enabledebug mode (ofdpaDebugLevels_t)
Returns
0 success
1 failure
int ofdpaDebugLvl ( int  lvl)

Set the Debug Verbosity.

Parameters
[in]lvlverbosity level (ofdpaDebugLevels_t)
Returns
0 success
int ofdpaDebugLvlGet ( void  )

Get the Debug Verbosity.

Returns
lvl verbosity level (ofdpaDebugLevels_t)
OFDPA_ERROR_t ofdpaEventReceive ( struct timeval *  timeout)

Receive an event.

Parameters
[in]timeouttime to wait for the event
Return values
OFDPA_E_NONEevent received successfully
OFDPA_E_FAILfailure in socket creation, timeout configuration or event reception
OFDPA_E_TIMEOUTno event waiting to be received
OFDPA_ERROR_t ofdpaFlowAdd ( ofdpaFlowEntry_t flow)

Add a new entry to a flow table.

Parameters
[in]flowstructure containing flow entry parameters
Return values
OFDPA_E_NONEflow entry added successfully
OFDPA_E_PARAMerror in flow entry parameters passed to function
OFDPA_E_ERRORflow entry validity check failed
OFDPA_E_FAILfailure occurred during flow entry installation
OFDPA_E_FULLmaximum number of flow entries already exist in table
OFDPA_E_EXISTSan entry that overlaps the new entry already exists in the table
OFDPA_ERROR_t ofdpaFlowByCookieDelete ( uint64_t  cookie)

Delete the flow entry with the specified cookie.

Parameters
[in]cookiecookie for the flow entry
Return values
OFDPA_E_NONEflow entry deleted successfully
OFDPA_E_FAILerror while deleting flow entry, including failure to find matching flow entry
OFDPA_ERROR_t ofdpaFlowByCookieGet ( uint64_t  cookie,
ofdpaFlowEntry_t flow,
ofdpaFlowEntryStats_t flowStats 
)

Returns statistics for the flow entry with the specified cookie value.

Parameters
[in]cookiecookie for the flow entry
[out]flowstructure to store flow entry parameters
[out]flowflowStatsstructure to store flow entry statistics
Return values
OFDPA_E_NONEflow entry was found and statistics returned
OFDPA_E_PARAMerror in flow entry parameters passed to function
OFDPA_E_NOT_FOUNDno flow entry with matching cookie found
OFDPA_E_FAILthe operation failed to complete
OFDPA_ERROR_t ofdpaFlowDelete ( ofdpaFlowEntry_t flow)

Delete an entry from a flow table.

Parameters
[in]flowstructure containing flow entry parameters
Return values
OFDPA_E_NONEflow entry added successfully
OFDPA_E_PARAMerror in flow entry parameters passed to function
OFDPA_E_FAILfailure occurred during flow entry installation
OFDPA_E_NOT_FOUNDno matching flow entry found
OFDPA_E_ERRORflow deletion validation failed
OFDPA_ERROR_t ofdpaFlowEntryInit ( OFDPA_FLOW_TABLE_ID_t  tableId,
ofdpaFlowEntry_t flow 
)

Initialize Flow entry structure.

Parameters
[in]tableIdFlow Table ID
[in,out]flowFlow entry structure
Return values
OFDPA_E_NONEif flow entry structure is initialized successfully.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_ERROR_t ofdpaFlowEventNextGet ( ofdpaFlowEvent_t eventData)

Get the next flow event.

Parameters
[in,out]eventDataevent data
Return values
OFDPA_E_NONEflow event data returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDnext port event not found
Note
populate the table id in eventData to get the events for the flow table
OFDPA_ERROR_t ofdpaFlowModify ( ofdpaFlowEntry_t flow)

Modify an existing entry in a flow table.

Parameters
[in]flowstructure containing flow entry parameters
Return values
OFDPA_E_NONEflow entry added successfully
OFDPA_E_PARAMerror in flow entry parameters passed to function
OFDPA_E_ERRORflow entry validity check failed
OFDPA_E_FAILfailure occurred during flow entry installation
OFDPA_ERROR_t ofdpaFlowNextGet ( ofdpaFlowEntry_t flow,
ofdpaFlowEntry_t nextFlow 
)

Retrieve the next flow entry in the specified flow table.

     This API allows the client to walk the entries in a flow table.
     In order to get the first entry in a flow table, the client
     calls with the flow table identifier set and all other
     parameters set to zero.  Table entries are walked in the
     order the table is indexed.  If there are no entries in the
     table after the entry specified, a return code indicates the
     end of the flow table has been reached
Parameters
[in]flowstructure containing flow entry parameters
[out]nextFlowstructure containing the next flow table entry, if any
Return values
OFDPA_E_NONEthe next flow entry was found and returned
OFDPA_E_PARAMerror in flow entry parameters passed to function
OFDPA_E_NOT_FOUNDno next flow entry found
OFDPA_ERROR_t ofdpaFlowStatsGet ( ofdpaFlowEntry_t flow,
ofdpaFlowEntryStats_t flowStats 
)

Returns statistics for the flow entry specified.

Parameters
[in]flowstructure containing flow entry parameters
[out]flowStatsstructure to store flow entry statistics
Return values
OFDPA_E_NONEflow entry was found and statistics returned
OFDPA_E_PARAMerror in flow entry parameters passed to function
OFDPA_E_NOT_FOUNDno matching flow entry found
OFDPA_ERROR_t ofdpaFlowTableInfoGet ( OFDPA_FLOW_TABLE_ID_t  tableId,
ofdpaFlowTableInfo_t info 
)

Get Flow Table Info.

Parameters
[in]tableIdflow table Id
[out]infoflow table info
Return values
OFDPA_E_NONEtable info returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDtable id not found
OFDPA_ERROR_t ofdpaGroupAdd ( ofdpaGroupEntry_t group)

Add Group.

Parameters
[in]groupgroup entry
Return values
OFDPA_E_NONEGroup added successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FULLGroup table full
OFDPA_E_EXISTSGroup entry exists
OFDPA_E_NOT_FOUNDport encoded in Group type L2 Interface not found
OFDPA_E_INTERNALinternal error
OFDPA_ERROR_t ofdpaGroupBucketEntryAdd ( ofdpaGroupBucketEntry_t bucket)

Add a Group Bucket entry.

Parameters
[in]bucketgroup bucket entry
Return values
OFDPA_E_NONEgroup bucket entry added successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FULLgroup bucket table full
OFDPA_E_NOT_FOUNDgroup not found
OFDPA_E_EXISTSgroup bucket entry exists
OFDPA_E_INTERNALinternal errors or failures
OFDPA_E_FAILinternal errors or failures
Note
For group table entries allowed to have multiple buckets, this is called more than once
OFDPA_ERROR_t ofdpaGroupBucketEntryDelete ( uint32_t  groupId,
uint32_t  bucketIndex 
)

Delete a Group Bucket entry.

Parameters
[in]groupIdgroup id
[in]bucketIndexgroup bucket index
Return values
OFDPA_E_NONEgroup bucket entry deleted successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDgroup bucket entry not found
OFDPA_E_EXISTSgroup reference exists
OFDPA_E_INTERNALinternal errors or failures
OFDPA_E_FAILinternal errors or failures
OFDPA_ERROR_t ofdpaGroupBucketEntryFirstGet ( uint32_t  groupId,
ofdpaGroupBucketEntry_t firstGroupBucket 
)

Get the first Group Bucket entry.

Parameters
[in]groupIdgroup id
[out]firstGroupBucketfirst group bucket entry
Return values
OFDPA_E_NONEgroup bucket entry returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FAILgroup bucket entry does not exist
OFDPA_ERROR_t ofdpaGroupBucketEntryGet ( uint32_t  groupId,
uint32_t  bucketIndex,
ofdpaGroupBucketEntry_t groupBucket 
)

Get the Group Bucket entry.

Parameters
[in]groupIdgroup id
[in]bucketIndexbucket index
[out]groupBucketgroup bucket entry
Return values
OFDPA_E_NONEgroup bucket entry returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FAILgroup bucket entry does not exist
OFDPA_ERROR_t ofdpaGroupBucketEntryInit ( OFDPA_GROUP_ENTRY_TYPE_t  groupType,
ofdpaGroupBucketEntry_t bucket 
)

Initialize Flow entry structure.

Parameters
[in]groupTypeGroup Type
[in,out]bucketGroup bucket entry structure
Return values
OFDPA_E_NONEif group bucket entry structure is initialized successfully.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_ERROR_t ofdpaGroupBucketEntryModify ( ofdpaGroupBucketEntry_t bucket)

Modify Group Bucket entry.

Parameters
[in]bucketgroup bucket entry to be modified
Return values
OFDPA_E_NONEgroup bucket entry modified successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDgroup bucket entry not found
OFDPA_E_INTERNALinternal errors or failures
OFDPA_E_FAILinternal errors or failures
OFDPA_ERROR_t ofdpaGroupBucketEntryNextGet ( uint32_t  groupId,
uint32_t  bucketIndex,
ofdpaGroupBucketEntry_t nextBucketEntry 
)

Get the next Group Bucket entry.

Parameters
[in]groupIdgroup id
[in]bucketIndexbucket index
[out]nextBucketEntrynext group bucket entry
Return values
OFDPA_E_NONEnext group bucket entry returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FAILnext group bucket entry does not exist
OFDPA_ERROR_t ofdpaGroupBucketsDeleteAll ( uint32_t  groupId)

Delete all Buckets from a Group.

Parameters
[in]groupIdgroup id
Return values
OFDPA_E_NONEgroup bucket entry deleted successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_EXISTSgroup reference exists
OFDPA_E_INTERNALinternal errors or failures
OFDPA_E_FAILinternal errors or failures
OFDPA_ERROR_t ofdpaGroupDecode ( uint32_t  groupId,
char *  outBuf,
int  bufSize 
)

Decode Group Id.

Parameters
[in]groupIdgroup id
[out]outBufgroup id decoded
[in]bufSizesize of outBuf
Return values
OFDPA_E_NONEGroup Id Decoded successfully
OFDPA_E_FULLbufSize not sufficient to hold the decoded Group Id
OFDPA_ERROR_t ofdpaGroupDelete ( uint32_t  groupId)

Delete Group.

Parameters
[in]groupIdgroup id
Return values
OFDPA_E_NONEGroup deleted successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDgroup entry not found
OFDPA_E_FAILfailure; other errors
OFDPA_ERROR_t ofdpaGroupEntryInit ( OFDPA_GROUP_ENTRY_TYPE_t  groupType,
ofdpaGroupEntry_t group 
)

Initialize Flow entry structure.

Parameters
[in]groupTypeGroup Type
[in,out]groupGroup entry structure
Return values
OFDPA_E_NONEif group entry structure is initialized successfully.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_ERROR_t ofdpaGroupIndexGet ( uint32_t  groupId,
uint32_t *  index 
)

Get the Index encoded in the Group Id.

Parameters
[in]groupIdgroup id
[out]indexIndex
Return values
OFDPA_E_NONEIndex returned successfully
OFDPA_E_UNAVAILIndex not available
Note
Applicable Group Types L2 Rewrite, L3 Unicast, L3 Interface, L3 ECMP
OFDPA_ERROR_t ofdpaGroupIndexSet ( uint32_t *  groupId,
uint32_t  index 
)

Encode the Index in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]indexIndex
Return values
OFDPA_E_NONEEncoded successfully
OFDPA_E_UNAVAILIndex field not available in Group Id
Note
Applicable Group Types L2 Rewrite, L3 Unicast, L3 Interface, L3 ECMP
OFDPA_ERROR_t ofdpaGroupIndexShortGet ( uint32_t  groupId,
uint32_t *  index 
)

Get the Short Index encoded in the Group Id.

Parameters
[in]groupIdgroup id
[out]indexIndex
Return values
OFDPA_E_NONEIndex returned successfully
OFDPA_E_UNAVAILIndex not available
Note
Applicable for L2 Multicastl L2 Flood and L3 Multicast group types only
OFDPA_ERROR_t ofdpaGroupIndexShortSet ( uint32_t *  groupId,
uint32_t  index 
)

Encode the Short Index in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]indexIndex
Return values
OFDPA_E_NONEEncoded successfully
OFDPA_E_UNAVAILShort Index field not available in Group Id
Note
Applicable for L2 Multicastl L2 Flood and L3 Multicast group types only
OFDPA_ERROR_t ofdpaGroupNextGet ( uint32_t  groupId,
ofdpaGroupEntry_t nextGroup 
)

Get the next Group entry.

Parameters
[in]groupIdgroup id
[out]nextGroupnext group entry
Return values
OFDPA_E_NONEnext group entry returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FAILnext group does not exist
OFDPA_ERROR_t ofdpaGroupOverlayIndexSet ( uint32_t *  groupId,
uint32_t  index 
)

Encode the Overlay Group index in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]indexindex
Return values
OFDPA_E_NONEEncoded successfully
OFDPA_E_UNAVAILSub-type field not available in Group Id
Note
Applicable Group Types L2 Overlay
OFDPA_ERROR_t ofdpaGroupOverlaySubTypeSet ( uint32_t *  groupId,
OFDPA_L2_OVERLAY_SUBTYPE_t  subType 
)

Encode the Overlay Group Sub-type in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]subTypesub-type
Return values
OFDPA_E_NONEEncoded successfully
OFDPA_E_UNAVAILSub-type field not available in Group Id
Note
Applicable Group Types L2 Overlay
OFDPA_ERROR_t ofdpaGroupOverlayTunnelIdSet ( uint32_t *  groupId,
uint32_t  tunnelId 
)

Encode the tunnel Id in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]tunnelIdtunnel Id
Return values
OFDPA_E_NONEEncoded successfully
OFDPA_E_UNAVAILtunnel Id field not available in Group Id
Note
Applicable Group Types L2 Overlay
OFDPA_ERROR_t ofdpaGroupPortIdGet ( uint32_t  groupId,
uint32_t *  portId 
)

Get the Port ID encoded in the Group Id.

Parameters
[in]groupIdgroup id
[out]portIdPort Id
Return values
OFDPA_E_NONEPort Id returned successfully
OFDPA_E_UNAVAILPort Id not available
Note
Applicable for L2 Interface group types only
OFDPA_ERROR_t ofdpaGroupPortIdSet ( uint32_t *  groupId,
uint32_t  portId 
)

Encode the Port Id in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]portIdPort Id
Return values
OFDPA_E_NONEEncoded successfully
OFDPA_E_UNAVAILPort Id field not available in Group Id
Note
Applicable Group Types L2 Interface only
OFDPA_ERROR_t ofdpaGroupStatsGet ( uint32_t  groupId,
ofdpaGroupEntryStats_t groupStats 
)

Get Group statistics.

Parameters
[in]groupIdgroup id
[out]groupStatsgroup statistics
Return values
OFDPA_E_NONEgroup statistics returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDgroup not found
OFDPA_ERROR_t ofdpaGroupTableInfoGet ( OFDPA_GROUP_ENTRY_TYPE_t  groupType,
ofdpaGroupTableInfo_t info 
)

Get Group table info.

Parameters
[in]groupTypegroup type
[in]infoinfo
Return values
OFDPA_E_NONEgroup info returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDgroup type not found
OFDPA_ERROR_t ofdpaGroupTypeGet ( uint32_t  groupId,
uint32_t *  type 
)

Get the Group Type encoded in the Group ID.

Parameters
[in]groupIdgroup id
[out]typegroup type
Return values
OFDPA_E_NONEGroup Id returned successfully
Note
Applicable for all group types
OFDPA_ERROR_t ofdpaGroupTypeNextGet ( uint32_t  groupId,
OFDPA_GROUP_ENTRY_TYPE_t  groupType,
ofdpaGroupEntry_t nextGroup 
)

Get the next Group entry of a given type.

Parameters
[in]groupIdgroup id
[in]groupTypegroup type
[out]nextGroupnext group entry
Return values
OFDPA_E_NONEnext group entry returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FAILnext group does not exist
OFDPA_ERROR_t ofdpaGroupTypeSet ( uint32_t *  groupId,
uint32_t  type 
)

Encode the Group Type in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]typegroup type
Return values
OFDPA_E_NONEEncoded successfully
Note
Applicable for all group types
OFDPA_ERROR_t ofdpaGroupVlanGet ( uint32_t  groupId,
uint32_t *  vlanId 
)

Get the VLAN ID encoded in the Group Id.

Parameters
[in]groupIdgroup id
[out]vlanIdVLAN Id
Return values
OFDPA_E_NONEVLAN Id returned successfully
OFDPA_E_UNAVAILVLAN Id not available
Note
Applicable for L2 Interface, L2 Multicast, L2 Flood, and L3 Multicast group types only
OFDPA_ERROR_t ofdpaGroupVlanSet ( uint32_t *  groupId,
uint32_t  vlanId 
)

Encode the VLAN Id in the Group Id.

Parameters
[in,out]groupIdgroup id
[in]vlanIdVLAN Id
Return values
OFDPA_E_NONEEncoded successfully
OFDPA_E_UNAVAILVLAN Id field not available in Group Id
Note
Applicable Group Types L2 Interface, L2 Multicast, L2 Flood and L3 Multicast
OFDPA_ERROR_t ofdpaMaxPktSizeGet ( uint32_t *  pktSize)

Report the size in bytes of the largest packet that can be received.

Parameters
[out]pktSizeThe maximum packet size, in bytes.
Return values
OFDPA_E_NONE
Note
A client can use the returned value to size a packet receive buffer.
OFDPA_ERROR_t ofdpaNumQueuesGet ( uint32_t  portNum,
uint32_t *  numQueues 
)

The client calls this function to get the number of COS queues on a port.

Parameters
[in]portNumPort number
[out]numQueuesNumber of Queues on a port
Return values
OFDPA_E_NONEif number of queues on a port is returned.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_E_NOT_FOUNDthe port does not exist.
OFDPA_ERROR_t ofdpaPktReceive ( struct timeval *  timeout,
ofdpaPacket_t pkt 
)

The client calls this function to retrieve a single packet that the hardware has punted to the CPU.

Parameters
[in]timeoutIf NULL, the function blocks until a packet is received. If the timeout value is zero, the function returns immediately, whether or not a packet is available. The return code indicates whether a packet has been received. If the timeout value is non-zero, the function blocks up to this length of time if a packet is not immediately available. Again, the return code indicates whether a packet was received.
[out]pktA packet structure allocated by the caller and used to return a received packet. The packet structure includes some metadata to indicate properties like why the packet came to the CPU and the ingress port. On input, the caller must set pkt->pktData.size to the size in bytes of the buffer allocated to hold the received packet. On output, pkt->pktData.size specifies the length of the packet in bytes. pkt->pktData.pstart on input must point to a buffer large enough to hold the largest possible received packet (OFDPA_MAX_PKT_LEN). This function copies the packet into this buffer, starting with the Ethernet header (the destination MAC address). The trailing Ethernet CRC is not included.
Return values
OFDPA_E_NONEif a packet is returned
OFDPA_E_TIMEOUTif no packet is available within the specified timeout
OFDPA_E_PARAMif an input parameter is invalid (e.g., pkt is NULL)
OFDPA_E_FAILfor any other failure
Note
This function runs in the client's own context and is not an RPC API.
OFDPA_ERROR_t ofdpaPktSend ( ofdpa_buffdesc pkt,
uint32_t  flags,
uint32_t  outPortNum,
uint32_t  inPortNum 
)

Packet out API.

Sends a packet out a switch port

Parameters
[in]pktpacket
[in]flagsOFDPA_PACKET_LOOKUP_TX: Indicates that packet must go through a hardware lookup starting from the first table in the pipeline. The srcIfNum is used as the ingress port in table lookups.

If this flag is not set, then the packet is sent unmodified out of the outIfNum

Parameters
[out]outPortNumOutput port. Can be physical or logical or reserved
[in]inPortNumInput port. Indicates the interface on which packet was originally received.
Return values
OFDPA_E_NONEif packet is transmitted successfully
OFDPA_E_PARAMif an input parameter is bad
OFDPA_E_NOT_FOUNDif the input or output port parameter is bad
OFDPA_E_INTERNALif transmit DMA buffer has not been allocated
Returns
Any other return code if there is a failure
Note
DPA will not do any buffering of packets and it is expected to be done at the agent if required
OFDPA_ERROR_t ofdpaPortAdvertiseFeatureSet ( uint32_t  portNum,
uint32_t  advertise 
)

Set the port features that can be advertized durng Auto-Negotiation.

Parameters
[in]portNumport number
[in]featureport features
Return values
OFDPA_E_NONEport features set successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_ERROR_t ofdpaPortConfigGet ( uint32_t  portNum,
OFDPA_PORT_CONFIG_t config 
)

Get the port administrative state.

Parameters
[in]portNumport number
[out]stateport administrative state
Return values
OFDPA_E_NONEport admin state returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_ERROR_t ofdpaPortConfigSet ( uint32_t  portNum,
OFDPA_PORT_CONFIG_t  config 
)

Set the port administrative state.

Parameters
[in]portNumport number
[in]stateport administrative state
Return values
OFDPA_E_NONEport admin state set successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_ERROR_t ofdpaPortCurrSpeedGet ( uint32_t  portNum,
uint32_t *  currSpeed 
)

Get the port current speed.

Parameters
[in]portNumport number
[out]currSpeedport current speed
Return values
OFDPA_E_NONEport current speed returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_ERROR_t ofdpaPortEventNextGet ( ofdpaPortEvent_t eventData)

Get the next port event.

Parameters
[in,out]eventDataevent data
Return values
OFDPA_E_NONEport event data returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDnext port event not found
Note
populate the port number in eventData to get the event for the next port
OFDPA_ERROR_t ofdpaPortFeatureGet ( uint32_t  portNum,
ofdpaPortFeature_t feature 
)

Get the port features.

Parameters
[in]portNumport number
[out]featureport features
Return values
OFDPA_E_NONEport features returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
void ofdpaPortIndexGet ( uint32_t  portNum,
uint32_t *  index 
)

Get the port index encoded in a port number value.

Parameters
[in]portNumport number value
[out]indexport index
Returns
nothing
void ofdpaPortIndexSet ( uint32_t *  portNum,
uint32_t  index 
)

Encode the port index in a port number.

Parameters
[in,out]portNumport number storage
[in]indexport index
Returns
nothing
OFDPA_ERROR_t ofdpaPortMacGet ( uint32_t  portNum,
ofdpaMacAddr_t mac 
)

Get the MAC address of the given port.

Parameters
[in]portNumcurrent port
[out]nextPortNumnext port
Return values
OFDPA_E_NONEMAC address returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_ERROR_t ofdpaPortMaxSpeedGet ( uint32_t  portNum,
uint32_t *  maxSpeed 
)

Get the port maximum speed.

Parameters
[in]portNumport number
[out]maxSpeedport maximum speed
Return values
OFDPA_E_NONEport max speed returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_ERROR_t ofdpaPortNameGet ( uint32_t  portNum,
ofdpa_buffdesc name 
)

Get the port name.

Parameters
[in]portNumport number
[out]nameport name
Return values
OFDPA_E_NONEport name returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
Note
Initialize the ofdpa_buffdesc with the name buffer and size appropriately. The size of the name buffer (including '\0') should be at least equal to OFDPA_MAX_PORT_NAME_STRING_SIZE
OFDPA_ERROR_t ofdpaPortNextGet ( uint32_t  portNum,
uint32_t *  nextPortNum 
)

Get the next port from the port table.

Parameters
[in]portNumcurrent port
[out]nextPortNumnext port
Return values
OFDPA_E_NONEnext port returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_FAILno more ports to be returned
OFDPA_ERROR_t ofdpaPortStateGet ( uint32_t  portNum,
OFDPA_PORT_STATE_t state 
)

Get the port link state.

Parameters
[in]portNumport number
[out]stateport link state
Return values
OFDPA_E_NONEport link state returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_ERROR_t ofdpaPortStatsClear ( uint32_t  portNum)

Clear port statistics.

Parameters
[in]portNumport number
Return values
OFDPA_E_NONEport statistics cleared successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_E_INTERNALinternal error
OFDPA_ERROR_t ofdpaPortStatsGet ( uint32_t  portNum,
ofdpaPortStats_t stats 
)

Get port statistics.

Parameters
[in]portNumport number
[out]statsport statistics
Return values
OFDPA_E_NONEport statistics returned successfully
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDport not found
OFDPA_E_UNAVAILcounter not available
OFDPA_E_INTERNALinternal error
void ofdpaPortTypeGet ( uint32_t  portNum,
uint32_t *  type 
)

Get the port type encoded in a port number value.

Parameters
[in]portNumport number value
[out]typeport type
Returns
nothing
void ofdpaPortTypeSet ( uint32_t *  portNum,
uint32_t  type 
)

Encode the port type in a port number value.

Parameters
[in,out]portNumport number storage
[in]typeport type
Returns
nothing
OFDPA_ERROR_t ofdpaQueueRateGet ( uint32_t  portNum,
uint32_t  queueId,
uint32_t *  minRate,
uint32_t *  maxRate 
)

The client calls this function to get minimum and maximum bandwidth on a queue on a given port.

Parameters
[in]portNumPort number
[in]queueIdQueue ID
[out]minRateMinimum bandwith
[out]maxRateMaximum bandwidth
Return values
OFDPA_E_NONEif minimum and maximum bandwidths of a queue are returned successfully on a given port.
OFDPA_E_PARAMif an input parameter is invalid
OFDPA_E_NOT_FOUNDthe port does not exist.
OFDPA_ERROR_t ofdpaQueueRateSet ( uint32_t  portNum,
uint32_t  queueId,
uint32_t  minRate,
uint32_t  maxRate 
)

The client calls this function to set minimum and maximum bandwidth on a queue on a given port.

Parameters
[in]portNumPort number
[in]queueIdQueue ID
[in]minRateMinimum bandwith
[in]maxRateMaximum bandwidth
Return values
OFDPA_E_NONEif minimum and maximum bandwidths of a queue are set successfully on a given port.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_E_NOT_FOUNDthe port does not exist.
OFDPA_ERROR_t ofdpaQueueStatsClear ( uint32_t  portNum,
uint32_t  queueId 
)

The client calls this function to clear all the statistics of a queue on a port.

Parameters
[in]portNumPort number
[in]queueIdQueue ID
Return values
OFDPA_E_NONEif the port queue statistics are cleared.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_E_NOT_FOUNDthe port does not exist.
OFDPA_ERROR_t ofdpaQueueStatsGet ( uint32_t  portNum,
uint32_t  queueId,
ofdpaPortQueueStats_t stats 
)

The client calls this function to get the statistics of a queue on a port.

Parameters
[in]portNumPort number
[in]queueIdQueue ID
[out]statsQueue Statistics on a given port
Return values
OFDPA_E_NONEif the port queue statistics are returned.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_E_NOT_FOUNDthe port does not exist.
OFDPA_ERROR_t ofdpaSourceMacLearningGet ( OFDPA_CONTROL_t mode,
ofdpaSrcMacLearnModeCfg_t srcMacLearnModeCfg 
)

The client calls this function to get the Source Mac Learning Mode with other config parameters.

Parameters
[out]modeSource MAC Learning Mode
[out]srcMacLearnModeCfgConfig structure holding other parameters of Source MAC Learning
Return values
OFDPA_E_NONEif Source MAC Learning Mode is returned successfully on controller port.
OFDPA_E_PARAMif an input parameter is invalid.
OFDPA_ERROR_t ofdpaSourceMacLearningSet ( OFDPA_CONTROL_t  mode,
ofdpaSrcMacLearnModeCfg_t srcMacLearnModeCfg 
)

The client calls this function to set the Source Mac Learning Mode with other config parameters.

Parameters
[in]modeSource MAC Learning Mode
[in]srcMacLearnModeCfgConfig structure holding other parameters of Source MAC Learning
Return values
OFDPA_E_NONEif Source MAC Learning Mode is set successfully.
OFDPA_E_UNAVAILif any of the learning methods (Local/Controller managed) is unsupported.
OFDPA_E_PARAMif an input parameter is invalid.
Note
Enable mode: Copies the packets with unknown source address to CPU.
Disable mode: Switches the packets with unknown source address.
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupCreate ( uint32_t  ecmpNextHopGroupId,
ofdpaTunnelEcmpNextHopGroupConfig_t config 
)

Create a tunnel ECMP next hop group entry.

Parameters
[in]ecmpNextHopGroupIdunique identifier for the entry
[in]configstructure containing configuration parameters
Return values
OFDPA_E_NONEentry successfully created
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_ERRORconfiguration error
OFDPA_E_FAILfailure occurred during entry creation
OFDPA_E_FULLmaximum number of entries already created
OFDPA_E_EXISTSan entry with the specified identifier already created
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupDelete ( uint32_t  ecmpNextHopGroupId)

Delete a tunnel ECMP next hop group entry.

Parameters
[in]ecmpNextHopGroupIdunique identifier for the entry
Return values
OFDPA_E_NONEentry successfully deleted
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDentry with identifier not configured
OFDPA_E_FAILfailure occurred during deletion, reasons include attempting to delete an entry that is being referenced
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupGet ( uint32_t  ecmpNextHopGroupId,
ofdpaTunnelEcmpNextHopGroupConfig_t config,
ofdpaTunnelEcmpNextHopGroupStatus_t status 
)

Retrieve tunnel ECMP next hop group configuration and/or status.

Parameters
[in]ecmpNextHopGroupIdunique identifier for the entry
[out]configstructure containing ECMP tunnel next hop configuration (optional)
[out]statusstructure containing ECMP tunnel next hop status (optional)
Return values
OFDPA_E_NONEdata successfully retrieved
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDentry with identifier not configured
Note
If the caller does not require the data in the configuration or status structure, either or both parameters may be set to NULL. An example of this type of invocation is if the caller is checking on presence of the entry, but has no need for the configuration or status data.
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMaxMembersGet ( uint32_t *  maxMemberCount)

Return the number of ECMP next hop group members supported by the switch.

Parameters
[out]maxMemberCountmaximum members supported in an ECMP next hop group
Return values
OFDPA_E_NONEmax count returned
OFDPA_E_PARAMNULL pointer passed
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberAdd ( uint32_t  ecmpNextHopGroupId,
uint32_t  nextHopId 
)

Adds a next hop member to an ECMP next hop group entry.

This is done by adding any entry to the ECMP next hop group member table. The index into this table is the ecmpNextHopGroupId, nextHopId tuple.

Parameters
[in]ecmpNextHopGroupIdECMP next hop group entry identifier
[in]nextHopIdnext hop entry identifier
Return values
OFDPA_E_NONEmember next hop successfully added
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_ERRORconfiguration error, includes ECMP tunnel next hop or next hop entry not found or other constraint violation
OFDPA_E_FAILfailure occurred while adding next hop to ECMP next hop group
OFDPA_E_FULLmaximum number of member next hops already added
OFDPA_E_EXISTSan entry with the specified identifier combination already added
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberDelete ( uint32_t  ecmpNextHopGroupId,
uint32_t  nextHopId 
)

Adds a next hop member to an ECMP next hop group entry.

This is done by adding any entry to the ECMP next hop group member table. The index into this table is the ecmpNextHopGroupId, nextHopId tuple.

Parameters
[in]ecmpNextHopGroupIdECMP next hop group entry identifier
[in]nextHopIdnext hop entry identifier
Return values
OFDPA_E_NONEnext hop member successfully deleted
OFDPA_E_NOT_FOUNDnext hop member is not configured in ECMP next hop group
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberGet ( uint32_t  ecmpNextHopListGroupId,
uint32_t  nextHopId 
)

Test whether a next hop is a member in the specified ECMP next hop group.

Parameters
[in]ecmpNextHopGroupIdECMP next hop group entry identifier
[in]nextHopIdnext hop entry identifier
Return values
OFDPA_E_NONEnext hop is a member of ECMP next hop group
OFDPA_E_NOT_FOUNDnext hop is not a member of ECMP next hop group
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupMemberNextGet ( uint32_t  ecmpNextHopListGroupId,
uint32_t  nextHopId,
uint32_t *  nextNextHopId 
)

Gets the next member next hop in the ECMP next hop group.

Parameters
[in]ecmpNextHopGroupIdECMP next hop group entry identifier
[in]nextHopIdnext hop entry identifier
[out]nextNextHopIdnext next hop entry identifier, if any
Return values
OFDPA_E_NONEnext entry found
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDno next entry found
OFDPA_ERROR_t ofdpaTunnelEcmpNextHopGroupNextGet ( uint32_t  ecmpNextHopGroupId,
uint32_t *  nextEcmpNextHopGroupId 
)

Return the ECMP tunnel next hop group identifier, if any, for the entry after the one specified.

Parameters
[in]ecmpNextHopGroupIdunique identifier for the entry
[out]nextEcmpNextHopGroupIdunique identifier for the next entry
Return values
OFDPA_E_NONEnext identifer found
OFDPA_E_FAILno next identifer found
OFDPA_ERROR_t ofdpaTunnelNextHopCreate ( uint32_t  nextHopId,
ofdpaTunnelNextHopConfig_t config 
)

Create a tunnel next hop entry.

Parameters
[in]nextHopIdunique identifier for the entry
[in]configstructure containing configuration parameters
Return values
OFDPA_E_NONEentry successfully created
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_ERRORconfiguration error
OFDPA_E_FAILfailure occurred during entry creation
OFDPA_E_FULLmaximum number of entries already created
OFDPA_E_EXISTSan entry with the specified identifier already created
OFDPA_ERROR_t ofdpaTunnelNextHopDelete ( uint32_t  nextHopId)

Delete a tunnel next hop entry.

Parameters
[in]nextHopIdunique identifier for the entry
Return values
OFDPA_E_NONEentry successfully deleted
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDentry with identifier not configured
OFDPA_E_FAILfailure occurred during deletion, reasons include attempting to delete an entry that is being referenced
OFDPA_ERROR_t ofdpaTunnelNextHopGet ( uint32_t  nextHopId,
ofdpaTunnelNextHopConfig_t config,
ofdpaTunnelNextHopStatus_t status 
)

Retrieve tunnel next hop configuration and/or status.

Parameters
[in]tunnelIdunique identifier for the entry
[out]configstructure containing tunnel next hop configuration (optional)
[out]statusstructure containing tunnel next hop status (optional)
Return values
OFDPA_E_NONEdata successfully retrieved
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDentry with identifier not configured
Note
If the caller does not require the data in the configuration or status structure, either or both parameters may be set to NULL. An example of this type of invocation is if the caller is checking on presence of the entry, but has no need for the configuration or status data.
OFDPA_ERROR_t ofdpaTunnelNextHopModify ( uint32_t  nextHopId,
ofdpaTunnelNextHopConfig_t config 
)

Modify a tunnel next hop entry.

This allows updating the configuration data of a next hop while it is referenced by other configuration. A referenced entry cannot be deleted but it can be modified.

Parameters
[in]nextHopIdunique identifier for an existing entry
[in]configstructure containing new configuration parameters
Return values
OFDPA_E_NONEentry successfully modified
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_ERRORconfiguration error, including attempting to modify next hop in a manner not allowed. See notes.
OFDPA_E_FAILfailure occurred during entry modification
OFDPA_E_NOT_FOUNDentry with identifier not configured
Note
Modification cannot change the destination MAC address from unicast to multicast or multicast to unicast. Modification cannot change the protocol of the next hop entry.
OFDPA_ERROR_t ofdpaTunnelNextHopNextGet ( uint32_t  nextHopId,
uint32_t *  nextNextHopId 
)

Return the tunnel next hop identifier, if any, for the entry after the one specified.

Parameters
[in]nextHopIdunique identifier for the next hop
[out]nextNextHopIdunique identifier for the next next hop entry
Return values
OFDPA_E_NONEnext identifer found
OFDPA_E_FAILno next identifer found
OFDPA_ERROR_t ofdpaTunnelPortCreate ( uint32_t  portNum,
ofdpa_buffdesc name,
ofdpaTunnelPortConfig_t config 
)

Create a tunnel logical port.

Parameters
[in]portNumunique identifier for the port within the switch
[in]namehuman readable name for the interface
[in]configstructure containing tunnel logical port parameters
Return values
OFDPA_E_NONElogical port successfully created
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_ERRORinternal error
OFDPA_E_FAILfailure occurred during logical port creation
OFDPA_E_FULLmaximum number of logical ports already created
OFDPA_E_EXISTSan entry with the specified portnum already created
OFDPA_ERROR_t ofdpaTunnelPortDelete ( uint32_t  portNum)

Delete a tunnel logical port.

Parameters
[in]portNumunique identifier for the port within the switch
Return values
OFDPA_E_NONElogical port successfully deleted
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDlogical port with identifier not configured
OFDPA_E_FAILfailure occurred during logical port deletion
OFDPA_ERROR_t ofdpaTunnelPortGet ( uint32_t  portNum,
ofdpaTunnelPortConfig_t config,
ofdpaTunnelPortStatus_t status 
)

Retrieve tunnel logical port configuration and/or status.

Parameters
[in]portNumunique identifier for the port within the switch
[out]configstructure containing tunnel logical port configuration (optional)
[out]statusstructure containing tunnel logical port status (optional)
Return values
OFDPA_E_NONElogical port data successfully retrieved
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDlogical port with identifier not configured
Note
If the caller does not require the data in the configuration or status structure, either or both parameters may be set to NULL. An example of this type of invocation is if the caller is checking on presence of a logical port, but has no need for the configuration or status data.
OFDPA_ERROR_t ofdpaTunnelPortNextGet ( uint32_t  portNum,
uint32_t *  nextPortNum 
)

Return the tunnel logical port identifier, if any, for the logical port after the one specified in the logical port table.

Parameters
[in]portNumunique identifier for the port within the switch
[out]nextPortNumunique identifier for the next logical port within the switch
Return values
OFDPA_E_NONEnext logical port identifer found
OFDPA_E_FAILno next logical port identifer found
OFDPA_ERROR_t ofdpaTunnelPortTenantAdd ( uint32_t  portNum,
uint32_t  tunnelId 
)

Adds a tenant reference to a logical port tunnel entry.

This is done by adding any entry to the tunnel port tenant table. The index into this table is the portNum, tunnelId tuple.

Parameters
[in]portNumunique identifier for the port within the switch
[in]tunnelIdtenant entry identifier
Return values
OFDPA_E_NONElogical port to tenant association successfully added
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_ERRORconfiguration error, includes logical port or tenant entry not found or other constraint violation
OFDPA_E_FAILfailure occurred during logical port association with tenant
OFDPA_E_FULLmaximum number of associations already created
OFDPA_E_EXISTSan entry with the specified portnum and tunnelId already added
OFDPA_ERROR_t ofdpaTunnelPortTenantDelete ( uint32_t  portNum,
uint32_t  tunnelId 
)

Deletes a tenant reference to a logical port tunnel entry.

Parameters
[in]portNumunique identifier for the port within the switch
[in]tunnelIdtenant entry identifier
Return values
OFDPA_E_NONElogical port to tenant association successfully deleted
OFDPA_E_FAILfailure occurred deleting logical port association with tenant, including the entry not being found
OFDPA_ERROR_t ofdpaTunnelPortTenantGet ( uint32_t  portNum,
uint32_t  tunnelId,
ofdpaTunnelPortTenantStatus_t status 
)

Test whether a tenant reference to a logical port exists for the port and tenant combination.

      Optionally retrieve status of entry.
Parameters
[in]portNumunique identifier for the port within the switch
[in]tunnelIdtenant entry identifier
[out]statusstructure containing tunnel logical port/tenant status (optional)
Return values
OFDPA_E_NONElogical port to tenant association successfully deleted
OFDPA_E_NOT_FOUNDlogical port to tenant association is not configured
Note
If the caller does not require the data in status structure, this parameter may be set to NULL. An example of this type of invocation is if the caller is checking on presence of an entry for the logical port and tenant, but has no need for the status data.
OFDPA_ERROR_t ofdpaTunnelPortTenantNextGet ( uint32_t  portNum,
uint32_t  tunnelId,
uint32_t *  nextTunnelId 
)

Gets the next logical port tunnel entry after the port and tenant identified.

      Iteration stops after returning the tunnelId for the last tenant
      associated with the logical port.
Parameters
[in]portNumunique identifier for the port within the switch
[in]tunnelIdtenant entry identifier
[out]nextTunnelIdnext tenant entry identifier, if any
Return values
OFDPA_E_NONEnext logical port tunnel identifer found
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDno next logical port tunnel identifer found
OFDPA_ERROR_t ofdpaTunnelTenantCreate ( uint32_t  tunnelId,
ofdpaTunnelTenantConfig_t config 
)

Create a tunnel tenant entry.

Parameters
[in]tunnelIdunique identifier for the tenant
[in]configstructure containing tenant parameters
Return values
OFDPA_E_NONEtenant entry successfully created
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_ERRORconfiguration error including specifying a multicast next hop entry reference that does not exist
OFDPA_E_FAILfailure occurred during tenant creation
OFDPA_E_FULLmaximum number of tenants already created
OFDPA_E_EXISTSan entry with the specified tunnelId already created
OFDPA_ERROR_t ofdpaTunnelTenantDelete ( uint32_t  tunnelId)

Delete a tunnel tenant entry.

Parameters
[in]tunnelIdunique identifier for the tenant
Return values
OFDPA_E_NONEtenant entry successfully deleted
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDtenant entry with identifier not configured
OFDPA_E_FAILfailure occurred during tenant deletion, reasons include attempting to delete a tenant entry that is being referenced
OFDPA_ERROR_t ofdpaTunnelTenantGet ( uint32_t  tunnelId,
ofdpaTunnelTenantConfig_t config,
ofdpaTunnelTenantStatus_t status 
)

Retrieve tunnel tenant configuration and/or status.

Parameters
[in]tunnelIdunique identifier for the tenant
[out]configstructure containing tunnel tenant configuration (optional)
[out]statusstructure containing tunnel tenant status (optional)
Return values
OFDPA_E_NONEdata successfully retrieved
OFDPA_E_PARAMerror in parameters passed to function
OFDPA_E_NOT_FOUNDentry with identifier not configured
Note
If the caller does not require the data in the configuration or status structure, either or both parameters may be set to NULL. An example of this type of invocation is if the caller is checking on presence of the entry, but has no need for the configuration or status data.
OFDPA_ERROR_t ofdpaTunnelTenantNextGet ( uint32_t  tunnelId,
uint32_t *  nextTunnelId 
)

Return the tunnel identifier, if any, for the entry after the one specified.

Parameters
[in]tunnelIdunique identifier for the tenant
[out]nextTunnelIdunique identifier for the next tenant entry
Return values
OFDPA_E_NONEnext identifer found
OFDPA_E_FAILno next identifer found