Coverage Report

Created: 2025-08-26 06:20

/src/frr/bgpd/bgp_route.h
Line
Count
Source (jump to first uncovered line)
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
/* BGP routing information base
3
 * Copyright (C) 1996, 97, 98, 2000 Kunihiro Ishiguro
4
 */
5
6
#ifndef _QUAGGA_BGP_ROUTE_H
7
#define _QUAGGA_BGP_ROUTE_H
8
9
#include <stdbool.h>
10
11
#include "hook.h"
12
#include "queue.h"
13
#include "nexthop.h"
14
#include "bgp_table.h"
15
#include "bgp_addpath_types.h"
16
#include "bgp_rpki.h"
17
18
struct bgp_nexthop_cache;
19
struct bgp_route_evpn;
20
21
enum bgp_show_type {
22
  bgp_show_type_normal,
23
  bgp_show_type_regexp,
24
  bgp_show_type_prefix_list,
25
  bgp_show_type_access_list,
26
  bgp_show_type_filter_list,
27
  bgp_show_type_route_map,
28
  bgp_show_type_neighbor,
29
  bgp_show_type_cidr_only,
30
  bgp_show_type_prefix_longer,
31
  bgp_show_type_community_alias,
32
  bgp_show_type_community_all,
33
  bgp_show_type_community,
34
  bgp_show_type_community_exact,
35
  bgp_show_type_community_list,
36
  bgp_show_type_community_list_exact,
37
  bgp_show_type_lcommunity_all,
38
  bgp_show_type_lcommunity,
39
  bgp_show_type_lcommunity_exact,
40
  bgp_show_type_lcommunity_list,
41
  bgp_show_type_lcommunity_list_exact,
42
  bgp_show_type_flap_statistics,
43
  bgp_show_type_flap_neighbor,
44
  bgp_show_type_dampend_paths,
45
  bgp_show_type_damp_neighbor,
46
  bgp_show_type_detail,
47
  bgp_show_type_rpki,
48
  bgp_show_type_prefix_version,
49
  bgp_show_type_self_originated,
50
};
51
52
enum bgp_show_adj_route_type {
53
  bgp_show_adj_route_advertised,
54
  bgp_show_adj_route_received,
55
  bgp_show_adj_route_filtered,
56
  bgp_show_adj_route_bestpath,
57
};
58
59
60
#define BGP_SHOW_SCODE_HEADER                                                  \
61
0
  "Status codes:  s suppressed, d damped, "                              \
62
0
  "h history, * valid, > best, = multipath,\n"                           \
63
0
  "               i internal, r RIB-failure, S Stale, R Removed\n"
64
#define BGP_SHOW_OCODE_HEADER                                                  \
65
0
  "Origin codes:  i - IGP, e - EGP, ? - incomplete\n"
66
0
#define BGP_SHOW_NCODE_HEADER "Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self\n"
67
#define BGP_SHOW_RPKI_HEADER                                                   \
68
0
  "RPKI validation codes: V valid, I invalid, N Not found\n\n"
69
0
#define BGP_SHOW_HEADER "    Network          Next Hop            Metric LocPrf Weight Path\n"
70
0
#define BGP_SHOW_HEADER_WIDE "    Network                                      Next Hop                                  Metric LocPrf Weight Path\n"
71
72
/* Maximum number of labels we can process or send with a prefix. We
73
 * really do only 1 for MPLS (BGP-LU) but we can do 2 for EVPN-VxLAN.
74
 */
75
0
#define BGP_MAX_LABELS 2
76
77
/* Maximum number of sids we can process or send with a prefix. */
78
#define BGP_MAX_SIDS 6
79
80
/* Maximum buffer length for storing BGP best path selection reason */
81
#define BGP_MAX_SELECTION_REASON_STR_BUF 32
82
83
/* Error codes for handling NLRI */
84
394
#define BGP_NLRI_PARSE_OK 0
85
182
#define BGP_NLRI_PARSE_ERROR_PREFIX_OVERFLOW -1
86
85
#define BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW -2
87
59
#define BGP_NLRI_PARSE_ERROR_PREFIX_LENGTH -3
88
4
#define BGP_NLRI_PARSE_ERROR_PACKET_LENGTH -4
89
0
#define BGP_NLRI_PARSE_ERROR_LABEL_LENGTH -5
90
5
#define BGP_NLRI_PARSE_ERROR_EVPN_MISSING_TYPE -6
91
9
#define BGP_NLRI_PARSE_ERROR_EVPN_TYPE2_SIZE -7
92
3
#define BGP_NLRI_PARSE_ERROR_EVPN_TYPE3_SIZE -8
93
1
#define BGP_NLRI_PARSE_ERROR_EVPN_TYPE4_SIZE -9
94
7
#define BGP_NLRI_PARSE_ERROR_EVPN_TYPE5_SIZE -10
95
#define BGP_NLRI_PARSE_ERROR_FLOWSPEC_IPV6_NOT_SUPPORTED -11
96
0
#define BGP_NLRI_PARSE_ERROR_FLOWSPEC_NLRI_SIZELIMIT -12
97
0
#define BGP_NLRI_PARSE_ERROR_FLOWSPEC_BAD_FORMAT -13
98
#define BGP_NLRI_PARSE_ERROR_ADDRESS_FAMILY -14
99
9
#define BGP_NLRI_PARSE_ERROR_EVPN_TYPE1_SIZE -15
100
0
#define BGP_NLRI_PARSE_ERROR -32
101
102
/* 1. local MAC-IP/type-2 paths in the VNI routing table are linked to the
103
 * destination ES
104
 * 2. remote MAC-IP paths in the global routing table are linked to the
105
 * destination ES
106
 */
107
struct bgp_path_es_info {
108
  /* back pointer to the route */
109
  struct bgp_path_info *pi;
110
  vni_t vni;
111
  /* destination ES */
112
  struct bgp_evpn_es *es;
113
  /* memory used for linking the path to the destination ES */
114
  struct listnode es_listnode;
115
  uint8_t flags;
116
/* Path is linked to the VNI list */
117
#define BGP_EVPN_PATH_ES_INFO_VNI_LIST (1 << 0)
118
/* Path is linked to the global list */
119
#define BGP_EVPN_PATH_ES_INFO_GLOBAL_LIST (1 << 1)
120
};
121
122
/* IP paths imported into the VRF from an EVPN route source
123
 * are linked to the nexthop/VTEP IP
124
 */
125
struct bgp_path_evpn_nh_info {
126
  /* back pointer to the route */
127
  struct bgp_path_info *pi;
128
  struct bgp_evpn_nh *nh;
129
  /* memory used for linking the path to the nexthop */
130
  struct listnode nh_listnode;
131
};
132
133
struct bgp_path_mh_info {
134
  struct bgp_path_es_info *es_info;
135
  struct bgp_path_evpn_nh_info *nh_info;
136
};
137
138
struct bgp_sid_info {
139
  struct in6_addr sid;
140
  uint8_t loc_block_len;
141
  uint8_t loc_node_len;
142
  uint8_t func_len;
143
  uint8_t arg_len;
144
  uint8_t transposition_len;
145
  uint8_t transposition_offset;
146
};
147
148
/* Ancillary information to struct bgp_path_info,
149
 * used for uncommonly used data (aggregation, MPLS, etc.)
150
 * and lazily allocated to save memory.
151
 */
