summaryrefslogtreecommitdiffstats
path: root/lib/northbound.h
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-13 19:08:37 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2021-10-13 19:12:35 +0200
commit2560505196b924f5c447f6c1d493ed9b74a13108 (patch)
tree515278e4362bf4f9c9418168df90a90b74946c20 /lib/northbound.h
parentMerge pull request #9788 from idryzhov/ospf6-clear-interface-vrf (diff)
downloadfrr-2560505196b924f5c447f6c1d493ed9b74a13108.tar.xz
frr-2560505196b924f5c447f6c1d493ed9b74a13108.zip
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.h')
-rw-r--r--lib/northbound.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/northbound.h b/lib/northbound.h
index bf04dbda1..a330bd1a3 100644
--- a/lib/northbound.h
+++ b/lib/northbound.h
@@ -488,7 +488,8 @@ struct nb_callbacks {
* >0 when the CLI command for the dnode2 should be printed first
* 0 when there is no difference
*/
- int (*cli_cmp)(struct lyd_node *dnode1, struct lyd_node *dnode2);
+ int (*cli_cmp)(const struct lyd_node *dnode1,
+ const struct lyd_node *dnode2);
/*
* Optional callback to show the CLI command associated to the given
@@ -510,7 +511,7 @@ struct nb_callbacks {
* nodes, in which case it might be desirable to hide one or more
* parts of the command when this parameter is set to false.
*/
- void (*cli_show)(struct vty *vty, struct lyd_node *dnode,
+ void (*cli_show)(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults);
/*
@@ -523,7 +524,7 @@ struct nb_callbacks {
* libyang data node that should be shown in the form of a CLI
* command.
*/
- void (*cli_show_end)(struct vty *vty, struct lyd_node *dnode);
+ void (*cli_show_end)(struct vty *vty, const struct lyd_node *dnode);
};
struct nb_dependency_callbacks {