for (bpi = (bn ? bgp_dest_get_bgp_path_info(bn) : NULL); bpi;
bpi = bpi->next) {
-
vnc_zlog_debug_verbose(
"%s: trying bpi=%p, bpi->peer=%p, bpi->type=%d, bpi->sub_type=%d, bpi->extra->vnc.export.rfapi_handle=%p, local_pref=%" PRIu64,
__func__, bpi, bpi->peer, bpi->type, bpi->sub_type,
- (bpi->extra ? bpi->extra->vnc.export.rfapi_handle
+ (bpi->extra ? bpi->extra->vnc->vnc.export.rfapi_handle
: NULL),
CHECK_FLAG(bpi->attr->flag,
ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF)
- ? bpi->attr->local_pref : 0));
-
- if (bpi->peer == peer && bpi->type == type
- && bpi->sub_type == sub_type && bpi->extra
- && bpi->extra->vnc.export.rfapi_handle == (void *)rfd) {
+ ? bpi->attr->local_pref
+ : 0));
+ if (bpi->peer == peer && bpi->type == type &&
+ bpi->sub_type == sub_type && bpi->extra &&
+ bpi->extra->vnc->vnc.export.rfapi_handle == (void *)rfd) {
vnc_zlog_debug_verbose("%s: matched it", __func__);
break;
* route. Leave the route itself in place.
* TBD add return code reporting of success/failure
*/
- if (!bpi || !bpi->extra
- || !bpi->extra->vnc.export.local_nexthops) {
+ if (!bpi || !bpi->extra ||
+ !bpi->extra->vnc->vnc.export.local_nexthops) {
/*
* no local nexthops
*/
struct listnode *node;
struct rfapi_nexthop *pLnh = NULL;
- for (ALL_LIST_ELEMENTS_RO(bpi->extra->vnc.export.local_nexthops,
+ for (ALL_LIST_ELEMENTS_RO(bpi->extra->vnc->vnc.export
+ .local_nexthops,
node, pLnh)) {
-
if (prefix_same(&pLnh->addr, &lnh->addr)) {
break;
}
}
if (pLnh) {
- listnode_delete(bpi->extra->vnc.export.local_nexthops,
+ listnode_delete(bpi->extra->vnc->vnc.export.local_nexthops,
pLnh);
/* silly rabbit, listnode_delete doesn't invoke
/*
* Delete local_nexthops list
*/
- if (bpi->extra && bpi->extra->vnc.export.local_nexthops)
- list_delete(&bpi->extra->vnc.export.local_nexthops);
+ if (bpi->extra && bpi->extra->vnc->vnc.export.local_nexthops)
+ list_delete(&bpi->extra->vnc->vnc.export.local_nexthops);
bgp_aggregate_decrement(bgp, p, bpi, afi, safi);
bgp_path_info_delete(bn, bpi);
*/
for (bpi = bgp_dest_get_bgp_path_info(bn); bpi; bpi = bpi->next) {
/* probably only need to check
- * bpi->extra->vnc.export.rfapi_handle */
- if (bpi->peer == rfd->peer && bpi->type == type
- && bpi->sub_type == sub_type && bpi->extra
- && bpi->extra->vnc.export.rfapi_handle == (void *)rfd) {
-
+ * bpi->extra->vnc->vnc.export.rfapi_handle */
+ if (bpi->peer == rfd->peer && bpi->type == type &&
+ bpi->sub_type == sub_type && bpi->extra &&
+ bpi->extra->vnc->vnc.export.rfapi_handle == (void *)rfd) {
break;
}
}
* what is advertised via BGP
*/
if (lnh) {
- if (!bpi->extra->vnc.export.local_nexthops) {
+ if (!bpi->extra->vnc->vnc.export.local_nexthops) {
/* TBD make arrangements to free when needed */
- bpi->extra->vnc.export.local_nexthops =
+ bpi->extra->vnc->vnc.export.local_nexthops =
list_new();
- bpi->extra->vnc.export.local_nexthops->del =
+ bpi->extra->vnc->vnc.export.local_nexthops->del =
rfapi_nexthop_free;
}
struct listnode *node;
struct rfapi_nexthop *pLnh = NULL;
- for (ALL_LIST_ELEMENTS_RO(
- bpi->extra->vnc.export.local_nexthops,
- node, pLnh)) {
-
+ for (ALL_LIST_ELEMENTS_RO(bpi->extra->vnc->vnc.export
+ .local_nexthops,
+ node, pLnh)) {
if (prefix_same(&pLnh->addr, &lnh->addr)) {
break;
}
*/
if (!pLnh) {
pLnh = rfapi_nexthop_new(lnh);
- listnode_add(
- bpi->extra->vnc.export.local_nexthops,
- pLnh);
+ listnode_add(bpi->extra->vnc->vnc.export
+ .local_nexthops,
+ pLnh);
}
}
/* save backref to rfapi handle */
bgp_path_info_extra_get(new);
- new->extra->vnc.export.rfapi_handle = (void *)rfd;
+ new->extra->vnc = XCALLOC(MTYPE_BGP_ROUTE_EXTRA_VNC,
+ sizeof(struct bgp_path_info_extra_vnc));
+ new->extra->vnc->vnc.export.rfapi_handle = (void *)rfd;
encode_label(label_val, &new->extra->label[0]);
/* debug */
* advertisement
*/
if (bpi->extra) {
- switch (bpi->extra->vnc.import.un_family) {
+ switch (bpi->extra->vnc->vnc.import.un_family) {
case AF_INET:
if (p) {
- p->family = bpi->extra->vnc.import.un_family;
- p->u.prefix4 = bpi->extra->vnc.import.un.addr4;
+ p->family =
+ bpi->extra->vnc->vnc.import.un_family;
+ p->u.prefix4 =
+ bpi->extra->vnc->vnc.import.un.addr4;
p->prefixlen = IPV4_MAX_BITLEN;
}
return 0;
case AF_INET6:
if (p) {
- p->family = bpi->extra->vnc.import.un_family;
- p->u.prefix6 = bpi->extra->vnc.import.un.addr6;
+ p->family =
+ bpi->extra->vnc->vnc.import.un_family;
+ p->u.prefix6 =
+ bpi->extra->vnc->vnc.import.un.addr6;
p->prefixlen = IPV6_MAX_BITLEN;
}
return 0;
new->attr = bgp_attr_intern(attr);
bgp_path_info_extra_get(new);
+ new->extra->vnc = XCALLOC(MTYPE_BGP_ROUTE_EXTRA_VNC,
+ sizeof(struct bgp_path_info_extra_vnc));
if (prd) {
- new->extra->vnc.import.rd = *prd;
- new->extra->vnc.import.create_time = monotime(NULL);
+ new->extra->vnc->vnc.import.rd = *prd;
+ new->extra->vnc->vnc.import.create_time = monotime(NULL);
}
if (label)
encode_label(*label, &new->extra->label[0]);
* If there is a timer waiting to delete this bpi, cancel
* the timer and delete immediately
*/
- if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED)
- && bpi->extra->vnc.import.timer) {
+ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) &&
+ bpi->extra->vnc->vnc.import.timer) {
struct rfapi_withdraw *wcb =
- EVENT_ARG(bpi->extra->vnc.import.timer);
+ EVENT_ARG(bpi->extra->vnc->vnc.import.timer);
XFREE(MTYPE_RFAPI_WITHDRAW, wcb);
- EVENT_OFF(bpi->extra->vnc.import.timer);
+ EVENT_OFF(bpi->extra->vnc->vnc.import.timer);
}
next = bpi->next;
*/
if (rfapiGetVncTunnelUnAddr(bpi1->attr, &pfx_un1)) {
if (bpi1->extra) {
- pfx_un1.family = bpi1->extra->vnc.import.un_family;
- switch (bpi1->extra->vnc.import.un_family) {
+ pfx_un1.family = bpi1->extra->vnc->vnc.import.un_family;
+ switch (bpi1->extra->vnc->vnc.import.un_family) {
case AF_INET:
pfx_un1.u.prefix4 =
- bpi1->extra->vnc.import.un.addr4;
+ bpi1->extra->vnc->vnc.import.un.addr4;
break;
case AF_INET6:
pfx_un1.u.prefix6 =
- bpi1->extra->vnc.import.un.addr6;
+ bpi1->extra->vnc->vnc.import.un.addr6;
break;
default:
pfx_un1.family = AF_UNSPEC;
if (rfapiGetVncTunnelUnAddr(bpi2->attr, &pfx_un2)) {
if (bpi2->extra) {
- pfx_un2.family = bpi2->extra->vnc.import.un_family;
- switch (bpi2->extra->vnc.import.un_family) {
+ pfx_un2.family = bpi2->extra->vnc->vnc.import.un_family;
+ switch (bpi2->extra->vnc->vnc.import.un_family) {
case AF_INET:
pfx_un2.u.prefix4 =
- bpi2->extra->vnc.import.un.addr4;
+ bpi2->extra->vnc->vnc.import.un.addr4;
break;
case AF_INET6:
pfx_un2.u.prefix6 =
- bpi2->extra->vnc.import.un.addr6;
+ bpi2->extra->vnc->vnc.import.un.addr6;
break;
default:
pfx_un2.family = AF_UNSPEC;
new->prefix = *rprefix;
- if (bpi->extra
- && decode_rd_type(bpi->extra->vnc.import.rd.val)
- == RD_TYPE_VNC_ETH) {
+ if (bpi->extra && decode_rd_type(bpi->extra->vnc->vnc.import.rd.val) ==
+ RD_TYPE_VNC_ETH) {
/* ethernet */
struct rfapi_vn_option *vo;
&vo->v.l2addr.tag_id);
/* local_nve_id comes from lower byte of RD type */
- vo->v.l2addr.local_nve_id = bpi->extra->vnc.import.rd.val[1];
+ vo->v.l2addr.local_nve_id =
+ bpi->extra->vnc->vnc.import.rd.val[1];
/* label comes from MP_REACH_NLRI label */
vo->v.l2addr.label = decode_label(&bpi->extra->label[0]);
* If there is an auxiliary prefix (i.e., host IP address),
* use it as the nexthop prefix instead of the query prefix
*/
- if (bpi->extra->vnc.import.aux_prefix.family) {
- rfapiQprefix2Rprefix(&bpi->extra->vnc.import.aux_prefix,
+ if (bpi->extra->vnc->vnc.import.aux_prefix.family) {
+ rfapiQprefix2Rprefix(&bpi->extra->vnc->vnc.import
+ .aux_prefix,
&new->prefix);
}
}
/*
* use cached UN address from ENCAP route
*/
- new->un_address.addr_family = bpi->extra->vnc.import.un_family;
+ new->un_address.addr_family =
+ bpi->extra->vnc->vnc.import.un_family;
switch (new->un_address.addr_family) {
case AF_INET:
new->un_address.addr.v4 =
- bpi->extra->vnc.import.un.addr4;
+ bpi->extra->vnc->vnc.import.un.addr4;
break;
case AF_INET6:
new->un_address.addr.v6 =
- bpi->extra->vnc.import.un.addr6;
+ bpi->extra->vnc->vnc.import.un.addr6;
break;
default:
zlog_warn("%s: invalid UN addr family (%d) for bpi %p",
if (is_l2) {
/* L2 routes: semantic nexthop in aux_prefix; VN addr
* ain't it */
- pfx_vn = bpi->extra->vnc.import.aux_prefix;
+ pfx_vn = bpi->extra->vnc->vnc.import.aux_prefix;
} else {
rfapiNexthop2Prefix(bpi->attr, &pfx_vn);
}
/*
* compare RDs
*/
- return vnc_prefix_cmp(
- (const struct prefix *)&bpi1->extra->vnc.import.rd,
- (const struct prefix *)&bpi2->extra->vnc.import.rd);
+ return vnc_prefix_cmp((const struct prefix *)&bpi1->extra->vnc->vnc
+ .import.rd,
+ (const struct prefix *)&bpi2->extra->vnc->vnc
+ .import.rd);
}
/*
/*
* compare RDs
*/
- rc = vnc_prefix_cmp((struct prefix *)&bpi1->extra->vnc.import.rd,
- (struct prefix *)&bpi2->extra->vnc.import.rd);
+ rc = vnc_prefix_cmp((struct prefix *)&bpi1->extra->vnc->vnc.import.rd,
+ (struct prefix *)&bpi2->extra->vnc->vnc.import.rd);
if (rc) {
return rc;
}
* because there is no guarantee of the order the test key and
* the real key will be passed)
*/
- if ((bpi1->extra->vnc.import.aux_prefix.family == AF_ETHERNET
- && (bpi1->extra->vnc.import.aux_prefix.prefixlen == 1))
- || (bpi2->extra->vnc.import.aux_prefix.family == AF_ETHERNET
- && (bpi2->extra->vnc.import.aux_prefix.prefixlen == 1))) {
-
+ if ((bpi1->extra->vnc->vnc.import.aux_prefix.family == AF_ETHERNET &&
+ (bpi1->extra->vnc->vnc.import.aux_prefix.prefixlen == 1)) ||
+ (bpi2->extra->vnc->vnc.import.aux_prefix.family == AF_ETHERNET &&
+ (bpi2->extra->vnc->vnc.import.aux_prefix.prefixlen == 1))) {
/*
* wildcard aux address specified
*/
return 0;
}
- return vnc_prefix_cmp(&bpi1->extra->vnc.import.aux_prefix,
- &bpi2->extra->vnc.import.aux_prefix);
+ return vnc_prefix_cmp(&bpi1->extra->vnc->vnc.import.aux_prefix,
+ &bpi2->extra->vnc->vnc.import.aux_prefix);
}
assert(bpi->extra);
vnc_zlog_debug_verbose("%s: bpi %p, peer %p, rd %pRDP", __func__, bpi,
- bpi->peer, &bpi->extra->vnc.import.rd);
+ bpi->peer, &bpi->extra->vnc->vnc.import.rd);
sl = RFAPI_RDINDEX_W_ALLOC(rn);
if (!sl) {
char buf[RD_ADDRSTRLEN];
char buf_aux_pfx[PREFIX_STRLEN];
- prefix_rd2str(
- &k->extra->vnc.import.rd, buf, sizeof(buf),
- bgp_get_asnotation(k->peer ? k->peer->bgp : NULL));
- if (k->extra->vnc.import.aux_prefix.family) {
- prefix2str(&k->extra->vnc.import.aux_prefix,
+ prefix_rd2str(&k->extra->vnc->vnc.import.rd, buf, sizeof(buf),
+ bgp_get_asnotation(k->peer ? k->peer->bgp : NULL));
+ if (k->extra->vnc->vnc.import.aux_prefix.family) {
+ prefix2str(&k->extra->vnc->vnc.import.aux_prefix,
buf_aux_pfx, sizeof(buf_aux_pfx));
} else
strlcpy(buf_aux_pfx, "(none)", sizeof(buf_aux_pfx));
int rc;
struct bgp_path_info bpi_fake = {0};
struct bgp_path_info_extra bpi_extra = {0};
+ struct bgp_path_info_extra_vnc bpi_extra_vnc = { 0 };
struct bgp_path_info *bpi_result;
sl = RFAPI_RDINDEX(rn);
for (bpi_result = rn->info; bpi_result;
bpi_result = bpi_result->next) {
#ifdef DEBUG_BI_SEARCH
- vnc_zlog_debug_verbose(
- "%s: bpi has prd=%pRDP, peer=%p", __func__,
- &bpi_result->extra->vnc.import.rd,
- bpi_result->peer);
+ vnc_zlog_debug_verbose("%s: bpi has prd=%pRDP, peer=%p",
+ __func__,
+ &bpi_result->extra->vnc->vnc
+ .import.rd,
+ bpi_result->peer);
#endif
- if (peer == bpi_result->peer
- && !prefix_cmp((struct prefix *)&bpi_result->extra
- ->vnc.import.rd,
- (struct prefix *)prd)) {
-
+ if (peer == bpi_result->peer &&
+ !prefix_cmp((struct prefix *)&bpi_result->extra->vnc
+ ->vnc.import.rd,
+ (struct prefix *)prd)) {
#ifdef DEBUG_BI_SEARCH
vnc_zlog_debug_verbose(
"%s: peer and RD same, doing aux_prefix check",
__func__);
#endif
- if (!aux_prefix
- || !prefix_cmp(
- aux_prefix,
- &bpi_result->extra->vnc.import
- .aux_prefix)) {
-
+ if (!aux_prefix ||
+ !prefix_cmp(aux_prefix,
+ &bpi_result->extra->vnc->vnc
+ .import.aux_prefix)) {
#ifdef DEBUG_BI_SEARCH
vnc_zlog_debug_verbose("%s: match",
__func__);
bpi_fake.peer = peer;
bpi_fake.extra = &bpi_extra;
- bpi_fake.extra->vnc.import.rd = *prd;
+ bpi_fake.extra->vnc = &bpi_extra_vnc;
+ bpi_fake.extra->vnc->vnc.import.rd = *prd;
if (aux_prefix) {
- bpi_fake.extra->vnc.import.aux_prefix = *aux_prefix;
+ bpi_fake.extra->vnc->vnc.import.aux_prefix = *aux_prefix;
} else {
/* wildcard */
- bpi_fake.extra->vnc.import.aux_prefix.family = AF_ETHERNET;
- bpi_fake.extra->vnc.import.aux_prefix.prefixlen = 1;
+ bpi_fake.extra->vnc->vnc.import.aux_prefix.family = AF_ETHERNET;
+ bpi_fake.extra->vnc->vnc.import.aux_prefix.prefixlen = 1;
}
rc = skiplist_search(sl, (void *)&bpi_fake, (void *)&bpi_result);
int rc;
vnc_zlog_debug_verbose("%s: bpi %p, peer %p, rd %pRDP", __func__, bpi,
- bpi->peer, &bpi->extra->vnc.import.rd);
+ bpi->peer, &bpi->extra->vnc->vnc.import.rd);
sl = RFAPI_RDINDEX(rn);
assert(sl);
RFAPI_MONITOR_ENCAP_W_ALLOC(rn) = m;
/* for easy lookup when deleting vpn route */
- vpn_bpi->extra->vnc.import.hme = m;
+ vpn_bpi->extra->vnc->vnc.import.hme = m;
- vnc_zlog_debug_verbose(
- "%s: it=%p, vpn_bpi=%p, afi=%d, encap rn=%p, setting vpn_bpi->extra->vnc.import.hme=%p",
- __func__, import_table, vpn_bpi, afi, rn, m);
+ vnc_zlog_debug_verbose("%s: it=%p, vpn_bpi=%p, afi=%d, encap rn=%p, setting vpn_bpi->extra->vnc->vnc.import.hme=%p",
+ __func__, import_table, vpn_bpi, afi, rn, m);
RFAPI_CHECK_REFCOUNT(rn, SAFI_ENCAP, 0);
bgp_attr_intern(vpn_bpi->attr);
vnc_zlog_debug_verbose("%s: vpn_bpi=%p", __func__, vpn_bpi);
if (vpn_bpi->extra) {
struct rfapi_monitor_encap *hme =
- vpn_bpi->extra->vnc.import.hme;
+ vpn_bpi->extra->vnc->vnc.import.hme;
if (hme) {
agg_unlock_node(hme->rn); /* decr ref count */
XFREE(MTYPE_RFAPI_MONITOR_ENCAP, hme);
- vpn_bpi->extra->vnc.import.hme = NULL;
+ vpn_bpi->extra->vnc->vnc.import.hme = NULL;
}
}
}
vnc_zlog_debug_verbose("%s: vpn_bpi->extra=%p", __func__,
vpn_bpi->extra);
- vpn_bpi->extra->vnc.import.un_family = AF_INET;
- vpn_bpi->extra->vnc.import.un.addr4 =
+ vpn_bpi->extra->vnc->vnc.import.un_family = AF_INET;
+ vpn_bpi->extra->vnc->vnc.import.un.addr4 =
encap_bpi->attr->mp_nexthop_global_in;
break;
case AF_INET6:
- vpn_bpi->extra->vnc.import.un_family = AF_INET6;
- vpn_bpi->extra->vnc.import.un.addr6 =
+ vpn_bpi->extra->vnc->vnc.import.un_family = AF_INET6;
+ vpn_bpi->extra->vnc->vnc.import.un.addr6 =
encap_bpi->attr->mp_nexthop_global;
break;
default:
zlog_warn("%s: invalid encap nexthop length: %d", __func__,
encap_bpi->attr->mp_nexthop_len);
- vpn_bpi->extra->vnc.import.un_family = AF_UNSPEC;
+ vpn_bpi->extra->vnc->vnc.import.un_family = AF_UNSPEC;
break;
}
}
__func__);
return 1;
}
- vpn_bpi->extra->vnc.import.un_family = AF_UNSPEC;
- memset(&vpn_bpi->extra->vnc.import.un, 0,
- sizeof(vpn_bpi->extra->vnc.import.un));
+ vpn_bpi->extra->vnc->vnc.import.un_family = AF_UNSPEC;
+ memset(&vpn_bpi->extra->vnc->vnc.import.un, 0,
+ sizeof(vpn_bpi->extra->vnc->vnc.import.un));
if (CHECK_FLAG(vpn_bpi->flags, BGP_PATH_VALID)) {
if (rfapiGetVncTunnelUnAddr(vpn_bpi->attr, NULL)) {
UNSET_FLAG(vpn_bpi->flags, BGP_PATH_VALID);
assert(bpi->extra);
if (lifetime > UINT32_MAX / 1001) {
/* sub-optimal case, but will probably never happen */
- bpi->extra->vnc.import.timer = NULL;
+ bpi->extra->vnc->vnc.import.timer = NULL;
event_add_timer(bm->master, timer_service_func, wcb, lifetime,
- &bpi->extra->vnc.import.timer);
+ &bpi->extra->vnc->vnc.import.timer);
} else {
static uint32_t jitter;
uint32_t lifetime_msec;
lifetime_msec = (lifetime * 1000) + jitter;
- bpi->extra->vnc.import.timer = NULL;
+ bpi->extra->vnc->vnc.import.timer = NULL;
event_add_timer_msec(bm->master, timer_service_func, wcb,
lifetime_msec,
- &bpi->extra->vnc.import.timer);
+ &bpi->extra->vnc->vnc.import.timer);
}
/* re-sort route list (BGP_PATH_REMOVED routes are last) */
* Compare RDs
*
* RD of import table bpi is in
- * bpi->extra->vnc.import.rd RD of info_orig is in prd
+ * bpi->extra->vnc->vnc.import.rd RD of info_orig is in prd
*/
if (!bpi->extra) {
vnc_zlog_debug_verbose("%s: no bpi->extra",
__func__);
continue;
}
- if (prefix_cmp(
- (struct prefix *)&bpi->extra->vnc.import.rd,
- (struct prefix *)prd)) {
-
+ if (prefix_cmp((struct prefix *)&bpi->extra->vnc->vnc
+ .import.rd,
+ (struct prefix *)prd)) {
vnc_zlog_debug_verbose("%s: prd does not match",
__func__);
continue;
* a previous withdraw, we must cancel its
* timer.
*/
- if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED)
- && bpi->extra->vnc.import.timer) {
+ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) &&
+ bpi->extra->vnc->vnc.import.timer) {
struct rfapi_withdraw *wcb = EVENT_ARG(
- bpi->extra->vnc.import.timer);
+ bpi->extra->vnc->vnc.import.timer);
XFREE(MTYPE_RFAPI_WITHDRAW, wcb);
- EVENT_OFF(bpi->extra->vnc.import.timer);
+ EVENT_OFF(bpi->extra->vnc->vnc.import
+ .timer);
}
if (action == FIF_ACTION_UPDATE) {
vnc_zlog_debug_verbose(
"%s: removing holddown bpi matching NVE of new route",
__func__);
- if (bpi->extra->vnc.import.timer) {
+ if (bpi->extra->vnc->vnc.import.timer) {
struct rfapi_withdraw *wcb =
- EVENT_ARG(bpi->extra->vnc.import.timer);
+ EVENT_ARG(bpi->extra->vnc->vnc.import.timer);
XFREE(MTYPE_RFAPI_WITHDRAW, wcb);
- EVENT_OFF(bpi->extra->vnc.import.timer);
+ EVENT_OFF(bpi->extra->vnc->vnc.import.timer);
}
rfapiExpireEncapNow(import_table, rn, bpi);
}
* a previous withdraw, we must cancel its
* timer.
*/
- if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED)
- && bpi->extra->vnc.import.timer) {
+ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) &&
+ bpi->extra->vnc->vnc.import.timer) {
struct rfapi_withdraw *wcb = EVENT_ARG(
- bpi->extra->vnc.import.timer);
+ bpi->extra->vnc->vnc.import.timer);
XFREE(MTYPE_RFAPI_WITHDRAW, wcb);
- EVENT_OFF(bpi->extra->vnc.import.timer);
+ EVENT_OFF(bpi->extra->vnc->vnc.import
+ .timer);
import_table->holddown_count[afi] -= 1;
RFAPI_UPDATE_ITABLE_COUNT(
/* Not a big deal, just means VPN route got here first */
vnc_zlog_debug_verbose("%s: no encap route for vn addr %pFX",
__func__, &vn_prefix);
- info_new->extra->vnc.import.un_family = AF_UNSPEC;
+ info_new->extra->vnc->vnc.import.un_family = AF_UNSPEC;
}
if (rn) {
vnc_zlog_debug_verbose("%s: setting BPI's aux_prefix",
__func__);
- info_new->extra->vnc.import.aux_prefix = *aux_prefix;
+ info_new->extra->vnc->vnc.import.aux_prefix = *aux_prefix;
}
vnc_zlog_debug_verbose("%s: inserting bpi %p at prefix %pRN #%d",
vnc_zlog_debug_verbose(
"%s: removing holddown bpi matching NVE of new route",
__func__);
- if (bpi->extra->vnc.import.timer) {
+ if (bpi->extra->vnc->vnc.import.timer) {
struct rfapi_withdraw *wcb =
- EVENT_ARG(bpi->extra->vnc.import.timer);
+ EVENT_ARG(bpi->extra->vnc->vnc.import.timer);
XFREE(MTYPE_RFAPI_WITHDRAW, wcb);
- EVENT_OFF(bpi->extra->vnc.import.timer);
+ EVENT_OFF(bpi->extra->vnc->vnc.import.timer);
}
rfapiExpireVpnNow(import_table, rn, bpi, 0);
}
if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED)) {
if (!delete_holddown)
continue;
- if (bpi->extra->vnc.import.timer) {
- struct rfapi_withdraw *wcb =
- EVENT_ARG(
- bpi->extra->vnc
- .import
- .timer);
+ if (bpi->extra->vnc->vnc.import.timer) {
+ struct rfapi_withdraw *wcb = EVENT_ARG(
+ bpi->extra->vnc->vnc
+ .import.timer);
wcb->import_table
->holddown_count[afi] -=
afi, 1);
XFREE(MTYPE_RFAPI_WITHDRAW,
wcb);
- EVENT_OFF(bpi->extra->vnc.import
- .timer);
+ EVENT_OFF(bpi->extra->vnc->vnc
+ .import.timer);
}
} else {
if (!delete_active)
if (!bpi)
return;
- if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra
- && bpi->extra->vnc.import.timer) {
- struct event *t = (struct event *)bpi->extra->vnc.import.timer;
+ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra &&
+ bpi->extra->vnc->vnc.import.timer) {
+ struct event *t =
+ (struct event *)bpi->extra->vnc->vnc.import.timer;
r = snprintf(p, REMAIN, " [%4lu] ",
event_timer_remain_second(t));
if (bpi->extra) {
/* TBD This valid only for SAFI_MPLS_VPN, but not for encap */
- if (decode_rd_type(bpi->extra->vnc.import.rd.val)
- == RD_TYPE_VNC_ETH) {
+ if (decode_rd_type(bpi->extra->vnc->vnc.import.rd.val) ==
+ RD_TYPE_VNC_ETH) {
has_macaddr = 1;
- memcpy(macaddr.octet, bpi->extra->vnc.import.rd.val + 2,
- 6);
- l2hid = bpi->extra->vnc.import.rd.val[1];
+ memcpy(macaddr.octet,
+ bpi->extra->vnc->vnc.import.rd.val + 2, 6);
+ l2hid = bpi->extra->vnc->vnc.import.rd.val[1];
}
}
l2o_buf.label, l2o_buf.logical_net_id, l2o_buf.local_nve_id,
HVTYNL);
}
- if (bpi->extra && bpi->extra->vnc.import.aux_prefix.family) {
+ if (bpi->extra && bpi->extra->vnc->vnc.import.aux_prefix.family) {
const char *sp;
- sp = rfapi_ntop(bpi->extra->vnc.import.aux_prefix.family,
- &bpi->extra->vnc.import.aux_prefix.u.prefix,
+ sp = rfapi_ntop(bpi->extra->vnc->vnc.import.aux_prefix.family,
+ &bpi->extra->vnc->vnc.import.aux_prefix.u.prefix,
buf, BUFSIZ);
buf[BUFSIZ - 1] = 0;
if (sp) {
fp(out, "%-10s ", buf_lifetime);
}
- if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra
- && bpi->extra->vnc.import.timer) {
-
+ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra &&
+ bpi->extra->vnc->vnc.import.timer) {
uint32_t remaining;
time_t age;
char buf_age[BUFSIZ];
- struct event *t = (struct event *)bpi->extra->vnc.import.timer;
+ struct event *t =
+ (struct event *)bpi->extra->vnc->vnc.import.timer;
remaining = event_timer_remain_second(t);
#ifdef RFAPI_REGISTRATIONS_REPORT_AGE
fp(out, "%-10s ", buf_age);
} else if (RFAPI_LOCAL_BI(bpi)) {
-
char buf_age[BUFSIZ];
- if (bpi->extra && bpi->extra->vnc.import.create_time) {
- rfapiFormatAge(bpi->extra->vnc.import.create_time,
+ if (bpi->extra && bpi->extra->vnc->vnc.import.create_time) {
+ rfapiFormatAge(bpi->extra->vnc->vnc.import.create_time,
buf_age, BUFSIZ);
} else {
buf_age[0] = '?';
* print that on the next line
*/
- if (bpi->extra && bpi->extra->vnc.import.aux_prefix.family) {
+ if (bpi->extra && bpi->extra->vnc->vnc.import.aux_prefix.family) {
const char *sp;
- sp = rfapi_ntop(
- bpi->extra->vnc.import.aux_prefix.family,
- &bpi->extra->vnc.import.aux_prefix.u.prefix,
- buf_ntop, BUFSIZ);
+ sp = rfapi_ntop(bpi->extra->vnc->vnc.import.aux_prefix
+ .family,
+ &bpi->extra->vnc->vnc.import.aux_prefix
+ .u.prefix,
+ buf_ntop, BUFSIZ);
buf_ntop[BUFSIZ - 1] = 0;
if (sp && strcmp(buf_vn, sp) != 0) {
vty_out(vty, " bd=%p%s", bd, HVTYNL);
for (bpi = bgp_dest_get_bgp_path_info(bd); bpi; bpi = bpi->next) {
- if (bpi->peer == rfd->peer && bpi->type == type
- && bpi->sub_type == BGP_ROUTE_RFP && bpi->extra
- && bpi->extra->vnc.export.rfapi_handle == (void *)rfd) {
-
+ if (bpi->peer == rfd->peer && bpi->type == type &&
+ bpi->sub_type == BGP_ROUTE_RFP && bpi->extra &&
+ bpi->extra->vnc->vnc.export.rfapi_handle == (void *)rfd) {
rfapiPrintBi(vty, bpi);
printed = 1;
}