Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.13.1.2
openapi_mpls.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2018 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 **********************************************************************
26 *
27 * @filename openapi_mpls.h
28 *
29 * @purpose MPLS Configuration and Status
30 *
31 * @component OpEN
32 *
33 * @create 01/16/2014
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_MPLS_H_INCLUDED
39 #define OPENAPI_MPLS_H_INCLUDED
40 
41 #include <stdio.h>
42 #include <stddef.h>
43 #include <sys/un.h>
44 
45 #include "openapi_common.h"
46 
48 typedef enum
49 {
55 
57 typedef enum
58 {
64 
66 typedef enum
67 {
72 
74 typedef enum
75 {
80 
82 typedef enum
83 {
92 
95 {
96  uint32_t ingressLabel;
101  /* LFDB entry status */
105  /* The following fields are applicable only for IPv4 label types */
106  uint32_t ipv4Addr;
107  uint32_t ipv4PrefixLen;
109  /* The following fields are applicable only for IPv6 label types */
111  uint32_t ipv6PrefixLen;
113  /* The following fields are applicable only for Layer-2 label types */
114  unsigned char egressMac[OPEN_MAC_ADDR_LEN];
115  uint32_t egressVlan;
116  uint32_t egressLabel;
117  uint32_t egressInterface;
119  /* LFDB entry statistics */
122  uint64_t inBytes;
123  uint64_t inPackets;
124 } OPEN_MPLS_LFDB_ENTRY_t;
125 
128 {
129  unsigned char mplsMac[OPEN_MAC_ADDR_LEN];
130  uint32_t lfdbSize;
131  uint32_t minLfdbLabel;
132  uint32_t maxLfdbLabel;
133  uint32_t numLfdbEntries;
134  uint32_t numLfdbInHardware;
139  /* Statistics.
140  ** These parameters are reset to 0 when the stats are cleared. */
142  uint32_t lfdbHighWaterMark;
145  /* ECMP Group Statistics. */
146  uint32_t ecmpInUse;
148  uint32_t ecmpHighInUse;
150  uint32_t ecmpMax;
158 } OPEN_MPLS_GLOBAL_STATS_t;
159 
161 typedef struct
162 {
165  uint32_t label[OPEN_MAX_MPLS_IMPOSE_LABELS];
167  uint32_t egressIfNum;
168  uint16_t egressVlan;
169  unsigned char egressMac [OPEN_MAC_ADDR_LEN];
171  uint32_t numRoutes;
172  uint32_t age;
174 
175 /*************************************************************************/
199  uint32_t intIfNum, OPEN_AFX_t type, uint32_t label);
200 
201 /*************************************************************************/
221  uint32_t intIfNum, OPEN_AFX_t type, uint32_t *label);
222 
223 /*************************************************************************/
236 
237 /*************************************************************************/
252  OPEN_MPLS_GLOBAL_STATS_t *global_status);
253 
254 /*************************************************************************/
272  OPEN_CONTROL_t *mode);
273 
274 /*************************************************************************/
293  OPEN_CONTROL_t mode);
294 
295 /*************************************************************************/
315  uint32_t label, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry);
316 
317 /*************************************************************************/
338  uint32_t label, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry);
339 
340 /*************************************************************************/
366  OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry);
367 
368 /*************************************************************************/
387  uint32_t label);
388 
389 /*************************************************************************/
405  OPEN_MPLS_TUNNEL_INITIATOR_t *tunnel_entry);
406 
407 /*************************************************************************/
424  OPEN_MPLS_TUNNEL_INITIATOR_t *tunnel_entry,
425  OPEN_MPLS_TUNNEL_INITIATOR_t *next_tunnel_entry);
426 #endif /* OPENAPI_MPLS_H_INCLUDED */
427 
uint32_t numLfdbPerType[OPEN_MPLS_TYPE_LAST]
Number of LFDB entries per type.
Definition: openapi_mpls.h:137
open_in6_addr_t ipv6Subnet
IPv6 address.
Definition: openapi_mpls.h:110
OPEN_MPLS_LFDB_PROTOCOL_t protocol
Protocol by which the label is created.
Definition: openapi_mpls.h:97
OPEN_MPLS_LFDB_NOT_INSERTED_REASON_t notInsertedReason
Reason why a MPLS label is not applied in HW.
Definition: openapi_mpls.h:103
OPEN_AFX_t
OPEN uses these enumerators to indicate BGP address family index of routes or policy for IPV4 or IPV6...
uint32_t numLfdbPerProto[OPEN_MPLS_PROTO_LAST]
Number of LFDB entries per protocol.
Definition: openapi_mpls.h:136
uint32_t age
Seconds since last update.
Definition: openapi_mpls.h:172
uint32_t ipv4PrefixLen
IPv4 prefix len.
Definition: openapi_mpls.h:107
uint32_t numLfdbNotInHardware
Number of LFDB entries that have not been applied into HW.
Definition: openapi_mpls.h:135
L2 label is not installed because reference VLAN is not created.
Definition: openapi_mpls.h:88
OPEN_MPLS_LFDB_ENTRY_TYPE_t
MPLS LFDB label type.
Definition: openapi_mpls.h:57
uint32_t maxTunnelInitiators
Maximum number of MPLS tunnels available in the hardware.
Definition: openapi_mpls.h:152
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.
uint32_t numTunnelsTwoLabel
Number of MPLS tunnels created with two labels.
Definition: openapi_mpls.h:155
open_error_t
OPEN uses these enumerators to indicate the error codes.
uint32_t ipv4Addr
IPv4 address.
Definition: openapi_mpls.h:106
This entry must be last in the list.
Definition: openapi_mpls.h:53
uint32_t egressLabel
Egress label ID.
Definition: openapi_mpls.h:116
OPEN_MPLS_LFDB_NOT_INSERTED_REASON_t
Reason for which the MPLS LFDB label is not applied to HW.
Definition: openapi_mpls.h:82
open_error_t openapiMplsBgpLabelModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t mode)
Sets the BGP label distribution mode.
A label was not applied into HW.
Definition: openapi_mpls.h:77
This entry must be last in the list.
Definition: openapi_mpls.h:62
L2 label type.
Definition: openapi_mpls.h:59
OPEN_MPLS_LFDB_PROTOCOL_t
MPLS LFDB protocol type.
Definition: openapi_mpls.h:48
Out of resources error.
Definition: openapi_mpls.h:87
uint32_t egressInterface
Egress interface.
Definition: openapi_mpls.h:117
OPEN_MPLS_LFDB_IN_HARDWARE_STATUS_t inHardware
Label status.
Definition: openapi_mpls.h:102
uint64_t inBytes
Statistics in bytes.
Definition: openapi_mpls.h:122
uint32_t numLfdbEntries
Number of LFDB entries that have been already created.
Definition: openapi_mpls.h:133
open_inet_addr_t nextHop
The IPv4 or IPv6 address of the next hop with which this tunnel is associated.
Definition: openapi_mpls.h:163
uint64_t inPackets
Statistics in packets.
Definition: openapi_mpls.h:123
OPEN_MPLS_LFDB_LABEL_ACTION_t labelAction
Label action.
Definition: openapi_mpls.h:99
MPLS tunnel initiator informaton.
Definition: openapi_mpls.h:161
uint32_t numTunnelsThreeLabel
Number of MPLS tunnels created with three labels.
Definition: openapi_mpls.h:156
Dynamic label.
Definition: openapi_mpls.h:51
uint32_t dynamicLfdbInsertFailures
LFDB dynamic insert failure count.
Definition: openapi_mpls.h:141
uint32_t lfdbSize
Maximum number of LFDB entries available in the hardware.
Definition: openapi_mpls.h:130
uint32_t numTunnelsOneLabel
Number of MPLS tunnels created with one label.
Definition: openapi_mpls.h:154
uint32_t numLfdbInHardware
Number of LFDB entries that have been applied into HW.
Definition: openapi_mpls.h:134
uint32_t maxLfdbLabel
Maximum number that can be used as a label ID.
Definition: openapi_mpls.h:132
uint32_t minLfdbLabel
Minimal number that can be used as a label ID.
Definition: openapi_mpls.h:131
open_error_t openapiMplsBgpLabelModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *mode)
Gets the BGP label distribution mode.
L3 label matches a locally attached subnet.
Definition: openapi_mpls.h:86
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.
open_error_t openapiMplsLfdbCreate(openapiClientHandle_t *client_handle, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry)
Inserts a LFDB entry into the database.
#define OPEN_MAX_MPLS_IMPOSE_LABELS
Maximum MPLS impose lables.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
open_error_t openapiMplsTunnelInitiatorGet(openapiClientHandle_t *client_handle, OPEN_MPLS_TUNNEL_INITIATOR_t *tunnel_entry)
Get the specified MPLS tunnel initiator information.
open_error_t openapiMplsLfdbDelete(openapiClientHandle_t *client_handle, uint32_t label)
Deletes an LFDB entry from the database.
unsigned char egressMac[OPEN_MAC_ADDR_LEN]
Egress MAC.
Definition: openapi_mpls.h:114
uint32_t ecmpHighInUse
The highest number of ECMP entries used since the switch was last powered up.
Definition: openapi_mpls.h:148
Pop action.
Definition: openapi_mpls.h:69
open_error_t openapiMplsCountersClear(openapiClientHandle_t *client_handle)
Clears MPLS statistics.
L3 label does not match any subnet.
Definition: openapi_mpls.h:85
uint32_t egressIfNum
The interface number to which this tunnel is pointing.
Definition: openapi_mpls.h:167
OPEN_MPLS_LFDB_IN_HARDWARE_STATUS_t
MPLS LFDB label status.
Definition: openapi_mpls.h:74
Last pop action.
Definition: openapi_mpls.h:70
OPEN_MPLS_LFDB_ENTRY_TYPE_t entryType
Type of label.
Definition: openapi_mpls.h:98
uint32_t numRoutes
Number of routes pointing to this MPLS tunnel initiator.
Definition: openapi_mpls.h:171
OPEN_PACKED_STRUCT
MPLS LFDB entry information.
Definition: openapi_mpls.h:95
uint32_t ecmpInUse
Current number of ECMP groups in use.
Definition: openapi_mpls.h:146
L2 label is not installed because egress port is not attached.
Definition: openapi_mpls.h:89
OPEN_MPLS_LFDB_LABEL_ACTION_t
MPLS LFDB label action.
Definition: openapi_mpls.h:66
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.
uint32_t lfdbHighWaterMark
LFDB high water mark.
Definition: openapi_mpls.h:142
Label is inserted in hardware.
Definition: openapi_mpls.h:84
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.
L3 label type that works with IPv6 address.
Definition: openapi_mpls.h:61
uint32_t ecmpMax
The maximum number of ECMP entries available in the hardware.
Definition: openapi_mpls.h:150
A label was applied to HW.
Definition: openapi_mpls.h:76
Static label.
Definition: openapi_mpls.h:50
uint16_t egressVlan
VLAN on which MPLS tunneled packets exit the switch.
Definition: openapi_mpls.h:168
open_error_t openapiMplsGlobalStatusGet(openapiClientHandle_t *client_handle, OPEN_MPLS_GLOBAL_STATS_t *global_status)
Gets the global MPLS status and statistics.
uint32_t numTunnelInitiators
Number of MPLS tunnels that have been already created.
Definition: openapi_mpls.h:153
uint64_t lfdbLookupFailurePackets
LFDB lookup failure packets.
Definition: openapi_mpls.h:143
uint32_t duplicateInsertions
The counter shows how many duplicate insertion attempts happened for the LFDB entry.
Definition: openapi_mpls.h:120
L3 label type that works with IPv4 address.
Definition: openapi_mpls.h:60
open_error_t openapiMplsBgpIntfLabelSet(openapiClientHandle_t *client_handle, uint32_t intIfNum, OPEN_AFX_t type, uint32_t label)
Set an interface label.
uint32_t egressVlan
Egress VLAN.
Definition: openapi_mpls.h:115
uint32_t ipv6PrefixLen
IPv6 prefix len.
Definition: openapi_mpls.h:111
Hash Mode names.
Label created with BGP.
Definition: openapi_mpls.h:52
Swap action.
Definition: openapi_mpls.h:68