summaryrefslogtreecommitdiff
path: root/lib/filter_cli.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2021-10-25 07:55:39 -0400
committerGitHub <noreply@github.com>2021-10-25 07:55:39 -0400
commit6f354338f98c173dc9cdc9165c03acdf5fc5685e (patch)
treef5c12250c4adce7667eb7ce3ddee9070e3013133 /lib/filter_cli.c
parentb793d3ce7103c10335047df83dd3cb68a376bff1 (diff)
parent2560505196b924f5c447f6c1d493ed9b74a13108 (diff)
Merge pull request #9824 from idryzhov/nb-cli-const-lyd-node
lib: northbound cli show/cmd functions must not modify data nodes
Diffstat (limited to 'lib/filter_cli.c')
-rw-r--r--lib/filter_cli.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/filter_cli.c b/lib/filter_cli.c
index e424fcf878..43618094ac 100644
--- a/lib/filter_cli.c
+++ b/lib/filter_cli.c
@@ -1012,7 +1012,8 @@ ALIAS(
ACCESS_LIST_REMARK_STR
ACCESS_LIST_REMARK_LINE_STR)
-int access_list_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2)
+int access_list_cmp(const struct lyd_node *dnode1,
+ const struct lyd_node *dnode2)
{
uint32_t seq1 = yang_dnode_get_uint32(dnode1, "./sequence");
uint32_t seq2 = yang_dnode_get_uint32(dnode2, "./sequence");
@@ -1020,7 +1021,7 @@ int access_list_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2)
return seq1 - seq2;
}
-void access_list_show(struct vty *vty, struct lyd_node *dnode,
+void access_list_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
int type = yang_dnode_get_enum(dnode, "../type");
@@ -1134,7 +1135,7 @@ void access_list_show(struct vty *vty, struct lyd_node *dnode,
vty_out(vty, "\n");
}
-void access_list_remark_show(struct vty *vty, struct lyd_node *dnode,
+void access_list_remark_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
int type = yang_dnode_get_enum(dnode, "../type");
@@ -1655,7 +1656,8 @@ ALIAS(
ACCESS_LIST_REMARK_STR
ACCESS_LIST_REMARK_LINE_STR)
-int prefix_list_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2)
+int prefix_list_cmp(const struct lyd_node *dnode1,
+ const struct lyd_node *dnode2)
{
uint32_t seq1 = yang_dnode_get_uint32(dnode1, "./sequence");
uint32_t seq2 = yang_dnode_get_uint32(dnode2, "./sequence");
@@ -1663,7 +1665,7 @@ int prefix_list_cmp(struct lyd_node *dnode1, struct lyd_node *dnode2)
return seq1 - seq2;
}
-void prefix_list_show(struct vty *vty, struct lyd_node *dnode,
+void prefix_list_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
int type = yang_dnode_get_enum(dnode, "../type");
@@ -1722,7 +1724,7 @@ void prefix_list_show(struct vty *vty, struct lyd_node *dnode,
vty_out(vty, "\n");
}
-void prefix_list_remark_show(struct vty *vty, struct lyd_node *dnode,
+void prefix_list_remark_show(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
int type = yang_dnode_get_enum(dnode, "../type");