Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Data Structures | Macros | Enumerations | Functions | Variables
MPLS Configuration And Status [OPENAPI_MPLS]

Data Structures

struct  OPEN_MPLS_LABELS_t
 
struct  OPEN_MPLS_TUNNEL_INITIATOR_t
 MPLS tunnel initiator informaton. More...
 

Macros

#define OPEN_MAX_MPLS_IMPOSE_LABELS   3
 

Enumerations

enum  OPEN_MPLS_LFDB_ENTRY_TYPE_t { OPEN_MPLS_TYPE_LAYER_2 = 1, OPEN_MPLS_TYPE_IPV4 = 2, OPEN_MPLS_TYPE_IPV6 = 3, OPEN_MPLS_TYPE_LAST = 4 }
 MPLS LFDB label type. More...
 
enum  OPEN_MPLS_LFDB_IN_HARDWARE_STATUS_t { OPEN_MPLS_LABEL_IN_HARDWARE = 0, OPEN_MPLS_LABEL_NOT_IN_HARDWARE = 1 }
 MPLS LFDB label status. More...
 
enum  OPEN_MPLS_LFDB_LABEL_ACTION_t { OPEN_MPLS_LABEL_SWAP = 1, OPEN_MPLS_LABEL_POP = 2, OPEN_MPLS_LABEL_LAST_POP = 3 }
 MPLS LFDB label action. More...
 
enum  OPEN_MPLS_LFDB_NOT_INSERTED_REASON_t {
  OPEN_MPLS_NONE = 0, OPEN_MPLS_UNKNOWN_SUBNET = 1, OPEN_MPLS_LOCAL_SUBNET = 3, OPEN_MPLS_NO_RESOURCES = 4,
  OPEN_MPLS_NO_VLAN = 5, OPEN_MPLS_NO_PORT = 6
}
 Reason for which the MPLS LFDB label is not applied to HW. More...
 
enum  OPEN_MPLS_LFDB_PROTOCOL_t { OPEN_MPLS_PROTO_STATIC = 1, OPEN_MPLS_PROTO_DYNAMIC = 2, OPEN_MPLS_PROTO_BGP = 3, OPEN_MPLS_PROTO_LAST = 4 }
 MPLS LFDB protocol type. More...
 

Functions

open_error_t openapiMplsBgpIntfLabelGet (openapiClientHandle_t *client_handle, uint32_t intIfNum, OPEN_AFX_t type, uint32_t *label)
 Get the label configured for the specified interface. More...
 
open_error_t openapiMplsBgpIntfLabelSet (openapiClientHandle_t *client_handle, uint32_t intIfNum, OPEN_AFX_t type, uint32_t label)
 Set an interface label. More...
 
open_error_t openapiMplsBgpLabelModeGet (openapiClientHandle_t *client_handle, OPEN_CONTROL_t *mode)
 Gets the BGP label distribution mode. More...
 
open_error_t openapiMplsBgpLabelModeSet (openapiClientHandle_t *client_handle, OPEN_CONTROL_t mode)
 Sets the BGP label distribution mode. More...
 
open_error_t openapiMplsCountersClear (openapiClientHandle_t *client_handle)
 Clears MPLS statistics. More...
 
open_error_t openapiMplsGlobalStatusGet (openapiClientHandle_t *client_handle, OPEN_MPLS_GLOBAL_STATS_t *global_status)
 Gets the global MPLS status and statistics. More...
 
open_error_t openapiMplsLfdbCreate (openapiClientHandle_t *client_handle, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry)
 Inserts a LFDB entry into the database. More...
 
open_error_t openapiMplsLfdbDelete (openapiClientHandle_t *client_handle, uint32_t label)
 Deletes an LFDB entry from the database. More...
 
open_error_t openapiMplsLfdbGet (openapiClientHandle_t *client_handle, uint32_t label, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry)
 Gets the LFDB entry for the specified label. More...
 
open_error_t openapiMplsLfdbNextGet (openapiClientHandle_t *client_handle, uint32_t label, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry)
 Gets the LFDB entry for the next numerically higher label after the specified label. More...
 
open_error_t openapiMplsTunnelInitiatorGet (openapiClientHandle_t *client_handle, OPEN_MPLS_TUNNEL_INITIATOR_t *tunnel_entry)
 Get the specified MPLS tunnel initiator information. More...
 
open_error_t openapiMplsTunnelInitiatorGetNext (openapiClientHandle_t *client_handle, OPEN_MPLS_TUNNEL_INITIATOR_t *tunnel_entry, OPEN_MPLS_TUNNEL_INITIATOR_t *next_tunnel_entry)
 Get the next MPLS tunnel initiator information. More...
 

