summaryrefslogtreecommitdiff
path: root/lib/routemap_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/routemap_cli.c')
-rw-r--r--lib/routemap_cli.c61
1 files changed, 46 insertions, 15 deletions
diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c
index 75d1175886..88b341cac0 100644
--- a/lib/routemap_cli.c
+++ b/lib/routemap_cli.c
@@ -90,8 +90,8 @@ DEFPY_YANG(
int route_map_instance_cmp(const struct lyd_node *dnode1,
const struct lyd_node *dnode2)
{
- uint16_t seq1 = yang_dnode_get_uint16(dnode1, "./sequence");
- uint16_t seq2 = yang_dnode_get_uint16(dnode2, "./sequence");
+ uint16_t seq1 = yang_dnode_get_uint16(dnode1, "sequence");
+ uint16_t seq2 = yang_dnode_get_uint16(dnode2, "sequence");
return seq1 - seq2;
}
@@ -100,8 +100,8 @@ void route_map_instance_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
const char *name = yang_dnode_get_string(dnode, "../name");
- const char *action = yang_dnode_get_string(dnode, "./action");
- const char *sequence = yang_dnode_get_string(dnode, "./sequence");
+ const char *action = yang_dnode_get_string(dnode, "action");
+ const char *sequence = yang_dnode_get_string(dnode, "sequence");
vty_out(vty, "route-map %s %s %s\n", name, action, sequence);
@@ -188,7 +188,7 @@ DEFPY_YANG(
DEFPY_YANG(
match_ip_address_prefix_list,
match_ip_address_prefix_list_cmd,
- "match ip address prefix-list PREFIXLIST_NAME$name",
+ "match ip address prefix-list PREFIXLIST4_NAME$name",
MATCH_STR
IP_STR
"Match address of route\n"
@@ -209,7 +209,7 @@ DEFPY_YANG(
DEFPY_YANG(
no_match_ip_address_prefix_list, no_match_ip_address_prefix_list_cmd,
- "no match ip address prefix-list [PREFIXLIST_NAME]",
+ "no match ip address prefix-list [PREFIXLIST4_NAME]",
NO_STR
MATCH_STR
IP_STR
@@ -265,7 +265,7 @@ DEFPY_YANG(
DEFPY_YANG(
match_ip_next_hop_prefix_list,
match_ip_next_hop_prefix_list_cmd,
- "match ip next-hop prefix-list PREFIXLIST_NAME$name",
+ "match ip next-hop prefix-list PREFIXLIST4_NAME$name",
MATCH_STR
IP_STR
"Match next-hop address of route\n"
@@ -287,7 +287,7 @@ DEFPY_YANG(
DEFPY_YANG(
no_match_ip_next_hop_prefix_list,
no_match_ip_next_hop_prefix_list_cmd,
- "no match ip next-hop prefix-list [PREFIXLIST_NAME]",
+ "no match ip next-hop prefix-list [PREFIXLIST4_NAME]",
NO_STR
MATCH_STR
IP_STR
@@ -379,7 +379,7 @@ DEFPY_YANG(
DEFPY_YANG(
match_ipv6_address_prefix_list, match_ipv6_address_prefix_list_cmd,
- "match ipv6 address prefix-list PREFIXLIST_NAME$name",
+ "match ipv6 address prefix-list PREFIXLIST6_NAME$name",
MATCH_STR
IPV6_STR
"Match address of route\n"
@@ -401,7 +401,7 @@ DEFPY_YANG(
DEFPY_YANG(
no_match_ipv6_address_prefix_list,
no_match_ipv6_address_prefix_list_cmd,
- "no match ipv6 address prefix-list [PREFIXLIST_NAME]",
+ "no match ipv6 address prefix-list [PREFIXLIST6_NAME]",
NO_STR
MATCH_STR
IPV6_STR
@@ -526,7 +526,7 @@ DEFPY_YANG(
void route_map_condition_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
- const char *condition = yang_dnode_get_string(dnode, "./condition");
+ const char *condition = yang_dnode_get_string(dnode, "condition");
const struct lyd_node *ln;
const char *acl;
@@ -599,11 +599,14 @@ void route_map_condition_show(struct vty *vty, const struct lyd_node *dnode,
yang_dnode_get_string(
dnode,
"./rmap-match-condition/frr-zebra-route-map:ipv4-prefix-length"));
- } else if (IS_MATCH_SRC_PROTO(condition)) {
+ } else if (IS_MATCH_SRC_PROTO(condition) ||
+ IS_MATCH_BGP_SRC_PROTO(condition)) {
vty_out(vty, " match source-protocol %s\n",
yang_dnode_get_string(
dnode,
- "./rmap-match-condition/frr-zebra-route-map:source-protocol"));
+ IS_MATCH_SRC_PROTO(condition)
+ ? "./rmap-match-condition/frr-zebra-route-map:source-protocol"
+ : "./rmap-match-condition/frr-bgp-route-map:source-protocol"));
} else if (IS_MATCH_SRC_INSTANCE(condition)) {
vty_out(vty, " match source-instance %s\n",
yang_dnode_get_string(
@@ -726,6 +729,10 @@ void route_map_condition_show(struct vty *vty, const struct lyd_node *dnode,
dnode,
"./rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name-exact-match"))
vty_out(vty, " exact-match");
+ if (yang_dnode_get_bool(
+ dnode,
+ "./rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name-any"))
+ vty_out(vty, " any");
vty_out(vty, "\n");
} else if (IS_MATCH_LCOMMUNITY(condition)) {
vty_out(vty, " match large-community %s",
@@ -736,6 +743,10 @@ void route_map_condition_show(struct vty *vty, const struct lyd_node *dnode,
dnode,
"./rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name-exact-match"))
vty_out(vty, " exact-match");
+ if (yang_dnode_get_bool(
+ dnode,
+ "./rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name-any"))
+ vty_out(vty, " any");
vty_out(vty, "\n");
} else if (IS_MATCH_EXTCOMMUNITY(condition)) {
vty_out(vty, " match extcommunity %s\n",
@@ -1039,7 +1050,7 @@ DEFUN_YANG (no_set_srte_color,
void route_map_action_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
- const char *action = yang_dnode_get_string(dnode, "./action");
+ const char *action = yang_dnode_get_string(dnode, "action");
const struct lyd_node *ln;
const char *acl;
@@ -1091,7 +1102,7 @@ void route_map_action_show(struct vty *vty, const struct lyd_node *dnode,
"./rmap-set-action/max-metric"));
} else if (IS_SET_TAG(action)) {
vty_out(vty, " set tag %s\n",
- yang_dnode_get_string(dnode, "./rmap-set-action/tag"));
+ yang_dnode_get_string(dnode, "rmap-set-action/tag"));
} else if (IS_SET_SR_TE_COLOR(action)) {
vty_out(vty, " set sr-te color %s\n",
yang_dnode_get_string(dnode,
@@ -1183,6 +1194,16 @@ void route_map_action_show(struct vty *vty, const struct lyd_node *dnode,
assert(acl);
vty_out(vty, " set large-comm-list %s delete\n", acl);
+ } else if (IS_SET_EXTCOMM_LIST_DEL(action)) {
+ acl = NULL;
+ ln = yang_dnode_get(dnode, "rmap-set-action/frr-bgp-route-map:comm-list-name");
+
+ if (ln)
+ acl = yang_dnode_get_string(ln, NULL);
+
+ assert(acl);
+
+ vty_out(vty, " set extended-comm-list %s delete\n", acl);
} else if (IS_SET_LCOMMUNITY(action)) {
if (yang_dnode_exists(
dnode,
@@ -1218,6 +1239,11 @@ void route_map_action_show(struct vty *vty, const struct lyd_node *dnode,
yang_dnode_get_string(
dnode,
"./rmap-set-action/frr-bgp-route-map:extcommunity-rt"));
+ } else if (IS_SET_EXTCOMMUNITY_NT(action)) {
+ vty_out(vty, " set extcommunity nt %s\n",
+ yang_dnode_get_string(
+ dnode,
+ "./rmap-set-action/frr-bgp-route-map:extcommunity-nt"));
} else if (IS_SET_EXTCOMMUNITY_SOO(action)) {
vty_out(vty, " set extcommunity soo %s\n",
yang_dnode_get_string(
@@ -1251,6 +1277,11 @@ void route_map_action_show(struct vty *vty, const struct lyd_node *dnode,
strlcat(str, " non-transitive", sizeof(str));
vty_out(vty, " set extcommunity bandwidth %s\n", str);
+ } else if (IS_SET_EXTCOMMUNITY_COLOR(action)) {
+ vty_out(vty, " set extcommunity color %s\n",
+ yang_dnode_get_string(
+ dnode,
+ "./rmap-set-action/frr-bgp-route-map:extcommunity-color"));
} else if (IS_SET_EXTCOMMUNITY_NONE(action)) {
if (yang_dnode_get_bool(
dnode,