152
struct bgp_path_info_extra {
153
  /* Pointer to dampening structure.  */
154
  struct bgp_damp_info *damp_info;
155
156
  /** List of aggregations that suppress this path. */
157
  struct list *aggr_suppressors;
158
159
  /* Nexthop reachability check.  */
160
  uint32_t igpmetric;
161
162
  /* MPLS label(s) - VNI(s) for EVPN-VxLAN  */
163
  mpls_label_t label[BGP_MAX_LABELS];
164
  uint32_t num_labels;
165
166
  /* af specific flags */
167
  uint16_t af_flags;
168
0
#define BGP_EVPN_MACIP_TYPE_SVI_IP (1 << 0)
169
170
  /* SRv6 SID(s) for SRv6-VPN */
171
  struct bgp_sid_info sid[BGP_MAX_SIDS];
172
  uint32_t num_sids;
173
174
#ifdef ENABLE_BGP_VNC
175
  union {
176
177
    struct {
178
      void *rfapi_handle; /* export: NVE advertising this
179
                 route */
180
      struct list *local_nexthops; /* optional, for static
181
              routes */
182
    } export;
183
184
    struct {
185
      struct event *timer;
186
      void *hme; /* encap monitor, if this is a VPN route */
187
      struct prefix_rd
188
        rd; /* import: route's route-distinguisher */
189
      uint8_t un_family; /* family of cached un address, 0 if
190
               unset */
191
      union {
192
        struct in_addr addr4;
193
        struct in6_addr addr6;
194
      } un; /* cached un address */
195
      time_t create_time;
196
      struct prefix aux_prefix; /* AFI_L2VPN: the IP addr,
197
                 if family set */
198
    } import;
199
200
  } vnc;
201
#endif
202
203
  /*
204
   * For imported routes into a VNI (or VRF)
205
   */
206
  void *parent;     /* parent from global table */
207
  union {
208
    struct ethaddr mac; /* MAC set here for VNI IP table */
209
    struct ipaddr ip;   /* IP set here for VNI MAC table */
210
  } vni_info;
211
212
  /*
213
   * Some tunnelish parameters follow. Maybe consolidate into an
214
   * internal tunnel structure?
215
   */
216
217
  /*
218
   * Original bgp instance for imported routes. Needed for:
219
   * 1. Find all routes from a specific vrf for deletion
220
   * 2. vrf context of original nexthop
221
   *
222
   * Store pointer to bgp instance rather than bgp->vrf_id because
223
   * bgp->vrf_id is not always valid (or may change?).
224
   *
225
   * Set to NULL if route is not imported from another bgp instance.
226
   */
227
  struct bgp *bgp_orig;
228
229
  /*
230
   * Original bgp session to know if the session is a
231
   * connected EBGP session or not
232
   */
233
  struct peer *peer_orig;
234
235
  /*
236
   * Nexthop in context of original bgp instance. Needed
237
   * for label resolution of core mpls routes exported to a vrf.
238
   * Set nexthop_orig.family to 0 if not valid.
239
   */
240
  struct prefix nexthop_orig;
241
  /* presence of FS pbr firewall based entry */
242
  struct list *bgp_fs_pbr;
243
  /* presence of FS pbr iprule based entry */
244
  struct list *bgp_fs_iprule;
245
  /* Destination Ethernet Segment links for EVPN MH */
246
  struct bgp_path_mh_info *mh_info;
247
};
248
249
struct bgp_path_info {
250
  /* For linked list. */
251
  struct bgp_path_info *next;
252
  struct bgp_path_info *prev;
253
254
  /* For nexthop linked list */
255
  LIST_ENTRY(bgp_path_info) nh_thread;
256
257
  /* Back pointer to the prefix node */
258
  struct bgp_dest *net;
259
260
  /* Back pointer to the nexthop structure */
261
  struct bgp_nexthop_cache *nexthop;
262
263
  /* Peer structure.  */
264
  struct peer *peer;
265
266
  /* Attribute structure.  */
267
  struct attr *attr;
268
269
  /* Extra information */
270
  struct bgp_path_info_extra *extra;
271
272
273
  /* Multipath information */
274
  struct bgp_path_info_mpath *mpath;
275
276
  /* Uptime.  */
277
  time_t uptime;
278
279
  /* reference count */
280
  int lock;
281
282
  /* BGP information status.  */
283
  uint32_t flags;
284
#define BGP_PATH_IGP_CHANGED (1 << 0)
285
0
#define BGP_PATH_DAMPED (1 << 1)
286
0
#define BGP_PATH_HISTORY (1 << 2)
287
0
#define BGP_PATH_SELECTED (1 << 3)
288
0
#define BGP_PATH_VALID (1 << 4)
289
0
#define BGP_PATH_ATTR_CHANGED (1 << 5)
290
0
#define BGP_PATH_DMED_CHECK (1 << 6)
291
0
#define BGP_PATH_DMED_SELECTED (1 << 7)
292
0
#define BGP_PATH_STALE (1 << 8)
293
0
#define BGP_PATH_REMOVED (1 << 9)
294
#define BGP_PATH_COUNTED (1 << 10)
295
#define BGP_PATH_MULTIPATH (1 << 11)
296
#define BGP_PATH_MULTIPATH_CHG (1 << 12)
297
#define BGP_PATH_RIB_ATTR_CHG (1 << 13)
298
0
#define BGP_PATH_ANNC_NH_SELF (1 << 14)
299
#define BGP_PATH_LINK_BW_CHG (1 << 15)
300
0
#define BGP_PATH_ACCEPT_OWN (1 << 16)
301
302
  /* BGP route type.  This can be static, RIP, OSPF, BGP etc.  */
303
  uint8_t type;
304
305
  /* When above type is BGP.  This sub type specify BGP sub type
306
     information.  */
307
  uint8_t sub_type;
308
2.86k
#define BGP_ROUTE_NORMAL       0
309
2.21k
#define BGP_ROUTE_STATIC       1
310
0
#define BGP_ROUTE_AGGREGATE    2
311
0
#define BGP_ROUTE_REDISTRIBUTE 3
312
#ifdef ENABLE_BGP_VNC
313
0
# define BGP_ROUTE_RFP          4
314
#endif
315
0
#define BGP_ROUTE_IMPORTED     5        /* from another bgp instance/safi */
316
317
  unsigned short instance;
318
319
  /* Addpath identifiers */
320
  uint32_t addpath_rx_id;
321
  struct bgp_addpath_info_data tx_addpath;
322
323
  /* For nexthop per label linked list */
324
  LIST_ENTRY(bgp_path_info) label_nh_thread;
325
326
  /* Back pointer to the bgp label per nexthop structure */
327
  struct bgp_label_per_nexthop_cache *label_nexthop_cache;
328
};
329
330
/* Structure used in BGP path selection */
331
struct bgp_path_info_pair {
332
  struct bgp_path_info *old;
333
  struct bgp_path_info *new;
334
};
335
336
/* BGP static route configuration. */
337
struct bgp_static {
338
  /* Backdoor configuration.  */
339
  int backdoor;
340
341
  /* Label index configuration; applies to LU prefixes. */
342
  uint32_t label_index;
343
2.75k
#define BGP_INVALID_LABEL_INDEX   0xFFFFFFFF
344
345
  /* Import check status.  */
346
  uint8_t valid;
347
348
  /* IGP metric. */
349
  uint32_t igpmetric;
350
351
  /* IGP nexthop. */
352
  struct in_addr igpnexthop;
353
354
  /* Atomic set reference count (ie cause of pathlimit) */
355
  uint32_t atomic;
356
357
  /* BGP redistribute route-map.  */
358
  struct {
359
    char *name;
360
    struct route_map *map;
361
  } rmap;
362
363
  /* Route Distinguisher */
364
  struct prefix_rd prd;
365
  char *prd_pretty;
366
367
  /* MPLS label.  */
368
  mpls_label_t label;
369
370
  /* EVPN */
371
  esi_t *eth_s_id;
372
  struct ethaddr *router_mac;
373
  uint16_t encap_tunneltype;
374
  struct prefix gatewayIp;
375
};
376
377
/* Aggreagete address:
378
 *
379
 *  advertise-map  Set condition to advertise attribute
380
 *  as-set         Generate AS set path information
381
 *  attribute-map  Set attributes of aggregate
382
 *  route-map      Set parameters of aggregate
383
 *  summary-only   Filter more specific routes from updates
384
 *  suppress-map   Conditionally filter more specific routes from updates
385
 *  <cr>
386
 */
