]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
88fa5104 | 2 | /* |
3 | * Copyright (C) 2018 Vmware | |
4 | * Vishal Dhingra | |
88fa5104 | 5 | */ |
6 | #ifndef _FRR_STATIC_NB_H_ | |
7 | #define _FRR_STATIC_NB_H_ | |
8 | ||
deca28a3 CH |
9 | #ifdef __cplusplus |
10 | extern "C" { | |
11 | #endif | |
12 | ||
88fa5104 | 13 | extern const struct frr_yang_module_info frr_staticd_info; |
14 | ||
15 | /* Mandatory callbacks. */ | |
16 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create( | |
17 | struct nb_cb_create_args *args); | |
18 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy( | |
19 | struct nb_cb_destroy_args *args); | |
20 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create( | |
21 | struct nb_cb_create_args *args); | |
22 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy( | |
23 | struct nb_cb_destroy_args *args); | |
24 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify( | |
25 | struct nb_cb_modify_args *args); | |
88fa5104 | 26 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create( |
27 | struct nb_cb_create_args *args); | |
28 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy( | |
29 | struct nb_cb_destroy_args *args); | |
30 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify( | |
31 | struct nb_cb_modify_args *args); | |
88fa5104 | 32 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify( |
33 | struct nb_cb_modify_args *args); | |
065276ae SM |
34 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify( |
35 | struct nb_cb_modify_args *args); | |
36 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy( | |
37 | struct nb_cb_destroy_args *args); | |
88fa5104 | 38 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create( |
39 | struct nb_cb_create_args *args); | |
40 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy( | |
41 | struct nb_cb_destroy_args *args); | |
42 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify( | |
43 | struct nb_cb_modify_args *args); | |
44 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy( | |
45 | struct nb_cb_destroy_args *args); | |
46 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify( | |
47 | struct nb_cb_modify_args *args); | |
48 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy( | |
49 | struct nb_cb_destroy_args *args); | |
50 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify( | |
51 | struct nb_cb_modify_args *args); | |
52 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy( | |
53 | struct nb_cb_destroy_args *args); | |
351ad684 RZ |
54 | int route_next_hop_bfd_create(struct nb_cb_create_args *args); |
55 | int route_next_hop_bfd_destroy(struct nb_cb_destroy_args *args); | |
56 | int route_next_hop_bfd_source_modify(struct nb_cb_modify_args *args); | |
57 | int route_next_hop_bfd_source_destroy(struct nb_cb_destroy_args *args); | |
58 | int route_next_hop_bfd_profile_modify(struct nb_cb_modify_args *args); | |
59 | int route_next_hop_bfd_profile_destroy(struct nb_cb_destroy_args *args); | |
60 | int route_next_hop_bfd_multi_hop_modify(struct nb_cb_modify_args *args); | |
88fa5104 | 61 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create( |
62 | struct nb_cb_create_args *args); | |
63 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy( | |
64 | struct nb_cb_destroy_args *args); | |
65 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create( | |
66 | struct nb_cb_create_args *args); | |
67 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy( | |
68 | struct nb_cb_destroy_args *args); | |
69 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify( | |
70 | struct nb_cb_modify_args *args); | |
88fa5104 | 71 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create( |
72 | struct nb_cb_create_args *args); | |
73 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy( | |
74 | struct nb_cb_destroy_args *args); | |
75 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify( | |
76 | struct nb_cb_modify_args *args); | |
88fa5104 | 77 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify( |
78 | struct nb_cb_modify_args *args); | |
065276ae SM |
79 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify( |
80 | struct nb_cb_modify_args *args); | |
81 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy( | |
82 | struct nb_cb_destroy_args *args); | |
88fa5104 | 83 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create( |
84 | struct nb_cb_create_args *args); | |
85 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy( | |
86 | struct nb_cb_destroy_args *args); | |
87 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify( | |
88 | struct nb_cb_modify_args *args); | |
89 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy( | |
90 | struct nb_cb_destroy_args *args); | |
91 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify( | |
92 | struct nb_cb_modify_args *args); | |
93 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy( | |
94 | struct nb_cb_destroy_args *args); | |
95 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify( | |
96 | struct nb_cb_modify_args *args); | |
97 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy( | |
98 | struct nb_cb_destroy_args *args); | |
99 | ||
100 | /* Optional 'apply_finish' callbacks. */ | |
101 | ||
102 | void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish( | |
103 | struct nb_cb_apply_finish_args *args); | |
104 | void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish( | |
105 | struct nb_cb_apply_finish_args *args); | |
106 | ||
107 | /* Optional 'pre_validate' callbacks. */ | |
108 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate( | |
109 | struct nb_cb_pre_validate_args *args); | |
110 | ||
111 | /* | |
112 | * Callback registered with routing_nb lib to validate only | |
113 | * one instance of staticd is allowed | |
114 | */ | |
115 | int routing_control_plane_protocols_name_validate( | |
116 | struct nb_cb_create_args *args); | |
117 | ||
118 | /* xpath macros */ | |
119 | /* route-list */ | |
120 | #define FRR_STATIC_ROUTE_INFO_KEY_XPATH \ | |
121 | "/frr-routing:routing/control-plane-protocols/" \ | |
122 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
314825ff | 123 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ |
ef4b6b22 | 124 | "path-list[table-id='%u'][distance='%u']" |
88fa5104 | 125 | |
e1ea6b20 IR |
126 | #define FRR_STATIC_ROUTE_INFO_KEY_NO_DISTANCE_XPATH \ |
127 | "/frr-routing:routing/control-plane-protocols/" \ | |
128 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
129 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ | |
130 | "path-list[table-id='%u']" | |
131 | ||
88fa5104 | 132 | |
133 | #define FRR_STATIC_ROUTE_PATH_TAG_XPATH "/tag" | |
134 | ||
88fa5104 | 135 | /* route-list/frr-nexthops */ |
136 | #define FRR_STATIC_ROUTE_NH_KEY_XPATH \ | |
137 | "/frr-nexthops/" \ | |
138 | "nexthop[nh-type='%s'][vrf='%s'][gateway='%s'][interface='%s']" | |
139 | ||
140 | #define FRR_STATIC_ROUTE_NH_ONLINK_XPATH "/onlink" | |
141 | ||
065276ae SM |
142 | #define FRR_STATIC_ROUTE_NH_COLOR_XPATH "/srte-color" |
143 | ||
88fa5104 | 144 | #define FRR_STATIC_ROUTE_NH_BH_XPATH "/bh-type" |
145 | ||
146 | #define FRR_STATIC_ROUTE_NH_LABEL_XPATH "/mpls-label-stack" | |
147 | ||
148 | #define FRR_STATIC_ROUTE_NHLB_KEY_XPATH "/entry[id='%u']/label" | |
149 | ||
150 | /* route-list/srclist */ | |
151 | #define FRR_S_ROUTE_SRC_INFO_KEY_XPATH \ | |
152 | "/frr-routing:routing/control-plane-protocols/" \ | |
153 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
314825ff | 154 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ |
ef4b6b22 | 155 | "src-list[src-prefix='%s']/path-list[table-id='%u'][distance='%u']" |
88fa5104 | 156 | |
e1ea6b20 IR |
157 | #define FRR_S_ROUTE_SRC_INFO_KEY_NO_DISTANCE_XPATH \ |
158 | "/frr-routing:routing/control-plane-protocols/" \ | |
159 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
160 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ | |
161 | "src-list[src-prefix='%s']/path-list[table-id='%u']" | |
162 | ||
88fa5104 | 163 | /* route-list/frr-nexthops */ |
164 | #define FRR_DEL_S_ROUTE_NH_KEY_XPATH \ | |
165 | FRR_STATIC_ROUTE_INFO_KEY_XPATH \ | |
166 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
167 | ||
e1ea6b20 IR |
168 | /* route-list/frr-nexthops */ |
169 | #define FRR_DEL_S_ROUTE_NH_KEY_NO_DISTANCE_XPATH \ | |
170 | FRR_STATIC_ROUTE_INFO_KEY_NO_DISTANCE_XPATH \ | |
171 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
172 | ||
88fa5104 | 173 | /* route-list/src/src-list/frr-nexthops*/ |
174 | #define FRR_DEL_S_ROUTE_SRC_NH_KEY_XPATH \ | |
175 | FRR_S_ROUTE_SRC_INFO_KEY_XPATH \ | |
176 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
177 | ||
e1ea6b20 IR |
178 | /* route-list/src/src-list/frr-nexthops*/ |
179 | #define FRR_DEL_S_ROUTE_SRC_NH_KEY_NO_DISTANCE_XPATH \ | |
180 | FRR_S_ROUTE_SRC_INFO_KEY_NO_DISTANCE_XPATH \ | |
181 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
182 | ||
deca28a3 CH |
183 | #ifdef __cplusplus |
184 | } | |
185 | #endif | |
186 | ||
88fa5104 | 187 | #endif |