/src/frr/yang/frr-nexthop.yang.c
Line | Count | Source |
1 | | /* autogenerated by embedmodel.py. DO NOT EDIT */ |
2 | | |
3 | | #include <zebra.h> |
4 | | #include "yang.h" |
5 | | |
6 | | static const char model[] = |
7 | | "// SPDX-License-Identifier: BSD-2-Clause\n" |
8 | | "module frr-nexthop {\n" |
9 | | " yang-version 1.1;\n" |
10 | | " namespace \"http://frrouting.org/yang/nexthop\";\n" |
11 | | " prefix frr-nexthop;\n" |
12 | | "\n" |
13 | | " import ietf-inet-types {\n" |
14 | | " prefix inet;\n" |
15 | | " }\n" |
16 | | "\n" |
17 | | " import ietf-routing-types {\n" |
18 | | " prefix rt-types;\n" |
19 | | " }\n" |
20 | | "\n" |
21 | | " import frr-interface {\n" |
22 | | " prefix frr-interface;\n" |
23 | | " }\n" |
24 | | "\n" |
25 | | " import frr-vrf {\n" |
26 | | " prefix frr-vrf;\n" |
27 | | " }\n" |
28 | | "\n" |
29 | | " organization\n" |
30 | | " \"FRRouting\";\n" |
31 | | " contact\n" |
32 | | " \"FRR Users List: <mailto:frog@lists.frrouting.org>\n" |
33 | | " FRR Development List: <mailto:dev@lists.frrouting.org>\";\n" |
34 | | " description\n" |
35 | | " \"This module defines a model for managing FRR nexthop information.\n" |
36 | | "\n" |
37 | | " Copyright 2020 FRRouting\n" |
38 | | "\n" |
39 | | " Redistribution and use in source and binary forms, with or without\n" |
40 | | " modification, are permitted provided that the following conditions\n" |
41 | | " are met:\n" |
42 | | "\n" |
43 | | " 1. Redistributions of source code must retain the above copyright notice,\n" |
44 | | " this list of conditions and the following disclaimer.\n" |
45 | | "\n" |
46 | | " 2. Redistributions in binary form must reproduce the above copyright\n" |
47 | | " notice, this list of conditions and the following disclaimer in the\n" |
48 | | " documentation and/or other materials provided with the distribution.\n" |
49 | | "\n" |
50 | | " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n" |
51 | | " \\\"AS IS\\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n" |
52 | | " LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n" |
53 | | " A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n" |
54 | | " HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n" |
55 | | " SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n" |
56 | | " LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n" |
57 | | " DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n" |
58 | | " THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n" |
59 | | " (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" |
60 | | " OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\";\n" |
61 | | "\n" |
62 | | " revision 2019-08-15 {\n" |
63 | | " description\n" |
64 | | " \"Initial revision.\";\n" |
65 | | " }\n" |
66 | | "\n" |
67 | | " typedef optional-ip-address {\n" |
68 | | " type union {\n" |
69 | | " type inet:ip-address;\n" |
70 | | " type string {\n" |
71 | | " length \"0\";\n" |
72 | | " }\n" |
73 | | " }\n" |
74 | | " }\n" |
75 | | "\n" |
76 | | " /*\n" |
77 | | " * Nexthop types.\n" |
78 | | " */\n" |
79 | | " typedef nexthop-type {\n" |
80 | | " type enumeration {\n" |
81 | | " enum \"ifindex\" {\n" |
82 | | " value 1;\n" |
83 | | " description\n" |
84 | | " \"Specific interface.\";\n" |
85 | | " }\n" |
86 | | " enum \"ip4\" {\n" |
87 | | " value 2;\n" |
88 | | " description\n" |
89 | | " \"IPv4 address.\";\n" |
90 | | " }\n" |
91 | | " enum \"ip4-ifindex\" {\n" |
92 | | " value 3;\n" |
93 | | " description\n" |
94 | | " \"IPv4 address and interface.\";\n" |
95 | | " }\n" |
96 | | " enum \"ip6\" {\n" |
97 | | " value 4;\n" |
98 | | " description\n" |
99 | | " \"IPv6 address.\";\n" |
100 | | " }\n" |
101 | | " enum \"ip6-ifindex\" {\n" |
102 | | " value 5;\n" |
103 | | " description\n" |
104 | | " \"IPv6 address and interface.\";\n" |
105 | | " }\n" |
106 | | " enum \"blackhole\" {\n" |
107 | | " value 6;\n" |
108 | | " description\n" |
109 | | " \"Unreachable or prohibited.\";\n" |
110 | | " }\n" |
111 | | " }\n" |
112 | | " description\n" |
113 | | " \"Nexthop types.\";\n" |
114 | | " }\n" |
115 | | "\n" |
116 | | " /*\n" |
117 | | " * Blockhole nexthop type.\n" |
118 | | " */\n" |
119 | | " typedef blackhole-type {\n" |
120 | | " type enumeration {\n" |
121 | | " enum \"unspec\" {\n" |
122 | | " value 0;\n" |
123 | | " description\n" |
124 | | " \"Generic unreachable.\";\n" |
125 | | " }\n" |
126 | | " enum \"null\" {\n" |
127 | | " value 1;\n" |
128 | | " description\n" |
129 | | " \"Null type.\";\n" |
130 | | " }\n" |
131 | | " enum \"reject\" {\n" |
132 | | " value 2;\n" |
133 | | " description\n" |
134 | | " \"ICMP unreachable.\";\n" |
135 | | " }\n" |
136 | | " enum \"prohibited\" {\n" |
137 | | " value 3;\n" |
138 | | " description\n" |
139 | | " \"ICMP admin-prohibited.\";\n" |
140 | | " }\n" |
141 | | " }\n" |
142 | | " default \"null\";\n" |
143 | | " description\n" |
144 | | " \"Nexthop blackhole types.\";\n" |
145 | | " }\n" |
146 | | "\n" |
147 | | " typedef nexthop-group-ref {\n" |
148 | | " type leafref {\n" |
149 | | " path \"/frr-nexthop:frr-nexthop-group/frr-nexthop:nexthop-groups/frr-nexthop:name\";\n" |
150 | | " require-instance false;\n" |
151 | | " }\n" |
152 | | " }\n" |
153 | | "\n" |
154 | | " /*\n" |
155 | | " * Common nexthop attributes grouping.\n" |
156 | | " */\n" |
157 | | " grouping frr-nexthop-attributes {\n" |
158 | | " leaf nh-type {\n" |
159 | | " type nexthop-type;\n" |
160 | | " mandatory true;\n" |
161 | | " description\n" |
162 | | " \"The nexthop type.\";\n" |
163 | | " }\n" |
164 | | "\n" |
165 | | " leaf vrf {\n" |
166 | | " type frr-vrf:vrf-ref;\n" |
167 | | " description\n" |
168 | | " \"The nexthop vrf name, if different from the route.\";\n" |
169 | | " }\n" |
170 | | "\n" |
171 | | " leaf gateway {\n" |
172 | | " type frr-nexthop:optional-ip-address;\n" |
173 | | " description\n" |
174 | | " \"The nexthop gateway address.\";\n" |
175 | | " }\n" |
176 | | "\n" |
177 | | " leaf interface {\n" |
178 | | " type frr-interface:interface-ref;\n" |
179 | | " description\n" |
180 | | " \"The nexthop egress interface.\";\n" |
181 | | " }\n" |
182 | | "\n" |
183 | | " leaf bh-type {\n" |
184 | | " type blackhole-type;\n" |
185 | | " description\n" |
186 | | " \"A blackhole sub-type, if the nexthop is a blackhole type.\";\n" |
187 | | " }\n" |
188 | | "\n" |
189 | | " leaf onlink {\n" |
190 | | " type boolean;\n" |
191 | | " default \"false\";\n" |
192 | | " description\n" |
193 | | " \"Nexthop is directly connected.\";\n" |
194 | | " }\n" |
195 | | "\n" |
196 | | " leaf srte-color {\n" |
197 | | " when \"../nh-type = \'ip4\' or\n" |
198 | | " ../nh-type = \'ip6\' or\n" |
199 | | " ../nh-type = \'ip4-ifindex\' or\n" |
200 | | " ../nh-type = \'ip6-ifindex\'\";\n" |
201 | | " type uint32;\n" |
202 | | " description\n" |
203 | | " \"The nexthop SR-TE color\";\n" |
204 | | " }\n" |
205 | | "\n" |
206 | | " uses rt-types:mpls-label-stack {\n" |
207 | | " description\n" |
208 | | " \"Nexthop\'s MPLS label stack.\";\n" |
209 | | " }\n" |
210 | | " }\n" |
211 | | "\n" |
212 | | " /*\n" |
213 | | " * operational common attributes for nexthop\n" |
214 | | " */\n" |
215 | | " grouping frr-nexthop-operational {\n" |
216 | | " leaf duplicate {\n" |
217 | | " type empty;\n" |
218 | | " config false;\n" |
219 | | " description\n" |
220 | | " \"Duplicate nexthop\";\n" |
221 | | " }\n" |
222 | | "\n" |
223 | | " leaf recursive {\n" |
224 | | " type empty;\n" |
225 | | " config false;\n" |
226 | | " description\n" |
227 | | " \"Nexthop resolved through another gateway.\";\n" |
228 | | " }\n" |
229 | | "\n" |
230 | | " leaf active {\n" |
231 | | " type empty;\n" |
232 | | " config false;\n" |
233 | | " description\n" |
234 | | " \"Nexthop is active.\";\n" |
235 | | " }\n" |
236 | | "\n" |
237 | | " leaf fib {\n" |
238 | | " type empty;\n" |
239 | | " config false;\n" |
240 | | " description\n" |
241 | | " \"Nexthop is installed in fib.\";\n" |
242 | | " }\n" |
243 | | "\n" |
244 | | " leaf weight {\n" |
245 | | " type uint8;\n" |
246 | | " config false;\n" |
247 | | " description\n" |
248 | | " \"Weight to be used by the nexthop for purposes of ECMP\";\n" |
249 | | " }\n" |
250 | | " }\n" |
251 | | "\n" |
252 | | " grouping nexthop-grouping {\n" |
253 | | " list nexthop {\n" |
254 | | " key \"nh-type vrf gateway interface\";\n" |
255 | | " min-elements 1;\n" |
256 | | " description\n" |
257 | | " \"A list of nexthop objects.\";\n" |
258 | | " uses frr-nexthop-attributes;\n" |
259 | | " }\n" |
260 | | " }\n" |
261 | | "\n" |
262 | | " /*\n" |
263 | | " * Single nexthop grouping.\n" |
264 | | " */\n" |
265 | | " grouping frr-nexthop {\n" |
266 | | " container frr-nexthops {\n" |
267 | | " description\n" |
268 | | " \"FRR nexthop object.\";\n" |
269 | | " uses nexthop-grouping;\n" |
270 | | " }\n" |
271 | | " }\n" |
272 | | "\n" |
273 | | "\n" |
274 | | " /*\n" |
275 | | " * Container for FRR nexthop group.\n" |
276 | | " */\n" |
277 | | " grouping frr-nexthop-grouping {\n" |
278 | | " list nexthop-groups {\n" |
279 | | " key \"name\";\n" |
280 | | " description\n" |
281 | | " \"List of nexthop groups, each contains group of nexthops\";\n" |
282 | | " leaf name {\n" |
283 | | " type string;\n" |
284 | | " description\n" |
285 | | " \"The nexthop-group name.\";\n" |
286 | | " }\n" |
287 | | "\n" |
288 | | " uses frr-nexthop;\n" |
289 | | " }\n" |
290 | | " }\n" |
291 | | "\n" |
292 | | " /* Operational nexthop-group */\n" |
293 | | " grouping frr-nexthop-group-operational {\n" |
294 | | " container nexthop-group {\n" |
295 | | " description\n" |
296 | | " \"A group of nexthops.\";\n" |
297 | | " leaf id {\n" |
298 | | " type uint32;\n" |
299 | | " description\n" |
300 | | " \"The nexthop-group id.\";\n" |
301 | | " }\n" |
302 | | "\n" |
303 | | " uses nexthop-grouping;\n" |
304 | | " }\n" |
305 | | " }\n" |
306 | | "\n" |
307 | | " container frr-nexthop-group {\n" |
308 | | " description\n" |
309 | | " \"A nexthop-group, represented as a list of nexthop objects.\";\n" |
310 | | " uses frr-nexthop-grouping;\n" |
311 | | " }\n" |
312 | | "\n" |
313 | | " /*\n" |
314 | | " * Augment weight attributes to nexthop group.\n" |
315 | | " */\n" |
316 | | " augment \"/frr-nexthop-group/nexthop-groups/frr-nexthops/nexthop\" {\n" |
317 | | " leaf weight {\n" |
318 | | " type uint8;\n" |
319 | | " description\n" |
320 | | " \"Weight to be used by the nexthop for purposes of ECMP\";\n" |
321 | | " }\n" |
322 | | " }\n" |
323 | | "}\n" |
324 | | ""; |
325 | | |
326 | | static struct yang_module_embed embed = { |
327 | | .mod_name = "frr-nexthop", |
328 | | .mod_rev = "2019-08-15", |
329 | | .sub_mod_name = "", |
330 | | .sub_mod_rev = "", |
331 | | .data = model, |
332 | | .format = LYS_IN_YANG, |
333 | | }; |
334 | | |
335 | | static void embed_register(void) __attribute__((_CONSTRUCTOR(2000))); |
336 | | static void embed_register(void) |
337 | 8 | { |
338 | 8 | yang_module_embed(&embed); |
339 | 8 | } |