387
struct bgp_aggregate {
388
  /* Summary-only flag. */
389
  uint8_t summary_only;
390
391
  /* AS set generation. */
392
  uint8_t as_set;
393
394
  /* Route-map for aggregated route. */
395
  struct {
396
    char *name;
397
    struct route_map *map;
398
  } rmap;
399
400
  /* Suppress-count. */
401
  unsigned long count;
402
403
  /* Count of routes of origin type incomplete under this aggregate. */
404
  unsigned long incomplete_origin_count;
405
406
  /* Count of routes of origin type egp under this aggregate. */
407
  unsigned long egp_origin_count;
408
409
  /* Optional modify flag to override ORIGIN */
410
  uint8_t origin;
411
412
  /* Hash containing the communities of all the
413
   * routes under this aggregate.
414
   */
415
  struct hash *community_hash;
416
417
  /* Hash containing the extended communities of all the
418
   * routes under this aggregate.
419
   */
420
  struct hash *ecommunity_hash;
421
422
  /* Hash containing the large communities of all the
423
   * routes under this aggregate.
424
   */
425
  struct hash *lcommunity_hash;
426
427
  /* Hash containing the AS-Path of all the
428
   * routes under this aggregate.
429
   */
430
  struct hash *aspath_hash;
431
432
  /* Aggregate route's community. */
433
  struct community *community;
434
435
  /* Aggregate route's extended community. */
436
  struct ecommunity *ecommunity;
437
438
  /* Aggregate route's large community. */
439
  struct lcommunity *lcommunity;
440
441
  /* Aggregate route's as-path. */
442
  struct aspath *aspath;
443
444
  /* SAFI configuration. */
445
  safi_t safi;
446
447
  /** Match only equal MED. */
448
  bool match_med;
449
  /* MED matching state. */
450
  /** Did we get the first MED value? */
451
  bool med_initialized;
452
  /** Are there MED mismatches? */
453
  bool med_mismatched;
454
  /** MED value found in current group. */
455
  uint32_t med_matched_value;
456
457
  /**
458
   * Test if aggregated address MED of all route match, otherwise
459
   * returns `false`. This macro will also return `true` if MED
460
   * matching is disabled.
461
   */
462
#define AGGREGATE_MED_VALID(aggregate)                                         \
463
0
  (((aggregate)->match_med && !(aggregate)->med_mismatched)              \
464
0
   || !(aggregate)->match_med)
465
466
  /** Suppress map route map name (`NULL` when disabled). */
467
  char *suppress_map_name;
468
  /** Suppress map route map pointer. */
469
  struct route_map *suppress_map;
470
};
471
472
#define BGP_NEXTHOP_AFI_FROM_NHLEN(nhlen)                                      \
473
0
  ((nhlen) < IPV4_MAX_BYTELEN                                            \
474
0
     ? 0                                                           \
475
0
     : ((nhlen) < IPV6_MAX_BYTELEN ? AFI_IP : AFI_IP6))
476
477
#define BGP_ATTR_MP_NEXTHOP_LEN_IP6(attr)                                      \
478
0
  ((attr)->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL ||               \
479
0
   (attr)->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL ||        \
480
0
   (attr)->mp_nexthop_len == BGP_ATTR_NHLEN_VPNV6_GLOBAL ||              \
481
0
   (attr)->mp_nexthop_len == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
482
483
#define BGP_ATTR_NEXTHOP_AFI_IP6(attr)                                         \
484
168
  (!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP)) &&          \
485
168
   BGP_ATTR_MP_NEXTHOP_LEN_IP6(attr))
486
487
#define BGP_PATH_COUNTABLE(BI)                                                 \
488
0
  (!CHECK_FLAG((BI)->flags, BGP_PATH_HISTORY)                            \
489
0
   && !CHECK_FLAG((BI)->flags, BGP_PATH_REMOVED))
490
491
/* Flags which indicate a route is unuseable in some form */
492
#define BGP_PATH_UNUSEABLE                                                     \
493
  (BGP_PATH_HISTORY | BGP_PATH_DAMPED | BGP_PATH_REMOVED)
494
/* Macro to check BGP information is alive or not.  Sadly,
495
 * not equivalent to just checking previous, because of the
496
 * sense of the additional VALID flag.
497
 */
498
#define BGP_PATH_HOLDDOWN(BI)                                                  \
499
0
  (!CHECK_FLAG((BI)->flags, BGP_PATH_VALID)                              \
500
0
   || CHECK_FLAG((BI)->flags, BGP_PATH_UNUSEABLE))
