Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.4.4.5
openapi_bgp_config.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_bgp_config.h
28 *
29 * @purpose Border Gateway Protocol Configuration and Status
30 *
31 * @component OPEN
32 *
33 * @create 06/25/2013
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_BGP_CONFIG_H_INCLUDED
39 #define OPENAPI_BGP_CONFIG_H_INCLUDED
40 
41 #include <stdbool.h>
42 #include "openapi_common.h"
43 
44 #define OPEN_BGP_NBR_MAX_PFX_NOLIMIT 0xFFFFFFFFUL
45 #define OPEN_BGP_ERR_STR_LEN 64
46 #define OPEN_BGP_AFI_MAX 3
47 #define OPEN_BGP_MAX_DP_REASON_STR 16
48 #define OPEN_BGP_MAX_STATS_ENTRIES 20
49 #define OPEN_BGP_MAX_PASSWORD 25
50 #define OPEN_BGP_MAX_TEMPLATE_NAME 32
51 #define OPEN_BGP_PEER_DESC_LENGTH 80
52 #define OPEN_BGP_PEER_ADDR_STR_LENGTH 128
55 #define OPEN_BGP_UPD_GROUP_NONE 0xFFFF
56 
58 typedef enum
59 {
66 
74 typedef enum
75 {
79 
81 typedef enum
82 {
86 
87 typedef enum
88 {
97 
98 typedef enum
99 {
104 
105 typedef enum
106 {
113 
116 {
117  uint16_t duplicateAttr;
119  uint16_t transFlag;
121  uint16_t optNonTransPart;
122  uint16_t attrTooLong;
123  uint16_t attrLenError;
124  uint16_t originInvalid;
125  uint16_t wrongFirstAs;
126  uint16_t invalidAsPathType;
127  uint16_t invalidNextHop;
128  uint16_t badNextHop;
129  uint16_t invalidAggregator;
130  uint16_t unknownWellKnown;
131  uint16_t missingMandatory;
132  uint16_t missingLocPref;
133  uint16_t invalidNetField;
134  uint16_t rxAsPathTooLong;
135  uint16_t origIdFromExtPeer;
139 
141 typedef struct open_bgpPeerStatus_s
142 {
144  uint32_t peerRouterId;
145 
148 
150  uint32_t peerAdminStatus;
151 
154 
157  uint16_t localTcpPort;
158 
160  uint16_t remoteTcpPort;
161 
163  uint32_t remoteAS;
164 
166  uint16_t capabilities;
167 
169  uint16_t negHoldTime;
170  uint16_t negKeepaliveTime;
171 
176  unsigned char lastErrorCode;
177  unsigned char lastErrorSubcode;
178  OPEN_BOOL_t lastErrorInbound;
179  uint32_t lastErrorTime;
180 
183  unsigned char lastSuberrorString[OPEN_BGP_ERR_STR_LEN];
184 
187 
189  uint32_t estTransitions;
190 
193  uint32_t estTime;
194 
196  uint32_t retryIntervalConf;
197  uint32_t holdTimeConf;
198  uint32_t keepAliveTimeConf;
203  uint32_t lastUpdate;
204 
207 
209  uint32_t txOpen;
210  uint32_t txUpdate;
211  uint32_t txKeepalive;
212  uint32_t txNotif;
213  uint32_t txRefresh;
214  uint32_t txTotal;
215 
217  uint32_t rxOpen;
218  uint32_t rxUpdate;
219  uint32_t rxKeepalive;
220  uint32_t rxNotif;
221  uint32_t rxRefresh;
222  uint32_t rxTotal;
223 
226 
229 
233  uint32_t inMinNlriPerUpdate[OPEN_BGP_AFI_MAX];
234 
237 
240  uint32_t outWithdraws[OPEN_BGP_AFI_MAX];
241  uint32_t outMaxNlriPerUpdate[OPEN_BGP_AFI_MAX];
242  uint32_t outMinNlriPerUpdate[OPEN_BGP_AFI_MAX];
243  uint32_t outPfxCurrent[OPEN_BGP_AFI_MAX];
244 
248 
252 
254  uint32_t updateQueueLen;
255  uint32_t updateQueueHigh;
257  uint32_t updateQueueDrops;
258 
261 
263  uint32_t flapCount;
264 
267  OPEN_BOOL_t ipv4Active;
268  OPEN_BOOL_t ipv6Active;
269 
272 
274 
276 typedef struct open_bgpDecProcHist_s
277 {
279  uint32_t decProcTime;
280 
282  uint16_t decProcPhase;
283 
285  uint16_t updateGroupId;
286 
288  uint32_t genId;
289 
292 
296 
298  uint16_t duration;
299 
301  uint16_t adds;
302  uint16_t mods;
303  uint16_t dels;
304 
306 
307 /*****************************************************************/
323  uint32_t *maxRoutes);
324 
325 /*****************************************************************/
341  uint32_t *maxRoutes);
342 
343 /*****************************************************************/
358  uint32_t *holdTime);
359 
360 /*****************************************************************/
378  uint32_t holdTime);
379 
380 /*****************************************************************/
395  uint32_t *keepAlive);
396 
397 /*****************************************************************/
415  uint32_t keepAlive);
416 
417 /*****************************************************************/
432  uint32_t *localAS);
433 
434 /*****************************************************************/
453  uint32_t localAS);
454 
455 /*****************************************************************/
470  uint32_t *routerId);
471 
472 /*****************************************************************/
488  uint32_t routerId);
489 
490 /*****************************************************************/
505  uint32_t *localPref);
506 
507 /*****************************************************************/
525  uint32_t localPref);
526 
527 /*****************************************************************/
542  bool *log);
543 
544 /*****************************************************************/
560  bool log);
561 
562 /*****************************************************************/
579  OPEN_AF_t af,
580  bool isIbgp,
581  uint32_t *maxPaths);
582 
583 /*****************************************************************/
608  OPEN_AF_t af,
609  bool isIbgp,
610  uint32_t maxPaths);
611 
612 /*****************************************************************/
633  bool normalMode,
634  bool useRm,
635  open_inet_addr_t addr,
636  uint32_t pfxLen,
637  open_buffdesc *rmName);
638 
639 /*****************************************************************/
674  bool add,
675  open_buffdesc *protoName,
676  bool matchSet,
677  uint32_t matchBits,
678  bool metricSet,
679  bool metricValueSet,
680  uint32_t metricValue,
681  bool routeMapSet,
682  OPEN_AF_t af,
683  open_buffdesc *rmName);
684 
685 /********************************************************************/
686 /*********************** NEIGHBOR / PEER API's **********************/
687 /********************************************************************/
688 
689 /*****************************************************************/
714  OPEN_BGP_PARAM_TYPE pType,
715  open_inet_addr_t remoteAddr,
716  uint32_t scopeId,
717  OPEN_AF_t af,
718  bool *activate);
719 
720 /*****************************************************************/
746  open_inet_addr_t remoteAddr,
747  uint32_t scopeId,
748  OPEN_AF_t af,
749  bool activate,
750  bool defValue);
751 
752 /*****************************************************************/
777  OPEN_BGP_PARAM_TYPE pType,
778  open_inet_addr_t remoteAddr,
779  uint32_t scopeId,
780  OPEN_BGP_PEER_STATE_t *status);
781 
782 /*****************************************************************/
808  open_buffdesc *vrf,
809  OPEN_BGP_PARAM_TYPE pType,
810  open_inet_addr_t remoteAddr,
811  uint32_t scopeId,
812  OPEN_BGP_PEER_STATE_t *status);
813 
814 
815 /*****************************************************************/
837  open_inet_addr_t remoteAddr,
838  uint32_t scopeId,
839  OPEN_BGP_PEER_STATE_t status,
840  bool defValue);
841 
842 /*****************************************************************/
865  open_buffdesc *vrf,
866  open_inet_addr_t remoteAddr,
867  uint32_t scopeId,
868  OPEN_BGP_PEER_STATE_t status,
869  bool defValue);
870 
871 
872 /*****************************************************************/
895  OPEN_BGP_PARAM_TYPE pType,
896  open_inet_addr_t remoteAddr,
897  uint32_t scopeId,
898  OPEN_AF_t af,
899  uint32_t *interval);
900 
901 /*****************************************************************/
929  open_inet_addr_t remoteAddr,
930  uint32_t scopeId,
931  OPEN_AF_t af,
932  uint32_t interval,
933  bool defValue);
934 
935 /*****************************************************************/
957  OPEN_BGP_PARAM_TYPE pType,
958  open_inet_addr_t remoteAddr,
959  uint32_t scopeId,
960  uint32_t *holdTime);
961 
962 /*****************************************************************/
985  open_inet_addr_t remoteAddr,
986  uint32_t scopeId,
987  uint32_t holdTime,
988  bool defValue);
989 
990 /*****************************************************************/
1012  OPEN_BGP_PARAM_TYPE pType,
1013  open_inet_addr_t remoteAddr,
1014  uint32_t scopeId,
1015  uint32_t *keepAlive);
1016 
1017 /*****************************************************************/
1040  open_inet_addr_t remoteAddr,
1041  uint32_t scopeId,
1042  uint32_t keepAlive,
1043  bool defValue);
1044 
1045 /*****************************************************************/
1069  OPEN_BGP_PARAM_TYPE pType,
1070  open_inet_addr_t remoteAddr,
1071  uint32_t scopeId,
1072  OPEN_AF_t af,
1073  OPEN_CONTROL_t *enable);
1074 
1075 /*****************************************************************/
1100  open_inet_addr_t remoteAddr,
1101  uint32_t scopeId,
1102  OPEN_AF_t af,
1103  OPEN_CONTROL_t enable,
1104  bool defValue);
1105 
1106 /*****************************************************************/
1132  OPEN_BGP_PARAM_TYPE pType,
1133  open_inet_addr_t remoteAddr,
1134  uint32_t scopeId,
1135  OPEN_AF_t af,
1136  uint32_t *pfxLimit,
1137  uint32_t *threshold,
1138  bool *warningOnly);
1139 
1140 /*****************************************************************/
1174  open_inet_addr_t remoteAddr,
1175  uint32_t scopeId,
1176  OPEN_AF_t af,
1177  uint32_t pfxLimit,
1178  uint32_t threshold,
1179  bool warningOnly,
1180  bool defValue);
1181 
1182 /*****************************************************************/
1201  open_inet_addr_t remoteAddr,
1202  uint32_t scopeId,
1203  uint32_t *remoteAS);
1204 
1205 /*****************************************************************/
1225  open_buffdesc *vrf,
1226  open_inet_addr_t remoteAddr,
1227  uint32_t scopeId,
1228  uint32_t *remoteAS);
1229 
1230 /*****************************************************************/
1254  open_inet_addr_t remoteAddr,
1255  uint32_t scopeId,
1256  uint32_t remoteAS);
1257 
1258 /*****************************************************************/
1283  open_buffdesc *vrf,
1284  open_inet_addr_t remoteAddr,
1285  uint32_t scopeId,
1286  uint32_t remoteAS);
1287 
1288 
1289 /*****************************************************************/
1312  OPEN_BGP_PARAM_TYPE pType,
1313  open_inet_addr_t remoteAddr,
1314  uint32_t scopeId,
1315  uint32_t *source);
1316 
1317 /*****************************************************************/
1340  open_inet_addr_t remoteAddr,
1341  uint32_t scopeId,
1342  uint32_t source,
1343  bool defValue);
1344 
1345 /*****************************************************************/
1362  OPEN_CONTROL_t * adminMode);
1363 
1364 /*****************************************************************/
1382  OPEN_CONTROL_t adminMode);
1383 
1384 /*****************************************************************/
1404  OPEN_AF_t af,
1405  uint32_t * numNetworks,
1406  uint32_t * numAsPaths);
1407 
1408 /*****************************************************************/
1429  OPEN_AF_t af,
1430  open_inet_addr_t prevRemoteAddr,
1431  uint32_t prevScopeId,
1432  open_inet_addr_t * remoteAddr,
1433  uint32_t * scopeId);
1434 
1435 /*****************************************************************/
1459  OPEN_AF_t af,
1460  open_inet_addr_t prevRemoteAddr,
1461  uint32_t prevScopeId,
1462  open_buffdesc *vrf,
1463  open_inet_addr_t * remoteAddr,
1464  uint32_t * scopeId);
1465 
1466 /*****************************************************************/
1488  open_inet_addr_t remoteAddr,
1489  uint32_t scopeId,
1490  OPEN_AF_t af,
1491  open_bgpPeerStatus_t * status);
1492 
1493 /*****************************************************************/
1515  open_buffdesc *vrf,
1516  open_inet_addr_t remoteAddr,
1517  uint32_t scopeId,
1518  OPEN_AF_t af,
1519  open_bgpPeerStatus_t * status);
1520 
1521 /*****************************************************************/
1538  uint32_t * maxLen);
1539 
1540 /*****************************************************************/
1562  open_buffdesc * bufdName);
1563 
1564 /*****************************************************************/
1586  open_buffdesc * bufdName);
1587 
1588 /*****************************************************************/
1607  open_buffdesc * bufdName, OPEN_AF_t af);
1608 
1609 /*****************************************************************/
1628  open_buffdesc * bufdName, OPEN_AF_t af);
1629 
1630 /*****************************************************************/
1649  open_buffdesc * bufdName,
1650  OPEN_AF_t af,
1651  OPEN_CONTROL_t enable);
1652 
1653 /*****************************************************************/
1668  uint32_t * maxLen);
1669 
1670 /*****************************************************************/
1690  open_inet_addr_t remoteAddr,
1691  uint32_t scopeId,
1692  open_buffdesc * bufdName,
1693  bool defValue);
1694 
1695 /*****************************************************************/
1715  open_buffdesc *vrf,
1716  open_inet_addr_t remoteAddr,
1717  uint32_t scopeId,
1718  open_buffdesc * bufdName,
1719  bool defValue);
1720 
1721 /*****************************************************************/
1740  open_inet_addr_t remoteAddr,
1741  uint32_t scopeId,
1742  open_buffdesc * bufdName);
1743 
1744 /*****************************************************************/
1763  open_buffdesc *vrf,
1764  open_inet_addr_t remoteAddr,
1765  uint32_t scopeId,
1766  open_buffdesc * bufdName);
1767 
1768 
1769 /*****************************************************************/
1792  open_inet_addr_t remoteAddr,
1793  uint32_t scopeId,
1794  open_buffdesc * bufdName, bool defValue);
1795 
1796 /*****************************************************************/
1816  open_inet_addr_t remoteAddr,
1817  uint32_t scopeId,
1818  open_buffdesc * bufdName);
1819 
1820 /*****************************************************************/
1843  OPEN_BGP_PARAM_TYPE pType,
1844  open_inet_addr_t remoteAddr,
1845  uint32_t scopeId,
1846  uint32_t * connRetryInterval);
1847 
1848 /*****************************************************************/
1863  uint32_t * maxLen);
1864 
1865 /*****************************************************************/
1888  OPEN_BGP_PARAM_TYPE pType,
1889  open_inet_addr_t remoteAddr,
1890  uint32_t scopeId,
1891  open_buffdesc * bufdName);
1892 
1893 /*****************************************************************/
1915  open_inet_addr_t remoteAddr,
1916  uint32_t scopeId,
1917  open_buffdesc * bufdName,
1918  bool defValue);
1919 
1920 /*****************************************************************/
1941  OPEN_AF_t af,
1942  uint32_t index,
1943  open_bgpDecProcHist_t * pHist);
1944 
1945 /*****************************************************************/
1963  OPEN_AF_t af,
1964  uint32_t * numEntries);
1965 
1966 /*****************************************************************/
1988  open_inet_addr_t remoteAddr,
1989  uint32_t scopeId, OPEN_AF_t af,
1990  uint32_t * flapCount);
1991 
1992 /*****************************************************************/
2011  uint32_t scopeId,
2012  open_inet_addr_t * nbrPeerAddr);
2013 
2014 /*****************************************************************/
2036  open_buffdesc * bufdName,
2037  uint32_t scopeId);
2038 
2039 /*****************************************************************/
2054  uint32_t * maxLen);
2055 
2056 /*****************************************************************/
2078  open_inet_addr_t peerAddr,
2079  uint32_t scopeId,
2080  OPEN_BOOL_t * enableBfd);
2081 
2082 #endif /* OPENAPI_BGP_CONFIG_H_INCLUDED */
2083