Variables

uint32_t duplicateInsertions
 The counter shows how many duplicate insertion attempts happened for the LFDB entry. More...
 
uint32_t dynamicLfdbInsertFailures
 LFDB dynamic insert failure count. More...
 
uint32_t ecmpHighInUse
 The highest number of ECMP entries used since the switch was last powered up. More...
 
uint32_t ecmpInUse
 Current number of ECMP groups in use. More...
 
uint32_t ecmpMax
 The maximum number of ECMP entries available in the hardware. More...
 
uint32_t egressInterface
 Egress interface. More...
 
uint32_t egressLabel
 Egress label ID. More...
 
unsigned char egressMac [OPEN_MAC_ADDR_LEN]
 Egress MAC. More...
 
uint32_t egressVlan
 Egress VLAN. More...
 
OPEN_MPLS_LFDB_ENTRY_TYPE_t entryType
 Type of label. More...
 
uint64_t inBytes
 Statistics in bytes. More...
 
OPEN_MPLS_LFDB_IN_HARDWARE_STATUS_t inHardware
 Label status. More...
 
uint64_t inPackets
 Statistics in packets. More...
 
uint32_t ipv4Addr
 IPv4 address. More...
 
uint32_t ipv4PrefixLen
 IPv4 prefix len. More...
 
uint32_t ipv6PrefixLen
 IPv6 prefix len. More...
 
open_in6_addr_t ipv6Subnet
 IPv6 address. More...
 
OPEN_MPLS_LFDB_LABEL_ACTION_t labelAction
 Label action. More...
 
uint32_t lfdbHighWaterMark
 LFDB high water mark. More...
 
uint64_t lfdbLookupFailurePackets
 LFDB lookup failure packets. More...
 
uint32_t lfdbSize
 Maximum number of LFDB entries available in the hardware. More...
 
uint32_t maxLfdbLabel
 Maximum number that can be used as a label ID. More...
 
uint32_t maxTunnelInitiators
 Maximum number of MPLS tunnels available in the hardware. More...
 
uint32_t minLfdbLabel
 Minimal number that can be used as a label ID. More...
 
OPEN_MPLS_LFDB_NOT_INSERTED_REASON_t notInsertedReason
 Reason why a MPLS label is not applied in HW. More...
 
uint32_t numLfdbEntries
 Number of LFDB entries that have been already created. More...
 
uint32_t numLfdbInHardware
 Number of LFDB entries that have been applied into HW. More...
 
uint32_t numLfdbNotInHardware
 Number of LFDB entries that have not been applied into HW. More...
 
uint32_t numLfdbPerProto [OPEN_MPLS_PROTO_LAST]
 Number of LFDB entries per protocol. More...
 
uint32_t numLfdbPerType [OPEN_MPLS_TYPE_LAST]
 Number of LFDB entries per type. More...
 
uint32_t numTunnelInitiators
 Number of MPLS tunnels that have been already created. More...
 
uint32_t numTunnelsOneLabel
 Number of MPLS tunnels created with one label.
 
uint32_t numTunnelsThreeLabel
 Number of MPLS tunnels created with three labels.
 
uint32_t numTunnelsTwoLabel
 Number of MPLS tunnels created with two labels.
 
 OPEN_MPLS_GLOBAL_STATS_t
 
 OPEN_MPLS_LFDB_ENTRY_t
 
 OPEN_PACKED_STRUCT
 MPLS LFDB entry information. More...
 
OPEN_MPLS_LFDB_PROTOCOL_t protocol
 Protocol by which the label is created. More...
 

Detailed Description

Enumeration Type Documentation

MPLS LFDB label type.

Enumerator
OPEN_MPLS_TYPE_LAYER_2 

L2 label type.

OPEN_MPLS_TYPE_IPV4 

L3 label type that works with IPv4 address.

OPEN_MPLS_TYPE_IPV6 

L3 label type that works with IPv6 address.

OPEN_MPLS_TYPE_LAST 

This entry must be last in the list.

Definition at line 59 of file openapi_mpls.h.

MPLS LFDB label status.

Enumerator
OPEN_MPLS_LABEL_IN_HARDWARE 

A label was applied to HW.

OPEN_MPLS_LABEL_NOT_IN_HARDWARE 

A label was not applied into HW.

The reason is located in OPEN_MPLS_LFDB_NOT_INSERTED_REASON_t.

Definition at line 76 of file openapi_mpls.h.

