Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.9.0.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 
47 #define OPEN_MAX_MPLS_IMPOSE_LABELS 3
48 
50 typedef enum
51 {
57 
59 typedef enum
60 {
66 
68 typedef enum
69 {
74 
76 typedef enum
77 {
82 
84 typedef enum
85 {
94 
95 /* MPLS label stack */
96 typedef struct
97 {
98  uint32_t label[OPEN_MAX_MPLS_IMPOSE_LABELS];
100 
103 {
104  uint32_t ingressLabel;
109  /* LFDB entry status */
113  /* The following fields are applicable only for IPv4 label types */
114  uint32_t ipv4Addr;
115  uint32_t ipv4PrefixLen;
117  /* The following fields are applicable only for IPv6 label types */
119  uint32_t ipv6PrefixLen;
121  /* The following fields are applicable only for Layer-2 label types */
122  unsigned char egressMac[OPEN_MAC_ADDR_LEN];
123  uint32_t egressVlan;
124  uint32_t egressLabel;
125  uint32_t egressInterface;
127  /* LFDB entry statistics */
130  uint64_t inBytes;
131  uint64_t inPackets;
132 } OPEN_MPLS_LFDB_ENTRY_t;
133 
136 {
137  unsigned char mplsMac[OPEN_MAC_ADDR_LEN];
138  uint32_t lfdbSize;
139  uint32_t minLfdbLabel;
140  uint32_t maxLfdbLabel;
141  uint32_t numLfdbEntries;
142  uint32_t numLfdbInHardware;
147  /* Statistics.
148  ** These parameters are reset to 0 when the stats are cleared. */
150  uint32_t lfdbHighWaterMark;
153  /* ECMP Group Statistics. */
154  uint32_t ecmpInUse;
156  uint32_t ecmpHighInUse;
158  uint32_t ecmpMax;
166 } OPEN_MPLS_GLOBAL_STATS_t;
167 
169 typedef struct
170 {
173  uint32_t label[OPEN_MAX_MPLS_IMPOSE_LABELS];
175  uint32_t egressIfNum;
176  uint16_t egressVlan;
177  unsigned char egressMac [OPEN_MAC_ADDR_LEN];
179  uint32_t numRoutes;
180  uint32_t age;
182 
183 /*************************************************************************/
207  uint32_t intIfNum, OPEN_AFX_t type, uint32_t label);
208 
209 /*************************************************************************/
229  uint32_t intIfNum, OPEN_AFX_t type, uint32_t *label);
230 
231 /*************************************************************************/
244 
245 /*************************************************************************/
260  OPEN_MPLS_GLOBAL_STATS_t *global_status);
261 
262 /*************************************************************************/
280  OPEN_CONTROL_t *mode);
281 
282 /*************************************************************************/
301  OPEN_CONTROL_t mode);
302 
303 /*************************************************************************/
323  uint32_t label, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry);
324 
325 /*************************************************************************/
346  uint32_t label, OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry);
347 
348 /*************************************************************************/
374  OPEN_MPLS_LFDB_ENTRY_t *lfdb_entry);
375 
376 /*************************************************************************/
395  uint32_t label);
396 
397 /*************************************************************************/
413  OPEN_MPLS_TUNNEL_INITIATOR_t *tunnel_entry);
414 
415 /*************************************************************************/
432  OPEN_MPLS_TUNNEL_INITIATOR_t *tunnel_entry,
433  OPEN_MPLS_TUNNEL_INITIATOR_t *next_tunnel_entry);
434 #endif /* OPENAPI_MPLS_H_INCLUDED */
435