2 * Copyright (C) 2020 NetDEF, Inc.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along
15 * with this program; see the file COPYING; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef _FRR_PATH_NB_H_
20 #define _FRR_PATH_NB_H_
22 #include "pathd/pathd.h"
24 extern const struct frr_yang_module_info frr_pathd_info
;
26 /* Mandatory callbacks. */
27 int pathd_srte_segment_list_create(struct nb_cb_create_args
*args
);
28 int pathd_srte_segment_list_destroy(struct nb_cb_destroy_args
*args
);
30 const void *pathd_srte_segment_list_get_next(struct nb_cb_get_next_args
*args
);
31 int pathd_srte_segment_list_get_keys(struct nb_cb_get_keys_args
*args
);
33 pathd_srte_segment_list_lookup_entry(struct nb_cb_lookup_entry_args
*args
);
35 int pathd_srte_segment_list_segment_create(struct nb_cb_create_args
*args
);
36 int pathd_srte_segment_list_segment_destroy(struct nb_cb_destroy_args
*args
);
37 int pathd_srte_segment_list_protocol_origin_modify(
38 struct nb_cb_modify_args
*args
);
39 int pathd_srte_segment_list_originator_modify(struct nb_cb_modify_args
*args
);
40 int pathd_srte_segment_list_segment_sid_value_modify(
41 struct nb_cb_modify_args
*args
);
42 int pathd_srte_segment_list_segment_nai_destroy(
43 struct nb_cb_destroy_args
*args
);
44 void pathd_srte_segment_list_segment_nai_apply_finish(
45 struct nb_cb_apply_finish_args
*args
);
46 int pathd_srte_policy_create(struct nb_cb_create_args
*args
);
47 int pathd_srte_policy_destroy(struct nb_cb_destroy_args
*args
);
48 const void *pathd_srte_policy_get_next(struct nb_cb_get_next_args
*args
);
49 int pathd_srte_policy_get_keys(struct nb_cb_get_keys_args
*args
);
51 pathd_srte_policy_lookup_entry(struct nb_cb_lookup_entry_args
*args
);
52 int pathd_srte_policy_name_modify(struct nb_cb_modify_args
*args
);
53 int pathd_srte_policy_name_destroy(struct nb_cb_destroy_args
*args
);
54 int pathd_srte_policy_binding_sid_modify(struct nb_cb_modify_args
*args
);
55 int pathd_srte_policy_binding_sid_destroy(struct nb_cb_destroy_args
*args
);
57 pathd_srte_policy_is_operational_get_elem(struct nb_cb_get_elem_args
*args
);
58 int pathd_srte_policy_candidate_path_create(struct nb_cb_create_args
*args
);
59 int pathd_srte_policy_candidate_path_destroy(struct nb_cb_destroy_args
*args
);
60 int pathd_srte_policy_candidate_path_name_modify(
61 struct nb_cb_modify_args
*args
);
63 pathd_srte_policy_candidate_path_get_next(struct nb_cb_get_next_args
*args
);
64 int pathd_srte_policy_candidate_path_get_keys(struct nb_cb_get_keys_args
*args
);
65 const void *pathd_srte_policy_candidate_path_lookup_entry(
66 struct nb_cb_lookup_entry_args
*args
);
67 void pathd_srte_policy_candidate_path_bandwidth_apply_finish(
68 struct nb_cb_apply_finish_args
*args
);
69 int pathd_srte_policy_candidate_path_bandwidth_destroy(
70 struct nb_cb_destroy_args
*args
);
71 int pathd_srte_policy_candidate_path_exclude_any_modify(
72 struct nb_cb_modify_args
*args
);
73 int pathd_srte_policy_candidate_path_exclude_any_destroy(
74 struct nb_cb_destroy_args
*args
);
75 int pathd_srte_policy_candidate_path_include_any_modify(
76 struct nb_cb_modify_args
*args
);
77 int pathd_srte_policy_candidate_path_include_any_destroy(
78 struct nb_cb_destroy_args
*args
);
79 int pathd_srte_policy_candidate_path_include_all_modify(
80 struct nb_cb_modify_args
*args
);
81 int pathd_srte_policy_candidate_path_include_all_destroy(
82 struct nb_cb_destroy_args
*args
);
83 int pathd_srte_policy_candidate_path_metrics_destroy(
84 struct nb_cb_destroy_args
*args
);
85 void pathd_srte_policy_candidate_path_metrics_apply_finish(
86 struct nb_cb_apply_finish_args
*args
);
87 int pathd_srte_policy_candidate_path_objfun_destroy(
88 struct nb_cb_destroy_args
*args
);
89 void pathd_srte_policy_candidate_path_objfun_apply_finish(
90 struct nb_cb_apply_finish_args
*args
);
92 pathd_srte_policy_candidate_path_is_best_candidate_path_get_elem(
93 struct nb_cb_get_elem_args
*args
);
94 int pathd_srte_policy_candidate_path_protocol_origin_modify(
95 struct nb_cb_modify_args
*args
);
96 int pathd_srte_policy_candidate_path_originator_modify(
97 struct nb_cb_modify_args
*args
);
98 struct yang_data
*pathd_srte_policy_candidate_path_discriminator_get_elem(
99 struct nb_cb_get_elem_args
*args
);
100 int pathd_srte_policy_candidate_path_type_modify(
101 struct nb_cb_modify_args
*args
);
102 int pathd_srte_policy_candidate_path_segment_list_name_modify(
103 struct nb_cb_modify_args
*args
);
104 int pathd_srte_policy_candidate_path_segment_list_name_destroy(
105 struct nb_cb_destroy_args
*args
);
107 /* Optional 'apply_finish' callbacks. */
108 void pathd_apply_finish(struct nb_cb_apply_finish_args
*args
);
110 /* Optional 'cli_show' callbacks. */
111 void cli_show_srte_segment_list(struct vty
*vty
, struct lyd_node
*dnode
,
113 void cli_show_srte_segment_list_segment(struct vty
*vty
, struct lyd_node
*dnode
,
115 void cli_show_srte_policy(struct vty
*vty
, struct lyd_node
*dnode
,
117 void cli_show_srte_policy_name(struct vty
*vty
, struct lyd_node
*dnode
,
119 void cli_show_srte_policy_binding_sid(struct vty
*vty
, struct lyd_node
*dnode
,
121 void cli_show_srte_policy_candidate_path(struct vty
*vty
,
122 struct lyd_node
*dnode
,
125 /* Utility functions */
126 typedef void (*of_pref_cp_t
)(enum objfun_type type
, void *arg
);
127 void iter_objfun_prefs(const struct lyd_node
*dnode
, const char *path
,
128 of_pref_cp_t fun
, void *arg
);
130 #endif /* _FRR_PATH_NB_H_ */