1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Addpath TX ID selection, and related utilities
4 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates
7 #ifndef _QUAGGA_BGPD_TX_ADDPATH_H
8 #define _QUAGGA_BGPD_TX_ADDPATH_H
13 #include "bgpd/bgp_addpath_types.h"
14 #include "bgpd/bgp_route.h"
15 #include "bgpd/bgp_table.h"
18 #define BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE 1
20 void bgp_addpath_init_bgp_data(struct bgp_addpath_bgp_data
*d
);
22 bool bgp_addpath_is_addpath_used(struct bgp_addpath_bgp_data
*d
, afi_t afi
,
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
);
29 void bgp_addpath_free_info_data(struct bgp_addpath_info_data
*d
,
30 struct bgp_addpath_node_data
*nd
);
33 bool bgp_addpath_info_has_ids(struct bgp_addpath_info_data
*d
);
35 uint32_t bgp_addpath_id_for_peer(struct peer
*peer
, afi_t afi
, safi_t safi
,
36 struct bgp_addpath_info_data
*d
);
38 const struct bgp_addpath_strategy_names
*
39 bgp_addpath_names(enum bgp_addpath_strat strat
);
41 bool bgp_addpath_dmed_required(int strategy
);
44 * Return true if this is a path we should advertise due to a configured
47 bool bgp_addpath_tx_path(enum bgp_addpath_strat strat
,
48 struct bgp_path_info
*pi
);
50 * Change the type of addpath used for a peer.
52 void bgp_addpath_set_peer_type(struct peer
*peer
, afi_t afi
, safi_t safi
,
53 enum bgp_addpath_strat addpath_type
);
55 void bgp_addpath_update_ids(struct bgp
*bgp
, struct bgp_dest
*dest
, afi_t afi
,
58 void bgp_addpath_type_changed(struct bgp
*bgp
);