diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2021-10-25 07:55:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-25 07:55:39 -0400 |
| commit | 6f354338f98c173dc9cdc9165c03acdf5fc5685e (patch) | |
| tree | f5c12250c4adce7667eb7ce3ddee9070e3013133 /pathd | |
| parent | b793d3ce7103c10335047df83dd3cb68a376bff1 (diff) | |
| parent | 2560505196b924f5c447f6c1d493ed9b74a13108 (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 'pathd')
| -rw-r--r-- | pathd/path_cli.c | 23 | ||||
| -rw-r--r-- | pathd/path_nb.h | 21 |
2 files changed, 24 insertions, 20 deletions
diff --git a/pathd/path_cli.c b/pathd/path_cli.c index 46242fd05a..bfeea8c3db 100644 --- a/pathd/path_cli.c +++ b/pathd/path_cli.c @@ -298,14 +298,15 @@ DEFPY(srte_no_segment_list, return nb_cli_apply_changes(vty, NULL); } -void cli_show_srte_segment_list(struct vty *vty, struct lyd_node *dnode, +void cli_show_srte_segment_list(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { vty_out(vty, " segment-list %s\n", yang_dnode_get_string(dnode, "./name")); } -void cli_show_srte_segment_list_end(struct vty *vty, struct lyd_node *dnode) +void cli_show_srte_segment_list_end(struct vty *vty, + const struct lyd_node *dnode) { vty_out(vty, " exit\n"); } @@ -557,7 +558,7 @@ DEFPY(srte_segment_list_no_segment, } void cli_show_srte_segment_list_segment(struct vty *vty, - struct lyd_node *dnode, + const struct lyd_node *dnode, bool show_defaults) { vty_out(vty, " index %s", yang_dnode_get_string(dnode, "./index")); @@ -668,7 +669,7 @@ DEFPY(srte_no_policy, return nb_cli_apply_changes(vty, NULL); } -void cli_show_srte_policy(struct vty *vty, struct lyd_node *dnode, +void cli_show_srte_policy(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { vty_out(vty, " policy color %s endpoint %s\n", @@ -676,7 +677,7 @@ void cli_show_srte_policy(struct vty *vty, struct lyd_node *dnode, yang_dnode_get_string(dnode, "./endpoint")); } -void cli_show_srte_policy_end(struct vty *vty, struct lyd_node *dnode) +void cli_show_srte_policy_end(struct vty *vty, const struct lyd_node *dnode) { vty_out(vty, " exit\n"); } @@ -708,8 +709,8 @@ DEFPY(srte_policy_no_name, } -void cli_show_srte_policy_name(struct vty *vty, struct lyd_node *dnode, - bool show_defaults) +void cli_show_srte_policy_name(struct vty *vty, const struct lyd_node *dnode, + bool show_defaults) { vty_out(vty, " name %s\n", yang_dnode_get_string(dnode, NULL)); } @@ -741,7 +742,7 @@ DEFPY(srte_policy_no_binding_sid, } void cli_show_srte_policy_binding_sid(struct vty *vty, - struct lyd_node *dnode, + const struct lyd_node *dnode, bool show_defaults) { vty_out(vty, " binding-sid %s\n", yang_dnode_get_string(dnode, NULL)); @@ -1187,7 +1188,7 @@ static int config_write_metric_cb(const struct lyd_node *dnode, void *arg) } void cli_show_srte_policy_candidate_path(struct vty *vty, - struct lyd_node *dnode, + const struct lyd_node *dnode, bool show_defaults) { float bandwidth; @@ -1253,7 +1254,7 @@ void cli_show_srte_policy_candidate_path(struct vty *vty, } void cli_show_srte_policy_candidate_path_end(struct vty *vty, - struct lyd_node *dnode) + const struct lyd_node *dnode) { const char *type = yang_dnode_get_string(dnode, "./type"); @@ -1265,7 +1266,7 @@ static int config_write_dnode(const struct lyd_node *dnode, void *arg) { struct vty *vty = arg; - nb_cli_show_dnode_cmds(vty, (struct lyd_node *)dnode, false); + nb_cli_show_dnode_cmds(vty, dnode, false); return YANG_ITER_CONTINUE; } diff --git a/pathd/path_nb.h b/pathd/path_nb.h index 6a918b8b82..dacc5eb0d8 100644 --- a/pathd/path_nb.h +++ b/pathd/path_nb.h @@ -110,23 +110,26 @@ int pathd_srte_policy_candidate_path_segment_list_name_destroy( void pathd_apply_finish(struct nb_cb_apply_finish_args *args); /* Optional 'cli_show' callbacks. */ -void cli_show_srte_segment_list(struct vty *vty, struct lyd_node *dnode, +void cli_show_srte_segment_list(struct vty *vty, const struct lyd_node *dnode, bool show_defaults); -void cli_show_srte_segment_list_end(struct vty *vty, struct lyd_node *dnode); -void cli_show_srte_segment_list_segment(struct vty *vty, struct lyd_node *dnode, +void cli_show_srte_segment_list_end(struct vty *vty, + const struct lyd_node *dnode); +void cli_show_srte_segment_list_segment(struct vty *vty, + const struct lyd_node *dnode, bool show_defaults); -void cli_show_srte_policy(struct vty *vty, struct lyd_node *dnode, +void cli_show_srte_policy(struct vty *vty, const struct lyd_node *dnode, bool show_defaults); -void cli_show_srte_policy_end(struct vty *vty, struct lyd_node *dnode); -void cli_show_srte_policy_name(struct vty *vty, struct lyd_node *dnode, +void cli_show_srte_policy_end(struct vty *vty, const struct lyd_node *dnode); +void cli_show_srte_policy_name(struct vty *vty, const struct lyd_node *dnode, bool show_defaults); -void cli_show_srte_policy_binding_sid(struct vty *vty, struct lyd_node *dnode, +void cli_show_srte_policy_binding_sid(struct vty *vty, + const struct lyd_node *dnode, bool show_defaults); void cli_show_srte_policy_candidate_path(struct vty *vty, - struct lyd_node *dnode, + const struct lyd_node *dnode, bool show_defaults); void cli_show_srte_policy_candidate_path_end(struct vty *vty, - struct lyd_node *dnode); + const struct lyd_node *dnode); /* Utility functions */ typedef void (*of_pref_cp_t)(enum objfun_type type, void *arg); |
