]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-bfdd.yang
Merge pull request #10566 from whichbug/master
[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 session-states {
246 /*
247 * Local settings.
248 */
249 leaf local-discriminator {
250 type discriminator;
251 description "Local session identifier";
252 }
253
254 leaf local-state {
255 type state;
256 description "Local session state";
257 }
258
259 leaf local-diagnostic {
260 type diagnostic;
261 description "Local session diagnostic";
262 }
263
264 leaf local-multiplier {
265 type multiplier;
266 description "Local session current multiplier";
267 }
268
269 /*
270 * Remote settings.
271 */
272 leaf remote-discriminator {
273 type discriminator;
274 description "Remote session identifier";
275 }
276
277 leaf remote-state {
278 type state;
279 description "Remote session state";
280 }
281
282 leaf remote-diagnostic {
283 type diagnostic;
284 description "Local session diagnostic";
285 }
286
287 leaf remote-multiplier {
288 type multiplier;
289 description "Remote session detection multiplier";
290 }
291
292 /*
293 * Negotiated settings.
294 */
295 leaf negotiated-transmission-interval {
296 description "Negotiated transmit interval";
297 type uint32;
298 units microseconds;
299 }
300
301 leaf negotiated-receive-interval {
302 description "Negotiated receive interval";
303 type uint32;
304 units microseconds;
305 }
306
307 leaf detection-mode {
308 description "Detection mode";
309
310 type enumeration {
311 enum async-with-echo {
312 value "1";
313 description "Async with echo";
314 }
315 enum async-without-echo {
316 value "2";
317 description "Async without echo";
318 }
319 enum demand-with-echo {
320 value "3";
321 description "Demand with echo";
322 }
323 enum demand-without-echo {
324 value "4";
325 description "Demand without echo";
326 }
327 }
328 }
329
330 /*
331 * Statistics.
332 */
333 leaf last-down-time {
334 type yang:date-and-time;
335 description "Time and date of the last time session was down";
336 }
337
338 leaf last-up-time {
339 type yang:date-and-time;
340 description "Time and date of the last time session was up";
341 }
342
343 leaf session-down-count {
344 type uint32;
345 description "Number of times the session went down";
346 }
347
348 leaf session-up-count {
349 type uint32;
350 description "Number of times the session went up";
351 }
352
353 leaf control-packet-input-count {
354 type uint64;
355 description "Number of control packets received";
356 }
357
358 leaf control-packet-output-count {
359 type uint64;
360 description "Number of control packets sent";
361 }
362
363 /*
364 * Echo mode operational data.
365 */
366 leaf negotiated-echo-transmission-interval {
367 type uint32;
368 units microseconds;
369 description "Negotiated echo transmit interval";
370 }
371
372 /*
373 * Statistics.
374 */
375 leaf echo-packet-input-count {
376 type uint64;
377 description "Number of echo packets received";
378 }
379
380 leaf echo-packet-output-count {
381 type uint64;
382 description "Number of echo packets sent";
383 }
384 }
385
386 /*
387 * BFD operational.
388 */
389 container bfdd {
390 container bfd {
391 presence "Present if the BFD protocol is enabled";
392
393 list profile {
394 key "name";
395 description "BFD pre configuration profiles";
396
397 leaf name {
398 type profile-name;
399 description "Profile name";
400 }
401
402 uses session-common;
403 uses session-echo;
404 uses session-multi-hop;
405 }
406
407 container sessions {
408 list single-hop {
409 key "dest-addr interface vrf";
410 description "List of single hop sessions";
411
412 leaf dest-addr {
413 type inet:ip-address;
414 description "IP address of the peer";
415 }
416
417 leaf interface {
418 type frr-interface:interface-ref;
419 description "Interface to use to contact peer";
420 }
421
422 leaf vrf {
423 type frr-vrf:vrf-ref;
424 description "Virtual Routing Domain name";
425 }
426
427 leaf source-addr {
428 type inet:ip-address;
429 description "Local IP address";
430 }
431
432 leaf profile {
433 type profile-ref;
434 description "Override defaults with profile.";
435 }
436
437 uses session-common;
438 uses session-echo;
439
440 container stats {
441 uses session-states;
442 config false;
443 }
444 }
445
446 list multi-hop {
447 key "source-addr dest-addr vrf";
448 description "List of multi hop sessions";
449
450 leaf source-addr {
451 type inet:ip-address;
452 description "Local IP address";
453 }
454
455 leaf dest-addr {
456 type inet:ip-address;
457 description "IP address of the peer";
458 }
459
460 leaf vrf {
461 type frr-vrf:vrf-ref;
462 description "Virtual Routing Domain name";
463 }
464
465 leaf profile {
466 type profile-ref;
467 description "Override defaults with profile.";
468 }
469
470 uses session-common;
471 uses session-multi-hop;
472
473 container stats {
474 uses session-states;
475 config false;
476 }
477 }
478 }
479 }
480 }
481 }