if (json)
json_prefix = json_object_new_object();
- if (rn->info) {
+ pi = bgp_node_get_bgp_path_info(rn);
+ if (pi) {
/* Overall header/legend displayed once. */
if (header) {
bgp_evpn_show_route_header(vty, bgp,
/* For EVPN, the prefix is displayed for each path (to fit in
* with code that already exists).
*/
- for (pi = rn->info; pi; pi = pi->next) {
+ for (; pi; pi = pi->next) {
json_object *json_path = NULL;
if (json)
if (json)
json_prefix = json_object_new_object();
- if (rn->info) {
+ pi = bgp_node_get_bgp_path_info(rn);
+ if (pi) {
/* Overall header/legend displayed once. */
if (header) {
bgp_evpn_show_route_header(vty, bgp,
/* For EVPN, the prefix is displayed for each path (to fit in
* with code that already exists).
*/
- for (pi = rn->info; pi; pi = pi->next) {
+ for (; pi; pi = pi->next) {
json_object *json_path = NULL;
if (vtep_ip.s_addr
if (prd && memcmp(rn->p.u.val, prd->val, 8) != 0)
continue;
- if ((table = rn->info) == NULL)
+ table = bgp_node_get_bgp_table_info(rn);
+ if (!table)
continue;
rd_header = 1;
tbl_ver = table->version;
for (rm = bgp_table_top(table); rm; rm = bgp_route_next(rm))
- for (pi = rm->info; pi; pi = pi->next) {
+ for (pi = bgp_node_get_bgp_path_info(rm); pi;
+ pi = pi->next) {
total_count++;
if (type == bgp_show_type_neighbor) {
union sockunion *su = output_arg;
/* See if route exists. */
build_evpn_type3_prefix(&p, orig_ip);
rn = bgp_node_lookup(vpn->route_table, (struct prefix *)&p);
- if (!rn || !rn->info) {
+ if (!rn || !bgp_node_has_bgp_path_info_data(rn)) {
if (!json)
vty_out(vty, "%% Network not in table\n");
return;
route_vty_out_detail_header(vty, bgp, rn, NULL, afi, safi, json);
/* Display each path for this prefix. */
- for (pi = rn->info; pi; pi = pi->next) {
+ for (pi = bgp_node_get_bgp_path_info(rn); pi; pi = pi->next) {
json_object *json_path = NULL;
if (json)
/* See if route exists. Look for both non-sticky and sticky. */
build_evpn_type2_prefix(&p, mac, ip);
rn = bgp_node_lookup(vpn->route_table, (struct prefix *)&p);
- if (!rn || !rn->info) {
+ if (!rn || !bgp_node_has_bgp_path_info_data(rn)) {
if (!json)
vty_out(vty, "%% Network not in table\n");
return;
route_vty_out_detail_header(vty, bgp, rn, NULL, afi, safi, json);
/* Display each path for this prefix. */
- for (pi = rn->info; pi; pi = pi->next) {
+ for (pi = bgp_node_get_bgp_path_info(rn); pi; pi = pi->next) {
json_object *json_path = NULL;
if (json)
build_evpn_type2_prefix(&p, mac, ip);
rn = bgp_afi_node_lookup(bgp->rib[afi][safi], afi, safi,
(struct prefix *)&p, prd);
- if (!rn || !rn->info) {
+ if (!rn || !bgp_node_has_bgp_path_info_data(rn)) {
if (!json)
vty_out(vty, "%% Network not in table\n");
return;
json_paths = json_object_new_array();
/* Display each path for this prefix. */
- for (pi = rn->info; pi; pi = pi->next) {
+ for (pi = bgp_node_get_bgp_path_info(rn); pi; pi = pi->next) {
json_object *json_path = NULL;
if (json)
if (!rd_rn)
return;
- table = (struct bgp_table *)rd_rn->info;
+ table = bgp_node_get_bgp_table_info(rd_rn);
if (table == NULL)
return;
if (json)
json_prefix = json_object_new_object();
- if (rn->info) {
+ pi = bgp_node_get_bgp_path_info(rn);
+ if (pi) {
/* RD header and legend - once overall. */
if (rd_header && !json) {
vty_out(vty,
json_paths = json_object_new_array();
/* Display each path for this prefix. */
- for (pi = rn->info; pi; pi = pi->next) {
+ for (; pi; pi = pi->next) {
json_object *json_path = NULL;
if (json)
int add_rd_to_json = 0;
uint64_t tbl_ver;
- table = (struct bgp_table *)rd_rn->info;
+ table = bgp_node_get_bgp_table_info(rd_rn);
if (table == NULL)
continue;
if (type && evp->prefix.route_type != type)
continue;
- if (rn->info) {
+ pi = bgp_node_get_bgp_path_info(rn);
+ if (pi) {
/* Overall header/legend displayed once. */
if (header) {
bgp_evpn_show_route_header(vty, bgp,
* fit in
* with code that already exists).
*/
- for (pi = rn->info; pi; pi = pi->next) {
+ for (; pi; pi = pi->next) {
json_object *json_path = NULL;
path_cnt++;
add_prefix_to_json = 1;
ecom)) {
ecom_str = ecommunity_ecom2str(
ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
- vty_out(vty, " route-target import %s\n", ecom_str);
+ vty_out(vty, " route-target import %s\n", ecom_str);
XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
}
}
ecom)) {
ecom_str = ecommunity_ecom2str(
ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
- vty_out(vty, " route-target export %s\n", ecom_str);
+ vty_out(vty, " route-target export %s\n", ecom_str);
XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
}
}