501
502
2.12k
#define DISTRIBUTE_IN_NAME(F)   ((F)->dlist[FILTER_IN].name)
503
0
#define DISTRIBUTE_IN(F)        ((F)->dlist[FILTER_IN].alist)
504
0
#define DISTRIBUTE_OUT_NAME(F)  ((F)->dlist[FILTER_OUT].name)
505
0
#define DISTRIBUTE_OUT(F)       ((F)->dlist[FILTER_OUT].alist)
506
507
2.12k
#define PREFIX_LIST_IN_NAME(F)  ((F)->plist[FILTER_IN].name)
508
0
#define PREFIX_LIST_IN(F)       ((F)->plist[FILTER_IN].plist)
509
0
#define PREFIX_LIST_OUT_NAME(F) ((F)->plist[FILTER_OUT].name)
510
0
#define PREFIX_LIST_OUT(F)      ((F)->plist[FILTER_OUT].plist)
511
512
2.12k
#define FILTER_LIST_IN_NAME(F)  ((F)->aslist[FILTER_IN].name)
513
0
#define FILTER_LIST_IN(F)       ((F)->aslist[FILTER_IN].aslist)
514
0
#define FILTER_LIST_OUT_NAME(F) ((F)->aslist[FILTER_OUT].name)
515
0
#define FILTER_LIST_OUT(F)      ((F)->aslist[FILTER_OUT].aslist)
516
517
2.04k
#define ROUTE_MAP_IN_NAME(F)    ((F)->map[RMAP_IN].name)
518
0
#define ROUTE_MAP_IN(F)         ((F)->map[RMAP_IN].map)
519
0
#define ROUTE_MAP_OUT_NAME(F)   ((F)->map[RMAP_OUT].name)
520
0
#define ROUTE_MAP_OUT(F)        ((F)->map[RMAP_OUT].map)
521
522
0
#define UNSUPPRESS_MAP_NAME(F)  ((F)->usmap.name)
523
0
#define UNSUPPRESS_MAP(F)       ((F)->usmap.map)
524
525
0
#define ADVERTISE_MAP_NAME(F) ((F)->advmap.aname)
526
0
#define ADVERTISE_MAP(F)  ((F)->advmap.amap)
527
528
0
#define ADVERTISE_CONDITION(F)  ((F)->advmap.condition)
529
530
0
#define CONDITION_MAP_NAME(F) ((F)->advmap.cname)
531
0
#define CONDITION_MAP(F)  ((F)->advmap.cmap)
532
533
/* path PREFIX (addpath rxid NUMBER) */
534
#define PATH_ADDPATH_STR_BUFFER PREFIX2STR_BUFFER + 32
535
536
enum bgp_path_type {
537
  BGP_PATH_SHOW_ALL,
538
  BGP_PATH_SHOW_BESTPATH,
539
  BGP_PATH_SHOW_MULTIPATH
540
};
541
542
static inline void bgp_bump_version(struct bgp_dest *dest)
543
0
{
544
0
  dest->version = bgp_table_next_version(bgp_dest_table(dest));
545
0
}
Unexecuted instantiation: bgp_main.c:bgp_bump_version
Unexecuted instantiation: bgp_attr.c:bgp_bump_version
Unexecuted instantiation: bgp_attr_evpn.c:bgp_bump_version
Unexecuted instantiation: bgp_clist.c:bgp_bump_version
Unexecuted instantiation: bgp_community.c:bgp_bump_version
Unexecuted instantiation: bgp_community_alias.c:bgp_bump_version
Unexecuted instantiation: bgp_debug.c:bgp_bump_version
Unexecuted instantiation: bgp_dump.c:bgp_bump_version
Unexecuted instantiation: bgp_ecommunity.c:bgp_bump_version
Unexecuted instantiation: bgp_evpn.c:bgp_bump_version
Unexecuted instantiation: bgp_evpn_mh.c:bgp_bump_version
Unexecuted instantiation: bgp_evpn_vty.c:bgp_bump_version
Unexecuted instantiation: bgp_filter.c:bgp_bump_version
Unexecuted instantiation: bgp_flowspec_vty.c:bgp_bump_version
Unexecuted instantiation: bgp_fsm.c:bgp_bump_version
Unexecuted instantiation: bgp_io.c:bgp_bump_version
Unexecuted instantiation: bgp_keepalives.c:bgp_bump_version
Unexecuted instantiation: bgp_labelpool.c:bgp_bump_version
Unexecuted instantiation: bgp_lcommunity.c:bgp_bump_version
Unexecuted instantiation: bgp_mac.c:bgp_bump_version
Unexecuted instantiation: bgp_mpath.c:bgp_bump_version
Unexecuted instantiation: bgp_mplsvpn.c:bgp_bump_version
Unexecuted instantiation: bgp_network.c:bgp_bump_version
Unexecuted instantiation: bgp_nexthop.c:bgp_bump_version
Unexecuted instantiation: bgp_nht.c:bgp_bump_version
Unexecuted instantiation: bgp_packet.c:bgp_bump_version
Unexecuted instantiation: bgp_pbr.c:bgp_bump_version
Unexecuted instantiation: bgp_rd.c:bgp_bump_version
Unexecuted instantiation: bgp_regex.c:bgp_bump_version
Unexecuted instantiation: bgp_route.c:bgp_bump_version
Unexecuted instantiation: bgp_routemap.c:bgp_bump_version
Unexecuted instantiation: bgp_table.c:bgp_bump_version
Unexecuted instantiation: bgp_updgrp.c:bgp_bump_version
Unexecuted instantiation: bgp_updgrp_adv.c:bgp_bump_version
Unexecuted instantiation: bgp_updgrp_packet.c:bgp_bump_version
Unexecuted instantiation: bgp_vpn.c:bgp_bump_version
Unexecuted instantiation: bgp_vty.c:bgp_bump_version
Unexecuted instantiation: bgp_zebra.c:bgp_bump_version
Unexecuted instantiation: bgpd.c:bgp_bump_version
Unexecuted instantiation: bgp_rfapi_cfg.c:bgp_bump_version
Unexecuted instantiation: rfapi_import.c:bgp_bump_version
Unexecuted instantiation: rfapi.c:bgp_bump_version
Unexecuted instantiation: rfapi_ap.c:bgp_bump_version
Unexecuted instantiation: rfapi_encap_tlv.c:bgp_bump_version
Unexecuted instantiation: rfapi_nve_addr.c:bgp_bump_version
Unexecuted instantiation: rfapi_monitor.c:bgp_bump_version
Unexecuted instantiation: rfapi_rib.c:bgp_bump_version
Unexecuted instantiation: rfapi_vty.c:bgp_bump_version
Unexecuted instantiation: vnc_export_bgp.c:bgp_bump_version
Unexecuted instantiation: vnc_export_table.c:bgp_bump_version
Unexecuted instantiation: vnc_import_bgp.c:bgp_bump_version
Unexecuted instantiation: vnc_zebra.c:bgp_bump_version
Unexecuted instantiation: bgp_addpath.c:bgp_bump_version
Unexecuted instantiation: bgp_advertise.c:bgp_bump_version
Unexecuted instantiation: bgp_aspath.c:bgp_bump_version
Unexecuted instantiation: bgp_bfd.c:bgp_bump_version
Unexecuted instantiation: bgp_conditional_adv.c:bgp_bump_version
Unexecuted instantiation: bgp_damp.c:bgp_bump_version
Unexecuted instantiation: bgp_encap_tlv.c:bgp_bump_version
Unexecuted instantiation: bgp_flowspec.c:bgp_bump_version
Unexecuted instantiation: bgp_flowspec_util.c:bgp_bump_version
Unexecuted instantiation: bgp_label.c:bgp_bump_version
Unexecuted instantiation: bgp_open.c:bgp_bump_version
Unexecuted instantiation: rfp_example.c:bgp_bump_version
546
547
static inline int bgp_fibupd_safi(safi_t safi)
548
0
{
549
0
  if (safi == SAFI_UNICAST || safi == SAFI_MULTICAST
550
0
      || safi == SAFI_LABELED_UNICAST
551
0
      || safi == SAFI_FLOWSPEC)
552
0
    return 1;
553
0
  return 0;
554
0
}
Unexecuted instantiation: bgp_main.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_attr.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_attr_evpn.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_clist.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_community.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_community_alias.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_debug.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_dump.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_ecommunity.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_evpn.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_evpn_mh.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_evpn_vty.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_filter.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_flowspec_vty.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_fsm.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_io.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_keepalives.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_labelpool.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_lcommunity.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_mac.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_mpath.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_mplsvpn.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_network.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_nexthop.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_nht.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_packet.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_pbr.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_rd.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_regex.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_route.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_routemap.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_table.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_updgrp.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_updgrp_adv.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_updgrp_packet.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_vpn.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_vty.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_zebra.c:bgp_fibupd_safi
Unexecuted instantiation: bgpd.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_rfapi_cfg.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi_import.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi_ap.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi_encap_tlv.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi_nve_addr.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi_monitor.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi_rib.c:bgp_fibupd_safi
Unexecuted instantiation: rfapi_vty.c:bgp_fibupd_safi
Unexecuted instantiation: vnc_export_bgp.c:bgp_fibupd_safi
Unexecuted instantiation: vnc_export_table.c:bgp_fibupd_safi
Unexecuted instantiation: vnc_import_bgp.c:bgp_fibupd_safi
Unexecuted instantiation: vnc_zebra.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_addpath.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_advertise.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_aspath.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_bfd.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_conditional_adv.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_damp.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_encap_tlv.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_flowspec.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_flowspec_util.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_label.c:bgp_fibupd_safi
Unexecuted instantiation: bgp_open.c:bgp_fibupd_safi
Unexecuted instantiation: rfp_example.c:bgp_fibupd_safi
555
556
/* Flag if the route path's family matches params. */
557
static inline bool is_pi_family_matching(struct bgp_path_info *pi,
558
           afi_t afi, safi_t safi)
