]>
Commit | Line | Data |
---|---|---|
88fa5104 | 1 | /* |
2 | * Copyright (C) 2018 Vmware | |
3 | * Vishal Dhingra | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU General Public License as published by the Free | |
7 | * Software Foundation; either version 2 of the License, or (at your option) | |
8 | * any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
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 | |
17 | */ | |
18 | #ifndef _FRR_STATIC_NB_H_ | |
19 | #define _FRR_STATIC_NB_H_ | |
20 | ||
deca28a3 CH |
21 | #ifdef __cplusplus |
22 | extern "C" { | |
23 | #endif | |
24 | ||
88fa5104 | 25 | extern const struct frr_yang_module_info frr_staticd_info; |
26 | ||
27 | /* Mandatory callbacks. */ | |
28 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create( | |
29 | struct nb_cb_create_args *args); | |
30 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy( | |
31 | struct nb_cb_destroy_args *args); | |
32 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create( | |
33 | struct nb_cb_create_args *args); | |
34 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy( | |
35 | struct nb_cb_destroy_args *args); | |
36 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify( | |
37 | struct nb_cb_modify_args *args); | |
88fa5104 | 38 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_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_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_bh_type_modify( | |
43 | struct nb_cb_modify_args *args); | |
88fa5104 | 44 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify( |
45 | struct nb_cb_modify_args *args); | |
065276ae SM |
46 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_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_color_destroy( | |
49 | struct nb_cb_destroy_args *args); | |
88fa5104 | 50 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create( |
51 | struct nb_cb_create_args *args); | |
52 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy( | |
53 | struct nb_cb_destroy_args *args); | |
54 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify( | |
55 | struct nb_cb_modify_args *args); | |
56 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy( | |
57 | struct nb_cb_destroy_args *args); | |
58 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify( | |
59 | struct nb_cb_modify_args *args); | |
60 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy( | |
61 | struct nb_cb_destroy_args *args); | |
62 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify( | |
63 | struct nb_cb_modify_args *args); | |
64 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy( | |
65 | struct nb_cb_destroy_args *args); | |
66 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create( | |
67 | struct nb_cb_create_args *args); | |
68 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy( | |
69 | struct nb_cb_destroy_args *args); | |
70 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create( | |
71 | struct nb_cb_create_args *args); | |
72 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy( | |
73 | struct nb_cb_destroy_args *args); | |
74 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify( | |
75 | struct nb_cb_modify_args *args); | |
88fa5104 | 76 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create( |
77 | struct nb_cb_create_args *args); | |
78 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy( | |
79 | struct nb_cb_destroy_args *args); | |
80 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify( | |
81 | struct nb_cb_modify_args *args); | |
88fa5104 | 82 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify( |
83 | struct nb_cb_modify_args *args); | |
065276ae SM |
84 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify( |
85 | struct nb_cb_modify_args *args); | |
86 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy( | |
87 | struct nb_cb_destroy_args *args); | |
88fa5104 | 88 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create( |
89 | struct nb_cb_create_args *args); | |
90 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy( | |
91 | struct nb_cb_destroy_args *args); | |
92 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify( | |
93 | struct nb_cb_modify_args *args); | |
94 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy( | |
95 | struct nb_cb_destroy_args *args); | |
96 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify( | |
97 | struct nb_cb_modify_args *args); | |
98 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy( | |
99 | struct nb_cb_destroy_args *args); | |
100 | 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( | |
101 | struct nb_cb_modify_args *args); | |
102 | 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( | |
103 | struct nb_cb_destroy_args *args); | |
104 | ||
105 | /* Optional 'apply_finish' callbacks. */ | |
106 | ||
107 | void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish( | |
108 | struct nb_cb_apply_finish_args *args); | |
109 | void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish( | |
110 | struct nb_cb_apply_finish_args *args); | |
111 | ||
112 | /* Optional 'pre_validate' callbacks. */ | |
113 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate( | |
114 | struct nb_cb_pre_validate_args *args); | |
115 | ||
116 | /* | |
117 | * Callback registered with routing_nb lib to validate only | |
118 | * one instance of staticd is allowed | |
119 | */ | |
120 | int routing_control_plane_protocols_name_validate( | |
121 | struct nb_cb_create_args *args); | |
122 | ||
123 | /* xpath macros */ | |
124 | /* route-list */ | |
125 | #define FRR_STATIC_ROUTE_INFO_KEY_XPATH \ | |
126 | "/frr-routing:routing/control-plane-protocols/" \ | |
127 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
314825ff | 128 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ |
ef4b6b22 | 129 | "path-list[table-id='%u'][distance='%u']" |
88fa5104 | 130 | |
e1ea6b20 IR |
131 | #define FRR_STATIC_ROUTE_INFO_KEY_NO_DISTANCE_XPATH \ |
132 | "/frr-routing:routing/control-plane-protocols/" \ | |
133 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
134 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ | |
135 | "path-list[table-id='%u']" | |
136 | ||
88fa5104 | 137 | |
138 | #define FRR_STATIC_ROUTE_PATH_TAG_XPATH "/tag" | |
139 | ||
88fa5104 | 140 | /* route-list/frr-nexthops */ |
141 | #define FRR_STATIC_ROUTE_NH_KEY_XPATH \ | |
142 | "/frr-nexthops/" \ | |
143 | "nexthop[nh-type='%s'][vrf='%s'][gateway='%s'][interface='%s']" | |
144 | ||
145 | #define FRR_STATIC_ROUTE_NH_ONLINK_XPATH "/onlink" | |
146 | ||
065276ae SM |
147 | #define FRR_STATIC_ROUTE_NH_COLOR_XPATH "/srte-color" |
148 | ||
88fa5104 | 149 | #define FRR_STATIC_ROUTE_NH_BH_XPATH "/bh-type" |
150 | ||
151 | #define FRR_STATIC_ROUTE_NH_LABEL_XPATH "/mpls-label-stack" | |
152 | ||
153 | #define FRR_STATIC_ROUTE_NHLB_KEY_XPATH "/entry[id='%u']/label" | |
154 | ||
155 | /* route-list/srclist */ | |
156 | #define FRR_S_ROUTE_SRC_INFO_KEY_XPATH \ | |
157 | "/frr-routing:routing/control-plane-protocols/" \ | |
158 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
314825ff | 159 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ |
ef4b6b22 | 160 | "src-list[src-prefix='%s']/path-list[table-id='%u'][distance='%u']" |
88fa5104 | 161 | |
e1ea6b20 IR |
162 | #define FRR_S_ROUTE_SRC_INFO_KEY_NO_DISTANCE_XPATH \ |
163 | "/frr-routing:routing/control-plane-protocols/" \ | |
164 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
165 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ | |
166 | "src-list[src-prefix='%s']/path-list[table-id='%u']" | |
167 | ||
88fa5104 | 168 | /* route-list/frr-nexthops */ |
169 | #define FRR_DEL_S_ROUTE_NH_KEY_XPATH \ | |
170 | FRR_STATIC_ROUTE_INFO_KEY_XPATH \ | |
171 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
172 | ||
e1ea6b20 IR |
173 | /* route-list/frr-nexthops */ |
174 | #define FRR_DEL_S_ROUTE_NH_KEY_NO_DISTANCE_XPATH \ | |
175 | FRR_STATIC_ROUTE_INFO_KEY_NO_DISTANCE_XPATH \ | |
176 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
177 | ||
88fa5104 | 178 | /* route-list/src/src-list/frr-nexthops*/ |
179 | #define FRR_DEL_S_ROUTE_SRC_NH_KEY_XPATH \ | |
180 | FRR_S_ROUTE_SRC_INFO_KEY_XPATH \ | |
181 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
182 | ||
e1ea6b20 IR |
183 | /* route-list/src/src-list/frr-nexthops*/ |
184 | #define FRR_DEL_S_ROUTE_SRC_NH_KEY_NO_DISTANCE_XPATH \ | |
185 | FRR_S_ROUTE_SRC_INFO_KEY_NO_DISTANCE_XPATH \ | |
186 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
187 | ||
deca28a3 CH |
188 | #ifdef __cplusplus |
189 | } | |
190 | #endif | |
191 | ||
88fa5104 | 192 | #endif |