MPLS LFDB label action.

Enumerator
OPEN_MPLS_LABEL_SWAP 

Swap action.

OPEN_MPLS_LABEL_POP 

Pop action.

OPEN_MPLS_LABEL_LAST_POP 

Last pop action.

Definition at line 68 of file openapi_mpls.h.

Reason for which the MPLS LFDB label is not applied to HW.

Enumerator
OPEN_MPLS_NONE 

Label is inserted in hardware.

OPEN_MPLS_UNKNOWN_SUBNET 

L3 label does not match any subnet.

OPEN_MPLS_LOCAL_SUBNET 

L3 label matches a locally attached subnet.

OPEN_MPLS_NO_RESOURCES 

Out of resources error.

OPEN_MPLS_NO_VLAN 

L2 label is not installed because reference VLAN is not created.

OPEN_MPLS_NO_PORT 

L2 label is not installed because egress port is not attached.

Either a LAG member or a LAG with no members.

Definition at line 84 of file openapi_mpls.h.

MPLS LFDB protocol type.

Enumerator
OPEN_MPLS_PROTO_STATIC 

Static label.

OPEN_MPLS_PROTO_DYNAMIC 

Dynamic label.

OPEN_MPLS_PROTO_BGP 

Label created with BGP.

OPEN_MPLS_PROTO_LAST 

This entry must be last in the list.

Definition at line 50 of file openapi_mpls.h.

Function Documentation

open_error_t openapiMplsBgpIntfLabelGet ( openapiClientHandle_t client_handle,
uint32_t  intIfNum,
OPEN_AFX_t  type,
uint32_t *  label 
)

Get the label configured for the specified interface.

Parameters
[in]client_handleclient handle from registration API.
[in]intIfNumthe interface for which to get the label.
[in]typetype for which need to get the label.
[out]labellabel assigned to the interface.
Return values
OPEN_E_NONELabel obtained successfully
OPEN_E_FAILFailed to get label ID
OPEN_E_PARAMError in parameter passed
OPEN_E_INTERNALOther internal failure
Note
0 - No label assigned to the interface. label - Label assigned to the interface.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsBgpIntfLabelSet ( openapiClientHandle_t client_handle,
uint32_t  intIfNum,
OPEN_AFX_t  type,
uint32_t  label 
)

Set an interface label.

Parameters
[in]client_handleclient handle from registration API.
[in]intIfNumthe interface for which to set the label.
[in]typetype for which need to set the label.
[in]labellabel assigned to the interface.
Return values
OPEN_E_NONELabel obtained successfully
OPEN_E_PARAMError in parameter passed
OPEN_E_EXISTSThe label is already in use and cannot be assigned repeatedly
OPEN_E_INTERNALOther internal failure
Note
Set the label to 0 in order to disable label distribution for the specified interface.
Certain error conditions cause SYSLOG events to be generated.
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsBgpLabelModeGet ( openapiClientHandle_t client_handle,
OPEN_CONTROL_t mode 
)

Gets the BGP label distribution mode.

Parameters
[in]client_handleclient handle from registration API
[out]modeBGP label distribution mode
Return values
OPEN_E_NONEMode obtained successfully
OPEN_E_FAILFailed to get the mode
OPEN_E_PARAMError in parameter passed
OPEN_E_INTERNALOther internal failure
Note
OPEN_ENABLE - BGP label distribution is enabled.
OPEN_DISABLE - BGP label distribution is disabled.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsBgpLabelModeSet ( openapiClientHandle_t client_handle,
OPEN_CONTROL_t  mode 
)

Sets the BGP label distribution mode.

Parameters
[in]client_handleclient handle from registration API
[in]modeBGP label distribution mode
Return values
OPEN_E_NONEMode was set successfully
OPEN_E_FAILFailed to set mode
OPEN_E_PARAMError in parameter passed
OPEN_E_INTERNALOther internal failure
Note
OPEN_ENABLE - BGP label distribution is enabled.
OPEN_DISABLE - BGP label distribution is disabled.
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsCountersClear ( openapiClientHandle_t client_handle)

Clears MPLS statistics.

Parameters
[in]client_handleclient handle from registration API
Return values
OPEN_E_NONEStatistics were cleared successfully
OPEN_E_FAILFailed to clear statistics
OPEN_E_INTERNALOther internal failure

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsGlobalStatusGet ( openapiClientHandle_t client_handle,
OPEN_MPLS_GLOBAL_STATS_t *  global_status 
)

Gets the global MPLS status and statistics.

