Do a straight conversion of `struct bgp_info` to `struct bgp_path_info`.
This commit will setup the rename of variables as well.
This is being done because `struct bgp_info` is not descriptive
of what this data actually is. It is path information for routes
that we keep to build the actual routes nexthops plus some extra
information.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
looking for data in hash table, and putting there if missing, refcnt
using pointer to existing data
many validity checks
- get new struct bgp_info (10 words/40 bytes)
- call bgp_info_add with rn and bgp_info
+ get new struct bgp_path_info
+ call bgp_path_info_add with rn and bgp_path_info
call bgp_process
bgp_routemap.c
Question: How much memory does quagga's bgpd use as a function of
state received from peers?
-It seems that a struct bgp_info is kept for each prefix. The "struct
+It seems that a struct bgp_path_info is kept for each prefix. The "struct
attr *" is interned, and variables within that are interned. So, 40
bytes are kept per received prefix, plus interned shared values. This
could be 36 if 'int suppress' where changed to a u_char and moved to
struct bgp_advertise_attr *baa;
/* BGP info. */
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
};
/* BGP adjacency out. */
}
/* A route becomes unreachable (RFC2439 Section 4.8.2). */
-int bgp_damp_withdraw(struct bgp_info *binfo, struct bgp_node *rn, afi_t afi,
- safi_t safi, int attr_change)
+int bgp_damp_withdraw(struct bgp_path_info *binfo, struct bgp_node *rn,
+ afi_t afi, safi_t safi, int attr_change)
{
time_t t_now;
struct bgp_damp_info *bdi = NULL;
return BGP_DAMP_USED;
}
-int bgp_damp_update(struct bgp_info *binfo, struct bgp_node *rn, afi_t afi,
+int bgp_damp_update(struct bgp_path_info *binfo, struct bgp_node *rn, afi_t afi,
safi_t safi)
{
time_t t_now;
}
/* Remove dampening information and history route. */
-int bgp_damp_scan(struct bgp_info *binfo, afi_t afi, safi_t safi)
+int bgp_damp_scan(struct bgp_path_info *binfo, afi_t afi, safi_t safi)
{
time_t t_now, t_diff;
struct bgp_damp_info *bdi;
void bgp_damp_info_free(struct bgp_damp_info *bdi, int withdraw)
{
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
if (!bdi)
return;
return buf;
}
-void bgp_damp_info_vty(struct vty *vty, struct bgp_info *binfo,
+void bgp_damp_info_vty(struct vty *vty, struct bgp_path_info *binfo,
json_object *json_path)
{
struct bgp_damp_info *bdi;
}
}
-const char *bgp_damp_reuse_time_vty(struct vty *vty, struct bgp_info *binfo,
- char *timebuf, size_t len, bool use_json,
+const char *bgp_damp_reuse_time_vty(struct vty *vty,
+ struct bgp_path_info *binfo, char *timebuf,
+ size_t len, bool use_json,
json_object *json)
{
struct bgp_damp_info *bdi;
time_t suppress_time;
/* Back reference to bgp_info. */
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
/* Back reference to bgp_node. */
struct bgp_node *rn;
extern int bgp_damp_enable(struct bgp *, afi_t, safi_t, time_t, unsigned int,
unsigned int, time_t);
extern int bgp_damp_disable(struct bgp *, afi_t, safi_t);
-extern int bgp_damp_withdraw(struct bgp_info *, struct bgp_node *, afi_t,
- safi_t, int);
-extern int bgp_damp_update(struct bgp_info *, struct bgp_node *, afi_t, safi_t);
-extern int bgp_damp_scan(struct bgp_info *, afi_t, safi_t);
-extern void bgp_damp_info_free(struct bgp_damp_info *, int);
+extern int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_node *rn,
+ afi_t afi, safi_t safi, int attr_change);
+extern int bgp_damp_update(struct bgp_path_info *path, struct bgp_node *rn,
+ afi_t afi, safi_t saff);
+extern int bgp_damp_scan(struct bgp_path_info *path, afi_t afi, safi_t safi);
+extern void bgp_damp_info_free(struct bgp_damp_info *path, int withdraw);
extern void bgp_damp_info_clean(void);
extern int bgp_damp_decay(time_t, int);
extern void bgp_config_write_damp(struct vty *);
-extern void bgp_damp_info_vty(struct vty *, struct bgp_info *,
+extern void bgp_damp_info_vty(struct vty *vty, struct bgp_path_info *path,
json_object *json_path);
extern const char *bgp_damp_reuse_time_vty(struct vty *vty,
- struct bgp_info *binfo,
+ struct bgp_path_info *binfo,
char *timebuf, size_t len,
bool use_json, json_object *json);
extern int bgp_show_dampening_parameters(struct vty *vty, afi_t, safi_t);
}
-static struct bgp_info *bgp_dump_route_node_record(int afi, struct bgp_node *rn,
- struct bgp_info *info,
- unsigned int seq)
+static struct bgp_path_info *
+bgp_dump_route_node_record(int afi, struct bgp_node *rn,
+ struct bgp_path_info *info, unsigned int seq)
{
struct stream *obuf;
size_t sizep;
static unsigned int bgp_dump_routes_func(int afi, int first_run,
unsigned int seq)
{
- struct bgp_info *info;
+ struct bgp_path_info *info;
struct bgp_node *rn;
struct bgp *bgp;
struct bgp_table *table;
/*
* Static function declarations
*/
-static void delete_evpn_route_entry(struct bgp *bgp,
- afi_t afi, safi_t safi,
+static void delete_evpn_route_entry(struct bgp *bgp, afi_t afi, safi_t safi,
struct bgp_node *rn,
- struct bgp_info **ri);
+ struct bgp_path_info **ri);
static int delete_all_vni_routes(struct bgp *bgp, struct bgpevpn *vpn);
/*
*/
static void evpn_delete_old_local_route(struct bgp *bgp, struct bgpevpn *vpn,
struct bgp_node *rn,
- struct bgp_info *old_local)
+ struct bgp_path_info *old_local)
{
struct bgp_node *global_rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
int ret = 0;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
- struct bgp_info *old_select; /* old best */
- struct bgp_info *new_select; /* new best */
- struct bgp_info_pair old_and_new;
+ struct bgp_path_info *old_select; /* old best */
+ struct bgp_path_info *new_select; /* new best */
+ struct bgp_path_info_pair old_and_new;
/* Compute the best path. */
bgp_best_selection(bgp, rn, &bgp->maxpaths[afi][safi],
static int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn,
struct bgp_node *rn)
{
- struct bgp_info *old_select, *new_select;
- struct bgp_info_pair old_and_new;
+ struct bgp_path_info *old_select, *new_select;
+ struct bgp_path_info_pair old_and_new;
struct prefix_evpn *evp;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
*/
static int evpn_route_is_def_gw(struct bgp *bgp, struct bgp_node *rn)
{
- struct bgp_info *tmp_ri = NULL;
- struct bgp_info *local_ri = NULL;
+ struct bgp_path_info *tmp_ri = NULL;
+ struct bgp_path_info *local_ri = NULL;
local_ri = NULL;
for (tmp_ri = rn->info; tmp_ri; tmp_ri = tmp_ri->next) {
*/
static int evpn_route_is_sticky(struct bgp *bgp, struct bgp_node *rn)
{
- struct bgp_info *tmp_ri;
- struct bgp_info *local_ri;
+ struct bgp_path_info *tmp_ri;
+ struct bgp_path_info *local_ri;
local_ri = NULL;
for (tmp_ri = rn->info; tmp_ri; tmp_ri = tmp_ri->next) {
* This could be in the ES table or the global table.
* TODO: handle remote ES (type4) routes as well
*/
-static int update_evpn_type4_route_entry(struct bgp *bgp,
- struct evpnes *es,
+static int update_evpn_type4_route_entry(struct bgp *bgp, struct evpnes *es,
afi_t afi, safi_t safi,
- struct bgp_node *rn,
- struct attr *attr,
- int add,
- struct bgp_info **ri,
+ struct bgp_node *rn, struct attr *attr,
+ int add, struct bgp_path_info **ri,
int *route_changed)
{
char buf[ESI_STR_LEN];
char buf1[INET6_ADDRSTRLEN];
- struct bgp_info *tmp_ri = NULL;
- struct bgp_info *local_ri = NULL; /* local route entry if any */
- struct bgp_info *remote_ri = NULL; /* remote route entry if any */
+ struct bgp_path_info *tmp_ri = NULL;
+ struct bgp_path_info *local_ri = NULL; /* local route entry if any */
+ struct bgp_path_info *remote_ri = NULL; /* remote route entry if any */
struct attr *attr_new = NULL;
struct prefix_evpn *evp = NULL;
struct attr attr;
struct attr *attr_new = NULL;
struct bgp_node *rn = NULL;
- struct bgp_info *ri = NULL;
+ struct bgp_path_info *ri = NULL;
memset(&attr, 0, sizeof(struct attr));
* Prefix-level) similar to L3VPN routes.
*/
if (route_changed) {
- struct bgp_info *global_ri;
+ struct bgp_path_info *global_ri;
rn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi,
(struct prefix *)p, &es->prd);
struct attr *attr, int *route_changed)
{
struct attr *attr_new = NULL;
- struct bgp_info *ri = NULL;
+ struct bgp_path_info *ri = NULL;
mpls_label_t label = MPLS_INVALID_LABEL;
- struct bgp_info *local_ri = NULL;
- struct bgp_info *tmp_ri = NULL;
+ struct bgp_path_info *local_ri = NULL;
+ struct bgp_path_info *tmp_ri = NULL;
*route_changed = 0;
/* locate the local route entry if any */
static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn,
afi_t afi, safi_t safi, struct bgp_node *rn,
struct attr *attr, int add,
- struct bgp_info **ri, uint8_t flags,
+ struct bgp_path_info **ri, uint8_t flags,
uint32_t seq)
{
- struct bgp_info *tmp_ri;
- struct bgp_info *local_ri;
+ struct bgp_path_info *tmp_ri;
+ struct bgp_path_info *local_ri;
struct attr *attr_new;
mpls_label_t label[BGP_MAX_LABELS];
uint32_t num_labels = 1;
struct attr attr;
struct attr *attr_new;
int add_l3_ecomm = 0;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
int route_change;
* Prefix-level) similar to L3VPN routes.
*/
if (route_change) {
- struct bgp_info *global_ri;
+ struct bgp_path_info *global_ri;
rn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi,
(struct prefix *)p, &vpn->prd);
* Delete EVPN route entry.
* The entry can be in ESI/VNI table or the global table.
*/
-static void delete_evpn_route_entry(struct bgp *bgp,
- afi_t afi, safi_t safi,
+static void delete_evpn_route_entry(struct bgp *bgp, afi_t afi, safi_t safi,
struct bgp_node *rn,
- struct bgp_info **ri)
+ struct bgp_path_info **ri)
{
- struct bgp_info *tmp_ri;
+ struct bgp_path_info *tmp_ri;
*ri = NULL;
{
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_node *rn = NULL; /* rn in esi table */
struct bgp_node *global_rn = NULL; /* rn in global table */
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
struct bgp_node *rn = NULL;
- struct bgp_info *ri = NULL;
+ struct bgp_path_info *ri = NULL;
struct bgp *bgp_def = NULL; /* default bgp instance */
bgp_def = bgp_get_default();
struct prefix_evpn *p)
{
struct bgp_node *rn, *global_rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
afi_t afi;
safi_t safi;
struct bgp_node *rn;
- struct bgp_info *ri, *tmp_ri;
+ struct bgp_path_info *ri, *tmp_ri;
struct attr attr;
struct attr *attr_new;
uint32_t seq;
rn = bgp_route_next(rn)) {
struct prefix_evpn *evp = (struct prefix_evpn *)&rn->p;
struct bgp_node *rd_rn;
- struct bgp_info *global_ri;
+ struct bgp_path_info *global_ri;
if (evp->prefix.route_type != BGP_EVPN_MAC_IP_ROUTE)
continue;
safi_t safi;
struct bgp_node *rdrn, *rn;
struct bgp_table *table;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi = AFI_L2VPN;
safi = SAFI_EVPN;
afi_t afi;
safi_t safi;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi = AFI_L2VPN;
safi = SAFI_EVPN;
static int delete_all_es_routes(struct bgp *bgp, struct evpnes *es)
{
struct bgp_node *rn;
- struct bgp_info *ri, *nextri;
+ struct bgp_path_info *ri, *nextri;
/* Walk this ES's route table and delete all routes. */
for (rn = bgp_table_top(es->route_table); rn;
static int delete_all_vni_routes(struct bgp *bgp, struct bgpevpn *vpn)
{
struct bgp_node *rn;
- struct bgp_info *ri, *nextri;
+ struct bgp_path_info *ri, *nextri;
/* Walk this VNI's route table and delete all routes. */
for (rn = bgp_table_top(vpn->route_table); rn;
}
/* Install EVPN route entry in ES */
-static int install_evpn_route_entry_in_es(struct bgp *bgp,
- struct evpnes *es,
+static int install_evpn_route_entry_in_es(struct bgp *bgp, struct evpnes *es,
struct prefix_evpn *p,
- struct bgp_info *parent_ri)
+ struct bgp_path_info *parent_ri)
{
int ret = 0;
struct bgp_node *rn = NULL;
- struct bgp_info *ri = NULL;
+ struct bgp_path_info *ri = NULL;
struct attr *attr_new = NULL;
/* Create (or fetch) route within the VNI.
/* Check if route entry is already present. */
for (ri = rn->info; ri; ri = ri->next)
- if (ri->extra &&
- (struct bgp_info *)ri->extra->parent == parent_ri)
+ if (ri->extra
+ && (struct bgp_path_info *)ri->extra->parent == parent_ri)
break;
if (!ri) {
*/
static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
struct prefix_evpn *evp,
- struct bgp_info *parent_ri)
+ struct bgp_path_info *parent_ri)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct attr attr;
struct attr *attr_new;
int ret = 0;
/* Check if route entry is already present. */
for (ri = rn->info; ri; ri = ri->next)
if (ri->extra
- && (struct bgp_info *)ri->extra->parent == parent_ri)
+ && (struct bgp_path_info *)ri->extra->parent == parent_ri)
break;
if (!ri) {
*/
static int install_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn,
struct prefix_evpn *p,
- struct bgp_info *parent_ri)
+ struct bgp_path_info *parent_ri)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct attr *attr_new;
int ret;
/* Check if route entry is already present. */
for (ri = rn->info; ri; ri = ri->next)
if (ri->extra
- && (struct bgp_info *)ri->extra->parent == parent_ri)
+ && (struct bgp_path_info *)ri->extra->parent == parent_ri)
break;
if (!ri) {
}
/* Uninstall EVPN route entry from ES route table */
-static int uninstall_evpn_route_entry_in_es(struct bgp *bgp,
- struct evpnes *es,
+static int uninstall_evpn_route_entry_in_es(struct bgp *bgp, struct evpnes *es,
struct prefix_evpn *p,
- struct bgp_info *parent_ri)
+ struct bgp_path_info *parent_ri)
{
int ret;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
if (!es->route_table)
return 0;
/* Find matching route entry. */
for (ri = rn->info; ri; ri = ri->next)
- if (ri->extra &&
- (struct bgp_info *)ri->extra->parent == parent_ri)
+ if (ri->extra
+ && (struct bgp_path_info *)ri->extra->parent == parent_ri)
break;
if (!ri)
*/
static int uninstall_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
struct prefix_evpn *evp,
- struct bgp_info *parent_ri)
+ struct bgp_path_info *parent_ri)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
int ret = 0;
struct prefix p;
struct prefix *pp = &p;
/* Find matching route entry. */
for (ri = rn->info; ri; ri = ri->next)
if (ri->extra
- && (struct bgp_info *)ri->extra->parent == parent_ri)
+ && (struct bgp_path_info *)ri->extra->parent == parent_ri)
break;
if (!ri)
*/
static int uninstall_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn,
struct prefix_evpn *p,
- struct bgp_info *parent_ri)
+ struct bgp_path_info *parent_ri)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
int ret;
/* Locate route within the VNI. */
/* Find matching route entry. */
for (ri = rn->info; ri; ri = ri->next)
if (ri->extra
- && (struct bgp_info *)ri->extra->parent == parent_ri)
+ && (struct bgp_path_info *)ri->extra->parent == parent_ri)
break;
if (!ri)
* Given a route entry and a VRF, see if this route entry should be
* imported into the VRF i.e., RTs match.
*/
-static int is_route_matching_for_vrf(struct bgp *bgp_vrf, struct bgp_info *ri)
+static int is_route_matching_for_vrf(struct bgp *bgp_vrf,
+ struct bgp_path_info *ri)
{
struct attr *attr = ri->attr;
struct ecommunity *ecom;
* imported into the VNI i.e., RTs match.
*/
static int is_route_matching_for_vni(struct bgp *bgp, struct bgpevpn *vpn,
- struct bgp_info *ri)
+ struct bgp_path_info *ri)
{
struct attr *attr = ri->attr;
struct ecommunity *ecom;
char buf1[ESI_STR_LEN];
struct bgp_node *rd_rn, *rn;
struct bgp_table *table;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi = AFI_L2VPN;
safi = SAFI_EVPN;
safi_t safi;
struct bgp_node *rd_rn, *rn;
struct bgp_table *table;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
int ret;
char buf[PREFIX_STRLEN];
struct bgp *bgp_def = NULL;
safi_t safi;
struct bgp_node *rd_rn, *rn;
struct bgp_table *table;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
int ret;
afi = AFI_L2VPN;
static int install_uninstall_route_in_es(struct bgp *bgp, struct evpnes *es,
afi_t afi, safi_t safi,
struct prefix_evpn *evp,
- struct bgp_info *ri,
- int install)
+ struct bgp_path_info *ri, int install)
{
int ret = 0;
char buf[ESI_STR_LEN];
*/
static int install_uninstall_route_in_vrfs(struct bgp *bgp_def, afi_t afi,
safi_t safi, struct prefix_evpn *evp,
- struct bgp_info *ri,
+ struct bgp_path_info *ri,
struct list *vrfs, int install)
{
char buf[PREFIX2STR_BUFFER];
*/
static int install_uninstall_route_in_vnis(struct bgp *bgp, afi_t afi,
safi_t safi, struct prefix_evpn *evp,
- struct bgp_info *ri,
+ struct bgp_path_info *ri,
struct list *vnis, int install)
{
struct bgpevpn *vpn;
* Install or uninstall route for appropriate VNIs/ESIs.
*/
static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi,
- struct prefix *p, struct bgp_info *ri,
- int import)
+ struct prefix *p,
+ struct bgp_path_info *ri, int import)
{
struct prefix_evpn *evp = (struct prefix_evpn *)p;
struct attr *attr = ri->attr;
{
struct prefix_evpn p;
struct bgp_node *rn, *global_rn;
- struct bgp_info *ri, *global_ri;
+ struct bgp_path_info *ri, *global_ri;
struct attr *attr;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
int ret;
struct prefix_evpn p;
struct bgp_node *global_rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
{
struct bgp_table *table = NULL;
struct bgp_node *rn = NULL;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
table = bgp_vrf->rib[afi][safi];
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
{
struct bgp_table *table = NULL;
struct bgp_node *rn = NULL;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
table = bgp_vrf->rib[afi][safi];
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
* Import evpn route from global table to VNI/VRF/ESI.
*/
int bgp_evpn_import_route(struct bgp *bgp, afi_t afi, safi_t safi,
- struct prefix *p, struct bgp_info *ri)
+ struct prefix *p, struct bgp_path_info *ri)
{
return install_uninstall_evpn_route(bgp, afi, safi, p, ri, 1);
}
* Unimport evpn route from VNI/VRF/ESI.
*/
int bgp_evpn_unimport_route(struct bgp *bgp, afi_t afi, safi_t safi,
- struct prefix *p, struct bgp_info *ri)
+ struct prefix *p, struct bgp_path_info *ri)
{
return install_uninstall_evpn_route(bgp, afi, safi, p, ri, 0);
}
safi_t safi;
struct bgp_node *rd_rn, *rn;
struct bgp_table *table;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi = AFI_L2VPN;
safi = SAFI_EVPN;
}
/* Flag if the route's parent is a EVPN route. */
-static inline int is_route_parent_evpn(struct bgp_info *ri)
+static inline int is_route_parent_evpn(struct bgp_path_info *ri)
{
- struct bgp_info *parent_ri;
+ struct bgp_path_info *parent_ri;
struct bgp_table *table;
struct bgp_node *rn;
return 0;
/* See if the parent is of family L2VPN/EVPN */
- parent_ri = (struct bgp_info *)ri->extra->parent;
+ parent_ri = (struct bgp_path_info *)ri->extra->parent;
rn = parent_ri->net;
if (!rn)
return 0;
extern int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
struct bgp_nlri *packet, int withdraw);
extern int bgp_evpn_import_route(struct bgp *bgp, afi_t afi, safi_t safi,
- struct prefix *p, struct bgp_info *ri);
+ struct prefix *p, struct bgp_path_info *ri);
extern int bgp_evpn_unimport_route(struct bgp *bgp, afi_t afi, safi_t safi,
- struct prefix *p, struct bgp_info *ri);
+ struct prefix *p, struct bgp_path_info *ri);
extern int bgp_filter_evpn_routes_upon_martian_nh_change(struct bgp *bgp);
extern int bgp_evpn_local_macip_del(struct bgp *bgp, vni_t vni,
struct ethaddr *mac, struct ipaddr *ip);
{
int header = 1;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
uint32_t prefix_cnt, path_cnt;
uint64_t tbl_ver;
json_object *json)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_table *table;
int header = 1;
uint64_t tbl_ver;
struct bgp_table *table;
struct bgp_node *rn;
struct bgp_node *rm;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
int rd_header;
int header = 1;
struct bgpevpn *vpn;
struct prefix_evpn p;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
uint32_t path_cnt = 0;
afi_t afi;
safi_t safi;
struct bgpevpn *vpn;
struct prefix_evpn p;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
uint32_t path_cnt = 0;
afi_t afi;
safi_t safi;
{
struct prefix_evpn p;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi_t afi;
safi_t safi;
uint32_t path_cnt = 0;
struct bgp_node *rd_rn;
struct bgp_table *table;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
int rd_header = 1;
afi_t afi;
safi_t safi;
struct bgp_node *rd_rn;
struct bgp_table *table;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
int header = 1;
int rd_header;
afi_t afi;
json_object *json_path);
extern void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
- struct bgp_info *binfo,
- int display, json_object *json_paths);
+ struct bgp_path_info *binfo, int display,
+ json_object *json_paths);
extern int bgp_fs_config_write_pbr(struct vty *vty, struct bgp *bgp,
afi_t afi, safi_t safi);
}
void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
- struct bgp_info *binfo,
- int display, json_object *json_paths)
+ struct bgp_path_info *binfo, int display,
+ json_object *json_paths)
{
struct attr *attr;
char return_string[BGP_FLOWSPEC_STRING_DISPLAY_MAX];
json_object_array_add(json_paths, json_time_path);
}
if (display == NLRI_STRING_FORMAT_LARGE) {
- struct bgp_info_extra *extra = bgp_info_extra_get(binfo);
+ struct bgp_path_info_extra *extra = bgp_info_extra_get(binfo);
if (extra->bgp_fs_pbr) {
struct listnode *node;
void *output_arg, bool use_json, int is_last,
unsigned long *output_cum, unsigned long *total_cum)
{
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_node *rn;
unsigned long total_count = 0;
json_object *json_paths = NULL;
return 1;
}
-mpls_label_t bgp_adv_label(struct bgp_node *rn, struct bgp_info *ri,
+mpls_label_t bgp_adv_label(struct bgp_node *rn, struct bgp_path_info *ri,
struct peer *to, afi_t afi, safi_t safi)
{
struct peer *from;
return rn->local_label;
}
-void bgp_reg_dereg_for_label(struct bgp_node *rn, struct bgp_info *ri, int reg)
+void bgp_reg_dereg_for_label(struct bgp_node *rn, struct bgp_path_info *ri,
+ int reg)
{
struct stream *s;
struct prefix *p;
#define BGP_PREVENT_VRF_2_VRF_LEAK 0xFFFFFFFE
struct bgp_node;
-struct bgp_info;
+struct bgp_path_info;
struct peer;
-extern void bgp_reg_dereg_for_label(struct bgp_node *rn, struct bgp_info *ri,
- int reg);
+extern void bgp_reg_dereg_for_label(struct bgp_node *rn,
+ struct bgp_path_info *ri, int reg);
extern int bgp_parse_fec_update(void);
-extern mpls_label_t bgp_adv_label(struct bgp_node *rn, struct bgp_info *ri,
+extern mpls_label_t bgp_adv_label(struct bgp_node *rn, struct bgp_path_info *ri,
struct peer *to, afi_t afi, safi_t safi);
extern int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
}
static inline void bgp_register_for_label(struct bgp_node *rn,
- struct bgp_info *ri)
+ struct bgp_path_info *ri)
{
bgp_reg_dereg_for_label(rn, ri, 1);
}
* or greater than zero if bi1 is respectively less than, equal to,
* or greater than bi2.
*/
-int bgp_info_nexthop_cmp(struct bgp_info *bi1, struct bgp_info *bi2)
+int bgp_info_nexthop_cmp(struct bgp_path_info *bi1, struct bgp_path_info *bi2)
{
int compare;
struct in6_addr addr1, addr2;
*/
static int bgp_info_mpath_cmp(void *val1, void *val2)
{
- struct bgp_info *bi1, *bi2;
+ struct bgp_path_info *bi1, *bi2;
int compare;
bi1 = val1;
*
* Adds a multipath entry to the mp_list
*/
-void bgp_mp_list_add(struct list *mp_list, struct bgp_info *mpinfo)
+void bgp_mp_list_add(struct list *mp_list, struct bgp_path_info *mpinfo)
{
assert(mp_list && mpinfo);
listnode_add_sort(mp_list, mpinfo);
*
* Allocate and zero memory for a new bgp_info_mpath element
*/
-static struct bgp_info_mpath *bgp_info_mpath_new(void)
+static struct bgp_path_info_mpath *bgp_info_mpath_new(void)
{
- struct bgp_info_mpath *new_mpath;
- new_mpath =
- XCALLOC(MTYPE_BGP_MPATH_INFO, sizeof(struct bgp_info_mpath));
+ struct bgp_path_info_mpath *new_mpath;
+ new_mpath = XCALLOC(MTYPE_BGP_MPATH_INFO,
+ sizeof(struct bgp_path_info_mpath));
return new_mpath;
}
*
* Release resources for a bgp_info_mpath element and zero out pointer
*/
-void bgp_info_mpath_free(struct bgp_info_mpath **mpath)
+void bgp_info_mpath_free(struct bgp_path_info_mpath **mpath)
{
if (mpath && *mpath) {
if ((*mpath)->mp_attr)
* Fetch the mpath element for the given bgp_info. Used for
* doing lazy allocation.
*/
-static struct bgp_info_mpath *bgp_info_mpath_get(struct bgp_info *binfo)
+static struct bgp_path_info_mpath *
+bgp_info_mpath_get(struct bgp_path_info *binfo)
{
- struct bgp_info_mpath *mpath;
+ struct bgp_path_info_mpath *mpath;
if (!binfo->mpath) {
mpath = bgp_info_mpath_new();
if (!mpath)
* Enqueue a path onto the multipath list given the previous multipath
* list entry
*/
-static void bgp_info_mpath_enqueue(struct bgp_info *prev_info,
- struct bgp_info *binfo)
+static void bgp_info_mpath_enqueue(struct bgp_path_info *prev_info,
+ struct bgp_path_info *binfo)
{
- struct bgp_info_mpath *prev, *mpath;
+ struct bgp_path_info_mpath *prev, *mpath;
prev = bgp_info_mpath_get(prev_info);
mpath = bgp_info_mpath_get(binfo);
*
* Remove a path from the multipath list
*/
-void bgp_info_mpath_dequeue(struct bgp_info *binfo)
+void bgp_info_mpath_dequeue(struct bgp_path_info *binfo)
{
- struct bgp_info_mpath *mpath = binfo->mpath;
+ struct bgp_path_info_mpath *mpath = binfo->mpath;
if (!mpath)
return;
if (mpath->mp_prev)
*
* Given a bgp_info, return the next multipath entry
*/
-struct bgp_info *bgp_info_mpath_next(struct bgp_info *binfo)
+struct bgp_path_info *bgp_info_mpath_next(struct bgp_path_info *binfo)
{
if (!binfo->mpath || !binfo->mpath->mp_next)
return NULL;
*
* Given bestpath bgp_info, return the first multipath entry.
*/
-struct bgp_info *bgp_info_mpath_first(struct bgp_info *binfo)
+struct bgp_path_info *bgp_info_mpath_first(struct bgp_path_info *binfo)
{
return bgp_info_mpath_next(binfo);
}
*
* Given the bestpath bgp_info, return the number of multipath entries
*/
-uint32_t bgp_info_mpath_count(struct bgp_info *binfo)
+uint32_t bgp_info_mpath_count(struct bgp_path_info *binfo)
{
if (!binfo->mpath)
return 0;
*
* Sets the count of multipaths into bestpath's mpath element
*/
-static void bgp_info_mpath_count_set(struct bgp_info *binfo, uint32_t count)
+static void bgp_info_mpath_count_set(struct bgp_path_info *binfo,
+ uint32_t count)
{
- struct bgp_info_mpath *mpath;
+ struct bgp_path_info_mpath *mpath;
if (!count && !binfo->mpath)
return;
mpath = bgp_info_mpath_get(binfo);
* Given bestpath bgp_info, return aggregated attribute set used
* for advertising the multipath route
*/
-struct attr *bgp_info_mpath_attr(struct bgp_info *binfo)
+struct attr *bgp_info_mpath_attr(struct bgp_path_info *binfo)
{
if (!binfo->mpath)
return NULL;
*
* Sets the aggregated attribute into bestpath's mpath element
*/
-static void bgp_info_mpath_attr_set(struct bgp_info *binfo, struct attr *attr)
+static void bgp_info_mpath_attr_set(struct bgp_path_info *binfo,
+ struct attr *attr)
{
- struct bgp_info_mpath *mpath;
+ struct bgp_path_info_mpath *mpath;
if (!attr && !binfo->mpath)
return;
mpath = bgp_info_mpath_get(binfo);
* Compare and sync up the multipath list with the mp_list generated by
* bgp_best_selection
*/
-void bgp_info_mpath_update(struct bgp_node *rn, struct bgp_info *new_best,
- struct bgp_info *old_best, struct list *mp_list,
+void bgp_info_mpath_update(struct bgp_node *rn, struct bgp_path_info *new_best,
+ struct bgp_path_info *old_best, struct list *mp_list,
struct bgp_maxpaths_cfg *mpath_cfg)
{
uint16_t maxpaths, mpath_count, old_mpath_count;
struct listnode *mp_node, *mp_next_node;
- struct bgp_info *cur_mpath, *new_mpath, *next_mpath, *prev_mpath;
+ struct bgp_path_info *cur_mpath, *new_mpath, *next_mpath, *prev_mpath;
int mpath_changed, debug;
char pfx_buf[PREFIX2STR_BUFFER], nh_buf[2][INET6_ADDRSTRLEN];
char path_buf[PATH_ADDPATH_STR_BUFFER];
* to skip over it
*/
while (mp_node || cur_mpath) {
- struct bgp_info *tmp_info;
+ struct bgp_path_info *tmp_info;
/*
* We can bail out of this loop if all existing paths on the
* Clean up multipath information for BGP_PATH_DMED_SELECTED path that
* is not selected as best path
*/
-void bgp_mp_dmed_deselect(struct bgp_info *dmed_best)
+void bgp_mp_dmed_deselect(struct bgp_path_info *dmed_best)
{
- struct bgp_info *mpinfo, *mpnext;
+ struct bgp_path_info *mpinfo, *mpnext;
if (!dmed_best)
return;
* is no change in multipath selection and no attribute change in
* any multipath.
*/
-void bgp_info_mpath_aggregate_update(struct bgp_info *new_best,
- struct bgp_info *old_best)
+void bgp_info_mpath_aggregate_update(struct bgp_path_info *new_best,
+ struct bgp_path_info *old_best)
{
- struct bgp_info *mpinfo;
+ struct bgp_path_info *mpinfo;
struct aspath *aspath;
struct aspath *asmerge;
struct attr *new_attr, *old_attr;
/* Supplemental information linked to bgp_info for keeping track of
* multipath selections, lazily allocated to save memory
*/
-struct bgp_info_mpath {
+struct bgp_path_info_mpath {
/* Points to the first multipath (on bestpath) or the next multipath */
- struct bgp_info_mpath *mp_next;
+ struct bgp_path_info_mpath *mp_next;
/* Points to the previous multipath or NULL on bestpath */
- struct bgp_info_mpath *mp_prev;
+ struct bgp_path_info_mpath *mp_prev;
/* Points to bgp_info associated with this multipath info */
- struct bgp_info *mp_info;
+ struct bgp_path_info *mp_info;
/* When attached to best path, the number of selected multipaths */
uint32_t mp_count;
/* Functions used by bgp_best_selection to record current
* multipath selections
*/
-extern int bgp_info_nexthop_cmp(struct bgp_info *bi1, struct bgp_info *bi2);
+extern int bgp_info_nexthop_cmp(struct bgp_path_info *bi1,
+ struct bgp_path_info *bi2);
extern void bgp_mp_list_init(struct list *);
extern void bgp_mp_list_clear(struct list *);
-extern void bgp_mp_list_add(struct list *, struct bgp_info *);
-extern void bgp_mp_dmed_deselect(struct bgp_info *);
-extern void bgp_info_mpath_update(struct bgp_node *, struct bgp_info *,
- struct bgp_info *, struct list *,
- struct bgp_maxpaths_cfg *);
-extern void bgp_info_mpath_aggregate_update(struct bgp_info *,
- struct bgp_info *);
+extern void bgp_mp_list_add(struct list *mp_list, struct bgp_path_info *mpinfo);
+extern void bgp_mp_dmed_deselect(struct bgp_path_info *dmed_best);
+extern void bgp_info_mpath_update(struct bgp_node *rn,
+ struct bgp_path_info *new_best,
+ struct bgp_path_info *old_best,
+ struct list *mp_list,
+ struct bgp_maxpaths_cfg *mpath_cfg);
+extern void bgp_info_mpath_aggregate_update(struct bgp_path_info *new_best,
+ struct bgp_path_info *old_best);
/* Unlink and free multipath information associated with a bgp_info */
-extern void bgp_info_mpath_dequeue(struct bgp_info *);
-extern void bgp_info_mpath_free(struct bgp_info_mpath **);
+extern void bgp_info_mpath_dequeue(struct bgp_path_info *path);
+extern void bgp_info_mpath_free(struct bgp_path_info_mpath **mpath);
/* Walk list of multipaths associated with a best path */
-extern struct bgp_info *bgp_info_mpath_first(struct bgp_info *);
-extern struct bgp_info *bgp_info_mpath_next(struct bgp_info *);
+extern struct bgp_path_info *bgp_info_mpath_first(struct bgp_path_info *);
+extern struct bgp_path_info *bgp_info_mpath_next(struct bgp_path_info *);
/* Accessors for multipath information */
-extern uint32_t bgp_info_mpath_count(struct bgp_info *);
-extern struct attr *bgp_info_mpath_attr(struct bgp_info *);
+extern uint32_t bgp_info_mpath_count(struct bgp_path_info *path);
+extern struct attr *bgp_info_mpath_attr(struct bgp_path_info *path);
#endif /* _QUAGGA_BGP_MPATH_H */
return 0;
}
-static bool labels_same(struct bgp_info *bi, mpls_label_t *label, uint32_t n)
+static bool labels_same(struct bgp_path_info *bi, mpls_label_t *label,
+ uint32_t n)
{
uint32_t i;
/*
* make encoded route labels match specified encoded label set
*/
-static void setlabels(
- struct bgp_info *bi,
- mpls_label_t *label, /* array of labels */
- uint32_t num_labels)
+static void setlabels(struct bgp_path_info *bi,
+ mpls_label_t *label, /* array of labels */
+ uint32_t num_labels)
{
if (num_labels)
assert(label);
return;
}
- struct bgp_info_extra *extra = bgp_info_extra_get(bi);
+ struct bgp_path_info_extra *extra = bgp_info_extra_get(bi);
uint32_t i;
for (i = 0; i < num_labels; ++i) {
/*
* returns pointer to new bgp_info upon success
*/
-static struct bgp_info *
-leak_update(
- struct bgp *bgp, /* destination bgp instance */
- struct bgp_node *bn,
- struct attr *new_attr, /* already interned */
- afi_t afi,
- safi_t safi,
- struct bgp_info *source_bi,
- mpls_label_t *label,
- uint32_t num_labels,
- void *parent,
- struct bgp *bgp_orig,
- struct prefix *nexthop_orig,
- int nexthop_self_flag,
- int debug)
+static struct bgp_path_info *
+leak_update(struct bgp *bgp, /* destination bgp instance */
+ struct bgp_node *bn, struct attr *new_attr, /* already interned */
+ afi_t afi, safi_t safi, struct bgp_path_info *source_bi,
+ mpls_label_t *label, uint32_t num_labels, void *parent,
+ struct bgp *bgp_orig, struct prefix *nexthop_orig,
+ int nexthop_self_flag, int debug)
{
struct prefix *p = &bn->p;
- struct bgp_info *bi;
- struct bgp_info *bi_ultimate;
- struct bgp_info *new;
+ struct bgp_path_info *bi;
+ struct bgp_path_info *bi_ultimate;
+ struct bgp_path_info *new;
char buf_prefix[PREFIX_STRLEN];
if (debug) {
setlabels(new, label, num_labels);
new->extra->parent = bgp_info_lock(parent);
- bgp_lock_node((struct bgp_node *)((struct bgp_info *)parent)->net);
+ bgp_lock_node((struct bgp_node *)((struct bgp_path_info *)parent)->net);
if (bgp_orig)
new->extra->bgp_orig = bgp_lock(bgp_orig);
if (nexthop_orig)
}
/* cf vnc_import_bgp_add_route_mode_nvegroup() and add_vnc_route() */
-void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
- struct bgp *bgp_vrf, /* from */
- struct bgp_info *info_vrf) /* route */
+void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
+ struct bgp *bgp_vrf, /* from */
+ struct bgp_path_info *info_vrf) /* route */
{
int debug = BGP_DEBUG(vpn, VPN_LEAK_FROM_VRF);
struct prefix *p = &info_vrf->net->p;
* route map handling
*/
if (bgp_vrf->vpn_policy[afi].rmap[BGP_VPN_POLICY_DIR_TOVPN]) {
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
memset(&info, 0, sizeof(info));
bn = bgp_afi_node_get(bgp_vpn->rib[afi][safi], afi, safi, p,
&(bgp_vrf->vpn_policy[afi].tovpn_rd));
- struct bgp_info *new_info;
+ struct bgp_path_info *new_info;
new_info = leak_update(bgp_vpn, bn, new_attr, afi, safi, info_vrf,
&label, 1, info_vrf, bgp_vrf, NULL,
vpn_leak_to_vrf_update(bgp_vrf, new_info);
}
-void vpn_leak_from_vrf_withdraw(struct bgp *bgp_vpn, /* to */
- struct bgp *bgp_vrf, /* from */
- struct bgp_info *info_vrf) /* route */
+void vpn_leak_from_vrf_withdraw(struct bgp *bgp_vpn, /* to */
+ struct bgp *bgp_vrf, /* from */
+ struct bgp_path_info *info_vrf) /* route */
{
int debug = BGP_DEBUG(vpn, VPN_LEAK_FROM_VRF);
struct prefix *p = &info_vrf->net->p;
afi_t afi = family2afi(p->family);
safi_t safi = SAFI_MPLS_VPN;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct bgp_node *bn;
const char *debugmsg;
char buf_prefix[PREFIX_STRLEN];
struct bgp_table *table;
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
/* This is the per-RD table of prefixes */
table = prn->info;
afi_t afi)
{
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
int debug = BGP_DEBUG(vpn, VPN_LEAK_FROM_VRF);
if (debug)
}
}
-static void vpn_leak_to_vrf_update_onevrf(struct bgp *bgp_vrf, /* to */
- struct bgp *bgp_vpn, /* from */
- struct bgp_info *info_vpn) /* route */
+static void
+vpn_leak_to_vrf_update_onevrf(struct bgp *bgp_vrf, /* to */
+ struct bgp *bgp_vpn, /* from */
+ struct bgp_path_info *info_vpn) /* route */
{
struct prefix *p = &info_vpn->net->p;
afi_t afi = family2afi(p->family);
mpls_label_t *pLabels = NULL;
uint32_t num_labels = 0;
int nexthop_self_flag = 1;
- struct bgp_info *bi_ultimate = NULL;
+ struct bgp_path_info *bi_ultimate = NULL;
int origin_local = 0;
struct bgp *src_vrf;
* route map handling
*/
if (bgp_vrf->vpn_policy[afi].rmap[BGP_VPN_POLICY_DIR_FROMVPN]) {
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
memset(&info, 0, sizeof(info));
src_vrf, &nexthop_orig, nexthop_self_flag, debug);
}
-void vpn_leak_to_vrf_update(struct bgp *bgp_vpn, /* from */
- struct bgp_info *info_vpn) /* route */
+void vpn_leak_to_vrf_update(struct bgp *bgp_vpn, /* from */
+ struct bgp_path_info *info_vpn) /* route */
{
struct listnode *mnode, *mnnode;
struct bgp *bgp;
}
}
-void vpn_leak_to_vrf_withdraw(struct bgp *bgp_vpn, /* from */
- struct bgp_info *info_vpn) /* route */
+void vpn_leak_to_vrf_withdraw(struct bgp *bgp_vpn, /* from */
+ struct bgp_path_info *info_vpn) /* route */
{
struct prefix *p;
afi_t afi;
struct bgp *bgp;
struct listnode *mnode, *mnnode;
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
const char *debugmsg;
char buf_prefix[PREFIX_STRLEN];
bn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, NULL);
for (bi = (bn ? bn->info : NULL); bi; bi = bi->next) {
if (bi->extra
- && (struct bgp_info *)bi->extra->parent
+ && (struct bgp_path_info *)bi->extra->parent
== info_vpn) {
break;
}
afi_t afi)
{
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
safi_t safi = SAFI_UNICAST;
int debug = BGP_DEBUG(vpn, VPN_LEAK_TO_VRF);
struct bgp_table *table;
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
memset(&prd, 0, sizeof(prd));
prd.family = AF_UNSPEC;
int tags, bool use_json);
extern void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, struct bgp *bgp_vrf,
- struct bgp_info *info_vrf);
+ struct bgp_path_info *info_vrf);
extern void vpn_leak_from_vrf_withdraw(struct bgp *bgp_vpn, struct bgp *bgp_vrf,
- struct bgp_info *info_vrf);
+ struct bgp_path_info *info_vrf);
extern void vpn_leak_from_vrf_withdraw_all(struct bgp *bgp_vpn,
struct bgp *bgp_vrf, afi_t afi);
afi_t afi);
extern void vpn_leak_to_vrf_update(struct bgp *bgp_vpn,
- struct bgp_info *info_vpn);
+ struct bgp_path_info *info_vpn);
extern void vpn_leak_to_vrf_withdraw(struct bgp *bgp_vpn,
- struct bgp_info *info_vpn);
+ struct bgp_path_info *info_vpn);
extern void vpn_leak_zebra_vrf_label_update(struct bgp *bgp, afi_t afi);
extern void vpn_leak_zebra_vrf_label_withdraw(struct bgp *bgp, afi_t afi);
struct bgp_node *node;
void *nht_info; /* In BGP, peer session */
- LIST_HEAD(path_list, bgp_info) paths;
+ LIST_HEAD(path_list, bgp_path_info) paths;
unsigned int path_count;
struct bgp *bgp;
};
int refcnt;
};
-extern int bgp_nexthop_lookup(afi_t, struct peer *peer, struct bgp_info *,
- int *, int *);
extern void bgp_connected_add(struct bgp *bgp, struct connected *c);
extern void bgp_connected_delete(struct bgp *bgp, struct connected *c);
extern int bgp_subgrp_multiaccess_check_v4(struct in_addr nexthop,
static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc,
int is_bgp_static_route);
static void evaluate_paths(struct bgp_nexthop_cache *bnc);
-static int make_prefix(int afi, struct bgp_info *ri, struct prefix *p);
-static void path_nh_map(struct bgp_info *path, struct bgp_nexthop_cache *bnc,
- int keep);
+static int make_prefix(int afi, struct bgp_path_info *ri, struct prefix *p);
+static void path_nh_map(struct bgp_path_info *path,
+ struct bgp_nexthop_cache *bnc, int keep);
static int bgp_isvalid_nexthop(struct bgp_nexthop_cache *bnc)
{
|| (bnc && CHECK_FLAG(bnc->flags, BGP_NEXTHOP_LABELED_VALID)));
}
-int bgp_find_nexthop(struct bgp_info *path, int connected)
+int bgp_find_nexthop(struct bgp_path_info *path, int connected)
{
struct bgp_nexthop_cache *bnc = path->nexthop;
}
}
-void bgp_unlink_nexthop(struct bgp_info *path)
+void bgp_unlink_nexthop(struct bgp_path_info *path)
{
struct bgp_nexthop_cache *bnc = path->nexthop;
* we need both the bgp_route and bgp_nexthop pointers.
*/
int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
- afi_t afi, struct bgp_info *ri,
+ afi_t afi, struct bgp_path_info *ri,
struct peer *peer, int connected)
{
struct bgp_node *rn;
* make_prefix - make a prefix structure from the path (essentially
* path's node.
*/
-static int make_prefix(int afi, struct bgp_info *ri, struct prefix *p)
+static int make_prefix(int afi, struct bgp_path_info *ri, struct prefix *p)
{
int is_bgp_static = ((ri->type == ZEBRA_ROUTE_BGP)
static void evaluate_paths(struct bgp_nexthop_cache *bnc)
{
struct bgp_node *rn;
- struct bgp_info *path;
+ struct bgp_path_info *path;
int afi;
struct peer *peer = (struct peer *)bnc->nht_info;
struct bgp_table *table;
* make - if set, make the association. if unset, just break the existing
* association.
*/
-static void path_nh_map(struct bgp_info *path, struct bgp_nexthop_cache *bnc,
- int make)
+static void path_nh_map(struct bgp_path_info *path,
+ struct bgp_nexthop_cache *bnc, int make)
{
if (path->nexthop) {
LIST_REMOVE(path, nh_thread);
* p - path for which the nexthop object is being looked up
* connected - True if NH MUST be a connected route
*/
-extern int bgp_find_nexthop(struct bgp_info *p, int connected);
+extern int bgp_find_nexthop(struct bgp_path_info *p, int connected);
/**
* bgp_find_or_add_nexthop() - lookup the nexthop cache table for the bnc
* connected - True if NH MUST be a connected route
*/
extern int bgp_find_or_add_nexthop(struct bgp *bgp_route,
- struct bgp *bgp_nexthop, afi_t a, struct bgp_info *p,
- struct peer *peer, int connected);
+ struct bgp *bgp_nexthop, afi_t a,
+ struct bgp_path_info *p, struct peer *peer,
+ int connected);
/**
* bgp_unlink_nexthop() - Unlink the nexthop object from the path structure.
* ARGUMENTS:
* p - path structure.
*/
-extern void bgp_unlink_nexthop(struct bgp_info *p);
-void bgp_unlink_nexthop_by_peer(struct peer *);
+extern void bgp_unlink_nexthop(struct bgp_path_info *p);
+void bgp_unlink_nexthop_by_peer(struct peer *peer);
/**
* bgp_delete_connected_nexthop() - Reset the 'peer' pointer for a connected
};
static void bgp_pbr_policyroute_add_to_zebra_unit(struct bgp *bgp,
- struct bgp_info *binfo,
+ struct bgp_path_info *binfo,
struct bgp_pbr_filter *bpf,
struct nexthop *nh,
float *rate);
/* return -1 if build or validation failed */
static int bgp_pbr_build_and_validate_entry(struct prefix *p,
- struct bgp_info *info,
+ struct bgp_path_info *info,
struct bgp_pbr_entry_main *api)
{
int ret;
bpme->installed = false;
bpme->backpointer = NULL;
if (bpme->bgp_info) {
- struct bgp_info *bgp_info;
- struct bgp_info_extra *extra;
+ struct bgp_path_info *bgp_info;
+ struct bgp_path_info_extra *extra;
/* unlink bgp_info to bpme */
- bgp_info = (struct bgp_info *)bpme->bgp_info;
+ bgp_info = (struct bgp_path_info *)bpme->bgp_info;
extra = bgp_info_extra_get(bgp_info);
if (extra->bgp_fs_pbr)
listnode_delete(extra->bgp_fs_pbr, bpme);
return HASHWALK_ABORT;
}
-static void bgp_pbr_policyroute_remove_from_zebra_unit(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_filter *bpf)
+static void
+bgp_pbr_policyroute_remove_from_zebra_unit(struct bgp *bgp,
+ struct bgp_path_info *binfo,
+ struct bgp_pbr_filter *bpf)
{
struct bgp_pbr_match temp;
struct bgp_pbr_match_entry temp2;
return 0;
}
-static void bgp_pbr_icmp_action(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_filter *bpf,
- struct bgp_pbr_or_filter *bpof,
- bool add,
- struct nexthop *nh,
- float *rate)
+static void bgp_pbr_icmp_action(struct bgp *bgp, struct bgp_path_info *binfo,
+ struct bgp_pbr_filter *bpf,
+ struct bgp_pbr_or_filter *bpof, bool add,
+ struct nexthop *nh, float *rate)
{
struct bgp_pbr_range_port srcp, dstp;
struct bgp_pbr_val_mask *icmp_type, *icmp_code;
}
}
-static void bgp_pbr_policyroute_remove_from_zebra_recursive(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_filter *bpf,
- struct bgp_pbr_or_filter *bpof,
- uint8_t type_entry)
+static void bgp_pbr_policyroute_remove_from_zebra_recursive(
+ struct bgp *bgp, struct bgp_path_info *binfo,
+ struct bgp_pbr_filter *bpf, struct bgp_pbr_or_filter *bpof,
+ uint8_t type_entry)
{
struct listnode *node, *nnode;
struct bgp_pbr_val_mask *valmask;
}
}
-static void bgp_pbr_policyroute_remove_from_zebra(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_filter *bpf,
- struct bgp_pbr_or_filter *bpof)
+static void bgp_pbr_policyroute_remove_from_zebra(
+ struct bgp *bgp, struct bgp_path_info *binfo,
+ struct bgp_pbr_filter *bpf, struct bgp_pbr_or_filter *bpof)
{
if (!bpof)
return bgp_pbr_policyroute_remove_from_zebra_unit(bgp,
}
static void bgp_pbr_policyroute_add_to_zebra_unit(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_filter *bpf,
- struct nexthop *nh,
- float *rate)
+ struct bgp_path_info *binfo,
+ struct bgp_pbr_filter *bpf,
+ struct nexthop *nh,
+ float *rate)
{
struct bgp_pbr_match temp;
struct bgp_pbr_match_entry temp2;
/* already installed */
if (bpme_found) {
- struct bgp_info_extra *extra = bgp_info_extra_get(binfo);
+ struct bgp_path_info_extra *extra = bgp_info_extra_get(binfo);
if (extra && extra->bgp_fs_pbr &&
listnode_lookup(extra->bgp_fs_pbr, bpme)) {
}
-static void bgp_pbr_policyroute_add_to_zebra_recursive(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_filter *bpf,
- struct bgp_pbr_or_filter *bpof,
- struct nexthop *nh,
- float *rate,
- uint8_t type_entry)
+static void bgp_pbr_policyroute_add_to_zebra_recursive(
+ struct bgp *bgp, struct bgp_path_info *binfo,
+ struct bgp_pbr_filter *bpf, struct bgp_pbr_or_filter *bpof,
+ struct nexthop *nh, float *rate, uint8_t type_entry)
{
struct listnode *node, *nnode;
struct bgp_pbr_val_mask *valmask;
}
static void bgp_pbr_policyroute_add_to_zebra(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_filter *bpf,
- struct bgp_pbr_or_filter *bpof,
- struct nexthop *nh,
- float *rate)
+ struct bgp_path_info *binfo,
+ struct bgp_pbr_filter *bpf,
+ struct bgp_pbr_or_filter *bpof,
+ struct nexthop *nh, float *rate)
{
if (!bpof)
return bgp_pbr_policyroute_add_to_zebra_unit(bgp, binfo,
list_delete_all_node(bpof->icmp_code);
}
-static void bgp_pbr_handle_entry(struct bgp *bgp,
- struct bgp_info *binfo,
- struct bgp_pbr_entry_main *api,
- bool add)
+static void bgp_pbr_handle_entry(struct bgp *bgp, struct bgp_path_info *binfo,
+ struct bgp_pbr_entry_main *api, bool add)
{
struct nexthop nh;
int i = 0;
}
void bgp_pbr_update_entry(struct bgp *bgp, struct prefix *p,
- struct bgp_info *info, afi_t afi, safi_t safi,
- bool nlri_update)
+ struct bgp_path_info *info, afi_t afi, safi_t safi,
+ bool nlri_update)
{
struct bgp_pbr_entry_main api;
void bgp_pbr_print_policy_route(struct bgp_pbr_entry_main *api);
struct bgp_node;
-struct bgp_info;
+struct bgp_path_info;
extern void bgp_pbr_update_entry(struct bgp *bgp, struct prefix *p,
- struct bgp_info *new_select,
- afi_t afi, safi_t safi,
- bool nlri_update);
+ struct bgp_path_info *new_select, afi_t afi,
+ safi_t safi, bool nlri_update);
/* bgp pbr utilities */
extern struct bgp_pbr_interface *pbr_interface_lookup(const char *name);
}
/* Allocate bgp_info_extra */
-static struct bgp_info_extra *bgp_info_extra_new(void)
+static struct bgp_path_info_extra *bgp_info_extra_new(void)
{
- struct bgp_info_extra *new;
- new = XCALLOC(MTYPE_BGP_ROUTE_EXTRA, sizeof(struct bgp_info_extra));
+ struct bgp_path_info_extra *new;
+ new = XCALLOC(MTYPE_BGP_ROUTE_EXTRA,
+ sizeof(struct bgp_path_info_extra));
new->label[0] = MPLS_INVALID_LABEL;
new->num_labels = 0;
return new;
}
-static void bgp_info_extra_free(struct bgp_info_extra **extra)
+static void bgp_info_extra_free(struct bgp_path_info_extra **extra)
{
- struct bgp_info_extra *e;
+ struct bgp_path_info_extra *e;
if (!extra || !*extra)
return;
e->damp_info = NULL;
if (e->parent) {
- struct bgp_info *bi = (struct bgp_info *)e->parent;
+ struct bgp_path_info *bi = (struct bgp_path_info *)e->parent;
if (bi->net) {
/* FIXME: since multiple e may have the same e->parent
/* Get bgp_info extra information for the given bgp_info, lazy allocated
* if required.
*/
-struct bgp_info_extra *bgp_info_extra_get(struct bgp_info *ri)
+struct bgp_path_info_extra *bgp_info_extra_get(struct bgp_path_info *ri)
{
if (!ri->extra)
ri->extra = bgp_info_extra_new();
}
/* Allocate new bgp info structure. */
-struct bgp_info *bgp_info_new(void)
+struct bgp_path_info *bgp_info_new(void)
{
- return XCALLOC(MTYPE_BGP_ROUTE, sizeof(struct bgp_info));
+ return XCALLOC(MTYPE_BGP_ROUTE, sizeof(struct bgp_path_info));
}
/* Free bgp route information. */
-static void bgp_info_free(struct bgp_info *binfo)
+static void bgp_info_free(struct bgp_path_info *binfo)
{
if (binfo->attr)
bgp_attr_unintern(&binfo->attr);
XFREE(MTYPE_BGP_ROUTE, binfo);
}
-struct bgp_info *bgp_info_lock(struct bgp_info *binfo)
+struct bgp_path_info *bgp_info_lock(struct bgp_path_info *binfo)
{
binfo->lock++;
return binfo;
}
-struct bgp_info *bgp_info_unlock(struct bgp_info *binfo)
+struct bgp_path_info *bgp_info_unlock(struct bgp_path_info *binfo)
{
assert(binfo && binfo->lock > 0);
binfo->lock--;
return binfo;
}
-void bgp_info_add(struct bgp_node *rn, struct bgp_info *ri)
+void bgp_info_add(struct bgp_node *rn, struct bgp_path_info *ri)
{
- struct bgp_info *top;
+ struct bgp_path_info *top;
top = rn->info;
/* Do the actual removal of info from RIB, for use by bgp_process
completion callback *only* */
-void bgp_info_reap(struct bgp_node *rn, struct bgp_info *ri)
+void bgp_info_reap(struct bgp_node *rn, struct bgp_path_info *ri)
{
if (ri->next)
ri->next->prev = ri->prev;
bgp_unlock_node(rn);
}
-void bgp_info_delete(struct bgp_node *rn, struct bgp_info *ri)
+void bgp_info_delete(struct bgp_node *rn, struct bgp_path_info *ri)
{
bgp_info_set_flag(rn, ri, BGP_PATH_REMOVED);
/* set of previous already took care of pcount */
/* undo the effects of a previous call to bgp_info_delete; typically
called when a route is deleted and then quickly re-added before the
deletion has been processed */
-void bgp_info_restore(struct bgp_node *rn, struct bgp_info *ri)
+void bgp_info_restore(struct bgp_node *rn, struct bgp_path_info *ri)
{
bgp_info_unset_flag(rn, ri, BGP_PATH_REMOVED);
/* unset of previous already took care of pcount */
}
/* Adjust pcount as required */
-static void bgp_pcount_adjust(struct bgp_node *rn, struct bgp_info *ri)
+static void bgp_pcount_adjust(struct bgp_node *rn, struct bgp_path_info *ri)
{
struct bgp_table *table;
}
}
-static int bgp_label_index_differs(struct bgp_info *ri1, struct bgp_info *ri2)
+static int bgp_label_index_differs(struct bgp_path_info *ri1,
+ struct bgp_path_info *ri2)
{
return (!(ri1->attr->label_index == ri2->attr->label_index));
}
/* Set/unset bgp_info flags, adjusting any other state as needed.
* This is here primarily to keep prefix-count in check.
*/
-void bgp_info_set_flag(struct bgp_node *rn, struct bgp_info *ri, uint32_t flag)
+void bgp_info_set_flag(struct bgp_node *rn, struct bgp_path_info *ri,
+ uint32_t flag)
{
SET_FLAG(ri->flags, flag);
bgp_pcount_adjust(rn, ri);
}
-void bgp_info_unset_flag(struct bgp_node *rn, struct bgp_info *ri,
+void bgp_info_unset_flag(struct bgp_node *rn, struct bgp_path_info *ri,
uint32_t flag)
{
UNSET_FLAG(ri->flags, flag);
}
}
-void bgp_info_path_with_addpath_rx_str(struct bgp_info *ri, char *buf)
+void bgp_info_path_with_addpath_rx_str(struct bgp_path_info *ri, char *buf)
{
if (ri->addpath_rx_id)
sprintf(buf, "path %s (addpath rxid %d)", ri->peer->host,
/* Compare two bgp route entity. If 'new' is preferable over 'exist' return 1.
*/
-static int bgp_info_cmp(struct bgp *bgp, struct bgp_info *new,
- struct bgp_info *exist, int *paths_eq,
+static int bgp_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
+ struct bgp_path_info *exist, int *paths_eq,
struct bgp_maxpaths_cfg *mpath_cfg, int debug,
char *pfx_buf, afi_t afi, safi_t safi)
{
* is preferred, or 0 if they are the same (usually will only occur if
* multipath is enabled
* This version is compatible with */
-int bgp_info_cmp_compatible(struct bgp *bgp, struct bgp_info *new,
- struct bgp_info *exist, char *pfx_buf, afi_t afi,
- safi_t safi)
+int bgp_info_cmp_compatible(struct bgp *bgp, struct bgp_path_info *new,
+ struct bgp_path_info *exist, char *pfx_buf,
+ afi_t afi, safi_t safi)
{
int paths_eq;
int ret;
const char *rmap_name)
{
struct bgp_filter *filter;
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
struct route_map *rmap = NULL;
/* Route map apply. */
if (rmap) {
- memset(&info, 0, sizeof(struct bgp_info));
+ memset(&info, 0, sizeof(struct bgp_path_info));
/* Duplicate current value to new strucutre for modification. */
info.peer = peer;
info.attr = attr;
struct attr *attr, afi_t afi, safi_t safi,
const char *rmap_name)
{
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
struct route_map *rmap = NULL;
uint8_t rmap_type;
if (rmap == NULL)
return RMAP_DENY;
- memset(&info, 0, sizeof(struct bgp_info));
+ memset(&info, 0, sizeof(struct bgp_path_info));
/* Route map apply. */
/* Duplicate current value to new strucutre for modification. */
info.peer = peer;
memset(&attr->mp_nexthop_global_in, 0, BGP_ATTR_NHLEN_IPV4);
}
-int subgroup_announce_check(struct bgp_node *rn, struct bgp_info *ri,
+int subgroup_announce_check(struct bgp_node *rn, struct bgp_path_info *ri,
struct update_subgroup *subgrp, struct prefix *p,
struct attr *attr)
{
/* Route map & unsuppress-map apply. */
if (ROUTE_MAP_OUT_NAME(filter) || (ri->extra && ri->extra->suppress)) {
- struct bgp_info info;
- struct bgp_info_extra dummy_info_extra;
+ struct bgp_path_info info;
+ struct bgp_path_info_extra dummy_info_extra;
struct attr dummy_attr;
- memset(&info, 0, sizeof(struct bgp_info));
+ memset(&info, 0, sizeof(struct bgp_path_info));
info.peer = peer;
info.attr = attr;
if (ri->extra) {
memcpy(&dummy_info_extra, ri->extra,
- sizeof(struct bgp_info_extra));
+ sizeof(struct bgp_path_info_extra));
info.extra = &dummy_info_extra;
}
void bgp_best_selection(struct bgp *bgp, struct bgp_node *rn,
struct bgp_maxpaths_cfg *mpath_cfg,
- struct bgp_info_pair *result, afi_t afi, safi_t safi)
-{
- struct bgp_info *new_select;
- struct bgp_info *old_select;
- struct bgp_info *ri;
- struct bgp_info *ri1;
- struct bgp_info *ri2;
- struct bgp_info *nextri = NULL;
+ struct bgp_path_info_pair *result, afi_t afi,
+ safi_t safi)
+{
+ struct bgp_path_info *new_select;
+ struct bgp_path_info *old_select;
+ struct bgp_path_info *ri;
+ struct bgp_path_info *ri1;
+ struct bgp_path_info *ri2;
+ struct bgp_path_info *nextri = NULL;
int paths_eq, do_mpath, debug;
struct list mp_list;
char pfx_buf[PREFIX2STR_BUFFER];
* for advertisement to the subgroup.
*/
int subgroup_process_announce_selected(struct update_subgroup *subgrp,
- struct bgp_info *selected,
+ struct bgp_path_info *selected,
struct bgp_node *rn,
uint32_t addpath_tx_id)
{
*/
void bgp_zebra_clear_route_change_flags(struct bgp_node *rn)
{
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
for (ri = rn->info; ri; ri = ri->next) {
if (BGP_PATH_HOLDDOWN(ri))
* if the route selection returns the same best route as earlier - to
* determine if we need to update zebra or not.
*/
-int bgp_zebra_has_route_changed(struct bgp_node *rn, struct bgp_info *selected)
+int bgp_zebra_has_route_changed(struct bgp_node *rn,
+ struct bgp_path_info *selected)
{
- struct bgp_info *mpinfo;
+ struct bgp_path_info *mpinfo;
/* If this is multipath, check all selected paths for any nexthop
* change or attribute change. Some attribute changes (e.g., community)
static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn,
afi_t afi, safi_t safi)
{
- struct bgp_info *new_select;
- struct bgp_info *old_select;
- struct bgp_info_pair old_and_new;
+ struct bgp_path_info *new_select;
+ struct bgp_path_info *old_select;
+ struct bgp_path_info_pair old_and_new;
char pfx_buf[PREFIX2STR_BUFFER];
int debug = 0;
/* Unconditionally remove the route from the RIB, without taking
* damping into consideration (eg, because the session went down)
*/
-void bgp_rib_remove(struct bgp_node *rn, struct bgp_info *ri, struct peer *peer,
- afi_t afi, safi_t safi)
+void bgp_rib_remove(struct bgp_node *rn, struct bgp_path_info *ri,
+ struct peer *peer, afi_t afi, safi_t safi)
{
bgp_aggregate_decrement(peer->bgp, &rn->p, ri, afi, safi);
bgp_process(peer->bgp, rn, afi, safi);
}
-static void bgp_rib_withdraw(struct bgp_node *rn, struct bgp_info *ri,
+static void bgp_rib_withdraw(struct bgp_node *rn, struct bgp_path_info *ri,
struct peer *peer, afi_t afi, safi_t safi,
struct prefix_rd *prd)
{
bgp_rib_remove(rn, ri, peer, afi, safi);
}
-struct bgp_info *info_make(int type, int sub_type, unsigned short instance,
- struct peer *peer, struct attr *attr,
- struct bgp_node *rn)
+struct bgp_path_info *info_make(int type, int sub_type, unsigned short instance,
+ struct peer *peer, struct attr *attr,
+ struct bgp_node *rn)
{
- struct bgp_info *new;
+ struct bgp_path_info *new;
/* Make new BGP info. */
- new = XCALLOC(MTYPE_BGP_ROUTE, sizeof(struct bgp_info));
+ new = XCALLOC(MTYPE_BGP_ROUTE, sizeof(struct bgp_path_info));
new->type = type;
new->instance = instance;
new->sub_type = sub_type;
}
}
-static bool overlay_index_equal(afi_t afi, struct bgp_info *info,
+static bool overlay_index_equal(afi_t afi, struct bgp_path_info *info,
struct eth_segment_id *eth_s_id,
union gw_addr *gw_ip)
{
struct bgp *bgp;
struct attr new_attr;
struct attr *attr_new;
- struct bgp_info *ri;
- struct bgp_info *new;
- struct bgp_info_extra *extra;
+ struct bgp_path_info *ri;
+ struct bgp_path_info *new;
+ struct bgp_path_info_extra *extra;
const char *reason;
char pfx_buf[BGP_PRD_PATH_STRLEN];
int connected = 0;
struct bgp *bgp;
char pfx_buf[BGP_PRD_PATH_STRLEN];
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
#if ENABLE_BGP_VNC
if ((SAFI_MPLS_VPN == safi) || (SAFI_ENCAP == safi)) {
if (ain->peer != peer)
continue;
- struct bgp_info *ri = rn->info;
+ struct bgp_path_info *ri = rn->info;
uint32_t num_labels = 0;
mpls_label_t *label_pnt = NULL;
struct bgp_clear_node_queue *cnq = data;
struct bgp_node *rn = cnq->rn;
struct peer *peer = wq->spec.data;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp *bgp;
afi_t afi = bgp_node_table(rn)->afi;
safi_t safi = bgp_node_table(rn)->safi;
return;
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
- struct bgp_info *ri, *next;
+ struct bgp_path_info *ri, *next;
struct bgp_adj_in *ain;
struct bgp_adj_in *ain_next;
void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_table *table;
if (safi == SAFI_MPLS_VPN) {
safi_t safi)
{
struct bgp_node *rn;
- struct bgp_info *ri;
- struct bgp_info *next;
+ struct bgp_path_info *ri;
+ struct bgp_path_info *next;
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn))
for (ri = rn->info; ri; ri = next) {
struct bgp_static *bgp_static, afi_t afi, safi_t safi)
{
struct bgp_node *rn;
- struct bgp_info *ri;
- struct bgp_info *new;
- struct bgp_info info;
+ struct bgp_path_info *ri;
+ struct bgp_path_info *new;
+ struct bgp_path_info info;
struct attr attr;
struct attr *attr_new;
int ret;
if (bgp_static->rmap.name) {
struct attr attr_tmp = attr;
- memset(&info, 0, sizeof(struct bgp_info));
+ memset(&info, 0, sizeof(struct bgp_path_info));
info.peer = bgp->peer_self;
info.attr = &attr_tmp;
safi_t safi)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
rn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, NULL);
struct prefix_rd *prd)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
rn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, prd);
safi_t safi)
{
struct bgp_node *rn;
- struct bgp_info *new;
+ struct bgp_path_info *new;
struct attr *attr_new;
struct attr attr = {0};
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
#if ENABLE_BGP_VNC
mpls_label_t label = 0;
#endif
/* Apply route-map. */
if (bgp_static->rmap.name) {
struct attr attr_tmp = attr;
- struct bgp_info info;
+ struct bgp_path_info info;
int ret;
info.peer = bgp->peer_self;
{
struct bgp_table *table;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
table = bgp->rib[afi][safi];
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
XFREE(MTYPE_BGP_AGGREGATE, aggregate);
}
-static int bgp_aggregate_info_same(struct bgp_info *ri, uint8_t origin,
+static int bgp_aggregate_info_same(struct bgp_path_info *ri, uint8_t origin,
struct aspath *aspath,
struct community *comm)
{
{
struct bgp_node *rn;
struct bgp_table *table;
- struct bgp_info *ri, *new;
+ struct bgp_path_info *ri, *new;
table = bgp->rib[afi][safi];
/* Update an aggregate as routes are added/removed from the BGP table */
static void bgp_aggregate_route(struct bgp *bgp, struct prefix *p,
- struct bgp_info *rinew, afi_t afi, safi_t safi,
- struct bgp_info *del,
+ struct bgp_path_info *rinew, afi_t afi,
+ safi_t safi, struct bgp_path_info *del,
struct bgp_aggregate *aggregate)
{
struct bgp_table *table;
struct aspath *asmerge = NULL;
struct community *community = NULL;
struct community *commerge = NULL;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
unsigned long match = 0;
uint8_t atomic_aggregate = 0;
struct bgp_table *table;
struct bgp_node *top;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
unsigned long match;
table = bgp->rib[afi][safi];
}
void bgp_aggregate_increment(struct bgp *bgp, struct prefix *p,
- struct bgp_info *ri, afi_t afi, safi_t safi)
+ struct bgp_path_info *ri, afi_t afi, safi_t safi)
{
struct bgp_node *child;
struct bgp_node *rn;
}
void bgp_aggregate_decrement(struct bgp *bgp, struct prefix *p,
- struct bgp_info *del, afi_t afi, safi_t safi)
+ struct bgp_path_info *del, afi_t afi, safi_t safi)
{
struct bgp_node *child;
struct bgp_node *rn;
uint8_t type, unsigned short instance,
route_tag_t tag)
{
- struct bgp_info *new;
- struct bgp_info *bi;
- struct bgp_info info;
+ struct bgp_path_info *new;
+ struct bgp_path_info *bi;
+ struct bgp_path_info info;
struct bgp_node *bn;
struct attr attr;
struct attr *new_attr;
/* Apply route-map. */
if (red->rmap.name) {
- memset(&info, 0, sizeof(struct bgp_info));
+ memset(&info, 0, sizeof(struct bgp_path_info));
info.peer = bgp->peer_self;
info.attr = &attr_new;
{
afi_t afi;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_redist *red;
afi = family2afi(p->family);
unsigned short instance)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_table *table;
table = bgp->rib[afi][SAFI_UNICAST];
};
/* Print the short form route status for a bgp_info */
-static void route_vty_short_status_out(struct vty *vty, struct bgp_info *binfo,
+static void route_vty_short_status_out(struct vty *vty,
+ struct bgp_path_info *binfo,
json_object *json_path)
{
if (json_path) {
}
/* called from terminal list command */
-void route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo,
- int display, safi_t safi, json_object *json_paths)
+void route_vty_out(struct vty *vty, struct prefix *p,
+ struct bgp_path_info *binfo, int display, safi_t safi,
+ json_object *json_paths)
{
struct attr *attr;
json_object *json_path = NULL;
}
void route_vty_out_tag(struct vty *vty, struct prefix *p,
- struct bgp_info *binfo, int display, safi_t safi,
+ struct bgp_path_info *binfo, int display, safi_t safi,
json_object *json)
{
json_object *json_out = NULL;
}
void route_vty_out_overlay(struct vty *vty, struct prefix *p,
- struct bgp_info *binfo, int display,
+ struct bgp_path_info *binfo, int display,
json_object *json_paths)
{
struct attr *attr;
/* dampening route */
static void damp_route_vty_out(struct vty *vty, struct prefix *p,
- struct bgp_info *binfo, int display, safi_t safi,
- bool use_json, json_object *json)
+ struct bgp_path_info *binfo, int display,
+ safi_t safi, bool use_json, json_object *json)
{
struct attr *attr;
int len;
/* flap route */
static void flap_route_vty_out(struct vty *vty, struct prefix *p,
- struct bgp_info *binfo, int display, safi_t safi,
- bool use_json, json_object *json)
+ struct bgp_path_info *binfo, int display,
+ safi_t safi, bool use_json, json_object *json)
{
struct attr *attr;
struct bgp_damp_info *bdi;
}
void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
- struct bgp_info *binfo, afi_t afi, safi_t safi,
+ struct bgp_path_info *binfo, afi_t afi, safi_t safi,
json_object *json_paths)
{
char buf[INET6_ADDRSTRLEN];
}
vty_out(vty, "\n");
if (binfo->extra && binfo->extra->parent) {
- struct bgp_info *parent_ri;
+ struct bgp_path_info *parent_ri;
struct bgp_node *rn, *prn;
- parent_ri = (struct bgp_info *)binfo->extra->parent;
+ parent_ri =
+ (struct bgp_path_info *)binfo->extra->parent;
rn = parent_ri->net;
if (rn && rn->prn) {
prn = rn->prn;
unsigned long *total_cum,
unsigned long *json_header_depth)
{
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_node *rn;
int header = 1;
int display;
}
if (type == bgp_show_type_route_map) {
struct route_map *rmap = output_arg;
- struct bgp_info binfo;
+ struct bgp_path_info binfo;
struct attr dummy_attr;
int ret;
struct bgp_node *rn, struct prefix_rd *prd,
afi_t afi, safi_t safi, json_object *json)
{
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct prefix *p;
struct peer *peer;
struct listnode *node, *nnode;
struct prefix match;
struct bgp_node *rn;
struct bgp_node *rm;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_table *table;
json_object *json = NULL;
json_object *json_paths = NULL;
ts->counts[BGP_STATS_MAXBITLEN] = space;
for (rn = top; rn; rn = bgp_route_next(rn)) {
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct bgp_node *prn = bgp_node_parent_nolock(rn);
unsigned int rinum = 0;
for (rn = bgp_table_top(pc->table); rn; rn = bgp_route_next(rn)) {
struct bgp_adj_in *ain;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
for (ain = rn->adj_in; ain; ain = ain->next)
if (ain->peer == peer)
}
/* Apply BGP information to distance method. */
-uint8_t bgp_distance_apply(struct prefix *p, struct bgp_info *rinfo, afi_t afi,
- safi_t safi, struct bgp *bgp)
+uint8_t bgp_distance_apply(struct prefix *p, struct bgp_path_info *rinfo,
+ afi_t afi, safi_t safi, struct bgp *bgp)
{
struct bgp_node *rn;
struct prefix q;
struct prefix match;
struct bgp_node *rn;
struct bgp_node *rm;
- struct bgp_info *ri;
- struct bgp_info *ri_temp;
+ struct bgp_path_info *ri;
+ struct bgp_path_info *ri_temp;
struct bgp *bgp;
struct bgp_table *table;
*/
#define BGP_MAX_LABELS 2
-/* Ancillary information to struct bgp_info,
+/* Ancillary information to struct bgp_path_info,
* used for uncommonly used data (aggregation, MPLS, etc.)
* and lazily allocated to save memory.
*/
-struct bgp_info_extra {
+struct bgp_path_info_extra {
/* Pointer to dampening structure. */
struct bgp_damp_info *damp_info;
struct list *bgp_fs_pbr;
};
-struct bgp_info {
+struct bgp_path_info {
/* For linked list. */
- struct bgp_info *next;
- struct bgp_info *prev;
+ struct bgp_path_info *next;
+ struct bgp_path_info *prev;
/* For nexthop linked list */
- LIST_ENTRY(bgp_info) nh_thread;
+ LIST_ENTRY(bgp_path_info) nh_thread;
/* Back pointer to the prefix node */
struct bgp_node *net;
struct attr *attr;
/* Extra information */
- struct bgp_info_extra *extra;
+ struct bgp_path_info_extra *extra;
/* Multipath information */
- struct bgp_info_mpath *mpath;
+ struct bgp_path_info_mpath *mpath;
/* Uptime. */
time_t uptime;
};
/* Structure used in BGP path selection */
-struct bgp_info_pair {
- struct bgp_info *old;
- struct bgp_info *new;
+struct bgp_path_info_pair {
+ struct bgp_path_info *old;
+ struct bgp_path_info *new;
};
/* BGP static route configuration. */
}
/* Prototypes. */
-extern void bgp_rib_remove(struct bgp_node *rn, struct bgp_info *ri,
+extern void bgp_rib_remove(struct bgp_node *rn, struct bgp_path_info *ri,
struct peer *peer, afi_t afi, safi_t safi);
extern void bgp_process_queue_init(void);
extern void bgp_route_init(void);
extern struct bgp_node *bgp_afi_node_get(struct bgp_table *table, afi_t afi,
safi_t safi, struct prefix *p,
struct prefix_rd *prd);
-extern struct bgp_info *bgp_info_lock(struct bgp_info *);
-extern struct bgp_info *bgp_info_unlock(struct bgp_info *);
-extern void bgp_info_add(struct bgp_node *rn, struct bgp_info *ri);
-extern void bgp_info_reap(struct bgp_node *rn, struct bgp_info *ri);
-extern void bgp_info_delete(struct bgp_node *rn, struct bgp_info *ri);
-extern struct bgp_info_extra *bgp_info_extra_get(struct bgp_info *);
-extern void bgp_info_set_flag(struct bgp_node *, struct bgp_info *, uint32_t);
-extern void bgp_info_unset_flag(struct bgp_node *, struct bgp_info *, uint32_t);
-extern void bgp_info_path_with_addpath_rx_str(struct bgp_info *ri, char *buf);
+extern struct bgp_path_info *bgp_info_lock(struct bgp_path_info *path);
+extern struct bgp_path_info *bgp_info_unlock(struct bgp_path_info *path);
+extern void bgp_info_add(struct bgp_node *rn, struct bgp_path_info *ri);
+extern void bgp_info_reap(struct bgp_node *rn, struct bgp_path_info *ri);
+extern void bgp_info_delete(struct bgp_node *rn, struct bgp_path_info *ri);
+extern struct bgp_path_info_extra *
+bgp_info_extra_get(struct bgp_path_info *path);
+extern void bgp_info_set_flag(struct bgp_node *rn, struct bgp_path_info *path,
+ uint32_t flag);
+extern void bgp_info_unset_flag(struct bgp_node *rn, struct bgp_path_info *path,
+ uint32_t flag);
+extern void bgp_info_path_with_addpath_rx_str(struct bgp_path_info *ri,
+ char *buf);
extern int bgp_nlri_parse_ip(struct peer *, struct attr *, struct bgp_nlri *);
extern void bgp_config_write_distance(struct vty *, struct bgp *, afi_t,
safi_t);
-extern void bgp_aggregate_increment(struct bgp *, struct prefix *,
- struct bgp_info *, afi_t, safi_t);
-extern void bgp_aggregate_decrement(struct bgp *, struct prefix *,
- struct bgp_info *, afi_t, safi_t);
+extern void bgp_aggregate_increment(struct bgp *bgp, struct prefix *p,
+ struct bgp_path_info *path, afi_t afi,
+ safi_t safi);
+extern void bgp_aggregate_decrement(struct bgp *bgp, struct prefix *p,
+ struct bgp_path_info *path, afi_t afi,
+ safi_t safi);
-extern uint8_t bgp_distance_apply(struct prefix *, struct bgp_info *, afi_t,
- safi_t, struct bgp *);
+extern uint8_t bgp_distance_apply(struct prefix *p, struct bgp_path_info *path,
+ afi_t afi, safi_t safi, struct bgp *bgp);
extern afi_t bgp_node_afi(struct vty *);
extern safi_t bgp_node_safi(struct vty *);
-extern struct bgp_info *info_make(int type, int sub_type,
- unsigned short instance, struct peer *peer,
- struct attr *attr, struct bgp_node *rn);
-
-extern void route_vty_out(struct vty *, struct prefix *, struct bgp_info *, int,
- safi_t, json_object *);
-extern void route_vty_out_tag(struct vty *, struct prefix *, struct bgp_info *,
- int, safi_t, json_object *);
+extern struct bgp_path_info *info_make(int type, int sub_type,
+ unsigned short instance,
+ struct peer *peer, struct attr *attr,
+ struct bgp_node *rn);
+
+extern void route_vty_out(struct vty *vty, struct prefix *p,
+ struct bgp_path_info *path, int display, safi_t safi,
+ json_object *json_paths);
+extern void route_vty_out_tag(struct vty *vty, struct prefix *p,
+ struct bgp_path_info *path, int display,
+ safi_t safi, json_object *json);
extern void route_vty_out_tmp(struct vty *vty, struct prefix *p,
struct attr *attr, safi_t safi, bool use_json,
json_object *json_ar);
extern void route_vty_out_overlay(struct vty *vty, struct prefix *p,
- struct bgp_info *binfo, int display,
+ struct bgp_path_info *binfo, int display,
json_object *json);
extern int subgroup_process_announce_selected(struct update_subgroup *subgrp,
- struct bgp_info *selected,
+ struct bgp_path_info *selected,
struct bgp_node *rn,
uint32_t addpath_tx_id);
-extern int subgroup_announce_check(struct bgp_node *rn, struct bgp_info *ri,
+extern int subgroup_announce_check(struct bgp_node *rn,
+ struct bgp_path_info *ri,
struct update_subgroup *subgrp,
struct prefix *p, struct attr *attr);
extern struct bgp_node *bgp_afi_node_lookup(struct bgp_table *table, afi_t afi,
safi_t safi, struct prefix *p,
struct prefix_rd *prd);
-extern struct bgp_info *bgp_info_new(void);
-extern void bgp_info_restore(struct bgp_node *, struct bgp_info *);
+extern struct bgp_path_info *bgp_info_new(void);
+extern void bgp_info_restore(struct bgp_node *rn, struct bgp_path_info *path);
-extern int bgp_info_cmp_compatible(struct bgp *, struct bgp_info *,
- struct bgp_info *, char *pfx_buf, afi_t afi,
- safi_t safi);
+extern int bgp_info_cmp_compatible(struct bgp *bgp, struct bgp_path_info *new,
+ struct bgp_path_info *exist, char *pfx_buf,
+ afi_t afi, safi_t safi);
extern void bgp_attr_add_gshut_community(struct attr *attr);
extern void bgp_best_selection(struct bgp *bgp, struct bgp_node *rn,
struct bgp_maxpaths_cfg *mpath_cfg,
- struct bgp_info_pair *result, afi_t afi,
+ struct bgp_path_info_pair *result, afi_t afi,
safi_t safi);
extern void bgp_zebra_clear_route_change_flags(struct bgp_node *rn);
extern int bgp_zebra_has_route_changed(struct bgp_node *rn,
- struct bgp_info *selected);
+ struct bgp_path_info *selected);
extern void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
struct bgp_node *rn,
struct prefix_rd *prd, afi_t afi,
safi_t safi, json_object *json);
extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
- struct prefix *p, struct bgp_info *binfo,
+ struct prefix *p, struct bgp_path_info *binfo,
afi_t afi, safi_t safi,
json_object *json_paths);
extern int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
if (type == RMAP_BGP) {
pc = rule;
su = &pc->su;
- peer = ((struct bgp_info *)object)->peer;
+ peer = ((struct bgp_path_info *)object)->peer;
if (pc->interface) {
if (!peer->conf_if)
u_int32_t locpref = 0;
u_int32_t newlocpref = 0;
enum lua_rm_status lrm_status;
- struct bgp_info *info = (struct bgp_info *)object;
+ struct bgp_path_info *info = (struct bgp_path_info *)object;
lua_State *L = lua_initialize("/etc/frr/lua.scr");
if (L == NULL)
void *object)
{
struct access_list *alist;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct prefix_ipv4 p;
if (type == RMAP_BGP && prefix->family == AF_INET) {
void *object)
{
struct access_list *alist;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct peer *peer;
struct prefix_ipv4 p;
route_map_object_t type, void *object)
{
struct prefix_list *plist;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct prefix_ipv4 p;
if (type == RMAP_BGP && prefix->family == AF_INET) {
route_match_ip_next_hop_type(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP && prefix->family == AF_INET) {
- bgp_info = (struct bgp_info *)object;
+ bgp_info = (struct bgp_path_info *)object;
if (!bgp_info || !bgp_info->attr)
return RMAP_DENYMATCH;
route_map_object_t type, void *object)
{
struct prefix_list *plist;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct peer *peer;
struct prefix_ipv4 p;
route_map_object_t type, void *object)
{
vni_t vni = 0;
- struct bgp_info *bgp_info = NULL;
+ struct bgp_path_info *bgp_info = NULL;
if (type == RMAP_BGP) {
vni = *((vni_t *)rule);
- bgp_info = (struct bgp_info *)object;
+ bgp_info = (struct bgp_path_info *)object;
if (bgp_info->extra == NULL)
return RMAP_NOMATCH;
void *object)
{
uint32_t *local_pref;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
local_pref = rule;
void *object)
{
struct rmap_value *rv;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
rv = rule;
{
struct as_list *as_list;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
as_list = as_list_lookup((char *)rule);
void *object)
{
struct community_list *list;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct rmap_community *rcom;
if (type == RMAP_BGP) {
void *object)
{
struct community_list *list;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct rmap_community *rcom;
if (type == RMAP_BGP) {
void *object)
{
struct community_list *list;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
bgp_info = object;
void *object)
{
uint8_t *origin;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
origin = rule;
void *object)
{
struct interface *ifp;
- struct bgp_info *info;
+ struct bgp_path_info *info;
if (type == RMAP_BGP) {
info = object;
route_map_object_t type, void *object)
{
route_tag_t *tag;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
tag = rule;
void *object)
{
struct rmap_ip_nexthop_set *rins = rule;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct peer *peer;
if (type == RMAP_BGP) {
void *object)
{
struct rmap_value *rv;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
uint32_t locpref = 0;
if (type == RMAP_BGP) {
void *object)
{
struct rmap_value *rv;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
/* Fetch routemap's rule information. */
void *object)
{
struct rmap_value *rv;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
uint32_t med = 0;
if (type == RMAP_BGP) {
{
struct aspath *aspath;
struct aspath *new;
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
if (type == RMAP_BGP) {
binfo = object;
void *object)
{
struct aspath *new_path, *exclude_path;
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
if (type == RMAP_BGP) {
exclude_path = rule;
void *object)
{
struct rmap_com_set *rcs;
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
struct attr *attr;
struct community *new = NULL;
struct community *old;
void *object)
{
struct rmap_lcom_set *rcs;
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
struct attr *attr;
struct lcommunity *new = NULL;
struct lcommunity *old;
struct lcommunity *merge;
struct lcommunity *new;
struct lcommunity *old;
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
if (type == RMAP_BGP) {
if (!rule)
struct community *merge;
struct community *new;
struct community *old;
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
if (type == RMAP_BGP) {
if (!rule)
struct ecommunity *ecom;
struct ecommunity *new_ecom;
struct ecommunity *old_ecom;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
ecom = rule;
void *object)
{
uint8_t *origin;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
origin = rule;
route_map_object_t type,
void *object)
{
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
bgp_info = object;
route_map_object_t type,
void *object)
{
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct aggregator *aggregator;
if (type == RMAP_BGP) {
route_set_aggregator_as_compile, route_set_aggregator_as_free,
};
-/* Set tag to object. object must be pointer to struct bgp_info */
+/* Set tag to object. object must be pointer to struct bgp_path_info */
static route_map_result_t route_set_tag(void *rule,
const struct prefix *prefix,
route_map_object_t type, void *object)
{
route_tag_t *tag;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
tag = rule;
route_map_rule_tag_free,
};
-/* Set label-index to object. object must be pointer to struct bgp_info */
+/* Set label-index to object. object must be pointer to struct bgp_path_info */
static route_map_result_t route_set_label_index(void *rule,
const struct prefix *prefix,
route_map_object_t type,
void *object)
{
struct rmap_value *rv;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
uint32_t label_index;
if (type == RMAP_BGP) {
void *object)
{
struct in6_addr *addr = rule;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
bgp_info = object;
route_match_ipv6_next_hop_type(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct in6_addr *addr = rule;
if (type == RMAP_BGP && prefix->family == AF_INET6) {
- bgp_info = (struct bgp_info *)object;
+ bgp_info = (struct bgp_path_info *)object;
if (!bgp_info || !bgp_info->attr)
return RMAP_DENYMATCH;
void *object)
{
struct in6_addr *address;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
/* Fetch routemap's rule information. */
route_set_ipv6_nexthop_prefer_global(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct peer *peer;
if (type == RMAP_BGP) {
void *object)
{
struct in6_addr *address;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
/* Fetch routemap's rule information. */
void *object)
{
struct in6_addr peer_address;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
struct peer *peer;
if (type == RMAP_BGP) {
void *object)
{
struct in_addr *address;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
/* Fetch routemap's rule information. */
void *object)
{
struct in6_addr *address;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
/* Fetch routemap's rule information. */
void *object)
{
struct in_addr *address;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
address = rule;
route_map_object_t type, void *object)
{
int *rpki_status = rule;
- struct bgp_info *bgp_info;
+ struct bgp_path_info *bgp_info;
if (type == RMAP_BGP) {
bgp_info = object;
for (ain = bgp_node->adj_in; ain; ain = ain->next) {
int ret;
- struct bgp_info *bgp_info = bgp_node->info;
+ struct bgp_path_info *bgp_info = bgp_node->info;
mpls_label_t *label = NULL;
uint32_t num_labels = 0;
return NULL;
}
-static struct bgp_info *bgp4PathAttrLookup(struct variable *v, oid name[],
- size_t *length, struct bgp *bgp,
- struct prefix_ipv4 *addr, int exact)
+static struct bgp_path_info *bgp4PathAttrLookup(struct variable *v, oid name[],
+ size_t *length, struct bgp *bgp,
+ struct prefix_ipv4 *addr,
+ int exact)
{
oid *offset;
int offsetlen;
- struct bgp_info *binfo;
- struct bgp_info *min;
+ struct bgp_path_info *binfo;
+ struct bgp_path_info *min;
struct bgp_node *rn;
union sockunion su;
unsigned int len;
WriteMethod **write_method)
{
struct bgp *bgp;
- struct bgp_info *binfo;
+ struct bgp_path_info *binfo;
struct prefix_ipv4 addr;
bgp = bgp_get_default();
* configured addpath-tx knob
*/
int bgp_addpath_tx_path(struct peer *peer, afi_t afi, safi_t safi,
- struct bgp_info *ri)
+ struct bgp_path_info *ri)
{
if (CHECK_FLAG(peer->af_flags[afi][safi],
PEER_FLAG_ADDPATH_TX_ALL_PATHS))
struct updwalk_context {
struct vty *vty;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
uint64_t updgrp_id;
uint64_t subgrp_id;
bgp_policy_type_e policy_type;
extern void subgroup_default_originate(struct update_subgroup *subgrp,
int withdraw);
extern void group_announce_route(struct bgp *bgp, afi_t afi, safi_t safi,
- struct bgp_node *rn, struct bgp_info *ri);
+ struct bgp_node *rn, struct bgp_path_info *ri);
extern void subgroup_clear_table(struct update_subgroup *subgrp);
extern void update_group_announce(struct bgp *bgp);
extern void update_group_announce_rrclients(struct bgp *bgp);
struct update_subgroup *subgrp);
extern void bgp_adj_out_set_subgroup(struct bgp_node *rn,
struct update_subgroup *subgrp,
- struct attr *attr, struct bgp_info *binfo);
+ struct attr *attr,
+ struct bgp_path_info *binfo);
extern void bgp_adj_out_unset_subgroup(struct bgp_node *rn,
struct update_subgroup *subgrp,
char withdraw, uint32_t addpath_tx_id);
extern void update_bgp_group_free(struct bgp *bgp);
extern int bgp_addpath_encode_tx(struct peer *peer, afi_t afi, safi_t safi);
extern int bgp_addpath_tx_path(struct peer *peer, afi_t afi, safi_t safi,
- struct bgp_info *ri);
+ struct bgp_path_info *ri);
/*
* Inline functions
{
struct updwalk_context *ctx = arg;
struct update_subgroup *subgrp;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
afi_t afi;
safi_t safi;
struct peer *peer;
void bgp_adj_out_set_subgroup(struct bgp_node *rn,
struct update_subgroup *subgrp, struct attr *attr,
- struct bgp_info *binfo)
+ struct bgp_path_info *binfo)
{
struct bgp_adj_out *adj = NULL;
struct bgp_advertise *adv;
adv = adj->adv;
adv->rn = rn;
assert(adv->binfo == NULL);
- adv->binfo = bgp_info_lock(binfo); /* bgp_info adj_out reference */
+ /* bgp_path_info adj_out reference */
+ adv->binfo = bgp_info_lock(binfo);
if (attr)
adv->baa = bgp_advertise_intern(subgrp->hash, attr);
struct bgp_table *table)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct attr attr;
struct peer *peer;
afi_t afi;
{
struct bgp *bgp;
struct attr attr;
- struct bgp_info *info, init_info, tmp_info;
+ struct bgp_path_info *info, init_info, tmp_info;
struct prefix p;
struct peer *from;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
struct peer *peer;
int ret = RMAP_DENYMATCH;
afi_t afi;
* input route.
*/
void group_announce_route(struct bgp *bgp, afi_t afi, safi_t safi,
- struct bgp_node *rn, struct bgp_info *ri)
+ struct bgp_node *rn, struct bgp_path_info *ri)
{
struct updwalk_context ctx;
ctx.ri = ri;
struct bgp_adj_out *adj;
struct bgp_advertise *adv;
struct bgp_node *rn = NULL;
- struct bgp_info *binfo = NULL;
+ struct bgp_path_info *binfo = NULL;
bgp_size_t total_attr_len = 0;
unsigned long attrlen_pos = 0;
size_t mpattrlen_pos = 0;
count = mtype_stats_alloc(MTYPE_BGP_ROUTE);
vty_out(vty, "%ld BGP routes, using %s of memory\n", count,
mtype_memstr(memstrbuf, sizeof(memstrbuf),
- count * sizeof(struct bgp_info)));
+ count * sizeof(struct bgp_path_info)));
if ((count = mtype_stats_alloc(MTYPE_BGP_ROUTE_EXTRA)))
vty_out(vty, "%ld BGP route ancillaries, using %s of memory\n",
count,
- mtype_memstr(memstrbuf, sizeof(memstrbuf),
- count * sizeof(struct bgp_info_extra)));
+ mtype_memstr(
+ memstrbuf, sizeof(memstrbuf),
+ count * sizeof(struct bgp_path_info_extra)));
if ((count = mtype_stats_alloc(MTYPE_BGP_STATIC)))
vty_out(vty, "%ld Static routes, using %s of memory\n", count,
return true;
}
-static struct in6_addr *bgp_info_to_ipv6_nexthop(struct bgp_info *info,
+static struct in6_addr *bgp_info_to_ipv6_nexthop(struct bgp_path_info *info,
ifindex_t *ifindex)
{
struct in6_addr *nexthop = NULL;
}
static int bgp_table_map_apply(struct route_map *map, struct prefix *p,
- struct bgp_info *info)
+ struct bgp_path_info *info)
{
route_map_result_t ret;
return 1;
}
-static int update_ipv6nh_for_route_install(int nh_othervrf,
- struct in6_addr *nexthop,
- ifindex_t ifindex,
- struct bgp_info *ri,
- struct bgp_info *best_ri,
- bool is_evpn,
- struct zapi_nexthop *api_nh)
+static int
+update_ipv6nh_for_route_install(int nh_othervrf, struct in6_addr *nexthop,
+ ifindex_t ifindex, struct bgp_path_info *ri,
+ struct bgp_path_info *best_ri, bool is_evpn,
+ struct zapi_nexthop *api_nh)
{
struct attr *attr;
}
void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
- struct bgp_info *info, struct bgp *bgp, afi_t afi,
+ struct bgp_path_info *info, struct bgp *bgp, afi_t afi,
safi_t safi)
{
struct zapi_route api;
int has_valid_label = 0;
uint8_t distance;
struct peer *peer;
- struct bgp_info *mpinfo;
+ struct bgp_path_info *mpinfo;
uint32_t metric;
struct attr local_attr;
- struct bgp_info local_info;
- struct bgp_info *mpinfo_cp = &local_info;
+ struct bgp_path_info local_info;
+ struct bgp_path_info *mpinfo_cp = &local_info;
route_tag_t tag;
mpls_label_t label;
int nh_othervrf = 0;
/* Obtain peer from parent */
if (info->extra && info->extra->parent)
- peer = ((struct bgp_info *)(info->extra->parent))->peer;
+ peer = ((struct bgp_path_info *)(info->extra->parent))
+ ->peer;
}
tag = info->attr->tag;
{
struct bgp_node *rn;
struct bgp_table *table;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
/* Don't try to install if we're not connected to Zebra or Zebra doesn't
* know of this instance.
safi);
}
-void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info,
+void bgp_zebra_withdraw(struct prefix *p, struct bgp_path_info *info,
struct bgp *bgp, safi_t safi)
{
struct zapi_route api;
afi_t afi, int type, uint32_t metric)
{
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
if (red->redist_metric_flag && red->redist_metric == metric)
return 0;
break;
case ZAPI_IPSET_ENTRY_INSTALLED:
{
- struct bgp_info *bgp_info;
- struct bgp_info_extra *extra;
-
- bgp_pbime->installed = true;
- bgp_pbime->install_in_progress = false;
- if (BGP_DEBUG(zebra, ZEBRA))
- zlog_debug("%s: Received IPSET_ENTRY_INSTALLED",
- __PRETTY_FUNCTION__);
- /* link bgp_info to bpme */
- bgp_info = (struct bgp_info *)bgp_pbime->bgp_info;
- extra = bgp_info_extra_get(bgp_info);
- if (extra->bgp_fs_pbr == NULL)
- extra->bgp_fs_pbr = list_new();
- listnode_add(extra->bgp_fs_pbr, bgp_pbime);
+ struct bgp_path_info *bgp_info;
+ struct bgp_path_info_extra *extra;
+
+ bgp_pbime->installed = true;
+ bgp_pbime->install_in_progress = false;
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: Received IPSET_ENTRY_INSTALLED",
+ __PRETTY_FUNCTION__);
+ /* link bgp_info to bpme */
+ bgp_info = (struct bgp_path_info *)bgp_pbime->bgp_info;
+ extra = bgp_info_extra_get(bgp_info);
+ if (extra->bgp_fs_pbr == NULL)
+ extra->bgp_fs_pbr = list_new();
+ listnode_add(extra->bgp_fs_pbr, bgp_pbime);
}
break;
case ZAPI_IPSET_ENTRY_FAIL_REMOVE:
safi_t);
extern void bgp_config_write_redistribute(struct vty *, struct bgp *, afi_t,
safi_t);
-extern void bgp_zebra_announce(struct bgp_node *, struct prefix *,
- struct bgp_info *, struct bgp *, afi_t, safi_t);
+extern void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
+ struct bgp_path_info *path, struct bgp *bgp,
+ afi_t afi, safi_t safi);
extern void bgp_zebra_announce_table(struct bgp *, afi_t, safi_t);
-extern void bgp_zebra_withdraw(struct prefix *, struct bgp_info *,
- struct bgp *, safi_t);
+extern void bgp_zebra_withdraw(struct prefix *p, struct bgp_path_info *path,
+ struct bgp *bgp, safi_t safi);
extern void bgp_zebra_initiate_radv(struct bgp *bgp, struct peer *peer);
extern void bgp_zebra_terminate_radv(struct bgp *bgp, struct peer *peer);
{
afi_t afi; /* of the VN address */
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
char buf[PREFIX_STRLEN];
char buf2[RD_ADDRSTRLEN];
struct prefix_rd prd0;
int flags)
{
afi_t afi; /* of the VN address */
- struct bgp_info *new;
- struct bgp_info *bi;
+ struct bgp_path_info *new;
+ struct bgp_path_info *bi;
struct bgp_node *bn;
struct attr attr = {0};
{
struct bgp_node *rdn;
struct bgp_node *rn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
if (!bgp)
return;
extern void rfapiProcessPeerDown(struct peer *peer);
-extern void vnc_zebra_announce(struct prefix *p, struct bgp_info *new_select,
+extern void vnc_zebra_announce(struct prefix *p,
+ struct bgp_path_info *new_select,
struct bgp *bgp);
-extern void vnc_zebra_withdraw(struct prefix *p, struct bgp_info *old_select);
+extern void vnc_zebra_withdraw(struct prefix *p,
+ struct bgp_path_info *old_select);
extern void rfapi_vty_out_vncinfo(struct vty *vty, struct prefix *p,
- struct bgp_info *bi, safi_t safi);
+ struct bgp_path_info *bi, safi_t safi);
extern void vnc_direct_bgp_vpn_enable(struct bgp *bgp, afi_t afi);
struct rfapi_withdraw {
struct rfapi_import_table *import_table;
struct agg_node *node;
- struct bgp_info *info;
+ struct bgp_path_info *info;
safi_t safi; /* used only for bulk operations */
/*
* For import table node reference count checking (i.e., debugging).
for (rn = agg_route_top(rt); rn;
rn = agg_route_next(rn)) {
- struct bgp_info *bi;
- struct bgp_info *next;
+ struct bgp_path_info *bi;
+ struct bgp_path_info *next;
for (bi = rn->info; bi; bi = next) {
next = bi->next;
{
unsigned int count_bi = 0;
unsigned int count_monitor = 0;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct rfapi_monitor_encap *hme;
struct rfapi_monitor_vpn *hmv;
/*
* Get UN address wherever it might be
*/
-int rfapiGetUnAddrOfVpnBi(struct bgp_info *bi, struct prefix *p)
+int rfapiGetUnAddrOfVpnBi(struct bgp_path_info *bi, struct prefix *p)
{
/* If it's in this route's VNC attribute, we're done */
if (!rfapiGetVncTunnelUnAddr(bi->attr, p))
/*
* Make a new bgp_info from gathered parameters
*/
-static struct bgp_info *rfapiBgpInfoCreate(struct attr *attr, struct peer *peer,
- void *rfd, struct prefix_rd *prd,
- uint8_t type, uint8_t sub_type,
- uint32_t *label)
+static struct bgp_path_info *rfapiBgpInfoCreate(struct attr *attr,
+ struct peer *peer, void *rfd,
+ struct prefix_rd *prd,
+ uint8_t type, uint8_t sub_type,
+ uint32_t *label)
{
- struct bgp_info *new;
+ struct bgp_path_info *new;
new = bgp_info_new();
assert(new);
* Frees bgp_info as used in import tables (parts are not
* allocated exactly the way they are in the main RIBs)
*/
-static void rfapiBgpInfoFree(struct bgp_info *goner)
+static void rfapiBgpInfoFree(struct bgp_path_info *goner)
{
if (!goner)
return;
static struct rfapi_monitor_vpn *
rfapiMonitorMoveShorter(struct agg_node *original_vpn_node, int lockoffset)
{
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct agg_node *par;
struct rfapi_monitor_vpn *m;
struct rfapi_monitor_vpn *mlast;
{
struct rfapi_monitor_vpn *monitor;
struct rfapi_monitor_vpn *mlast;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct agg_node *par;
RFAPI_CHECK_REFCOUNT(new_vpn_node, SAFI_MPLS_VPN, 0);
}
-static void rfapiBgpInfoChainFree(struct bgp_info *bi)
+static void rfapiBgpInfoChainFree(struct bgp_path_info *bi)
{
- struct bgp_info *next;
+ struct bgp_path_info *next;
while (bi) {
return ENOENT;
}
-static int rfapiVpnBiNhEqualsPt(struct bgp_info *bi, struct rfapi_ip_addr *hpt)
+static int rfapiVpnBiNhEqualsPt(struct bgp_path_info *bi,
+ struct rfapi_ip_addr *hpt)
{
uint8_t family;
/*
* Compare 2 VPN BIs. Return true if they have the same VN and UN addresses
*/
-static int rfapiVpnBiSamePtUn(struct bgp_info *bi1, struct bgp_info *bi2)
+static int rfapiVpnBiSamePtUn(struct bgp_path_info *bi1,
+ struct bgp_path_info *bi2)
{
struct prefix pfx_un1;
struct prefix pfx_un2;
static struct rfapi_next_hop_entry *
rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix,
- struct bgp_info *bi, /* route to encode */
- uint32_t lifetime, /* use this in nhe */
- struct agg_node *rn) /* req for L2 eth addr */
+ struct bgp_path_info *bi, /* route to encode */
+ uint32_t lifetime, /* use this in nhe */
+ struct agg_node *rn) /* req for L2 eth addr */
{
struct rfapi_next_hop_entry *new;
int have_vnc_tunnel_un = 0;
int rfapiHasNonRemovedRoutes(struct agg_node *rn)
{
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
for (bi = rn->info; bi; bi = bi->next) {
struct prefix pfx;
*/
void rfapiDumpNode(struct agg_node *rn)
{
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
vnc_zlog_debug_verbose("%s: rn=%p", __func__, rn);
for (bi = rn->info; bi; bi = bi->next) {
struct agg_node *rfd_rib_node, /* preload this NVE rib node */
struct prefix *pfx_target_original) /* query target */
{
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct rfapi_next_hop_entry *new;
struct prefix pfx_un;
struct skiplist *seen_nexthops;
* keeping the list of BIs sorted best route first
*/
static void rfapiBgpInfoAttachSorted(struct agg_node *rn,
- struct bgp_info *info_new, afi_t afi,
+ struct bgp_path_info *info_new, afi_t afi,
safi_t safi)
{
struct bgp *bgp;
- struct bgp_info *prev;
- struct bgp_info *next;
+ struct bgp_path_info *prev;
+ struct bgp_path_info *next;
char pfx_buf[PREFIX2STR_BUFFER];
bgp_attr_intern(info_new->attr);
}
-static void rfapiBgpInfoDetach(struct agg_node *rn, struct bgp_info *bi)
+static void rfapiBgpInfoDetach(struct agg_node *rn, struct bgp_path_info *bi)
{
/*
* Remove the route (doubly-linked)
*/
static int rfapi_bi_peer_rd_cmp(void *b1, void *b2)
{
- struct bgp_info *bi1 = b1;
- struct bgp_info *bi2 = b2;
+ struct bgp_path_info *bi1 = b1;
+ struct bgp_path_info *bi2 = b2;
/*
* Compare peers
*/
static int rfapi_bi_peer_rd_aux_cmp(void *b1, void *b2)
{
- struct bgp_info *bi1 = b1;
- struct bgp_info *bi2 = b2;
+ struct bgp_path_info *bi1 = b1;
+ struct bgp_path_info *bi2 = b2;
int rc;
/*
* Index on RD and Peer
*/
static void rfapiItBiIndexAdd(struct agg_node *rn, /* Import table VPN node */
- struct bgp_info *bi) /* new BI */
+ struct bgp_path_info *bi) /* new BI */
{
struct skiplist *sl;
{
struct skiplist *sl;
void *cursor = NULL;
- struct bgp_info *k;
- struct bgp_info *v;
+ struct bgp_path_info *k;
+ struct bgp_path_info *v;
int rc;
sl = RFAPI_RDINDEX(rn);
}
}
-static struct bgp_info *rfapiItBiIndexSearch(
+static struct bgp_path_info *rfapiItBiIndexSearch(
struct agg_node *rn, /* Import table VPN node */
struct prefix_rd *prd, struct peer *peer,
struct prefix *aux_prefix) /* optional L3 addr for L2 ITs */
{
struct skiplist *sl;
int rc;
- struct bgp_info bi_fake;
- struct bgp_info_extra bi_extra;
- struct bgp_info *bi_result;
+ struct bgp_path_info bi_fake;
+ struct bgp_path_info_extra bi_extra;
+ struct bgp_path_info *bi_result;
sl = RFAPI_RDINDEX(rn);
if (!sl)
}
static void rfapiItBiIndexDel(struct agg_node *rn, /* Import table VPN node */
- struct bgp_info *bi) /* old BI */
+ struct bgp_path_info *bi) /* old BI */
{
struct skiplist *sl;
int rc;
* Add a backreference at the ENCAP node to the VPN route that
* refers to it
*/
-static void rfapiMonitorEncapAdd(struct rfapi_import_table *import_table,
- struct prefix *p, /* VN address */
- struct agg_node *vpn_rn, /* VPN node */
- struct bgp_info *vpn_bi) /* VPN bi/route */
+static void
+rfapiMonitorEncapAdd(struct rfapi_import_table *import_table,
+ struct prefix *p, /* VN address */
+ struct agg_node *vpn_rn, /* VPN node */
+ struct bgp_path_info *vpn_bi) /* VPN bi/route */
{
afi_t afi = family2afi(p->family);
struct agg_node *rn;
bgp_attr_intern(vpn_bi->attr);
}
-static void rfapiMonitorEncapDelete(struct bgp_info *vpn_bi)
+static void rfapiMonitorEncapDelete(struct bgp_path_info *vpn_bi)
{
/*
* Remove encap monitor
static int rfapiWithdrawTimerVPN(struct thread *t)
{
struct rfapi_withdraw *wcb = t->arg;
- struct bgp_info *bi = wcb->info;
+ struct bgp_path_info *bi = wcb->info;
struct bgp *bgp = bgp_get_default();
struct rfapi_monitor_vpn *moved;
& BGP_VNC_CONFIG_RESPONSE_REMOVAL_DISABLE)) {
int has_valid_duplicate = 0;
- struct bgp_info *bii;
+ struct bgp_path_info *bii;
/*
* First check if there are any OTHER routes at this node
return 1;
}
-static void rfapiCopyUnEncap2VPN(struct bgp_info *encap_bi,
- struct bgp_info *vpn_bi)
+static void rfapiCopyUnEncap2VPN(struct bgp_path_info *encap_bi,
+ struct bgp_path_info *vpn_bi)
{
if (!encap_bi->attr) {
zlog_warn("%s: no encap bi attr/extra, can't copy UN address",
* returns 0 on success, nonzero on error
*/
static int rfapiWithdrawEncapUpdateCachedUn(
- struct rfapi_import_table *import_table, struct bgp_info *encap_bi,
- struct agg_node *vpn_rn, struct bgp_info *vpn_bi)
+ struct rfapi_import_table *import_table, struct bgp_path_info *encap_bi,
+ struct agg_node *vpn_rn, struct bgp_path_info *vpn_bi)
{
if (!encap_bi) {
static int rfapiWithdrawTimerEncap(struct thread *t)
{
struct rfapi_withdraw *wcb = t->arg;
- struct bgp_info *bi = wcb->info;
+ struct bgp_path_info *bi = wcb->info;
int was_first_route = 0;
struct rfapi_monitor_encap *em;
struct skiplist *vpn_node_sl = skiplist_new(0, NULL, NULL);
*/
static void
rfapiBiStartWithdrawTimer(struct rfapi_import_table *import_table,
- struct agg_node *rn, struct bgp_info *bi, afi_t afi,
- safi_t safi,
+ struct agg_node *rn, struct bgp_path_info *bi,
+ afi_t afi, safi_t safi,
int (*timer_service_func)(struct thread *))
{
uint32_t lifetime;
}
/* re-sort route list (BGP_PATH_REMOVED routes are last) */
- if (((struct bgp_info *)rn->info)->next) {
+ if (((struct bgp_path_info *)rn->info)->next) {
rfapiBgpInfoDetach(rn, bi);
rfapiBgpInfoAttachSorted(rn, bi, afi, safi);
}
static void rfapiExpireEncapNow(struct rfapi_import_table *it,
- struct agg_node *rn, struct bgp_info *bi)
+ struct agg_node *rn, struct bgp_path_info *bi)
{
struct rfapi_withdraw *wcb;
struct thread t;
{
struct agg_table *rt = NULL;
struct agg_node *rn;
- struct bgp_info *info_new;
- struct bgp_info *bi;
- struct bgp_info *next;
+ struct bgp_path_info *info_new;
+ struct bgp_path_info *bi;
+ struct bgp_path_info *next;
char buf[BUFSIZ];
struct prefix p_firstbi_old;
*/
if (rn->info) {
rfapiNexthop2Prefix(
- ((struct bgp_info *)(rn->info))->attr,
+ ((struct bgp_path_info *)(rn->info))->attr,
&p_firstbi_old);
}
rfapiExpireEncapNow(import_table, rn, bi);
}
- rfapiNexthop2Prefix(((struct bgp_info *)(rn->info))->attr,
+ rfapiNexthop2Prefix(((struct bgp_path_info *)(rn->info))->attr,
&p_firstbi_new);
/*
}
static void rfapiExpireVpnNow(struct rfapi_import_table *it,
- struct agg_node *rn, struct bgp_info *bi,
+ struct agg_node *rn, struct bgp_path_info *bi,
int lockoffset)
{
struct rfapi_withdraw *wcb;
struct agg_table *rt = NULL;
struct agg_node *rn;
struct agg_node *n;
- struct bgp_info *info_new;
- struct bgp_info *bi;
- struct bgp_info *next;
+ struct bgp_path_info *info_new;
+ struct bgp_path_info *bi;
+ struct bgp_path_info *next;
char buf[BUFSIZ];
struct prefix vn_prefix;
struct prefix un_prefix;
afi_t afi, safi_t safi)
{
struct agg_node *rn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct agg_table *rt;
int (*timer_service_func)(struct thread *);
for (rn2 = bgp_table_top(rn1->info); rn2;
rn2 = bgp_route_next(rn2)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
for (bi = rn2->info; bi; bi = bi->next) {
uint32_t label = 0;
afi);
for (rn = agg_route_top(rt); rn; rn = agg_route_next(rn)) {
- struct bgp_info *bi;
- struct bgp_info *next;
+ struct bgp_path_info *bi;
+ struct bgp_path_info *next;
if (VNC_DEBUG(IMPORT_DEL_REMOTE)) {
char p1line[PREFIX_STRLEN];
/*
* Print BI in an Import Table
*/
-extern void rfapiPrintBi(void *stream, struct bgp_info *bi);
+extern void rfapiPrintBi(void *stream, struct bgp_path_info *bi);
extern void rfapiShowImportTable(void *stream, const char *label,
struct agg_table *rt, int isvpn);
extern int rfapiProcessDeferredClose(struct thread *t);
-extern int rfapiGetUnAddrOfVpnBi(struct bgp_info *bi, struct prefix *p);
+extern int rfapiGetUnAddrOfVpnBi(struct bgp_path_info *bi, struct prefix *p);
extern void rfapiNexthop2Prefix(struct attr *attr, struct prefix *p);
struct prefix *p,
struct prefix *aux_prefix, /* AFI_ETHER: optional IP */
afi_t afi, struct prefix_rd *prd,
- struct attr *attr, /* part of bgp_info */
- uint8_t type, /* part of bgp_info */
- uint8_t sub_type, /* part of bgp_info */
- uint32_t *label); /* part of bgp_info */
+ struct attr *attr, /* part of bgp_path_info */
+ uint8_t type, /* part of bgp_path_info */
+ uint8_t sub_type, /* part of bgp_path_info */
+ uint32_t *label); /* part of bgp_path_info */
extern struct rfapi_next_hop_entry *rfapiEthRouteNode2NextHopList(
struct agg_node *rn, struct rfapi_ip_prefix *rprefix,
for (rn = agg_node_match(rfd->import_table->imported_vpn[afi], p);
rn;) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct prefix pfx_dummy;
/* TBD update this code to use new valid_interior_count */
struct rfapi_monitor_encap *next;
struct rfapi_monitor_encap *prev;
struct agg_node *node; /* VPN node */
- struct bgp_info *bi; /* VPN bi */
+ struct bgp_path_info *bi; /* VPN bi */
struct agg_node *rn; /* parent node */
};
/*
* when importing bgp-direct routes in resolve-nve mode,
- * this list maps unicast route nexthops to their bgp_infos
+ * this list maps unicast route nexthops to their bgp_path_infos
* in the unicast table
*/
struct skiplist *resolve_nve_nexthop;
}
/*
- * Copies struct bgp_info to struct rfapi_info, except for rk fields and un
+ * Copies struct bgp_path_info to struct rfapi_info, except for rk fields and un
*/
-static void rfapiRibBi2Ri(struct bgp_info *bi, struct rfapi_info *ri,
+static void rfapiRibBi2Ri(struct bgp_path_info *bi, struct rfapi_info *ri,
uint32_t lifetime)
{
struct bgp_attr_encap_subtlv *pEncap;
int rfapiRibPreloadBi(
struct agg_node *rfd_rib_node, /* NULL = don't preload or filter */
struct prefix *pfx_vn, struct prefix *pfx_un, uint32_t lifetime,
- struct bgp_info *bi)
+ struct bgp_path_info *bi)
{
struct rfapi_descriptor *rfd;
struct skiplist *slRibPt = NULL;
struct agg_node *it_node, uint32_t lifetime)
{
struct prefix *prefix;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct agg_node *pn;
afi_t afi;
uint32_t queued_flag;
extern int rfapiRibPreloadBi(struct agg_node *rfd_rib_node,
struct prefix *pfx_vn, struct prefix *pfx_un,
- uint32_t lifetime, struct bgp_info *bi);
+ uint32_t lifetime, struct bgp_path_info *bi);
extern struct rfapi_next_hop_entry *
rfapiRibPreload(struct bgp *bgp, struct rfapi_descriptor *rfd,
/* called from bgpd/bgp_vty.c'route_vty_out() */
void rfapi_vty_out_vncinfo(struct vty *vty, struct prefix *p,
- struct bgp_info *bi, safi_t safi)
+ struct bgp_path_info *bi, safi_t safi)
{
char *s;
uint32_t lifetime;
/*
* Print BI in an Import Table
*/
-void rfapiPrintBi(void *stream, struct bgp_info *bi)
+void rfapiPrintBi(void *stream, struct bgp_path_info *bi)
{
char buf[BUFSIZ];
char *s;
void rfapiShowItNode(void *stream, struct agg_node *rn)
{
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
char buf[BUFSIZ];
int (*fp)(void *, const char *, ...);
fp(out, "Import Table [%s]%s", label, HVTYNL);
for (rn = agg_route_top(rt); rn; rn = agg_route_next(rn)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
if (rn->p.family == AF_ETHERNET) {
rfapiEthAddr2Str(&rn->p.u.prefix_eth, buf, BUFSIZ);
}
static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream,
- struct agg_node *rn, struct bgp_info *bi)
+ struct agg_node *rn, struct bgp_path_info *bi)
{
int (*fp)(void *, const char *, ...);
struct vty *vty;
#if RFAPI_REGISTRATIONS_REPORT_AGE
/*
* Calculate when the timer started. Doing so here saves
- * us a timestamp field in "struct bgp_info".
+ * us a timestamp field in "struct bgp_path_info".
*
* See rfapi_import.c'rfapiBiStartWithdrawTimer() for the
* original calculation.
for (rn = agg_route_top(it->imported_vpn[afi]); rn;
rn = agg_route_next(rn)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
int count_only;
/* allow for wider or more narrow mask from user */
{
afi_t afi; /* of the VN address */
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
uint8_t type = ZEBRA_ROUTE_BGP;
struct bgp *bgp;
int printed = 0;
void vnc_direct_bgp_add_route_ce(struct bgp *bgp, struct agg_node *rn,
- struct bgp_info *bi)
+ struct bgp_path_info *bi)
{
struct attr *attr = bi->attr;
struct peer *peer = bi->peer;
struct prefix *prefix = &rn->p;
afi_t afi = family2afi(prefix->family);
struct bgp_node *urn;
- struct bgp_info *ubi;
+ struct bgp_path_info *ubi;
struct attr hattr;
struct attr *iattr;
struct prefix ce_nexthop;
*/
encap_attr_export_ce(&hattr, attr, &ce_nexthop);
if (bgp->rfapi_cfg->routemap_export_bgp) {
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
memset(&info, 0, sizeof(info));
* "Withdrawing a Route" export process
*/
void vnc_direct_bgp_del_route_ce(struct bgp *bgp, struct agg_node *rn,
- struct bgp_info *bi)
+ struct bgp_path_info *bi)
{
afi_t afi = family2afi(rn->p.family);
- struct bgp_info *vbi;
+ struct bgp_path_info *vbi;
struct prefix ce_nexthop;
if (!afi) {
static void vnc_direct_bgp_vpn_enable_ce(struct bgp *bgp, afi_t afi)
{
struct agg_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
vnc_zlog_debug_verbose("%s: entry, afi=%d", __func__, afi);
for (rn = bgp_table_top(bgp->rib[afi][SAFI_UNICAST]); rn;
rn = bgp_route_next(rn)) {
- struct bgp_info *ri;
- struct bgp_info *next;
+ struct bgp_path_info *ri;
+ struct bgp_path_info *next;
for (ri = rn->info, next = NULL; ri; ri = next) {
static struct ecommunity *vnc_route_origin_ecom(struct agg_node *rn)
{
struct ecommunity *new;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
if (!rn->info)
return NULL;
struct rfapi_descriptor *irfd = rfd;
struct attr hattr;
struct attr *iattr;
- struct bgp_info info;
+ struct bgp_path_info info;
if (rfapiRaddr2Qprefix(&irfd->vn_addr,
&nhp))
afi_t afi, struct rfapi_descriptor *irfd)
{
struct prefix nhp;
- struct bgp_info info;
+ struct bgp_path_info info;
struct attr hattr;
struct attr *iattr;
if (encap_attr_export(&hattr, attr, NULL, NULL))
return;
if (hc->routemap_export_bgp) {
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
memset(&info, 0, sizeof(info));
struct bgp_table *table;
struct bgp_node *rn;
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
memset(&prd, 0, sizeof(prd));
prd.family = AF_UNSPEC;
}
if (hc->routemap_export_bgp) {
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
memset(&info, 0, sizeof(info));
for (rn = bgp_table_top(bgp->rib[afi][SAFI_UNICAST]); rn;
rn = bgp_route_next(rn)) {
- struct bgp_info *ri;
- struct bgp_info *next;
+ struct bgp_path_info *ri;
+ struct bgp_path_info *next;
for (ri = rn->info, next = NULL; ri; ri = next) {
#include "rfapi_private.h"
extern void vnc_direct_bgp_add_route_ce(struct bgp *bgp, struct agg_node *rn,
- struct bgp_info *bi);
+ struct bgp_path_info *bi);
extern void vnc_direct_bgp_del_route_ce(struct bgp *bgp, struct agg_node *rn,
- struct bgp_info *bi);
+ struct bgp_path_info *bi);
extern void vnc_direct_bgp_add_prefix(struct bgp *bgp,
struct rfapi_import_table *import_table,
struct prefix_bag {
struct prefix hpfx; /* ce address = unicast nexthop */
struct prefix upfx; /* unicast prefix */
- struct bgp_info *ubi; /* unicast route */
+ struct bgp_path_info *ubi; /* unicast route */
};
static const uint8_t maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0,
static int process_unicast_route(struct bgp *bgp, /* in */
afi_t afi, /* in */
struct prefix *prefix, /* in */
- struct bgp_info *info, /* in */
+ struct bgp_path_info *info, /* in */
struct ecommunity **ecom, /* OUT */
struct prefix *unicast_nexthop) /* OUT */
{
bgp_attr_dup(&hattr, attr); /* hattr becomes a ghost attr */
if (rmap) {
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
memset(&info, 0, sizeof(info));
static void vnc_import_bgp_add_route_mode_resolve_nve_one_bi(
- struct bgp *bgp, afi_t afi, struct bgp_info *bi, /* VPN bi */
- struct prefix_rd *prd, /* RD */
+ struct bgp *bgp, afi_t afi, struct bgp_path_info *bi, /* VPN bi */
+ struct prefix_rd *prd, /* RD */
struct prefix *prefix, /* unicast route prefix */
uint32_t *local_pref, /* NULL = no local_pref */
uint32_t *med, /* NULL = no med */
struct prefix *ubi_nexthop) /* unicast nexthop */
{
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
if (!table_rd)
return;
return;
}
- /* Iterate over bgp_info items at this node */
+ /* Iterate over bgp_path_info items at this node */
for (bi = bn->info; bi; bi = bi->next) {
vnc_import_bgp_add_route_mode_resolve_nve_one_bi(
static void vnc_import_bgp_add_route_mode_resolve_nve(
struct bgp *bgp, struct prefix *prefix, /* unicast prefix */
- struct bgp_info *info) /* unicast info */
+ struct bgp_path_info *info) /* unicast info */
{
afi_t afi = family2afi(prefix->family);
static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp,
struct prefix *prefix,
- struct bgp_info *info)
+ struct bgp_path_info *info)
{
afi_t afi = family2afi(prefix->family);
struct peer *peer = info->peer;
bgp_attr_dup(&hattr, attr); /* hattr becomes a ghost attr */
if (rmap) {
- struct bgp_info info;
+ struct bgp_path_info info;
route_map_result_t ret;
memset(&info, 0, sizeof(info));
static void
vnc_import_bgp_add_route_mode_nvegroup(struct bgp *bgp, struct prefix *prefix,
- struct bgp_info *info,
+ struct bgp_path_info *info,
struct rfapi_nve_group_cfg *rfg)
{
afi_t afi = family2afi(prefix->family);
bgp_attr_dup(&hattr, attr); /* hattr becomes a ghost attr */
if (rmap) {
- struct bgp_info binfo;
+ struct bgp_path_info binfo;
route_map_result_t ret;
memset(&binfo, 0, sizeof(binfo));
static void vnc_import_bgp_del_route_mode_plain(struct bgp *bgp,
struct prefix *prefix,
- struct bgp_info *info)
+ struct bgp_path_info *info)
{
struct prefix_rd prd;
afi_t afi = family2afi(prefix->family);
static void vnc_import_bgp_del_route_mode_nvegroup(struct bgp *bgp,
struct prefix *prefix,
- struct bgp_info *info)
+ struct bgp_path_info *info)
{
struct prefix_rd prd;
afi_t afi = family2afi(prefix->family);
}
static void vnc_import_bgp_del_route_mode_resolve_nve_one_bi(
- struct bgp *bgp, afi_t afi, struct bgp_info *bi, /* VPN bi */
- struct prefix_rd *prd, /* RD */
+ struct bgp *bgp, afi_t afi, struct bgp_path_info *bi, /* VPN bi */
+ struct prefix_rd *prd, /* RD */
struct prefix *prefix) /* unicast route prefix */
{
struct prefix un;
struct prefix *ubi_nexthop) /* unicast bi's nexthop */
{
struct bgp_node *bn;
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
if (!table_rd)
return;
return;
}
- /* Iterate over bgp_info items at this node */
+ /* Iterate over bgp_path_info items at this node */
for (bi = bn->info; bi; bi = bi->next) {
vnc_import_bgp_del_route_mode_resolve_nve_one_bi(
bgp_unlock_node(bn);
}
-static void vnc_import_bgp_del_route_mode_resolve_nve(struct bgp *bgp,
- afi_t afi,
- struct prefix *prefix,
- struct bgp_info *info)
+static void
+vnc_import_bgp_del_route_mode_resolve_nve(struct bgp *bgp, afi_t afi,
+ struct prefix *prefix,
+ struct bgp_path_info *info)
{
struct ecommunity *ecom = NULL;
struct prefix pfx_unicast_nexthop = {0}; /* happy valgrind */
struct bgp *bgp, struct prefix_rd *prd, /* RD */
struct bgp_table *table_rd, /* per-rd VPN route table */
struct prefix *prefix, /* VPN prefix */
- struct bgp_info *bi) /* new VPN host route */
+ struct bgp_path_info *bi) /* new VPN host route */
{
afi_t afi = family2afi(prefix->family);
struct skiplist *sl = NULL;
struct bgp *bgp, struct prefix_rd *prd, /* RD */
struct bgp_table *table_rd, /* per-rd VPN route table */
struct prefix *prefix, /* VPN prefix */
- struct bgp_info *bi) /* old VPN host route */
+ struct bgp_path_info *bi) /* old VPN host route */
{
afi_t afi = family2afi(prefix->family);
struct skiplist *sl = NULL;
#define DEBUG_IS_USABLE_INTERIOR 1
-static int is_usable_interior_route(struct bgp_info *bi_interior)
+static int is_usable_interior_route(struct bgp_path_info *bi_interior)
{
if (!VALID_INTERIOR_TYPE(bi_interior->type)) {
#if DEBUG_IS_USABLE_INTERIOR
static void vnc_import_bgp_exterior_add_route_it(
struct bgp *bgp, /* exterior instance, we hope */
struct prefix *prefix, /* unicast prefix */
- struct bgp_info *info, /* unicast info */
+ struct bgp_path_info *info, /* unicast info */
struct rfapi_import_table *it_only) /* NULL, or limit to this IT */
{
struct rfapi *h;
struct agg_table *table;
struct agg_node *rn;
struct agg_node *par;
- struct bgp_info *bi_interior;
+ struct bgp_path_info *bi_interior;
int have_usable_route;
vnc_zlog_debug_verbose("%s: doing it %p", __func__, it);
}
void vnc_import_bgp_exterior_add_route(
- struct bgp *bgp, /* exterior instance, we hope */
- struct prefix *prefix, /* unicast prefix */
- struct bgp_info *info) /* unicast info */
+ struct bgp *bgp, /* exterior instance, we hope */
+ struct prefix *prefix, /* unicast prefix */
+ struct bgp_path_info *info) /* unicast info */
{
vnc_import_bgp_exterior_add_route_it(bgp, prefix, info, NULL);
}
*/
void vnc_import_bgp_exterior_del_route(
struct bgp *bgp, struct prefix *prefix, /* unicast prefix */
- struct bgp_info *info) /* unicast info */
+ struct bgp_path_info *info) /* unicast info */
{
struct rfapi *h;
struct rfapi_cfg *hc;
struct agg_table *table;
struct agg_node *rn;
struct agg_node *par;
- struct bgp_info *bi_interior;
+ struct bgp_path_info *bi_interior;
int have_usable_route;
table = it->imported_vpn[afi];
*/
void vnc_import_bgp_exterior_add_route_interior(
struct bgp *bgp, struct rfapi_import_table *it,
- struct agg_node *rn_interior, /* VPN IT node */
- struct bgp_info *bi_interior) /* VPN IT route */
+ struct agg_node *rn_interior, /* VPN IT node */
+ struct bgp_path_info *bi_interior) /* VPN IT route */
{
afi_t afi = family2afi(rn_interior->p.family);
struct agg_node *par;
- struct bgp_info *bi_exterior;
+ struct bgp_path_info *bi_exterior;
struct prefix *pfx_exterior; /* exterior pfx */
void *cursor;
int rc;
if (prefix_match(&rn_interior->p, &pfx_nexthop)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
struct prefix_rd *prd;
struct attr new_attr;
uint32_t label = 0;
*/
void vnc_import_bgp_exterior_del_route_interior(
struct bgp *bgp, struct rfapi_import_table *it,
- struct agg_node *rn_interior, /* VPN IT node */
- struct bgp_info *bi_interior) /* VPN IT route */
+ struct agg_node *rn_interior, /* VPN IT node */
+ struct bgp_path_info *bi_interior) /* VPN IT route */
{
afi_t afi = family2afi(rn_interior->p.family);
struct agg_node *par;
- struct bgp_info *bi_exterior;
+ struct bgp_path_info *bi_exterior;
struct prefix *pfx_exterior; /* exterior pfx */
void *cursor;
int rc;
if (par) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
/*
* Add monitor to parent node
***********************************************************************/
void vnc_import_bgp_add_route(struct bgp *bgp, struct prefix *prefix,
- struct bgp_info *info)
+ struct bgp_path_info *info)
{
afi_t afi = family2afi(prefix->family);
* "Withdrawing a Route" import process
*/
void vnc_import_bgp_del_route(struct bgp *bgp, struct prefix *prefix,
- struct bgp_info *info) /* unicast info */
+ struct bgp_path_info *info) /* unicast info */
{
afi_t afi = family2afi(prefix->family);
for (rn = bgp_table_top(bgp->rib[afi][SAFI_UNICAST]); rn;
rn = bgp_route_next(rn)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
for (bi = rn->info; bi; bi = bi->next) {
for (rn = bgp_table_top(bgp_exterior->rib[afi][SAFI_UNICAST]); rn;
rn = bgp_route_next(rn)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
for (bi = rn->info; bi; bi = bi->next) {
for (rn = bgp_table_top(bgp_exterior->rib[afi][SAFI_UNICAST]); rn;
rn = bgp_route_next(rn)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
for (bi = rn->info; bi; bi = bi->next) {
for (rn2 = bgp_table_top(rn1->info); rn2;
rn2 = bgp_route_next(rn2)) {
- struct bgp_info *bi;
- struct bgp_info *nextbi;
+ struct bgp_path_info *bi;
+ struct bgp_path_info *nextbi;
for (bi = rn2->info; bi; bi = nextbi) {
/* Clear RHN list */
if (bgp->rfapi->resolve_nve_nexthop) {
struct prefix_bag *pb;
- struct bgp_info *info;
+ struct bgp_path_info *info;
while (!skiplist_first(bgp->rfapi->resolve_nve_nexthop, NULL,
(void *)&pb)) {
info = pb->ubi;
for (rn = bgp_table_top(bgp_exterior->rib[afi][SAFI_UNICAST]);
rn; rn = bgp_route_next(rn)) {
- struct bgp_info *bi;
+ struct bgp_path_info *bi;
for (bi = rn->info; bi; bi = bi->next) {
extern int vnc_prefix_cmp(void *pfx1, void *pfx2);
extern void vnc_import_bgp_add_route(struct bgp *bgp, struct prefix *prefix,
- struct bgp_info *info);
+ struct bgp_path_info *info);
extern void vnc_import_bgp_del_route(struct bgp *bgp, struct prefix *prefix,
- struct bgp_info *info);
+ struct bgp_path_info *info);
extern void vnc_import_bgp_redist_enable(struct bgp *bgp, afi_t afi);
extern void vnc_import_bgp_exterior_add_route(
- struct bgp *bgp, /* exterior instance, we hope */
- struct prefix *prefix, /* unicast prefix */
- struct bgp_info *info); /* unicast info */
+ struct bgp *bgp, /* exterior instance, we hope */
+ struct prefix *prefix, /* unicast prefix */
+ struct bgp_path_info *info); /* unicast info */
-extern void
-vnc_import_bgp_exterior_del_route(struct bgp *bgp,
- struct prefix *prefix, /* unicast prefix */
- struct bgp_info *info); /* unicast info */
+extern void vnc_import_bgp_exterior_del_route(
+ struct bgp *bgp, struct prefix *prefix, /* unicast prefix */
+ struct bgp_path_info *info); /* unicast info */
extern void vnc_import_bgp_add_vnc_host_route_mode_resolve_nve(
struct bgp *bgp, struct prefix_rd *prd, /* RD */
struct bgp_table *table_rd, /* per-rd VPN route table */
struct prefix *prefix, /* VPN prefix */
- struct bgp_info *bi); /* new VPN host route */
+ struct bgp_path_info *bi); /* new VPN host route */
extern void vnc_import_bgp_del_vnc_host_route_mode_resolve_nve(
struct bgp *bgp, struct prefix_rd *prd, /* RD */
struct bgp_table *table_rd, /* per-rd VPN route table */
struct prefix *prefix, /* VPN prefix */
- struct bgp_info *bi); /* old VPN host route */
+ struct bgp_path_info *bi); /* old VPN host route */
#endif /* _QUAGGA_RFAPI_VNC_IMPORT_BGP_H_ */
extern void vnc_import_bgp_exterior_add_route_interior(
struct bgp *bgp, struct rfapi_import_table *it,
- struct agg_node *rn_interior, /* VPN IT node */
- struct bgp_info *bi_interior); /* VPN IT route */
+ struct agg_node *rn_interior, /* VPN IT node */
+ struct bgp_path_info *bi_interior); /* VPN IT route */
extern void vnc_import_bgp_exterior_del_route_interior(
struct bgp *bgp, struct rfapi_import_table *it,
- struct agg_node *rn_interior, /* VPN IT node */
- struct bgp_info *bi_interior); /* VPN IT route */
+ struct agg_node *rn_interior, /* VPN IT node */
+ struct bgp_path_info *bi_interior); /* VPN IT route */
extern void
vnc_import_bgp_exterior_redist_enable_it(struct bgp *bgp, afi_t afi,
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
- struct bgp_info *ri;
+ struct bgp_path_info *ri;
for (ri = rn->info; ri; ri = ri->next) {
if (ri->type
/\ struct bgp_node: a BGP destination/route/prefix
\/
- [ ] struct bgp_info: a BGP path (e.g. route received from a peer)
+ [ ] struct bgp_path_info: a BGP path (e.g. route received from a peer)
_
(_) struct bgp_nexthop_cache: a BGP nexthop
};
int test_mp_list_peer_count = sizeof(test_mp_list_peer) / sizeof(struct peer);
struct attr test_mp_list_attr[4];
-struct bgp_info test_mp_list_info[] = {
+struct bgp_path_info test_mp_list_info[] = {
{.peer = &test_mp_list_peer[0], .attr = &test_mp_list_attr[0]},
{.peer = &test_mp_list_peer[1], .attr = &test_mp_list_attr[1]},
{.peer = &test_mp_list_peer[2], .attr = &test_mp_list_attr[1]},
{.peer = &test_mp_list_peer[4], .attr = &test_mp_list_attr[3]},
};
int test_mp_list_info_count =
- sizeof(test_mp_list_info) / sizeof(struct bgp_info);
+ sizeof(test_mp_list_info) / sizeof(struct bgp_path_info);
static int setup_bgp_mp_list(testcase_t *t)
{
{
struct list mp_list;
struct listnode *mp_node;
- struct bgp_info *info;
+ struct bgp_path_info *info;
int i;
int test_result = TEST_PASSED;
bgp_mp_list_init(&mp_list);
};
/*=========================================================
- * Testcase for bgp_info_mpath_update
+ * Testcase for bgp_path_info_mpath_update
*/
struct bgp_node test_rn;
-static int setup_bgp_info_mpath_update(testcase_t *t)
+static int setup_bgp_path_info_mpath_update(testcase_t *t)
{
int i;
str2prefix("42.1.1.0/24", &test_rn.p);
setup_bgp_mp_list(t);
for (i = 0; i < test_mp_list_info_count; i++)
- bgp_info_add(&test_rn, &test_mp_list_info[i]);
+ bgp_path_info_add(&test_rn, &test_mp_list_info[i]);
return 0;
}
-static int run_bgp_info_mpath_update(testcase_t *t)
+static int run_bgp_path_info_mpath_update(testcase_t *t)
{
- struct bgp_info *new_best, *old_best, *mpath;
+ struct bgp_path_info *new_best, *old_best, *mpath;
struct list mp_list;
struct bgp_maxpaths_cfg mp_cfg = {3, 3};
int test_result = TEST_PASSED;
bgp_mp_list_add(&mp_list, &test_mp_list_info[1]);
new_best = &test_mp_list_info[3];
old_best = NULL;
- bgp_info_mpath_update(&test_rn, new_best, old_best, &mp_list, &mp_cfg);
+ bgp_path_info_mpath_update(&test_rn, new_best, old_best, &mp_list, &mp_cfg);
bgp_mp_list_clear(&mp_list);
- EXPECT_TRUE(bgp_info_mpath_count(new_best) == 2, test_result);
- mpath = bgp_info_mpath_first(new_best);
+ EXPECT_TRUE(bgp_path_info_mpath_count(new_best) == 2, test_result);
+ mpath = bgp_path_info_mpath_first(new_best);
EXPECT_TRUE(mpath == &test_mp_list_info[0], test_result);
EXPECT_TRUE(CHECK_FLAG(mpath->flags, BGP_PATH_MULTIPATH), test_result);
- mpath = bgp_info_mpath_next(mpath);
+ mpath = bgp_path_info_mpath_next(mpath);
EXPECT_TRUE(mpath == &test_mp_list_info[1], test_result);
EXPECT_TRUE(CHECK_FLAG(mpath->flags, BGP_PATH_MULTIPATH), test_result);
bgp_mp_list_add(&mp_list, &test_mp_list_info[1]);
new_best = &test_mp_list_info[0];
old_best = &test_mp_list_info[3];
- bgp_info_mpath_update(&test_rn, new_best, old_best, &mp_list, &mp_cfg);
+ bgp_path_info_mpath_update(&test_rn, new_best, old_best, &mp_list, &mp_cfg);
bgp_mp_list_clear(&mp_list);
- EXPECT_TRUE(bgp_info_mpath_count(new_best) == 1, test_result);
- mpath = bgp_info_mpath_first(new_best);
+ EXPECT_TRUE(bgp_path_info_mpath_count(new_best) == 1, test_result);
+ mpath = bgp_path_info_mpath_first(new_best);
EXPECT_TRUE(mpath == &test_mp_list_info[1], test_result);
EXPECT_TRUE(CHECK_FLAG(mpath->flags, BGP_PATH_MULTIPATH), test_result);
EXPECT_TRUE(!CHECK_FLAG(test_mp_list_info[0].flags, BGP_PATH_MULTIPATH),
return test_result;
}
-static int cleanup_bgp_info_mpath_update(testcase_t *t)
+static int cleanup_bgp_path_info_mpath_update(testcase_t *t)
{
int i;
return 0;
}
-testcase_t test_bgp_info_mpath_update = {
- .desc = "Test bgp_info_mpath_update",
- .setup = setup_bgp_info_mpath_update,
- .run = run_bgp_info_mpath_update,
- .cleanup = cleanup_bgp_info_mpath_update,
+testcase_t test_bgp_path_info_mpath_update = {
+ .desc = "Test bgp_path_info_mpath_update",
+ .setup = setup_bgp_path_info_mpath_update,
+ .run = run_bgp_path_info_mpath_update,
+ .cleanup = cleanup_bgp_path_info_mpath_update,
};
/*=========================================================
*/
testcase_t *all_tests[] = {
&test_bgp_cfg_maximum_paths, &test_bgp_mp_list,
- &test_bgp_info_mpath_update,
+ &test_bgp_path_info_mpath_update,
};
int all_tests_count = (sizeof(all_tests) / sizeof(testcase_t *));
TestMpath.okfail("bgp maximum-paths config")
TestMpath.okfail("bgp_mp_list")
-TestMpath.okfail("bgp_info_mpath_update")
+TestMpath.okfail("bgp_path_info_mpath_update")