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.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c
index cadad15fa7..9360c7f529 100644
--- a/lib/routemap_cli.c
+++ b/lib/routemap_cli.c
@@ -103,7 +103,8 @@ DEFPY_YANG(
return nb_cli_apply_changes(vty, NULL);
}
-int route_map_instance_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2)
+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");
@@ -111,7 +112,7 @@ int route_map_instance_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2)
return seq1 - seq2;
}
-void route_map_instance_show(struct vty *vty, struct lyd_node *dnode,
+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");
@@ -122,7 +123,7 @@ void route_map_instance_show(struct vty *vty, struct lyd_node *dnode,
}
-void route_map_instance_show_end(struct vty *vty, struct lyd_node *dnode)
+void route_map_instance_show_end(struct vty *vty, const struct lyd_node *dnode)
{
vty_out(vty, "exit\n");
vty_out(vty, "!\n");
@@ -165,12 +166,10 @@ DEFPY_YANG(
DEFPY_YANG(
match_ip_address, match_ip_address_cmd,
- "match ip address <(1-199)|(1300-2699)|WORD>$name",
+ "match ip address WORD$name",
MATCH_STR
IP_STR
"Match address of route\n"
- "IP access-list number\n"
- "IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
@@ -187,13 +186,11 @@ DEFPY_YANG(
DEFPY_YANG(
no_match_ip_address, no_match_ip_address_cmd,
- "no match ip address [<(1-199)|(1300-2699)|WORD>]",
+ "no match ip address [WORD]",
NO_STR
MATCH_STR
IP_STR
"Match address of route\n"
- "IP access-list number\n"
- "IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
@@ -246,12 +243,10 @@ DEFPY_YANG(
DEFPY_YANG(
match_ip_next_hop, match_ip_next_hop_cmd,
- "match ip next-hop <(1-199)|(1300-2699)|WORD>$name",
+ "match ip next-hop WORD$name",
MATCH_STR
IP_STR
"Match next-hop address of route\n"
- "IP access-list number\n"
- "IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
@@ -268,13 +263,11 @@ DEFPY_YANG(
DEFPY_YANG(
no_match_ip_next_hop, no_match_ip_next_hop_cmd,
- "no match ip next-hop [<(1-199)|(1300-2699)|WORD>]",
+ "no match ip next-hop [WORD]",
NO_STR
MATCH_STR
IP_STR
"Match address of route\n"
- "IP access-list number\n"
- "IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
@@ -546,11 +539,11 @@ DEFPY_YANG(
return nb_cli_apply_changes(vty, NULL);
}
-void route_map_condition_show(struct vty *vty, struct lyd_node *dnode,
+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");
- struct lyd_node *ln;
+ const struct lyd_node *ln;
const char *acl;
if (IS_MATCH_INTERFACE(condition)) {
@@ -1021,11 +1014,11 @@ DEFUN_YANG (no_set_srte_color,
}
-void route_map_action_show(struct vty *vty, struct lyd_node *dnode,
+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");
- struct lyd_node *ln;
+ const struct lyd_node *ln;
const char *acl;
if (IS_SET_IPv4_NH(action)) {
@@ -1363,7 +1356,7 @@ ALIAS_YANG(
"Continue on a different entry within the route-map\n"
"Route-map entry sequence number\n")
-void route_map_exit_policy_show(struct vty *vty, struct lyd_node *dnode,
+void route_map_exit_policy_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
int exit_policy = yang_dnode_get_enum(dnode, NULL);
@@ -1405,7 +1398,7 @@ DEFPY_YANG(
return nb_cli_apply_changes(vty, NULL);
}
-void route_map_call_show(struct vty *vty, struct lyd_node *dnode,
+void route_map_call_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " call %s\n", yang_dnode_get_string(dnode, NULL));
@@ -1439,7 +1432,7 @@ DEFUN_YANG (no_rmap_description,
return nb_cli_apply_changes(vty, NULL);
}
-void route_map_description_show(struct vty *vty, struct lyd_node *dnode,
+void route_map_description_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " description %s\n", yang_dnode_get_string(dnode, NULL));
@@ -1468,7 +1461,7 @@ DEFPY_YANG(
}
void route_map_optimization_disabled_show(struct vty *vty,
- struct lyd_node *dnode,
+ const struct lyd_node *dnode,
bool show_defaults)
{
const char *name = yang_dnode_get_string(dnode, "../name");
@@ -1515,7 +1508,7 @@ DEFPY_HIDDEN(
static int route_map_config_write(struct vty *vty)
{
- struct lyd_node *dnode;
+ const struct lyd_node *dnode;
int written = 0;
dnode = yang_dnode_get(running_config->dnode,