559
0
{
560
0
  struct bgp_table *table;
561
0
  struct bgp_dest *dest;
562
563
0
  dest = pi->net;
564
0
  if (!dest)
565
0
    return false;
566
0
  table = bgp_dest_table(dest);
567
0
  if (table &&
568
0
      table->afi == afi &&
569
0
      table->safi == safi)
570
0
    return true;
571
0
  return false;
572
0
}
Unexecuted instantiation: bgp_main.c:is_pi_family_matching
Unexecuted instantiation: bgp_attr.c:is_pi_family_matching
Unexecuted instantiation: bgp_attr_evpn.c:is_pi_family_matching
Unexecuted instantiation: bgp_clist.c:is_pi_family_matching
Unexecuted instantiation: bgp_community.c:is_pi_family_matching
Unexecuted instantiation: bgp_community_alias.c:is_pi_family_matching
Unexecuted instantiation: bgp_debug.c:is_pi_family_matching
Unexecuted instantiation: bgp_dump.c:is_pi_family_matching
Unexecuted instantiation: bgp_ecommunity.c:is_pi_family_matching
Unexecuted instantiation: bgp_evpn.c:is_pi_family_matching
Unexecuted instantiation: bgp_evpn_mh.c:is_pi_family_matching
Unexecuted instantiation: bgp_evpn_vty.c:is_pi_family_matching
Unexecuted instantiation: bgp_filter.c:is_pi_family_matching
Unexecuted instantiation: bgp_flowspec_vty.c:is_pi_family_matching
Unexecuted instantiation: bgp_fsm.c:is_pi_family_matching
Unexecuted instantiation: bgp_io.c:is_pi_family_matching
Unexecuted instantiation: bgp_keepalives.c:is_pi_family_matching
Unexecuted instantiation: bgp_labelpool.c:is_pi_family_matching
Unexecuted instantiation: bgp_lcommunity.c:is_pi_family_matching
Unexecuted instantiation: bgp_mac.c:is_pi_family_matching
Unexecuted instantiation: bgp_mpath.c:is_pi_family_matching
Unexecuted instantiation: bgp_mplsvpn.c:is_pi_family_matching
Unexecuted instantiation: bgp_network.c:is_pi_family_matching
Unexecuted instantiation: bgp_nexthop.c:is_pi_family_matching
Unexecuted instantiation: bgp_nht.c:is_pi_family_matching
Unexecuted instantiation: bgp_packet.c:is_pi_family_matching
Unexecuted instantiation: bgp_pbr.c:is_pi_family_matching
Unexecuted instantiation: bgp_rd.c:is_pi_family_matching
Unexecuted instantiation: bgp_regex.c:is_pi_family_matching
Unexecuted instantiation: bgp_route.c:is_pi_family_matching
Unexecuted instantiation: bgp_routemap.c:is_pi_family_matching
Unexecuted instantiation: bgp_table.c:is_pi_family_matching
Unexecuted instantiation: bgp_updgrp.c:is_pi_family_matching
Unexecuted instantiation: bgp_updgrp_adv.c:is_pi_family_matching
Unexecuted instantiation: bgp_updgrp_packet.c:is_pi_family_matching
Unexecuted instantiation: bgp_vpn.c:is_pi_family_matching
Unexecuted instantiation: bgp_vty.c:is_pi_family_matching
Unexecuted instantiation: bgp_zebra.c:is_pi_family_matching
Unexecuted instantiation: bgpd.c:is_pi_family_matching
Unexecuted instantiation: bgp_rfapi_cfg.c:is_pi_family_matching
Unexecuted instantiation: rfapi_import.c:is_pi_family_matching
Unexecuted instantiation: rfapi.c:is_pi_family_matching
Unexecuted instantiation: rfapi_ap.c:is_pi_family_matching
Unexecuted instantiation: rfapi_encap_tlv.c:is_pi_family_matching
Unexecuted instantiation: rfapi_nve_addr.c:is_pi_family_matching
Unexecuted instantiation: rfapi_monitor.c:is_pi_family_matching
Unexecuted instantiation: rfapi_rib.c:is_pi_family_matching
Unexecuted instantiation: rfapi_vty.c:is_pi_family_matching
Unexecuted instantiation: vnc_export_bgp.c:is_pi_family_matching
Unexecuted instantiation: vnc_export_table.c:is_pi_family_matching
Unexecuted instantiation: vnc_import_bgp.c:is_pi_family_matching
Unexecuted instantiation: vnc_zebra.c:is_pi_family_matching
Unexecuted instantiation: bgp_addpath.c:is_pi_family_matching
Unexecuted instantiation: bgp_advertise.c:is_pi_family_matching
Unexecuted instantiation: bgp_aspath.c:is_pi_family_matching
Unexecuted instantiation: bgp_bfd.c:is_pi_family_matching
Unexecuted instantiation: bgp_conditional_adv.c:is_pi_family_matching
Unexecuted instantiation: bgp_damp.c:is_pi_family_matching
Unexecuted instantiation: bgp_encap_tlv.c:is_pi_family_matching
Unexecuted instantiation: bgp_flowspec.c:is_pi_family_matching
Unexecuted instantiation: bgp_flowspec_util.c:is_pi_family_matching
Unexecuted instantiation: bgp_label.c:is_pi_family_matching
Unexecuted instantiation: bgp_open.c:is_pi_family_matching
Unexecuted instantiation: rfp_example.c:is_pi_family_matching
573
574
static inline void prep_for_rmap_apply(struct bgp_path_info *dst_pi,
575
               struct bgp_path_info_extra *dst_pie,
576
               struct bgp_dest *dest,
577
               struct bgp_path_info *src_pi,
578
               struct peer *peer, struct attr *attr)
