]>
Commit | Line | Data |
---|---|---|
41db488c | 1 | // SPDX-License-Identifier: BSD-2-Clause |
990e89e5 RZ |
2 | module frr-bfdd { |
3 | yang-version 1.1; | |
4 | namespace "http://frrouting.org/yang/bfdd"; | |
5 | prefix frr-bfdd; | |
6 | ||
7 | import ietf-inet-types { | |
8 | prefix inet; | |
9 | } | |
10 | import ietf-yang-types { | |
11 | prefix yang; | |
12 | } | |
13 | import frr-interface { | |
14 | prefix frr-interface; | |
15 | } | |
806defc8 IR |
16 | import frr-vrf { |
17 | prefix frr-vrf; | |
18 | } | |
990e89e5 RZ |
19 | import frr-route-types { |
20 | prefix frr-route-types; | |
21 | } | |
22 | ||
8678d638 | 23 | organization "FRRouting"; |
990e89e5 RZ |
24 | contact |
25 | "FRR Users List: <mailto:frog@lists.frrouting.org> | |
26 | FRR Development List: <mailto:dev@lists.frrouting.org>"; | |
27 | description | |
fe3b629a RW |
28 | "This module defines a model for managing FRR bfdd daemon. |
29 | ||
30 | Copyright 2020 FRRouting | |
31 | ||
32 | Redistribution and use in source and binary forms, with or without | |
33 | modification, are permitted provided that the following conditions | |
34 | are met: | |
35 | ||
36 | 1. Redistributions of source code must retain the above copyright notice, | |
37 | this list of conditions and the following disclaimer. | |
38 | ||
39 | 2. Redistributions in binary form must reproduce the above copyright | |
40 | notice, this list of conditions and the following disclaimer in the | |
41 | documentation and/or other materials provided with the distribution. | |
42 | ||
43 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
44 | \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
45 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
46 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
47 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
48 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
49 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
50 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
51 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
52 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
53 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."; | |
990e89e5 RZ |
54 | |
55 | revision 2019-05-09 { | |
56 | description "Initial revision."; | |
57 | reference | |
58 | "RFC 5880: Bidirectional Forwarding Detection (BFD). | |
59 | RFC 5881: Bidirectional Forwarding Detection (BFD) | |
60 | for IPv4 and IPv6 (Single Hop). | |
0ff1fb53 | 61 | RFC 5883: Bidirectional Forwarding Detection (BFD) for Multihop Paths."; |
990e89e5 RZ |
62 | } |
63 | ||
64 | ||
65 | /* | |
66 | * BFD types declaration. | |
67 | */ | |
68 | typedef multiplier { | |
69 | description "Detection multiplier"; | |
70 | type uint8 { | |
0c91b419 | 71 | range "2..255"; |
990e89e5 RZ |
72 | } |
73 | } | |
74 | ||
75 | typedef discriminator { | |
76 | description "BFD session identification"; | |
77 | type uint32 { | |
0c91b419 | 78 | range "1..4294967295"; |
990e89e5 RZ |
79 | } |
80 | } | |
81 | ||
82 | typedef state { | |
83 | description "BFD session state"; | |
84 | type enumeration { | |
85 | enum admin-down { | |
86 | value 0; | |
87 | description "Administratively down"; | |
88 | } | |
89 | enum down { | |
90 | value 1; | |
91 | description "Down"; | |
92 | } | |
93 | enum init { | |
94 | value 2; | |
95 | description "Initializing"; | |
96 | } | |
97 | enum up { | |
98 | value 3; | |
99 | description "Up"; | |
100 | } | |
101 | } | |
102 | } | |
103 | ||
104 | typedef diagnostic { | |
105 | description "BFD session diagnostic"; | |
106 | type enumeration { | |
107 | enum ok { | |
108 | value 0; | |
109 | description "Ok"; | |
110 | } | |
111 | enum control-expired { | |
112 | value 1; | |
113 | description "Control timer expired"; | |
114 | } | |
115 | enum echo-failed { | |
116 | value 2; | |
117 | description "Echo function failed"; | |
118 | } | |
119 | enum neighbor-down { | |
120 | value 3; | |
121 | description "Neighbor signaled session down"; | |
122 | } | |
123 | enum forwarding-reset { | |
124 | value 4; | |
125 | description "Forwarding plane reset"; | |
126 | } | |
127 | enum path-down { | |
128 | value 5; | |
129 | description "Path down"; | |
130 | } | |
131 | enum concatenated-path-down { | |
132 | value 6; | |
133 | description "Concatenated path down"; | |
134 | } | |
135 | enum administratively-down { | |
136 | value 7; | |
137 | description "Administratively down"; | |
138 | } | |
139 | enum reverse-concat-path-down { | |
140 | value 8; | |
141 | description "Reverse concatenated path down"; | |
142 | } | |
143 | } | |
144 | } | |
145 | ||
abf1ba08 RZ |
146 | typedef profile-name { |
147 | type string { | |
148 | length "1..64"; | |
149 | } | |
150 | description "Profile name format"; | |
151 | } | |
152 | ||
153 | typedef profile-ref { | |
154 | type leafref { | |
155 | path "/frr-bfdd:bfdd/frr-bfdd:bfd/frr-bfdd:profile/frr-bfdd:name"; | |
156 | require-instance false; | |
157 | } | |
158 | description "Reference to a BFD profile"; | |
159 | } | |
160 | ||
990e89e5 RZ |
161 | /* |
162 | * Shared BFD items. | |
163 | */ | |
164 | grouping session-common { | |
165 | description "Common BFD session settings"; | |
166 | ||
167 | leaf detection-multiplier { | |
168 | type multiplier; | |
169 | default 3; | |
170 | description "Local session detection multiplier"; | |
171 | } | |
172 | ||
173 | leaf desired-transmission-interval { | |
ebf8b885 | 174 | type uint32 { |
175 | range "10000..60000000"; | |
176 | } | |
8a676ce6 RZ |
177 | units microseconds; |
178 | default 300000; | |
990e89e5 RZ |
179 | description "Minimum desired control packet transmission interval"; |
180 | } | |
181 | ||
182 | leaf required-receive-interval { | |
ebf8b885 | 183 | type uint32 { |
184 | range "10000..60000000"; | |
185 | } | |
8a676ce6 RZ |
186 | units microseconds; |
187 | default 300000; | |
990e89e5 RZ |
188 | description "Minimum required control packet receive interval"; |
189 | } | |
190 | ||
191 | leaf administrative-down { | |
192 | type boolean; | |
59dad813 | 193 | default false; |
990e89e5 RZ |
194 | description "Disables or enables the session administratively"; |
195 | } | |
8733bc48 RZ |
196 | |
197 | leaf passive-mode { | |
198 | type boolean; | |
199 | default false; | |
200 | description | |
201 | "Don't attempt to start session establishment."; | |
202 | } | |
990e89e5 RZ |
203 | } |
204 | ||
205 | grouping session-echo { | |
206 | description "BFD session echo settings"; | |
207 | ||
208 | leaf echo-mode { | |
209 | type boolean; | |
210 | default false; | |
211 | description "Use echo packets to detect failures"; | |
212 | } | |
213 | ||
214 | leaf desired-echo-transmission-interval { | |
ebf8b885 | 215 | type uint32 { |
216 | range "10000..60000000"; | |
217 | } | |
8a676ce6 RZ |
218 | units microseconds; |
219 | default 50000; | |
4df3e31c IR |
220 | description "Minimum desired echo packet transmission interval"; |
221 | } | |
222 | ||
223 | leaf required-echo-receive-interval { | |
ebf8b885 | 224 | type uint32 { |
225 | range "0 | 10000..60000000"; | |
226 | } | |
4df3e31c IR |
227 | units microseconds; |
228 | default 50000; | |
229 | description "Minimum required echo packet receive interval"; | |
990e89e5 RZ |
230 | } |
231 | } | |
232 | ||
8733bc48 RZ |
233 | grouping session-multi-hop { |
234 | description "BFD session multi hop settings."; | |
235 | ||
236 | leaf minimum-ttl { | |
237 | type uint8 { | |
0c91b419 | 238 | range "1..254"; |
8733bc48 | 239 | } |
0c91b419 | 240 | default "254"; |
8733bc48 RZ |
241 | description |
242 | "Minimum expected TTL on received packets."; | |
243 | } | |
244 | } | |
245 | ||
73df597f RZ |
246 | grouping bfd-monitoring { |
247 | description | |
248 | "BFD monitoring template for protocol integration."; | |
249 | ||
250 | leaf source { | |
251 | type inet:ip-address; | |
252 | description | |
253 | "Source address to use for liveness check. | |
254 | ||
255 | When source is not set and multi-hop is `false` the source | |
256 | address will be `0.0.0.0` (any). | |
257 | ||
258 | When source is not set and multi-hop is `true` the source | |
259 | address will be automatic selected through Next Hop Tracking (NHT)."; | |
260 | } | |
261 | ||
262 | leaf multi-hop { | |
263 | description | |
264 | "Use multi hop session instead of single hop."; | |
265 | type boolean; | |
266 | default false; | |
267 | } | |
268 | ||
269 | leaf profile { | |
270 | description | |
271 | "BFD pre configured profile."; | |
272 | type frr-bfdd:profile-ref; | |
273 | } | |
274 | } | |
275 | ||
990e89e5 RZ |
276 | grouping session-states { |
277 | /* | |
278 | * Local settings. | |
279 | */ | |
280 | leaf local-discriminator { | |
281 | type discriminator; | |
282 | description "Local session identifier"; | |
283 | } | |
284 | ||
285 | leaf local-state { | |
286 | type state; | |
287 | description "Local session state"; | |
288 | } | |
289 | ||
290 | leaf local-diagnostic { | |
291 | type diagnostic; | |
292 | description "Local session diagnostic"; | |
293 | } | |
294 | ||
295 | leaf local-multiplier { | |
296 | type multiplier; | |
297 | description "Local session current multiplier"; | |
298 | } | |
299 | ||
300 | /* | |
301 | * Remote settings. | |
302 | */ | |
303 | leaf remote-discriminator { | |
304 | type discriminator; | |
305 | description "Remote session identifier"; | |
306 | } | |
307 | ||
308 | leaf remote-state { | |
309 | type state; | |
310 | description "Remote session state"; | |
311 | } | |
312 | ||
313 | leaf remote-diagnostic { | |
314 | type diagnostic; | |
315 | description "Local session diagnostic"; | |
316 | } | |
317 | ||
318 | leaf remote-multiplier { | |
319 | type multiplier; | |
320 | description "Remote session detection multiplier"; | |
321 | } | |
322 | ||
323 | /* | |
324 | * Negotiated settings. | |
325 | */ | |
326 | leaf negotiated-transmission-interval { | |
327 | description "Negotiated transmit interval"; | |
328 | type uint32; | |
8a676ce6 | 329 | units microseconds; |
990e89e5 RZ |
330 | } |
331 | ||
332 | leaf negotiated-receive-interval { | |
333 | description "Negotiated receive interval"; | |
334 | type uint32; | |
8a676ce6 | 335 | units microseconds; |
990e89e5 RZ |
336 | } |
337 | ||
338 | leaf detection-mode { | |
339 | description "Detection mode"; | |
340 | ||
341 | type enumeration { | |
342 | enum async-with-echo { | |
343 | value "1"; | |
344 | description "Async with echo"; | |
345 | } | |
346 | enum async-without-echo { | |
347 | value "2"; | |
348 | description "Async without echo"; | |
349 | } | |
350 | enum demand-with-echo { | |
351 | value "3"; | |
352 | description "Demand with echo"; | |
353 | } | |
354 | enum demand-without-echo { | |
355 | value "4"; | |
356 | description "Demand without echo"; | |
357 | } | |
358 | } | |
359 | } | |
360 | ||
361 | /* | |
362 | * Statistics. | |
363 | */ | |
364 | leaf last-down-time { | |
365 | type yang:date-and-time; | |
366 | description "Time and date of the last time session was down"; | |
367 | } | |
368 | ||
369 | leaf last-up-time { | |
370 | type yang:date-and-time; | |
371 | description "Time and date of the last time session was up"; | |
372 | } | |
373 | ||
374 | leaf session-down-count { | |
375 | type uint32; | |
f79f7a7b | 376 | description "Number of times the session went down"; |
990e89e5 RZ |
377 | } |
378 | ||
379 | leaf session-up-count { | |
380 | type uint32; | |
f79f7a7b | 381 | description "Number of times the session went up"; |
990e89e5 RZ |
382 | } |
383 | ||
384 | leaf control-packet-input-count { | |
385 | type uint64; | |
f79f7a7b | 386 | description "Number of control packets received"; |
990e89e5 RZ |
387 | } |
388 | ||
389 | leaf control-packet-output-count { | |
390 | type uint64; | |
f79f7a7b | 391 | description "Number of control packets sent"; |
990e89e5 RZ |
392 | } |
393 | ||
394 | /* | |
395 | * Echo mode operational data. | |
396 | */ | |
397 | leaf negotiated-echo-transmission-interval { | |
398 | type uint32; | |
8a676ce6 | 399 | units microseconds; |
990e89e5 RZ |
400 | description "Negotiated echo transmit interval"; |
401 | } | |
402 | ||
403 | /* | |
404 | * Statistics. | |
405 | */ | |
406 | leaf echo-packet-input-count { | |
407 | type uint64; | |
f79f7a7b | 408 | description "Number of echo packets received"; |
990e89e5 RZ |
409 | } |
410 | ||
411 | leaf echo-packet-output-count { | |
412 | type uint64; | |
f79f7a7b | 413 | description "Number of echo packets sent"; |
990e89e5 RZ |
414 | } |
415 | } | |
416 | ||
417 | /* | |
418 | * BFD operational. | |
419 | */ | |
420 | container bfdd { | |
421 | container bfd { | |
422 | presence "Present if the BFD protocol is enabled"; | |
423 | ||
abf1ba08 RZ |
424 | list profile { |
425 | key "name"; | |
426 | description "BFD pre configuration profiles"; | |
427 | ||
428 | leaf name { | |
429 | type profile-name; | |
430 | description "Profile name"; | |
431 | } | |
432 | ||
433 | uses session-common; | |
434 | uses session-echo; | |
8733bc48 | 435 | uses session-multi-hop; |
abf1ba08 RZ |
436 | } |
437 | ||
990e89e5 RZ |
438 | container sessions { |
439 | list single-hop { | |
440 | key "dest-addr interface vrf"; | |
441 | description "List of single hop sessions"; | |
442 | ||
990e89e5 RZ |
443 | leaf dest-addr { |
444 | type inet:ip-address; | |
445 | description "IP address of the peer"; | |
446 | } | |
447 | ||
448 | leaf interface { | |
806defc8 | 449 | type frr-interface:interface-ref; |
990e89e5 RZ |
450 | description "Interface to use to contact peer"; |
451 | } | |
452 | ||
453 | leaf vrf { | |
806defc8 | 454 | type frr-vrf:vrf-ref; |
990e89e5 RZ |
455 | description "Virtual Routing Domain name"; |
456 | } | |
457 | ||
7f121ef7 RZ |
458 | leaf source-addr { |
459 | type inet:ip-address; | |
460 | description "Local IP address"; | |
461 | } | |
462 | ||
abf1ba08 RZ |
463 | leaf profile { |
464 | type profile-ref; | |
465 | description "Override defaults with profile."; | |
466 | } | |
467 | ||
990e89e5 RZ |
468 | uses session-common; |
469 | uses session-echo; | |
470 | ||
471 | container stats { | |
472 | uses session-states; | |
473 | config false; | |
474 | } | |
475 | } | |
476 | ||
477 | list multi-hop { | |
874ca769 | 478 | key "source-addr dest-addr vrf"; |
990e89e5 RZ |
479 | description "List of multi hop sessions"; |
480 | ||
481 | leaf source-addr { | |
482 | type inet:ip-address; | |
483 | description "Local IP address"; | |
484 | } | |
485 | ||
486 | leaf dest-addr { | |
487 | type inet:ip-address; | |
488 | description "IP address of the peer"; | |
489 | } | |
490 | ||
990e89e5 | 491 | leaf vrf { |
806defc8 | 492 | type frr-vrf:vrf-ref; |
990e89e5 RZ |
493 | description "Virtual Routing Domain name"; |
494 | } | |
495 | ||
abf1ba08 RZ |
496 | leaf profile { |
497 | type profile-ref; | |
498 | description "Override defaults with profile."; | |
499 | } | |
500 | ||
990e89e5 | 501 | uses session-common; |
8733bc48 | 502 | uses session-multi-hop; |
990e89e5 RZ |
503 | |
504 | container stats { | |
505 | uses session-states; | |
506 | config false; | |
507 | } | |
508 | } | |
509 | } | |
510 | } | |
511 | } | |
512 | } |