mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 15:33:56 +00:00
bgpd: Add advertsie-all-vni in show bgp neighbor
Ticket: CM-17249 Review: CCR-6558 Testing: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
This commit is contained in:
parent
d77114b704
commit
dff8f48da3
@ -2200,41 +2200,52 @@ bgp_evpn_route2json (struct prefix_evpn *p, json_object *json)
|
|||||||
if (!json)
|
if (!json)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (p->prefix.route_type == BGP_EVPN_IMET_ROUTE)
|
if (p->prefix.route_type == BGP_EVPN_IMET_ROUTE) {
|
||||||
{
|
|
||||||
json_object_int_add (json, "routeType", p->prefix.route_type);
|
json_object_int_add (json, "routeType", p->prefix.route_type);
|
||||||
json_object_int_add (json, "ethTag", 0);
|
json_object_int_add (json, "ethTag", 0);
|
||||||
json_object_int_add (json, "ipLen", IS_EVPN_PREFIX_IPADDR_V4 (p) ? IPV4_MAX_BITLEN : IPV6_MAX_BITLEN);
|
json_object_int_add (json,
|
||||||
json_object_string_add (json, "ip", inet_ntoa (p->prefix.ip.ipaddr_v4));
|
"ipLen",
|
||||||
|
IS_EVPN_PREFIX_IPADDR_V4 (p) ?
|
||||||
|
IPV4_MAX_BITLEN : IPV6_MAX_BITLEN);
|
||||||
|
json_object_string_add (json, "ip",
|
||||||
|
inet_ntoa (p->prefix.ip.ipaddr_v4));
|
||||||
}
|
}
|
||||||
else if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE)
|
else if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) {
|
||||||
{
|
if (IS_EVPN_PREFIX_IPADDR_NONE(p)) {
|
||||||
if (IS_EVPN_PREFIX_IPADDR_NONE(p))
|
|
||||||
{
|
|
||||||
json_object_int_add (json, "routeType", p->prefix.route_type);
|
json_object_int_add (json, "routeType", p->prefix.route_type);
|
||||||
json_object_int_add (json, "esi", 0); /* TODO: we don't support esi yet */
|
json_object_int_add (json, "esi", 0); /* TODO: we don't support esi yet */
|
||||||
json_object_int_add (json, "ethTag", 0);
|
json_object_int_add (json, "ethTag", 0);
|
||||||
json_object_int_add (json, "macLen", 8 * ETHER_ADDR_LEN);
|
json_object_int_add (json, "macLen", 8 * ETH_ALEN);
|
||||||
json_object_string_add (json, "mac", prefix_mac2str (&p->prefix.mac, buf1, sizeof (buf1)));
|
json_object_string_add (json, "mac",
|
||||||
}
|
prefix_mac2str (&p->prefix.mac,
|
||||||
else
|
buf1, sizeof (buf1)));
|
||||||
{
|
} else {
|
||||||
u_char family;
|
u_char family;
|
||||||
|
|
||||||
family = IS_EVPN_PREFIX_IPADDR_V4(p) ? \
|
family = IS_EVPN_PREFIX_IPADDR_V4(p) ? \
|
||||||
AF_INET : AF_INET6;
|
AF_INET : AF_INET6;
|
||||||
|
|
||||||
json_object_int_add (json, "routeType", p->prefix.route_type);
|
json_object_int_add (json, "routeType",
|
||||||
|
p->prefix.route_type);
|
||||||
json_object_int_add (json, "esi", 0); /* TODO: we don't support esi yet */
|
json_object_int_add (json, "esi", 0); /* TODO: we don't support esi yet */
|
||||||
json_object_int_add (json, "ethTag", 0);
|
json_object_int_add (json, "ethTag", 0);
|
||||||
json_object_int_add (json, "macLen", 8 * ETHER_ADDR_LEN);
|
json_object_int_add (json, "macLen",
|
||||||
json_object_string_add (json, "mac", prefix_mac2str (&p->prefix.mac, buf1, sizeof (buf1)));
|
8 * ETH_ALEN);
|
||||||
json_object_int_add (json, "ipLen", IS_EVPN_PREFIX_IPADDR_V4 (p) ? IPV4_MAX_BITLEN : IPV6_MAX_BITLEN);
|
json_object_string_add (json, "mac",
|
||||||
json_object_string_add (json, "ip", inet_ntop (family, &p->prefix.ip.ip.addr, buf2, PREFIX2STR_BUFFER));
|
prefix_mac2str (&p->prefix.mac,
|
||||||
|
buf1,
|
||||||
|
sizeof (buf1)));
|
||||||
|
json_object_int_add (json, "ipLen",
|
||||||
|
IS_EVPN_PREFIX_IPADDR_V4 (p) ?
|
||||||
|
IPV4_MAX_BITLEN :
|
||||||
|
IPV6_MAX_BITLEN);
|
||||||
|
json_object_string_add (json, "ip",
|
||||||
|
inet_ntop (family,
|
||||||
|
&p->prefix.ip.ip.addr,
|
||||||
|
buf2,
|
||||||
|
PREFIX2STR_BUFFER));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Currently, this is to cater to other AF_ETHERNET code. */
|
/* Currently, this is to cater to other AF_ETHERNET code. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ static void show_import_rt_entry(struct hash_backet *backet, void *args[])
|
|||||||
vty = args[0];
|
vty = args[0];
|
||||||
json = args[1];
|
json = args[1];
|
||||||
|
|
||||||
display_import_rt(vty, irt);
|
display_import_rt(vty, irt, json);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -7602,6 +7602,12 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
|
|||||||
"defaultNotSent");
|
"defaultNotSent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (afi == AFI_L2VPN && safi == SAFI_EVPN) {
|
||||||
|
if (p->bgp->advertise_all_vni)
|
||||||
|
json_object_boolean_true_add(json_addr,
|
||||||
|
"advertiseAllVnis");
|
||||||
|
}
|
||||||
|
|
||||||
if (filter->plist[FILTER_IN].name
|
if (filter->plist[FILTER_IN].name
|
||||||
|| filter->dlist[FILTER_IN].name
|
|| filter->dlist[FILTER_IN].name
|
||||||
|| filter->aslist[FILTER_IN].name
|
|| filter->aslist[FILTER_IN].name
|
||||||
@ -7867,6 +7873,12 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
|
|||||||
vty_out(vty, " default not sent\n");
|
vty_out(vty, " default not sent\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* advertise-vni-all */
|
||||||
|
if (afi == AFI_L2VPN && safi == SAFI_EVPN) {
|
||||||
|
if (p->bgp->advertise_all_vni)
|
||||||
|
vty_out(vty, " advertise-all-vni\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (filter->plist[FILTER_IN].name
|
if (filter->plist[FILTER_IN].name
|
||||||
|| filter->dlist[FILTER_IN].name
|
|| filter->dlist[FILTER_IN].name
|
||||||
|| filter->aslist[FILTER_IN].name
|
|| filter->aslist[FILTER_IN].name
|
||||||
|
Loading…
Reference in New Issue
Block a user