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>
This commit is contained in:
Donald Sharp 2017-09-19 13:57:35 -04:00
parent 6a989fc134
commit b96879c0d1

View File

@ -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))