]>
Commit | Line | Data |
---|---|---|
dcc68b5e MS |
1 | /* |
2 | * Addpath TX ID selection, and related utilities | |
3 | * Copyright (C) 2018 Amazon.com, Inc. or its affiliates | |
4 | * | |
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) | |
8 | * any later version. | |
9 | * | |
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 | |
13 | * more details. | |
14 | * | |
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 | |
18 | */ | |
19 | ||
20 | #ifndef _QUAGGA_BGPD_TX_ADDPATH_H | |
21 | #define _QUAGGA_BGPD_TX_ADDPATH_H | |
22 | ||
23 | #include <stdint.h> | |
24 | #include <zebra.h> | |
25 | ||
26 | #include "bgpd/bgp_addpath_types.h" | |
27 | #include "bgpd/bgp_route.h" | |
28 | #include "bgpd/bgp_table.h" | |
29 | #include "lib/json.h" | |
30 | ||
31 | #define BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE 1 | |
32 | ||
33 | void bgp_addpath_init_bgp_data(struct bgp_addpath_bgp_data *d); | |
34 | ||
3dc339cd DA |
35 | bool bgp_addpath_is_addpath_used(struct bgp_addpath_bgp_data *d, afi_t afi, |
36 | safi_t safi); | |
dcc68b5e MS |
37 | |
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); | |
41 | ||
42 | void bgp_addpath_free_info_data(struct bgp_addpath_info_data *d, | |
43 | struct bgp_addpath_node_data *nd); | |
44 | ||
45 | ||
3dc339cd | 46 | bool bgp_addpath_info_has_ids(struct bgp_addpath_info_data *d); |
dcc68b5e MS |
47 | |
48 | uint32_t bgp_addpath_id_for_peer(struct peer *peer, afi_t afi, safi_t safi, | |
49 | struct bgp_addpath_info_data *d); | |
50 | ||
2b64873d | 51 | const struct bgp_addpath_strategy_names * |
dcc68b5e MS |
52 | bgp_addpath_names(enum bgp_addpath_strat strat); |
53 | ||
3dc339cd | 54 | bool bgp_addpath_dmed_required(int strategy); |
dcc68b5e MS |
55 | |
56 | /* | |
57 | * Return true if this is a path we should advertise due to a configured | |
58 | * addpath-tx knob | |
59 | */ | |
3dc339cd DA |
60 | bool bgp_addpath_tx_path(enum bgp_addpath_strat strat, |
61 | struct bgp_path_info *pi); | |
dcc68b5e MS |
62 | /* |
63 | * Change the type of addpath used for a peer. | |
64 | */ | |
65 | void bgp_addpath_set_peer_type(struct peer *peer, afi_t afi, safi_t safi, | |
66 | enum bgp_addpath_strat addpath_type); | |
67 | ||
9bcb3eef | 68 | void bgp_addpath_update_ids(struct bgp *bgp, struct bgp_dest *dest, afi_t afi, |
dcc68b5e MS |
69 | safi_t safi); |
70 | ||
71 | void bgp_addpath_type_changed(struct bgp *bgp); | |
72 | #endif |