summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2019-06-14 02:55:38 +0200
committerChirag Shah <chirag@cumulusnetworks.com>2019-06-21 23:21:38 +0200
commit6f214dd377588ffc44224c07ad3839c36051178c (patch)
treeef7b26d8240199c4320e26dff056b25ff827cf6e /bgpd/bgp_route.c
parentMerge pull request #4583 from donaldsharp/no_pim_trace_detail (diff)
downloadfrr-6f214dd377588ffc44224c07ad3839c36051178c.tar.xz
frr-6f214dd377588ffc44224c07ad3839c36051178c.zip
bgpd: print ecom in evpn route output
EVPN route's extended community include important informations like Mobility sequence, router mac, and RT values, include the ecomm in evpn brief output. Ticket:CM-25353 Testing Done: Validated in evpn deployment with routes. TOR#show bgp l2vpn evpn route ... Network Next Hop Metric LocPrf Weight Path Extended Community Route Distinguisher: 27.0.0.11:3 *> [2]:[0]:[0]:[48]:[00:02:00:00:00:04]:[128]:[fe80::202:ff:fe00:4] 36.0.0.11 0 4435 5546 i RT:5546:1008 ET:8 ND:Router Flag * [2]:[0]:[0]:[48]:[00:02:00:00:00:36] 36.0.0.11 0 4435 5546 i RT:5546:1008 RT:5546:4003 ET:8 MM:0, sticky MAC Rmac:44:38:39:ff:ff:01 *> [2]:[0]:[0]:[48]:[00:02:00:00:00:36] 36.0.0.11 0 4435 5546 i RT:5546:1008 RT:5546:4003 ET:8 MM:0, sticky MAC Rmac:44:38:39:ff:ff:01 * [3]:[0]:[32]:[36.0.0.11] 36.0.0.11 0 4435 5546 i RT:5546:1008 ET:8 *> [3]:[0]:[32]:[36.0.0.11] 36.0.0.11 0 4435 5546 i RT:5546:1008 ET:8 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 4ae018698..3e9afe039 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -6965,6 +6965,7 @@ void route_vty_out(struct vty *vty, struct prefix *p,
json_object *json_nexthops = NULL;
json_object *json_nexthop_global = NULL;
json_object *json_nexthop_ll = NULL;
+ json_object *json_ext_community = NULL;
char vrf_id_str[VRF_NAMSIZ] = {0};
bool nexthop_self =
CHECK_FLAG(path->flags, BGP_PATH_ANNC_NH_SELF) ? true : false;
@@ -7330,6 +7331,17 @@ void route_vty_out(struct vty *vty, struct prefix *p,
vty_out(vty, "%s", bgp_origin_str[attr->origin]);
if (json_paths) {
+ if (safi == SAFI_EVPN &&
+ attr->flag & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)) {
+ json_ext_community = json_object_new_object();
+ json_object_string_add(json_ext_community,
+ "string",
+ attr->ecommunity->str);
+ json_object_object_add(json_path,
+ "extendedCommunity",
+ json_ext_community);
+ }
+
if (nexthop_self)
json_object_boolean_true_add(json_path,
"announceNexthopSelf");
@@ -7363,6 +7375,13 @@ void route_vty_out(struct vty *vty, struct prefix *p,
json_object_array_add(json_paths, json_path);
} else {
vty_out(vty, "\n");
+
+ if (safi == SAFI_EVPN &&
+ attr->flag & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)) {
+ vty_out(vty, "%*s", 20, " ");
+ vty_out(vty, "%s\n", attr->ecommunity->str);
+ }
+
#if ENABLE_BGP_VNC
/* prints an additional line, indented, with VNC info, if
* present */