summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-19 19:57:35 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-19 19:57:35 +0200
commitb96879c0d135201f0a6de8c0a587d477410c4693 (patch)
treee152d5fbed4efdac71ad533d39dd805c298fc4c9 /bgpd/bgp_route.c
parentMerge pull request #1194 from dwalton76/igmp-rejoin-existing-group (diff)
downloadfrr-b96879c0d135201f0a6de8c0a587d477410c4693.tar.xz
frr-b96879c0d135201f0a6de8c0a587d477410c4693.zip
bgpd: Add large community json support
Add the ability to display large commnunity json support Fixes: 1191 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_route.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index e3f63f11b..a12abd9fd 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7328,6 +7328,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
json_object *json_cluster_list = NULL;
json_object *json_cluster_list_list = NULL;
json_object *json_ext_community = NULL;
+ json_object *json_lcommunity = NULL;
json_object *json_last_update = NULL;
json_object *json_nexthop_global = NULL;
json_object *json_nexthop_ll = NULL;
@@ -7900,9 +7901,20 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
}
/* Line 6 display Large community */
- if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES))
- vty_out(vty, " Large Community: %s\n",
- attr->lcommunity->str);
+ if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES)) {
+ if (json_paths) {
+ json_lcommunity = json_object_new_object();
+ json_object_string_add(json_lcommunity,
+ "string",
+ attr->lcommunity->str);
+ json_object_object_add(json_path,
+ "largeCommunity",
+ json_lcommunity);
+ } else {
+ vty_out(vty, " Large Community: %s\n",
+ attr->lcommunity->str);
+ }
+ }
/* Line 7 display Originator, Cluster-id */
if ((attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))