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