Parameters
[in]client_handleclient handle from registration API
[out]global_statusMPLS global status/statistics
Return values
OPEN_E_NONEStatus obtained successfully
OPEN_E_FAILFailed to get status
OPEN_E_PARAMError in parameter passed
OPEN_E_INTERNALOther internal failure

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsLfdbCreate ( openapiClientHandle_t client_handle,
OPEN_MPLS_LFDB_ENTRY_t *  lfdb_entry 
)

Inserts a LFDB entry into the database.

Parameters
[in]client_handleclient handle from registration API
[in]lfdb_entryLFDB entry
Return values
OPEN_E_NONEOperation successful
OPEN_E_FAILFailed to insert LFDB entry
OPEN_E_PARAMError in parameter passed
OPEN_E_FULLAttempting to create an entry, but already reached maximum number of labels
OPEN_E_EXISTSAttempting to create an entry for a label which already exists in the database.
OPEN_E_ERRORAttempting to create IPv4 or IPv6 entry with a subnet that is already assigned to another label.
OPEN_E_INTERNALOther internal failure
Note
The caller must populate the lfdb_entry structure correctly.
Certain error conditions cause SYSLOG events to be
generated.
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsLfdbDelete ( openapiClientHandle_t client_handle,
uint32_t  label 
)

Deletes an LFDB entry from the database.

Parameters
[in]client_handleclient handle from registration API
[in]labellabel that needs to be deleted
Return values
OPEN_E_NONEOperation successful
OPEN_E_FAILFailed to delete LFDB entry
OPEN_E_NOT_FOUNDLFDB entry doesn't exist
OPEN_E_PARAMError in parameter passed
OPEN_E_INTERNALOther internal failure
Note
The database is indexed by ingress label ID, so only the label
needs to be passed to this function.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsLfdbGet ( openapiClientHandle_t client_handle,
uint32_t  label,
OPEN_MPLS_LFDB_ENTRY_t *  lfdb_entry 
)

Gets the LFDB entry for the specified label.

Parameters
[in]client_handleclient handle from registration API
[in]labellabel for which to get the LFDB entry
[out]lfdb_entryLFDB entry
Return values
OPEN_E_NONEOperation successful
OPEN_E_FAILFailed to get the specified label
OPEN_E_PARAMError in parameter passed
OPEN_E_NOT_FOUNDSpecified LFDB entry doesn't exist
OPEN_E_INTERNALOther internal failure
Note
The lfdb_entry must point to allocated memory, but does not need to be initialized.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsLfdbNextGet ( openapiClientHandle_t client_handle,
uint32_t  label,
OPEN_MPLS_LFDB_ENTRY_t *  lfdb_entry 
)

Gets the LFDB entry for the next numerically higher label after the specified label.

Parameters
[in]client_handleclient handle from registration API
[in]labelingress label ID
[out]lfdb_entryLFDB entry
Return values
OPEN_E_NONEOperation successful
OPEN_E_FAILFailed to get specified label
OPEN_E_PARAMError in parameter passed
OPEN_E_NOT_FOUNDThe next entry was not found
OPEN_E_INTERNALOther internal failure
Note
The lfdb_entry must point to allocated memory, but does not need to be initialized.

OpEN API Version: 1.3

Examples:
mpls_example.c.
open_error_t openapiMplsTunnelInitiatorGet ( openapiClientHandle_t client_handle,
OPEN_MPLS_TUNNEL_INITIATOR_t tunnel_entry 
)

Get the specified MPLS tunnel initiator information.

Parameters
[in]client_handleclient handle from registration API
[in,out]tunnel_entryMPLS tunnel initiator entry
Return values
OPEN_E_NONEOperation successful
OPEN_E_FAILFailed to get the specified tunnel
OPEN_E_PARAMError in parameter passed
OPEN_E_NOT_FOUNDSpecified tunnel entry doesn't exist
OPEN_E_INTERNALOther internal failure

OpEN API Version: 1.3

open_error_t openapiMplsTunnelInitiatorGetNext ( openapiClientHandle_t client_handle,
OPEN_MPLS_TUNNEL_INITIATOR_t tunnel_entry,
OPEN_MPLS_TUNNEL_INITIATOR_t next_tunnel_entry 
)

Get the next MPLS tunnel initiator information.

Parameters
[in]client_handleclient handle from registration API
[in]tunnel_entryCurrent MPLS tunnel initiator entry
[out]next_tunnel_entryNext MPLS tunnel initiator entry
Return values
OPEN_E_NONEOperation successful
OPEN_E_FAILFailed to get specified tunnel initiator
OPEN_E_PARAMError in parameter passed
OPEN_E_NOT_FOUNDThe next MPLS tunnel entry was not found
OPEN_E_INTERNALOther internal failure

