2 * Addpath TX ID selection, and related utilities
3 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _QUAGGA_BGPD_TX_ADDPATH_H
21 #define _QUAGGA_BGPD_TX_ADDPATH_H
26 #include "bgpd/bgp_addpath_types.h"
27 #include "bgpd/bgp_route.h"
28 #include "bgpd/bgp_table.h"
31 #define BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE 1
33 void bgp_addpath_init_bgp_data(struct bgp_addpath_bgp_data
*d
);
35 bool bgp_addpath_is_addpath_used(struct bgp_addpath_bgp_data
*d
, afi_t afi
,
38 void bgp_addpath_free_node_data(struct bgp_addpath_bgp_data
*bd
,
39 struct bgp_addpath_node_data
*nd
,
40 afi_t afi
, safi_t safi
);
42 void bgp_addpath_free_info_data(struct bgp_addpath_info_data
*d
,
43 struct bgp_addpath_node_data
*nd
);
46 bool bgp_addpath_info_has_ids(struct bgp_addpath_info_data
*d
);
48 uint32_t bgp_addpath_id_for_peer(struct peer
*peer
, afi_t afi
, safi_t safi
,
49 struct bgp_addpath_info_data
*d
);
51 const struct bgp_addpath_strategy_names
*
52 bgp_addpath_names(enum bgp_addpath_strat strat
);
54 bool bgp_addpath_dmed_required(int strategy
);
57 * Return true if this is a path we should advertise due to a configured
60 bool bgp_addpath_tx_path(enum bgp_addpath_strat strat
,
61 struct bgp_path_info
*pi
);
63 * Change the type of addpath used for a peer.
65 void bgp_addpath_set_peer_type(struct peer
*peer
, afi_t afi
, safi_t safi
,
66 enum bgp_addpath_strat addpath_type
);
68 void bgp_addpath_update_ids(struct bgp
*bgp
, struct bgp_dest
*dest
, afi_t afi
,
71 void bgp_addpath_type_changed(struct bgp
*bgp
);