summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/routemap.h2
-rw-r--r--lib/routemap_cli.c29
2 files changed, 31 insertions, 0 deletions
diff --git a/lib/routemap.h b/lib/routemap.h
index 5b6b64eaeb..97a62c8ace 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -348,6 +348,8 @@ DECLARE_QOBJ_TYPE(route_map);
(strmatch(A, "frr-bgp-route-map:set-extcommunity-rt"))
#define IS_SET_EXTCOMMUNITY_SOO(A) \
(strmatch(A, "frr-bgp-route-map:set-extcommunity-soo"))
+#define IS_SET_EXTCOMMUNITY_LB(A) \
+ (strmatch(A, "frr-bgp-route-map:set-extcommunity-lb"))
#define IS_SET_AGGREGATOR(A) \
(strmatch(A, "frr-bgp-route-map:aggregator"))
#define IS_SET_AS_PREPEND(A) \
diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c
index e11b9eea74..7c788a4e79 100644
--- a/lib/routemap_cli.c
+++ b/lib/routemap_cli.c
@@ -25,6 +25,7 @@
#include "lib/command.h"
#include "lib/northbound_cli.h"
#include "lib/routemap.h"
+#include "bgpd/bgp_ecommunity.h"
#ifndef VTYSH_EXTRACT_PL
#include "lib/routemap_cli_clippy.c"
@@ -1189,6 +1190,34 @@ void route_map_action_show(struct vty *vty, struct lyd_node *dnode,
yang_dnode_get_string(
dnode,
"./rmap-set-action/frr-bgp-route-map:extcommunity-soo"));
+ } else if (IS_SET_EXTCOMMUNITY_LB(action)) {
+ enum ecommunity_lb_type lb_type;
+ char str[VTY_BUFSIZ];
+ uint16_t bandwidth;
+
+ lb_type = yang_dnode_get_enum(
+ dnode,
+ "./rmap-set-action/frr-bgp-route-map:extcommunity-lb/lb-type");
+ switch (lb_type) {
+ case EXPLICIT_BANDWIDTH:
+ bandwidth = yang_dnode_get_uint16(
+ dnode,
+ "./rmap-set-action/frr-bgp-route-map:extcommunity-lb/bandwidth");
+ snprintf(str, sizeof(str), "%d", bandwidth);
+ break;
+ case CUMULATIVE_BANDWIDTH:
+ snprintf(str, sizeof(str), "%s", "cumulative");
+ break;
+ case COMPUTED_BANDWIDTH:
+ snprintf(str, sizeof(str), "%s", "num-multipaths");
+ }
+
+ if (yang_dnode_get_bool(
+ dnode,
+ "./rmap-set-action/frr-bgp-route-map:extcommunity-lb/two-octet-as-specific"))
+ strlcat(str, " non-transitive", sizeof(str));
+
+ vty_out(vty, " set extcommunity bandwidth %s\n", str);
} else if (IS_SET_AGGREGATOR(action)) {
vty_out(vty, " set aggregator as %s %s\n",
yang_dnode_get_string(