summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-13 20:08:37 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-10-13 20:12:35 +0300
commit2560505196b924f5c447f6c1d493ed9b74a13108 (patch)
tree515278e4362bf4f9c9418168df90a90b74946c20 /lib/if.c
parentd7374bd3b1be5edfc20534ae5a301a0160c017bf (diff)
lib: northbound cli show/cmd functions must not modify data nodes
To ensure this, add a const modifier to functions' arguments. Would be great do this initially and avoid this large code change, but better late than never. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/if.c b/lib/if.c
index 424880ff42..2a517911e6 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1277,8 +1277,8 @@ DEFPY_YANG (no_interface,
ifname, vrf_name);
}
-static void cli_show_interface(struct vty *vty, struct lyd_node *dnode,
- bool show_defaults)
+static void cli_show_interface(struct vty *vty, const struct lyd_node *dnode,
+ bool show_defaults)
{
const char *vrf;
@@ -1291,7 +1291,8 @@ static void cli_show_interface(struct vty *vty, struct lyd_node *dnode,
vty_out(vty, "\n");
}
-static void cli_show_interface_end(struct vty *vty, struct lyd_node *dnode)
+static void cli_show_interface_end(struct vty *vty,
+ const struct lyd_node *dnode)
{
vty_out(vty, "exit\n");
}
@@ -1327,8 +1328,9 @@ DEFPY_YANG (no_interface_desc,
return nb_cli_apply_changes(vty, NULL);
}
-static void cli_show_interface_desc(struct vty *vty, struct lyd_node *dnode,
- bool show_defaults)
+static void cli_show_interface_desc(struct vty *vty,
+ const struct lyd_node *dnode,
+ bool show_defaults)
{
vty_out(vty, " description %s\n", yang_dnode_get_string(dnode, NULL));
}