579
0
{
580
0
  memset(dst_pi, 0, sizeof(struct bgp_path_info));
581
0
  dst_pi->peer = peer;
582
0
  dst_pi->attr = attr;
583
0
  dst_pi->net = dest;
584
0
  dst_pi->flags = src_pi->flags;
585
0
  dst_pi->type = src_pi->type;
586
0
  dst_pi->sub_type = src_pi->sub_type;
587
0
  dst_pi->mpath = src_pi->mpath;
588
0
  if (src_pi->extra) {
589
0
    memcpy(dst_pie, src_pi->extra,
590
0
           sizeof(struct bgp_path_info_extra));
591
0
    dst_pi->extra = dst_pie;
592
0
  }
593
0
}
Unexecuted instantiation: bgp_main.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_attr.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_attr_evpn.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_clist.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_community.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_community_alias.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_debug.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_dump.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_ecommunity.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_evpn.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_evpn_mh.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_evpn_vty.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_filter.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_flowspec_vty.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_fsm.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_io.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_keepalives.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_labelpool.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_lcommunity.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_mac.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_mpath.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_mplsvpn.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_network.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_nexthop.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_nht.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_packet.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_pbr.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_rd.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_regex.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_route.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_routemap.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_table.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_updgrp.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_updgrp_adv.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_updgrp_packet.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_vpn.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_vty.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_zebra.c:prep_for_rmap_apply
Unexecuted instantiation: bgpd.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_rfapi_cfg.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi_import.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi_ap.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi_encap_tlv.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi_nve_addr.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi_monitor.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi_rib.c:prep_for_rmap_apply
Unexecuted instantiation: rfapi_vty.c:prep_for_rmap_apply
Unexecuted instantiation: vnc_export_bgp.c:prep_for_rmap_apply
Unexecuted instantiation: vnc_export_table.c:prep_for_rmap_apply
Unexecuted instantiation: vnc_import_bgp.c:prep_for_rmap_apply
Unexecuted instantiation: vnc_zebra.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_addpath.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_advertise.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_aspath.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_bfd.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_conditional_adv.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_damp.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_encap_tlv.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_flowspec.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_flowspec_util.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_label.c:prep_for_rmap_apply
Unexecuted instantiation: bgp_open.c:prep_for_rmap_apply
Unexecuted instantiation: rfp_example.c:prep_for_rmap_apply
594
595
static inline bool bgp_check_advertise(struct bgp *bgp, struct bgp_dest *dest)
596
0
{
597
0
  return (!(BGP_SUPPRESS_FIB_ENABLED(bgp) &&
598
0
      CHECK_FLAG(dest->flags, BGP_NODE_FIB_INSTALL_PENDING) &&
599
0
     (!bgp_option_check(BGP_OPT_NO_FIB))));
600
0
}
Unexecuted instantiation: bgp_main.c:bgp_check_advertise
Unexecuted instantiation: bgp_attr.c:bgp_check_advertise
Unexecuted instantiation: bgp_attr_evpn.c:bgp_check_advertise
Unexecuted instantiation: bgp_clist.c:bgp_check_advertise
Unexecuted instantiation: bgp_community.c:bgp_check_advertise
Unexecuted instantiation: bgp_community_alias.c:bgp_check_advertise
Unexecuted instantiation: bgp_debug.c:bgp_check_advertise
Unexecuted instantiation: bgp_dump.c:bgp_check_advertise
Unexecuted instantiation: bgp_ecommunity.c:bgp_check_advertise
Unexecuted instantiation: bgp_evpn.c:bgp_check_advertise
Unexecuted instantiation: bgp_evpn_mh.c:bgp_check_advertise
Unexecuted instantiation: bgp_evpn_vty.c:bgp_check_advertise
Unexecuted instantiation: bgp_filter.c:bgp_check_advertise
Unexecuted instantiation: bgp_flowspec_vty.c:bgp_check_advertise
Unexecuted instantiation: bgp_fsm.c:bgp_check_advertise
Unexecuted instantiation: bgp_io.c:bgp_check_advertise
Unexecuted instantiation: bgp_keepalives.c:bgp_check_advertise
Unexecuted instantiation: bgp_labelpool.c:bgp_check_advertise
Unexecuted instantiation: bgp_lcommunity.c:bgp_check_advertise
Unexecuted instantiation: bgp_mac.c:bgp_check_advertise
Unexecuted instantiation: bgp_mpath.c:bgp_check_advertise
Unexecuted instantiation: bgp_mplsvpn.c:bgp_check_advertise
Unexecuted instantiation: bgp_network.c:bgp_check_advertise
Unexecuted instantiation: bgp_nexthop.c:bgp_check_advertise
Unexecuted instantiation: bgp_nht.c:bgp_check_advertise
Unexecuted instantiation: bgp_packet.c:bgp_check_advertise
Unexecuted instantiation: bgp_pbr.c:bgp_check_advertise
Unexecuted instantiation: bgp_rd.c:bgp_check_advertise
Unexecuted instantiation: bgp_regex.c:bgp_check_advertise
Unexecuted instantiation: bgp_route.c:bgp_check_advertise
Unexecuted instantiation: bgp_routemap.c:bgp_check_advertise
Unexecuted instantiation: bgp_table.c:bgp_check_advertise
Unexecuted instantiation: bgp_updgrp.c:bgp_check_advertise
Unexecuted instantiation: bgp_updgrp_adv.c:bgp_check_advertise
Unexecuted instantiation: bgp_updgrp_packet.c:bgp_check_advertise
Unexecuted instantiation: bgp_vpn.c:bgp_check_advertise
Unexecuted instantiation: bgp_vty.c:bgp_check_advertise
Unexecuted instantiation: bgp_zebra.c:bgp_check_advertise
Unexecuted instantiation: bgpd.c:bgp_check_advertise
Unexecuted instantiation: bgp_rfapi_cfg.c:bgp_check_advertise
Unexecuted instantiation: rfapi_import.c:bgp_check_advertise
Unexecuted instantiation: rfapi.c:bgp_check_advertise
Unexecuted instantiation: rfapi_ap.c:bgp_check_advertise
Unexecuted instantiation: rfapi_encap_tlv.c:bgp_check_advertise
Unexecuted instantiation: rfapi_nve_addr.c:bgp_check_advertise
Unexecuted instantiation: rfapi_monitor.c:bgp_check_advertise
Unexecuted instantiation: rfapi_rib.c:bgp_check_advertise
Unexecuted instantiation: rfapi_vty.c:bgp_check_advertise
Unexecuted instantiation: vnc_export_bgp.c:bgp_check_advertise
Unexecuted instantiation: vnc_export_table.c:bgp_check_advertise
Unexecuted instantiation: vnc_import_bgp.c:bgp_check_advertise
Unexecuted instantiation: vnc_zebra.c:bgp_check_advertise
Unexecuted instantiation: bgp_addpath.c:bgp_check_advertise
Unexecuted instantiation: bgp_advertise.c:bgp_check_advertise
Unexecuted instantiation: bgp_aspath.c:bgp_check_advertise
Unexecuted instantiation: bgp_bfd.c:bgp_check_advertise
Unexecuted instantiation: bgp_conditional_adv.c:bgp_check_advertise
Unexecuted instantiation: bgp_damp.c:bgp_check_advertise
Unexecuted instantiation: bgp_encap_tlv.c:bgp_check_advertise
Unexecuted instantiation: bgp_flowspec.c:bgp_check_advertise
Unexecuted instantiation: bgp_flowspec_util.c:bgp_check_advertise
Unexecuted instantiation: bgp_label.c:bgp_check_advertise
Unexecuted instantiation: bgp_open.c:bgp_check_advertise
Unexecuted instantiation: rfp_example.c:bgp_check_advertise
601
602
/*
603
 * If we have a fib result and it failed to install( or was withdrawn due
604
 * to better admin distance we need to send down the wire a withdrawal.
605
 * This function assumes that bgp_check_advertise was already returned
606
 * as good to go.
607
 */
608
static inline bool bgp_check_withdrawal(struct bgp *bgp, struct bgp_dest *dest)
609
0
{
610
0
  struct bgp_path_info *pi, *selected = NULL;
611
612
0
  if (!BGP_SUPPRESS_FIB_ENABLED(bgp))
613
0
    return false;
614
615
0
  for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) {
616
0
    if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) {
617
0
      selected = pi;
618
0
      continue;
619
0
    }
620
621
0
    if (pi->sub_type != BGP_ROUTE_NORMAL)
622
0
      return true;
623
0
  }
624
625
  /*
626
   * pi is selected and bgp is dealing with a static route
627
   * ( ie a network statement of some sort ).  FIB installed
628
   * is irrelevant
629
   *
630
   * I am not sure what the above for loop is wanted in this
631
   * manner at this point.  But I do know that if I have
632
   * a static route that is selected and it's the one
633
   * being checked for should I withdrawal we do not
634
   * want to withdraw the route on installation :)
635
   */
636
0
  if (selected && selected->sub_type == BGP_ROUTE_STATIC)
637
0
    return false;
638
639
0
  if (CHECK_FLAG(dest->flags, BGP_NODE_FIB_INSTALLED))
640
0
    return false;
641
642
0
  return true;