OpEN API Version: 1.3

Examples:
mpls_example.c.

Variable Documentation

uint32_t duplicateInsertions

The counter shows how many duplicate insertion attempts happened for the LFDB entry.

Definition at line 128 of file openapi_mpls.h.

uint32_t dynamicLfdbInsertFailures

LFDB dynamic insert failure count.

Definition at line 149 of file openapi_mpls.h.

uint32_t ecmpHighInUse

The highest number of ECMP entries used since the switch was last powered up.

Definition at line 156 of file openapi_mpls.h.

uint32_t ecmpInUse

Current number of ECMP groups in use.

The count includes entries used by the routing component.

Definition at line 154 of file openapi_mpls.h.

uint32_t ecmpMax

The maximum number of ECMP entries available in the hardware.

Definition at line 158 of file openapi_mpls.h.

uint32_t egressInterface

Egress interface.

Definition at line 125 of file openapi_mpls.h.

uint32_t egressLabel

Egress label ID.

For "pop" action the field is ignored.

Definition at line 124 of file openapi_mpls.h.

unsigned char egressMac[OPEN_MAC_ADDR_LEN]

Egress MAC.

Definition at line 122 of file openapi_mpls.h.

uint32_t egressVlan

Egress VLAN.

Definition at line 123 of file openapi_mpls.h.

Type of label.

Definition at line 106 of file openapi_mpls.h.

uint64_t inBytes

Statistics in bytes.

Definition at line 130 of file openapi_mpls.h.

Label status.

Definition at line 110 of file openapi_mpls.h.

uint64_t inPackets

Statistics in packets.

Definition at line 131 of file openapi_mpls.h.

uint32_t ipv4Addr

IPv4 address.

Examples:
routing_example.c, and system_example.c.

Definition at line 114 of file openapi_mpls.h.

uint32_t ipv4PrefixLen

IPv4 prefix len.

Definition at line 115 of file openapi_mpls.h.

uint32_t ipv6PrefixLen

IPv6 prefix len.

Definition at line 119 of file openapi_mpls.h.

open_in6_addr_t ipv6Subnet

IPv6 address.

Definition at line 118 of file openapi_mpls.h.

Label action.

Definition at line 107 of file openapi_mpls.h.

uint32_t lfdbHighWaterMark

LFDB high water mark.

Definition at line 150 of file openapi_mpls.h.

uint64_t lfdbLookupFailurePackets

LFDB lookup failure packets.

Definition at line 151 of file openapi_mpls.h.

uint32_t lfdbSize

Maximum number of LFDB entries available in the hardware.

Definition at line 138 of file openapi_mpls.h.

uint32_t maxLfdbLabel

Maximum number that can be used as a label ID.

Definition at line 140 of file openapi_mpls.h.

uint32_t maxTunnelInitiators

Maximum number of MPLS tunnels available in the hardware.

Definition at line 160 of file openapi_mpls.h.

uint32_t minLfdbLabel

Minimal number that can be used as a label ID.

Definition at line 139 of file openapi_mpls.h.

Reason why a MPLS label is not applied in HW.

Definition at line 111 of file openapi_mpls.h.

uint32_t numLfdbEntries

Number of LFDB entries that have been already created.

Definition at line 141 of file openapi_mpls.h.

uint32_t numLfdbInHardware

Number of LFDB entries that have been applied into HW.

Definition at line 142 of file openapi_mpls.h.

uint32_t numLfdbNotInHardware

Number of LFDB entries that have not been applied into HW.

Definition at line 143 of file openapi_mpls.h.

uint32_t numLfdbPerProto[OPEN_MPLS_PROTO_LAST]

Number of LFDB entries per protocol.

Definition at line 144 of file openapi_mpls.h.

uint32_t numLfdbPerType[OPEN_MPLS_TYPE_LAST]

Number of LFDB entries per type.

Definition at line 145 of file openapi_mpls.h.

uint32_t numTunnelInitiators

Number of MPLS tunnels that have been already created.

Definition at line 161 of file openapi_mpls.h.

OPEN_PACKED_STRUCT
Initial value:
{
uint32_t ingressLabel

MPLS LFDB entry information.

MPLS global statistics information.

Ingress label ID. It is also used as table index.

MPLS MAC address.

Definition at line 103 of file openapi_mpls.h.

Protocol by which the label is created.

Examples:
mpls_example.c.

Definition at line 105 of file openapi_mpls.h.