return rn;
}
-/* Allocate bgp_info_extra */
-static struct bgp_path_info_extra *bgp_info_extra_new(void)
+/* Allocate bgp_path_info_extra */
+static struct bgp_path_info_extra *bgp_path_info_extra_new(void)
{
struct bgp_path_info_extra *new;
new = XCALLOC(MTYPE_BGP_ROUTE_EXTRA,
return new;
}
-static void bgp_info_extra_free(struct bgp_path_info_extra **extra)
+static void bgp_path_info_extra_free(struct bgp_path_info_extra **extra)
{
struct bgp_path_info_extra *e;
*/
unsigned refcount;
- bi = bgp_info_lock(bi);
+ bi = bgp_path_info_lock(bi);
refcount = bi->net->lock - 1;
bgp_unlock_node((struct bgp_node *)bi->net);
if (!refcount)
bi->net = NULL;
- bgp_info_unlock(bi);
+ bgp_path_info_unlock(bi);
}
- bgp_info_unlock(e->parent);
+ bgp_path_info_unlock(e->parent);
e->parent = NULL;
}
*extra = NULL;
}
-/* Get bgp_info extra information for the given bgp_info, lazy allocated
- * if required.
+/* Get bgp_path_info extra information for the given bgp_path_info, lazy
+ * allocated if required.
*/
-struct bgp_path_info_extra *bgp_info_extra_get(struct bgp_path_info *ri)
+struct bgp_path_info_extra *bgp_path_info_extra_get(struct bgp_path_info *ri)
{
if (!ri->extra)
- ri->extra = bgp_info_extra_new();
+ ri->extra = bgp_path_info_extra_new();
return ri->extra;
}
/* Allocate new bgp info structure. */
-struct bgp_path_info *bgp_info_new(void)
+struct bgp_path_info *bgp_path_info_new(void)
{
return XCALLOC(MTYPE_BGP_ROUTE, sizeof(struct bgp_path_info));
}
/* Free bgp route information. */
-static void bgp_info_free(struct bgp_path_info *binfo)
+static void bgp_path_info_free(struct bgp_path_info *binfo)
{
if (binfo->attr)
bgp_attr_unintern(&binfo->attr);
bgp_unlink_nexthop(binfo);
- bgp_info_extra_free(&binfo->extra);
- bgp_info_mpath_free(&binfo->mpath);
+ bgp_path_info_extra_free(&binfo->extra);
+ bgp_path_info_mpath_free(&binfo->mpath);
- peer_unlock(binfo->peer); /* bgp_info peer reference */
+ peer_unlock(binfo->peer); /* bgp_path_info peer reference */
XFREE(MTYPE_BGP_ROUTE, binfo);
}
-struct bgp_path_info *bgp_info_lock(struct bgp_path_info *binfo)
+struct bgp_path_info *bgp_path_info_lock(struct bgp_path_info *binfo)
{
binfo->lock++;
return binfo;
}
-struct bgp_path_info *bgp_info_unlock(struct bgp_path_info *binfo)
+struct bgp_path_info *bgp_path_info_unlock(struct bgp_path_info *binfo)
{
assert(binfo && binfo->lock > 0);
binfo->lock--;
zlog_debug ("%s: unlocked and freeing", __func__);
zlog_backtrace (LOG_DEBUG);
#endif
- bgp_info_free(binfo);
+ bgp_path_info_free(binfo);
return NULL;
}
return binfo;
}
-void bgp_info_add(struct bgp_node *rn, struct bgp_path_info *ri)
+void bgp_path_info_add(struct bgp_node *rn, struct bgp_path_info *ri)
{
struct bgp_path_info *top;
top->prev = ri;
rn->info = ri;
- bgp_info_lock(ri);
+ bgp_path_info_lock(ri);
bgp_lock_node(rn);
- peer_lock(ri->peer); /* bgp_info peer reference */
+ peer_lock(ri->peer); /* bgp_path_info peer reference */
}
/* 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_path_info *ri)
+void bgp_path_info_reap(struct bgp_node *rn, struct bgp_path_info *ri)
{
if (ri->next)
ri->next->prev = ri->prev;
else
rn->info = ri->next;
- bgp_info_mpath_dequeue(ri);
- bgp_info_unlock(ri);
+ bgp_path_info_mpath_dequeue(ri);
+ bgp_path_info_unlock(ri);
bgp_unlock_node(rn);
}
-void bgp_info_delete(struct bgp_node *rn, struct bgp_path_info *ri)
+void bgp_path_info_delete(struct bgp_node *rn, struct bgp_path_info *ri)
{
- bgp_info_set_flag(rn, ri, BGP_PATH_REMOVED);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_REMOVED);
/* set of previous already took care of pcount */
UNSET_FLAG(ri->flags, BGP_PATH_VALID);
}
-/* undo the effects of a previous call to bgp_info_delete; typically
+/* undo the effects of a previous call to bgp_path_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_path_info *ri)
+void bgp_path_info_restore(struct bgp_node *rn, struct bgp_path_info *ri)
{
- bgp_info_unset_flag(rn, ri, BGP_PATH_REMOVED);
+ bgp_path_info_unset_flag(rn, ri, BGP_PATH_REMOVED);
/* unset of previous already took care of pcount */
SET_FLAG(ri->flags, BGP_PATH_VALID);
}
return (!(ri1->attr->label_index == ri2->attr->label_index));
}
-/* Set/unset bgp_info flags, adjusting any other state as needed.
+/* Set/unset bgp_path_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_path_info *ri,
- uint32_t flag)
+void bgp_path_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_path_info *ri,
- uint32_t flag)
+void bgp_path_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_path_info *ri, char *buf)
+void bgp_path_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_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)
+static int bgp_path_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)
{
struct attr *newattr, *existattr;
bgp_peer_sort_t new_sort;
}
if (debug)
- bgp_info_path_with_addpath_rx_str(new, new_buf);
+ bgp_path_info_path_with_addpath_rx_str(new, new_buf);
if (exist == NULL) {
if (debug)
}
if (debug) {
- bgp_info_path_with_addpath_rx_str(exist, exist_buf);
+ bgp_path_info_path_with_addpath_rx_str(exist, exist_buf);
zlog_debug("%s: Comparing %s flags 0x%x with %s flags 0x%x",
pfx_buf, new_buf, new->flags, exist_buf,
exist->flags);
prefix2str(&new->net->p, pfx_buf,
sizeof(*pfx_buf)
* PREFIX2STR_BUFFER);
- bgp_info_path_with_addpath_rx_str(new, new_buf);
- bgp_info_path_with_addpath_rx_str(exist,
- exist_buf);
+ bgp_path_info_path_with_addpath_rx_str(new,
+ new_buf);
+ bgp_path_info_path_with_addpath_rx_str(
+ exist, exist_buf);
}
if (newattr->sticky && !existattr->sticky) {
* 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_path_info *new,
- struct bgp_path_info *exist, char *pfx_buf,
- afi_t afi, safi_t safi)
+int bgp_path_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;
- ret = bgp_info_cmp(bgp, new, exist, &paths_eq, NULL, 0, pfx_buf, afi,
- safi);
+ ret = bgp_path_info_cmp(bgp, new, exist, &paths_eq, NULL, 0, pfx_buf,
+ afi, safi);
if (paths_eq)
ret = 0;
from = ri->peer;
filter = &peer->filter[afi][safi];
bgp = SUBGRP_INST(subgrp);
- riattr = bgp_info_mpath_count(ri) ? bgp_info_mpath_attr(ri) : ri->attr;
+ riattr = bgp_path_info_mpath_count(ri) ? bgp_path_info_mpath_attr(ri)
+ : ri->attr;
#if ENABLE_BGP_VNC
if (((afi == AFI_IP) || (afi == AFI_IP6)) && (safi == SAFI_MPLS_VPN)
/* Clear BGP_PATH_DMED_SELECTED for all paths */
for (ri1 = rn->info; ri1; ri1 = ri1->next)
- bgp_info_unset_flag(rn, ri1, BGP_PATH_DMED_SELECTED);
+ bgp_path_info_unset_flag(rn, ri1,
+ BGP_PATH_DMED_SELECTED);
for (ri1 = rn->info; ri1; ri1 = ri1->next) {
if (CHECK_FLAG(ri1->flags, BGP_PATH_DMED_CHECK))
|| aspath_cmp_left_confed(
ri1->attr->aspath,
ri2->attr->aspath)) {
- if (bgp_info_cmp(bgp, ri2,
- new_select,
- &paths_eq,
- mpath_cfg,
- debug, pfx_buf,
- afi, safi)) {
- bgp_info_unset_flag(
+ if (bgp_path_info_cmp(
+ bgp, ri2,
+ new_select,
+ &paths_eq,
+ mpath_cfg, debug,
+ pfx_buf, afi,
+ safi)) {
+ bgp_path_info_unset_flag(
rn, new_select,
BGP_PATH_DMED_SELECTED);
new_select = ri2;
}
- bgp_info_set_flag(
+ bgp_path_info_set_flag(
rn, ri2,
BGP_PATH_DMED_CHECK);
}
}
}
- bgp_info_set_flag(rn, new_select, BGP_PATH_DMED_CHECK);
- bgp_info_set_flag(rn, new_select,
- BGP_PATH_DMED_SELECTED);
+ bgp_path_info_set_flag(rn, new_select,
+ BGP_PATH_DMED_CHECK);
+ bgp_path_info_set_flag(rn, new_select,
+ BGP_PATH_DMED_SELECTED);
if (debug) {
- bgp_info_path_with_addpath_rx_str(new_select,
- path_buf);
+ bgp_path_info_path_with_addpath_rx_str(
+ new_select, path_buf);
zlog_debug("%s: %s is the bestpath from AS %u",
pfx_buf, path_buf,
aspath_get_first_as(
*/
if (CHECK_FLAG(ri->flags, BGP_PATH_REMOVED)
&& (ri != old_select))
- bgp_info_reap(rn, ri);
+ bgp_path_info_reap(rn, ri);
if (debug)
zlog_debug("%s: ri %p in holddown", __func__,
if (bgp_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED)
&& (!CHECK_FLAG(ri->flags, BGP_PATH_DMED_SELECTED))) {
- bgp_info_unset_flag(rn, ri, BGP_PATH_DMED_CHECK);
+ bgp_path_info_unset_flag(rn, ri, BGP_PATH_DMED_CHECK);
if (debug)
zlog_debug("%s: ri %p dmed", __func__, ri);
continue;
}
- bgp_info_unset_flag(rn, ri, BGP_PATH_DMED_CHECK);
+ bgp_path_info_unset_flag(rn, ri, BGP_PATH_DMED_CHECK);
- if (bgp_info_cmp(bgp, ri, new_select, &paths_eq, mpath_cfg,
- debug, pfx_buf, afi, safi)) {
+ if (bgp_path_info_cmp(bgp, ri, new_select, &paths_eq, mpath_cfg,
+ debug, pfx_buf, afi, safi)) {
new_select = ri;
}
}
*/
if (debug) {
if (new_select)
- bgp_info_path_with_addpath_rx_str(new_select, path_buf);
+ bgp_path_info_path_with_addpath_rx_str(new_select,
+ path_buf);
else
sprintf(path_buf, "NONE");
zlog_debug(
ri = nextri) {
if (debug)
- bgp_info_path_with_addpath_rx_str(ri, path_buf);
+ bgp_path_info_path_with_addpath_rx_str(
+ ri, path_buf);
if (ri == new_select) {
if (debug)
if (ri->peer->status != Established)
continue;
- if (!bgp_info_nexthop_cmp(ri, new_select)) {
+ if (!bgp_path_info_nexthop_cmp(ri, new_select)) {
if (debug)
zlog_debug(
"%s: %s has the same nexthop as the bestpath, skip it",
continue;
}
- bgp_info_cmp(bgp, ri, new_select, &paths_eq, mpath_cfg,
- debug, pfx_buf, afi, safi);
+ bgp_path_info_cmp(bgp, ri, new_select, &paths_eq,
+ mpath_cfg, debug, pfx_buf, afi, safi);
if (paths_eq) {
if (debug)
}
}
- bgp_info_mpath_update(rn, new_select, old_select, &mp_list, mpath_cfg);
- bgp_info_mpath_aggregate_update(new_select, old_select);
+ bgp_path_info_mpath_update(rn, new_select, old_select, &mp_list,
+ mpath_cfg);
+ bgp_path_info_mpath_aggregate_update(new_select, old_select);
bgp_mp_list_clear(&mp_list);
result->old = old_select;
/*
* If this is multipath, check all selected paths for any nexthop change
*/
- for (mpinfo = bgp_info_mpath_first(selected); mpinfo;
- mpinfo = bgp_info_mpath_next(mpinfo)) {
+ for (mpinfo = bgp_path_info_mpath_first(selected); mpinfo;
+ mpinfo = bgp_path_info_mpath_next(mpinfo)) {
if (CHECK_FLAG(mpinfo->flags, BGP_PATH_IGP_CHANGED)
|| CHECK_FLAG(mpinfo->flags, BGP_PATH_ATTR_CHANGED))
return 1;
}
if (old_select)
- bgp_info_unset_flag(rn, old_select, BGP_PATH_SELECTED);
+ bgp_path_info_unset_flag(rn, old_select, BGP_PATH_SELECTED);
if (new_select) {
if (debug)
zlog_debug("%s: setting SELECTED flag", __func__);
- bgp_info_set_flag(rn, new_select, BGP_PATH_SELECTED);
- bgp_info_unset_flag(rn, new_select, BGP_PATH_ATTR_CHANGED);
+ bgp_path_info_set_flag(rn, new_select, BGP_PATH_SELECTED);
+ bgp_path_info_unset_flag(rn, new_select, BGP_PATH_ATTR_CHANGED);
UNSET_FLAG(new_select->flags, BGP_PATH_MULTIPATH_CHG);
}
/* Clear any route change flags. */
bgp_zebra_clear_route_change_flags(rn);
- /* Reap old select bgp_info, if it has been removed */
+ /* Reap old select bgp_path_info, if it has been removed */
if (old_select && CHECK_FLAG(old_select->flags, BGP_PATH_REMOVED))
- bgp_info_reap(rn, old_select);
+ bgp_path_info_reap(rn, old_select);
UNSET_FLAG(rn->flags, BGP_NODE_PROCESS_SCHEDULED);
return;
bgp_aggregate_decrement(peer->bgp, &rn->p, ri, afi, safi);
if (!CHECK_FLAG(ri->flags, BGP_PATH_HISTORY))
- bgp_info_delete(rn, ri); /* keep historical info */
+ bgp_path_info_delete(rn, ri); /* keep historical info */
bgp_process(peer->bgp, rn, afi, safi);
}
struct prefix_rd *prd)
{
/* apply dampening, if result is suppressed, we'll be retaining
- * the bgp_info in the RIB for historical reference.
+ * the bgp_path_info in the RIB for historical reference.
*/
if (CHECK_FLAG(peer->bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)
&& peer->sort == BGP_PEER_EBGP)
if (!CHECK_FLAG(ri->flags, BGP_PATH_REMOVED)
&& attrhash_cmp(ri->attr, attr_new)
&& (!has_valid_label
- || memcmp(&(bgp_info_extra_get(ri))->label, label,
+ || memcmp(&(bgp_path_info_extra_get(ri))->label, label,
num_labels * sizeof(mpls_label_t))
== 0)
&& (overlay_index_equal(
/* graceful restart STALE flag unset. */
if (CHECK_FLAG(ri->flags, BGP_PATH_STALE)) {
- bgp_info_unset_flag(rn, ri,
- BGP_PATH_STALE);
+ bgp_path_info_unset_flag(
+ rn, ri, BGP_PATH_STALE);
bgp_process(bgp, rn, afi, safi);
}
}
peer->host, pfx_buf);
}
- bgp_info_restore(rn, ri);
+ bgp_path_info_restore(rn, ri);
}
/* Received Logging. */
/* graceful restart STALE flag unset. */
if (CHECK_FLAG(ri->flags, BGP_PATH_STALE))
- bgp_info_unset_flag(rn, ri, BGP_PATH_STALE);
+ bgp_path_info_unset_flag(rn, ri, BGP_PATH_STALE);
/* The attribute is changed. */
- bgp_info_set_flag(rn, ri, BGP_PATH_ATTR_CHANGED);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_ATTR_CHANGED);
/* implicit withdraw, decrement aggregate and pcount here.
* only if update is accepted, they'll increment below.
/* Update MPLS label */
if (has_valid_label) {
- extra = bgp_info_extra_get(ri);
+ extra = bgp_path_info_extra_get(ri);
memcpy(&extra->label, label,
num_labels * sizeof(mpls_label_t));
extra->num_labels = num_labels;
if (bgp_find_or_add_nexthop(bgp, bgp_nexthop, afi,
ri, NULL, connected)
|| CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
- bgp_info_set_flag(rn, ri, BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_VALID);
else {
if (BGP_DEBUG(nht, NHT)) {
char buf1[INET6_ADDRSTRLEN];
zlog_debug("%s(%s): NH unresolved",
__FUNCTION__, buf1);
}
- bgp_info_unset_flag(rn, ri, BGP_PATH_VALID);
+ bgp_path_info_unset_flag(rn, ri,
+ BGP_PATH_VALID);
}
} else
- bgp_info_set_flag(rn, ri, BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_VALID);
#if ENABLE_BGP_VNC
if (safi == SAFI_MPLS_VPN) {
/* Update MPLS label */
if (has_valid_label) {
- extra = bgp_info_extra_get(new);
+ extra = bgp_path_info_extra_get(new);
memcpy(&extra->label, label, num_labels * sizeof(mpls_label_t));
extra->num_labels = num_labels;
if (!(afi == AFI_L2VPN && safi == SAFI_EVPN))
if (bgp_find_or_add_nexthop(bgp, bgp, afi, new, NULL, connected)
|| CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
- bgp_info_set_flag(rn, new, BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, new, BGP_PATH_VALID);
else {
if (BGP_DEBUG(nht, NHT)) {
char buf1[INET6_ADDRSTRLEN];
zlog_debug("%s(%s): NH unresolved",
__FUNCTION__, buf1);
}
- bgp_info_unset_flag(rn, new, BGP_PATH_VALID);
+ bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);
}
} else
- bgp_info_set_flag(rn, new, BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, new, BGP_PATH_VALID);
/* Addpath ID */
new->addpath_rx_id = addpath_id;
bgp_aggregate_increment(bgp, p, new, afi, safi);
/* Register new BGP information. */
- bgp_info_add(rn, new);
+ bgp_path_info_add(rn, new);
/* route_node_get lock */
bgp_unlock_node(rn);
&& peer->nsf[afi][safi]
&& !CHECK_FLAG(ri->flags, BGP_PATH_STALE)
&& !CHECK_FLAG(ri->flags, BGP_PATH_UNUSEABLE))
- bgp_info_set_flag(rn, ri, BGP_PATH_STALE);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_STALE);
else {
/* If this is an EVPN route, process for
* un-import. */
continue;
if (force)
- bgp_info_reap(rn, ri);
+ bgp_path_info_reap(rn, ri);
else {
struct bgp_clear_node_queue *cnq;
if (bgp_fibupd_safi(safi))
bgp_zebra_withdraw(&rn->p, ri,
bgp, safi);
- bgp_info_reap(rn, ri);
+ bgp_path_info_reap(rn, ri);
}
}
}
return;
} else {
/* The attribute is changed. */
- bgp_info_set_flag(rn, ri, BGP_PATH_ATTR_CHANGED);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_ATTR_CHANGED);
/* Rewrite BGP route information. */
if (CHECK_FLAG(ri->flags, BGP_PATH_REMOVED))
- bgp_info_restore(rn, ri);
+ bgp_path_info_restore(rn, ri);
else
bgp_aggregate_decrement(bgp, p, ri, afi, safi);
#if ENABLE_BGP_VNC
if (bgp_find_or_add_nexthop(bgp, bgp_nexthop,
afi, ri, NULL, 0))
- bgp_info_set_flag(rn, ri,
- BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, ri,
+ BGP_PATH_VALID);
else {
if (BGP_DEBUG(nht, NHT)) {
char buf1[INET6_ADDRSTRLEN];
"%s(%s): Route not in table, not advertising",
__FUNCTION__, buf1);
}
- bgp_info_unset_flag(rn, ri,
- BGP_PATH_VALID);
+ bgp_path_info_unset_flag(
+ rn, ri, BGP_PATH_VALID);
}
} else {
/* Delete the NHT structure if any, if we're
* process interaction
*/
bgp_unlink_nexthop(ri);
- bgp_info_set_flag(rn, ri, BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_VALID);
}
/* Process change. */
bgp_aggregate_increment(bgp, p, ri, afi, safi);
if (bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK)
&& (safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST)) {
if (bgp_find_or_add_nexthop(bgp, bgp, afi, new, NULL, 0))
- bgp_info_set_flag(rn, new, BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, new, BGP_PATH_VALID);
else {
if (BGP_DEBUG(nht, NHT)) {
char buf1[INET6_ADDRSTRLEN];
"%s(%s): Route not in table, not advertising",
__FUNCTION__, buf1);
}
- bgp_info_unset_flag(rn, new, BGP_PATH_VALID);
+ bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);
}
} else {
/* Delete the NHT structure if any, if we're toggling between
*/
bgp_unlink_nexthop(new);
- bgp_info_set_flag(rn, new, BGP_PATH_VALID);
+ bgp_path_info_set_flag(rn, new, BGP_PATH_VALID);
}
/* Aggregate address increment. */
bgp_aggregate_increment(bgp, p, new, afi, safi);
/* Register new BGP information. */
- bgp_info_add(rn, new);
+ bgp_path_info_add(rn, new);
/* route_node_get lock */
bgp_unlock_node(rn);
}
bgp_aggregate_decrement(bgp, p, ri, afi, safi);
bgp_unlink_nexthop(ri);
- bgp_info_delete(rn, ri);
+ bgp_path_info_delete(rn, ri);
bgp_process(bgp, rn, afi, safi);
}
vpn_leak_to_vrf_withdraw(bgp, ri);
}
bgp_aggregate_decrement(bgp, p, ri, afi, safi);
- bgp_info_delete(rn, ri);
+ bgp_path_info_delete(rn, ri);
bgp_process(bgp, rn, afi, safi);
}
return;
} else {
/* The attribute is changed. */
- bgp_info_set_flag(rn, ri, BGP_PATH_ATTR_CHANGED);
+ bgp_path_info_set_flag(rn, ri, BGP_PATH_ATTR_CHANGED);
/* Rewrite BGP route information. */
if (CHECK_FLAG(ri->flags, BGP_PATH_REMOVED))
- bgp_info_restore(rn, ri);
+ bgp_path_info_restore(rn, ri);
else
bgp_aggregate_decrement(bgp, p, ri, afi, safi);
bgp_attr_unintern(&ri->attr);
new = info_make(ZEBRA_ROUTE_BGP, BGP_ROUTE_STATIC, 0, bgp->peer_self,
attr_new, rn);
SET_FLAG(new->flags, BGP_PATH_VALID);
- new->extra = bgp_info_extra_new();
+ new->extra = bgp_path_info_extra_new();
if (num_labels) {
new->extra->label[0] = bgp_static->label;
new->extra->num_labels = num_labels;
bgp_aggregate_increment(bgp, p, new, afi, safi);
/* Register new BGP information. */
- bgp_info_add(rn, new);
+ bgp_path_info_add(rn, new);
/* route_node_get lock */
bgp_unlock_node(rn);
bgp_aggregate_decrement(bgp, &rn->p, ri, afi,
safi);
bgp_unlink_nexthop(ri);
- bgp_info_delete(rn, ri);
+ bgp_path_info_delete(rn, ri);
bgp_process(bgp, rn, afi, safi);
}
}
* Mark the old as unusable
*/
if (ri)
- bgp_info_delete(rn, ri);
+ bgp_path_info_delete(rn, ri);
new = info_make(
ZEBRA_ROUTE_BGP, BGP_ROUTE_AGGREGATE, 0, bgp->peer_self,
rn);
SET_FLAG(new->flags, BGP_PATH_VALID);
- bgp_info_add(rn, new);
+ bgp_path_info_add(rn, new);
bgp_process(bgp, rn, afi, safi);
} else {
for (ri = rn->info; ri; ri = ri->next)
/* Withdraw static BGP route from routing table. */
if (ri) {
- bgp_info_delete(rn, ri);
+ bgp_path_info_delete(rn, ri);
bgp_process(bgp, rn, afi, safi);
}
}
* aggregated route announcements.
*/
if (aggregate->summary_only) {
- (bgp_info_extra_get(ri))->suppress++;
- bgp_info_set_flag(rn, ri,
- BGP_PATH_ATTR_CHANGED);
+ (bgp_path_info_extra_get(ri))->suppress++;
+ bgp_path_info_set_flag(rn, ri,
+ BGP_PATH_ATTR_CHANGED);
match++;
}
aggregate->count++;
if (aggregate->summary_only)
- (bgp_info_extra_get(rinew))->suppress++;
+ (bgp_path_info_extra_get(rinew))->suppress++;
if (origin < rinew->attr->origin)
origin = rinew->attr->origin;
ri->extra->suppress--;
if (ri->extra->suppress == 0) {
- bgp_info_set_flag(
+ bgp_path_info_set_flag(
rn, ri, BGP_PATH_ATTR_CHANGED);
match++;
}
return;
} else {
/* The attribute is changed. */
- bgp_info_set_flag(bn, bi,
- BGP_PATH_ATTR_CHANGED);
+ bgp_path_info_set_flag(bn, bi,
+ BGP_PATH_ATTR_CHANGED);
/* Rewrite BGP route information. */
if (CHECK_FLAG(bi->flags, BGP_PATH_REMOVED))
- bgp_info_restore(bn, bi);
+ bgp_path_info_restore(bn, bi);
else
bgp_aggregate_decrement(bgp, p, bi, afi,
SAFI_UNICAST);
SET_FLAG(new->flags, BGP_PATH_VALID);
bgp_aggregate_increment(bgp, p, new, afi, SAFI_UNICAST);
- bgp_info_add(bn, new);
+ bgp_path_info_add(bn, new);
bgp_unlock_node(bn);
bgp_process(bgp, bn, afi, SAFI_UNICAST);
bgp, ri);
}
bgp_aggregate_decrement(bgp, p, ri, afi, SAFI_UNICAST);
- bgp_info_delete(rn, ri);
+ bgp_path_info_delete(rn, ri);
bgp_process(bgp, rn, afi, SAFI_UNICAST);
}
bgp_unlock_node(rn);
}
bgp_aggregate_decrement(bgp, &rn->p, ri, afi,
SAFI_UNICAST);
- bgp_info_delete(rn, ri);
+ bgp_path_info_delete(rn, ri);
bgp_process(bgp, rn, afi, SAFI_UNICAST);
}
}
normal_list,
};
-/* Print the short form route status for a bgp_info */
+/* Print the short form route status for a bgp_path_info */
static void route_vty_short_status_out(struct vty *vty,
struct bgp_path_info *binfo,
json_object *json_path)
if (CHECK_FLAG(binfo->flags, BGP_PATH_MULTIPATH)
|| (CHECK_FLAG(binfo->flags, BGP_PATH_SELECTED)
- && bgp_info_mpath_count(binfo))) {
+ && bgp_path_info_mpath_count(binfo))) {
if (json_paths)
json_object_boolean_true_add(json_path,
"multipath");