643
0
}
Unexecuted instantiation: bgp_main.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_attr.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_attr_evpn.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_clist.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_community.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_community_alias.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_debug.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_dump.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_ecommunity.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_evpn.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_evpn_mh.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_evpn_vty.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_filter.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_flowspec_vty.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_fsm.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_io.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_keepalives.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_labelpool.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_lcommunity.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_mac.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_mpath.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_mplsvpn.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_network.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_nexthop.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_nht.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_packet.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_pbr.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_rd.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_regex.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_route.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_routemap.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_table.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_updgrp.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_updgrp_adv.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_updgrp_packet.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_vpn.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_vty.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_zebra.c:bgp_check_withdrawal
Unexecuted instantiation: bgpd.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_rfapi_cfg.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi_import.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi_ap.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi_encap_tlv.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi_nve_addr.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi_monitor.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi_rib.c:bgp_check_withdrawal
Unexecuted instantiation: rfapi_vty.c:bgp_check_withdrawal
Unexecuted instantiation: vnc_export_bgp.c:bgp_check_withdrawal
Unexecuted instantiation: vnc_export_table.c:bgp_check_withdrawal
Unexecuted instantiation: vnc_import_bgp.c:bgp_check_withdrawal
Unexecuted instantiation: vnc_zebra.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_addpath.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_advertise.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_aspath.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_bfd.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_conditional_adv.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_damp.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_encap_tlv.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_flowspec.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_flowspec_util.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_label.c:bgp_check_withdrawal
Unexecuted instantiation: bgp_open.c:bgp_check_withdrawal
Unexecuted instantiation: rfp_example.c:bgp_check_withdrawal
644
645
/* called before bgp_process() */
646
DECLARE_HOOK(bgp_process,
647
       (struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *bn,
648
        struct peer *peer, bool withdraw),
649
       (bgp, afi, safi, bn, peer, withdraw));
650
651
/* BGP show options */
652
#define BGP_SHOW_OPT_JSON (1 << 0)
653
#define BGP_SHOW_OPT_WIDE (1 << 1)
654
#define BGP_SHOW_OPT_AFI_ALL (1 << 2)
655
#define BGP_SHOW_OPT_AFI_IP (1 << 3)
656
#define BGP_SHOW_OPT_AFI_IP6 (1 << 4)
657
#define BGP_SHOW_OPT_ESTABLISHED (1 << 5)
658
#define BGP_SHOW_OPT_FAILED (1 << 6)
659
#define BGP_SHOW_OPT_JSON_DETAIL (1 << 7)
660
#define BGP_SHOW_OPT_TERSE (1 << 8)
661
0
#define BGP_SHOW_OPT_ROUTES_DETAIL (1 << 9)
662
663
/* Prototypes. */
664
extern void bgp_rib_remove(struct bgp_dest *dest, struct bgp_path_info *pi,
665
         struct peer *peer, afi_t afi, safi_t safi);
666
extern void bgp_process_queue_init(struct bgp *bgp);
667
extern void bgp_route_init(void);
668
extern void bgp_route_finish(void);
669
extern void bgp_cleanup_routes(struct bgp *);
670
extern void bgp_free_aggregate_info(struct bgp_aggregate *aggregate);
671
extern void bgp_announce_route(struct peer *peer, afi_t afi, safi_t safi,
672
             bool force);
673
extern void bgp_stop_announce_route_timer(struct peer_af *paf);
674
extern void bgp_announce_route_all(struct peer *);
675
extern void bgp_default_originate(struct peer *, afi_t, safi_t, int);
676
extern void bgp_soft_reconfig_table_task_cancel(const struct bgp *bgp,
677
            const struct bgp_table *table,
678
            const struct peer *peer);
679
680
/*
681
 * If this peer is configured for soft reconfig in then do the work
682
 * and return true.  If it is not return false; and do nothing
683
 */
684
extern bool bgp_soft_reconfig_in(struct peer *peer, afi_t afi, safi_t safi);
685
extern void bgp_clear_route(struct peer *, afi_t, safi_t);
686
extern void bgp_clear_route_all(struct peer *);
687
extern void bgp_clear_adj_in(struct peer *, afi_t, safi_t);
688
extern void bgp_clear_stale_route(struct peer *, afi_t, safi_t);
689
extern void bgp_set_stale_route(struct peer *peer, afi_t afi, safi_t safi);
690
extern bool bgp_outbound_policy_exists(struct peer *, struct bgp_filter *);
691
extern bool bgp_inbound_policy_exists(struct peer *, struct bgp_filter *);
692
693
extern struct bgp_dest *bgp_afi_node_get(struct bgp_table *table, afi_t afi,
694
           safi_t safi, const struct prefix *p,
695
           struct prefix_rd *prd);
696
extern struct bgp_path_info *bgp_path_info_lock(struct bgp_path_info *path);
697
extern struct bgp_path_info *bgp_path_info_unlock(struct bgp_path_info *path);
698
extern struct bgp_path_info *
699
bgp_get_imported_bpi_ultimate(struct bgp_path_info *info);
700
extern void bgp_path_info_add(struct bgp_dest *dest, struct bgp_path_info *pi);
701
extern void bgp_path_info_extra_free(struct bgp_path_info_extra **extra);
702
extern void bgp_path_info_reap(struct bgp_dest *dest, struct bgp_path_info *pi);
703
extern void bgp_path_info_delete(struct bgp_dest *dest,
704
         struct bgp_path_info *pi);
705
extern struct bgp_path_info_extra *
706
bgp_path_info_extra_get(struct bgp_path_info *path);
707
extern void bgp_path_info_set_flag(struct bgp_dest *dest,
708
           struct bgp_path_info *path, uint32_t flag);
709
extern void bgp_path_info_unset_flag(struct bgp_dest *dest,
710
             struct bgp_path_info *path, uint32_t flag);
711
extern void bgp_path_info_path_with_addpath_rx_str(struct bgp_path_info *pi,
712
               char *buf, size_t buf_len);
713
714
extern int bgp_nlri_parse_ip(struct peer *, struct attr *, struct bgp_nlri *);
715
716
extern bool bgp_maximum_prefix_overflow(struct peer *, afi_t, safi_t, int);
717
718
extern void bgp_redistribute_add(struct bgp *bgp, struct prefix *p,
719
         const union g_addr *nexthop, ifindex_t ifindex,
720
         enum nexthop_types_t nhtype, uint8_t distance,
721
         enum blackhole_type bhtype, uint32_t metric,
722
         uint8_t type, unsigned short instance,
723
         route_tag_t tag);
724
extern void bgp_redistribute_delete(struct bgp *, struct prefix *, uint8_t,
725
            unsigned short);
726
extern void bgp_redistribute_withdraw(struct bgp *, afi_t, int, unsigned short);
727
728
extern void bgp_static_add(struct bgp *);
729
extern void bgp_static_delete(struct bgp *);
730
extern void bgp_static_redo_import_check(struct bgp *);
731
extern void bgp_purge_static_redist_routes(struct bgp *bgp);
732
extern void bgp_static_update(struct bgp *bgp, const struct prefix *p,
733
            struct bgp_static *s, afi_t afi, safi_t safi);
734
extern void bgp_static_withdraw(struct bgp *bgp, const struct prefix *p,
735
        afi_t afi, safi_t safi);
736
737
extern int bgp_static_set_safi(afi_t afi, safi_t safi, struct vty *vty,
738
             const char *, const char *, const char *,
739
             const char *, int, const char *, const char *,
740
             const char *, const char *);
741
742
extern int bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *,
743
         const char *, const char *, const char *, int,
744
         const char *, const char *, const char *);
