summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 8061f34d2b..861600596e 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -42,6 +42,7 @@
#include "zebra/redistribute.h"
#include "zebra/zebra_routemap.h"
#include "lib/json.h"
+#include "lib/route_opaque.h"
#include "zebra/zebra_vxlan.h"
#include "zebra/zebra_evpn_mh.h"
#ifndef VTYSH_EXTRACT_PL
@@ -421,6 +422,8 @@ static void show_nexthop_detail_helper(struct vty *vty,
static void zebra_show_ip_route_opaque(struct vty *vty, struct route_entry *re,
struct json_object *json)
{
+ struct bgp_zebra_opaque bzo = {};
+
if (!re->opaque)
return;
@@ -433,13 +436,27 @@ static void zebra_show_ip_route_opaque(struct vty *vty, struct route_entry *re,
vty_out(vty, " Opaque Data: %s",
(char *)re->opaque->data);
break;
- case ZEBRA_ROUTE_BGP:
- if (json)
- json_object_string_add(json, "asPath",
- (char *)re->opaque->data);
- else
- vty_out(vty, " AS-Path: %s",
- (char *)re->opaque->data);
+ case ZEBRA_ROUTE_BGP: {
+ memcpy(&bzo, re->opaque->data, re->opaque->length);
+
+ if (json) {
+ json_object_string_add(json, "asPath", bzo.aspath);
+ json_object_string_add(json, "communities",
+ bzo.community);
+ json_object_string_add(json, "largeCommunities",
+ bzo.lcommunity);
+ } else {
+ vty_out(vty, " AS-Path : %s\n", bzo.aspath);
+
+ if (bzo.community[0] != '\0')
+ vty_out(vty, " Communities : %s\n",
+ bzo.community);
+
+ if (bzo.lcommunity[0] != '\0')
+ vty_out(vty, " Large-Communities: %s\n",
+ bzo.lcommunity);
+ }
+ }
default:
break;
}
@@ -2530,8 +2547,8 @@ DEFPY (evpn_mh_neigh_holdtime,
"Duration in seconds\n")
{
- return zebra_evpn_mh_neigh_holdtime_update(vty, duration,
- no ? true : false);
+ return zebra_evpn_mh_neigh_holdtime_update(vty, duration,
+ no ? true : false);
}
DEFPY (evpn_mh_startup_delay,