diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-13 20:08:37 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-13 20:12:35 +0300 |
| commit | 2560505196b924f5c447f6c1d493ed9b74a13108 (patch) | |
| tree | 515278e4362bf4f9c9418168df90a90b74946c20 /lib/northbound_cli.c | |
| parent | d7374bd3b1be5edfc20534ae5a301a0160c017bf (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/northbound_cli.c')
| -rw-r--r-- | lib/northbound_cli.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c index 6676c0b072..70c71b18c4 100644 --- a/lib/northbound_cli.c +++ b/lib/northbound_cli.c @@ -550,14 +550,16 @@ void nb_cli_show_config_prepare(struct nb_config *config, bool with_defaults) LYD_VALIDATE_NO_STATE, NULL); } -static int lyd_node_cmp(struct lyd_node **dnode1, struct lyd_node **dnode2) +static int lyd_node_cmp(const struct lyd_node **dnode1, + const struct lyd_node **dnode2) { struct nb_node *nb_node = (*dnode1)->schema->priv; return nb_node->cbs.cli_cmp(*dnode1, *dnode2); } -static void show_dnode_children_cmds(struct vty *vty, struct lyd_node *root, +static void show_dnode_children_cmds(struct vty *vty, + const struct lyd_node *root, bool with_defaults) { struct nb_node *nb_node, *sort_node = NULL; @@ -616,7 +618,7 @@ static void show_dnode_children_cmds(struct vty *vty, struct lyd_node *root, } } -void nb_cli_show_dnode_cmds(struct vty *vty, struct lyd_node *root, +void nb_cli_show_dnode_cmds(struct vty *vty, const struct lyd_node *root, bool with_defaults) { struct nb_node *nb_node; |