745
746
/* this is primarily for MPLS-VPN */
747
extern void bgp_update(struct peer *peer, const struct prefix *p,
748
           uint32_t addpath_id, struct attr *attr, afi_t afi,
749
           safi_t safi, int type, int sub_type,
750
           struct prefix_rd *prd, mpls_label_t *label,
751
           uint32_t num_labels, int soft_reconfig,
752
           struct bgp_route_evpn *evpn);
753
extern void bgp_withdraw(struct peer *peer, const struct prefix *p,
754
       uint32_t addpath_id, afi_t afi, safi_t safi, int type,
755
       int sub_type, struct prefix_rd *prd,
756
       mpls_label_t *label, uint32_t num_labels,
757
       struct bgp_route_evpn *evpn);
758
759
/* for bgp_nexthop and bgp_damp */
760
extern void bgp_process(struct bgp *, struct bgp_dest *, afi_t, safi_t);
761
762
/*
763
 * Add an end-of-initial-update marker to the process queue. This is just a
764
 * queue element with NULL bgp node.
765
 */
766
extern void bgp_add_eoiu_mark(struct bgp *);
767
extern void bgp_config_write_table_map(struct vty *, struct bgp *, afi_t,
768
               safi_t);
769
extern void bgp_config_write_network(struct vty *, struct bgp *, afi_t, safi_t);
770
extern void bgp_config_write_distance(struct vty *, struct bgp *, afi_t,
771
              safi_t);
772
773
extern void bgp_aggregate_delete(struct bgp *bgp, const struct prefix *p,
774
         afi_t afi, safi_t safi,
775
         struct bgp_aggregate *aggregate);
776
extern bool bgp_aggregate_route(struct bgp *bgp, const struct prefix *p,
777
        afi_t afi, safi_t safi,
778
        struct bgp_aggregate *aggregate);
779
extern void bgp_aggregate_increment(struct bgp *bgp, const struct prefix *p,
780
            struct bgp_path_info *path, afi_t afi,
781
            safi_t safi);
782
extern void bgp_aggregate_decrement(struct bgp *bgp, const struct prefix *p,
783
            struct bgp_path_info *path, afi_t afi,
784
            safi_t safi);
785
786
extern uint8_t bgp_distance_apply(const struct prefix *p,
787
          struct bgp_path_info *path, afi_t afi,
788
          safi_t safi, struct bgp *bgp);
789
790
extern afi_t bgp_node_afi(struct vty *);
791
extern safi_t bgp_node_safi(struct vty *);
792
793
extern struct bgp_path_info *info_make(int type, int sub_type,
794
               unsigned short instance,
795
               struct peer *peer, struct attr *attr,
796
               struct bgp_dest *dest);
797
798
extern void route_vty_out(struct vty *vty, const struct prefix *p,
799
        struct bgp_path_info *path, int display, safi_t safi,
800
        json_object *json_paths, bool wide);
801
extern void route_vty_out_tag(struct vty *vty, const struct prefix *p,
802
            struct bgp_path_info *path, int display,
803
            safi_t safi, json_object *json);
804
extern void route_vty_out_tmp(struct vty *vty, struct bgp_dest *dest,
805
            const struct prefix *p, struct attr *attr,
806
            safi_t safi, bool use_json, json_object *json_ar,
807
            bool wide);
808
extern void route_vty_out_overlay(struct vty *vty, const struct prefix *p,
809
          struct bgp_path_info *path, int display,
810
          json_object *json);
811
812
extern void bgp_notify_conditional_adv_scanner(struct update_subgroup *subgrp);
813
814
extern void subgroup_process_announce_selected(struct update_subgroup *subgrp,
815
                 struct bgp_path_info *selected,
816
                 struct bgp_dest *dest, afi_t afi,
817
                 safi_t safi,
818
                 uint32_t addpath_tx_id);
819
820
extern bool subgroup_announce_check(struct bgp_dest *dest,
821
            struct bgp_path_info *pi,
822
            struct update_subgroup *subgrp,
823
            const struct prefix *p, struct attr *attr,
824
            struct attr *post_attr);
825
826
extern void bgp_peer_clear_node_queue_drain_immediate(struct peer *peer);
827
extern void bgp_process_queues_drain_immediate(void);
828
829
/* for encap/vpn */
830
extern struct bgp_dest *bgp_safi_node_lookup(struct bgp_table *table,
831
               safi_t safi,
832
               const struct prefix *p,
833
               struct prefix_rd *prd);
834
extern void bgp_path_info_restore(struct bgp_dest *dest,
835
          struct bgp_path_info *path);
836
837
extern int bgp_path_info_cmp_compatible(struct bgp *bgp,
838
          struct bgp_path_info *new,
839
          struct bgp_path_info *exist,
840
          char *pfx_buf, afi_t afi, safi_t safi,
841
          enum bgp_path_selection_reason *reason);
842
extern void bgp_attr_add_llgr_community(struct attr *attr);
843
extern void bgp_attr_add_gshut_community(struct attr *attr);
844
845
extern void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
846
             struct bgp_maxpaths_cfg *mpath_cfg,
847
             struct bgp_path_info_pair *result, afi_t afi,
848
             safi_t safi);
849
extern void bgp_zebra_clear_route_change_flags(struct bgp_dest *dest);
850
extern bool bgp_zebra_has_route_changed(struct bgp_path_info *selected);
851
852
extern void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
853
          struct bgp_dest *dest,
854
          const struct prefix *p,
855
          const struct prefix_rd *prd, afi_t afi,
856
          safi_t safi, json_object *json,
857
          bool incremental_print);
858
extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
859
         struct bgp_dest *bn, const struct prefix *p,
860
         struct bgp_path_info *path, afi_t afi,
861
         safi_t safi, enum rpki_states,
862
         json_object *json_paths);
863
extern int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
864
           struct bgp_table *table, struct prefix_rd *prd,
865
           enum bgp_show_type type, void *output_arg,
866
           uint16_t show_flags);
867
extern void bgp_best_path_select_defer(struct bgp *bgp, afi_t afi, safi_t safi);
868
extern bool bgp_update_martian_nexthop(struct bgp *bgp, afi_t afi, safi_t safi,
869
               uint8_t type, uint8_t stype,
870
               struct attr *attr, struct bgp_dest *dest);
871
extern int bgp_evpn_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
872
           struct bgp_path_info *exist, int *paths_eq);
873
extern void bgp_aggregate_toggle_suppressed(struct bgp_aggregate *aggregate,
874
              struct bgp *bgp,
875
              const struct prefix *p, afi_t afi,
876
              safi_t safi, bool suppress);
877
extern void subgroup_announce_reset_nhop(uint8_t family, struct attr *attr);
878
const char *
879
bgp_path_selection_reason2str(enum bgp_path_selection_reason reason);
880
extern bool bgp_addpath_encode_rx(struct peer *peer, afi_t afi, safi_t safi);
881
extern const struct prefix_rd *bgp_rd_from_dest(const struct bgp_dest *dest,
882
            safi_t safi);
883
extern void bgp_path_info_free_with_caller(const char *caller,
884
             struct bgp_path_info *path);
885
extern void bgp_path_info_add_with_caller(const char *caller,
886
            struct bgp_dest *dest,
887
            struct bgp_path_info *pi);
888
extern void bgp_aggregate_free(struct bgp_aggregate *aggregate);
889
#define bgp_path_info_add(A, B)                                                \
890
0
  bgp_path_info_add_with_caller(__func__, (A), (B))
891
0
#define bgp_path_info_free(B) bgp_path_info_free_with_caller(__func__, (B))
892
#endif /* _QUAGGA_BGP_ROUTE_H */