]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_addpath.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / bgpd / bgp_addpath.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Addpath TX ID selection, and related utilities
4 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates
5 */
6
7 #ifndef _QUAGGA_BGPD_TX_ADDPATH_H
8 #define _QUAGGA_BGPD_TX_ADDPATH_H
9
10 #include <stdint.h>
11 #include <zebra.h>
12
13 #include "bgpd/bgp_addpath_types.h"
14 #include "bgpd/bgp_route.h"
15 #include "bgpd/bgp_table.h"
16 #include "lib/json.h"
17
18 #define BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE 1
19
20 void bgp_addpath_init_bgp_data(struct bgp_addpath_bgp_data *d);
21
22 bool bgp_addpath_is_addpath_used(struct bgp_addpath_bgp_data *d, afi_t afi,
23 safi_t safi);
24
25 void bgp_addpath_free_node_data(struct bgp_addpath_bgp_data *bd,
26 struct bgp_addpath_node_data *nd,
27 afi_t afi, safi_t safi);
28
29 void bgp_addpath_free_info_data(struct bgp_addpath_info_data *d,
30 struct bgp_addpath_node_data *nd);
31
32
33 bool bgp_addpath_info_has_ids(struct bgp_addpath_info_data *d);
34
35 uint32_t bgp_addpath_id_for_peer(struct peer *peer, afi_t afi, safi_t safi,
36 struct bgp_addpath_info_data *d);
37
38 const struct bgp_addpath_strategy_names *
39 bgp_addpath_names(enum bgp_addpath_strat strat);
40
41 bool bgp_addpath_dmed_required(int strategy);
42
43 /*
44 * Return true if this is a path we should advertise due to a configured
45 * addpath-tx knob
46 */
47 bool bgp_addpath_tx_path(enum bgp_addpath_strat strat,
48 struct bgp_path_info *pi);
49 /*
50 * Change the type of addpath used for a peer.
51 */
52 void bgp_addpath_set_peer_type(struct peer *peer, afi_t afi, safi_t safi,
53 enum bgp_addpath_strat addpath_type);
54
55 void bgp_addpath_update_ids(struct bgp *bgp, struct bgp_dest *dest, afi_t afi,
56 safi_t safi);
57
58 void bgp_addpath_type_changed(struct bgp *bgp);
59 #endif