]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-bfdd.yang
Merge pull request #8120 from ton31337/feature/bgp_ipv6_default_activated
[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 units microseconds;
175 default 300000;
176 description "Minimum desired control packet transmission interval";
177 }
178
179 leaf required-receive-interval {
180 type uint32;
181 units microseconds;
182 default 300000;
183 description "Minimum required control packet receive interval";
184 }
185
186 leaf administrative-down {
187 type boolean;
188 default false;
189 description "Disables or enables the session administratively";
190 }
191
192 leaf passive-mode {
193 type boolean;
194 default false;
195 description
196 "Don't attempt to start session establishment.";
197 }
198 }
199
200 grouping session-echo {
201 description "BFD session echo settings";
202
203 leaf echo-mode {
204 type boolean;
205 default false;
206 description "Use echo packets to detect failures";
207 }
208
209 leaf desired-echo-transmission-interval {
210 type uint32;
211 units microseconds;
212 default 50000;
213 description "Minimum desired echo packet transmission interval";
214 }
215
216 leaf required-echo-receive-interval {
217 type uint32;
218 units microseconds;
219 default 50000;
220 description "Minimum required echo packet receive interval";
221 }
222 }
223
224 grouping session-multi-hop {
225 description "BFD session multi hop settings.";
226
227 leaf minimum-ttl {
228 type uint8 {
229 range 1..254;
230 }
231 description
232 "Minimum expected TTL on received packets.";
233 }
234 }
235
236 grouping session-states {
237 /*
238 * Local settings.
239 */
240 leaf local-discriminator {
241 type discriminator;
242 description "Local session identifier";
243 }
244
245 leaf local-state {
246 type state;
247 description "Local session state";
248 }
249
250 leaf local-diagnostic {
251 type diagnostic;
252 description "Local session diagnostic";
253 }
254
255 leaf local-multiplier {
256 type multiplier;
257 description "Local session current multiplier";
258 }
259
260 /*
261 * Remote settings.
262 */
263 leaf remote-discriminator {
264 type discriminator;
265 description "Remote session identifier";
266 }
267
268 leaf remote-state {
269 type state;
270 description "Remote session state";
271 }
272
273 leaf remote-diagnostic {
274 type diagnostic;
275 description "Local session diagnostic";
276 }
277
278 leaf remote-multiplier {
279 type multiplier;
280 description "Remote session detection multiplier";
281 }
282
283 /*
284 * Negotiated settings.
285 */
286 leaf negotiated-transmission-interval {
287 description "Negotiated transmit interval";
288 type uint32;
289 units microseconds;
290 }
291
292 leaf negotiated-receive-interval {
293 description "Negotiated receive interval";
294 type uint32;
295 units microseconds;
296 }
297
298 leaf detection-mode {
299 description "Detection mode";
300
301 type enumeration {
302 enum async-with-echo {
303 value "1";
304 description "Async with echo";
305 }
306 enum async-without-echo {
307 value "2";
308 description "Async without echo";
309 }
310 enum demand-with-echo {
311 value "3";
312 description "Demand with echo";
313 }
314 enum demand-without-echo {
315 value "4";
316 description "Demand without echo";
317 }
318 }
319 }
320
321 /*
322 * Statistics.
323 */
324 leaf last-down-time {
325 type yang:date-and-time;
326 description "Time and date of the last time session was down";
327 }
328
329 leaf last-up-time {
330 type yang:date-and-time;
331 description "Time and date of the last time session was up";
332 }
333
334 leaf session-down-count {
335 type uint32;
336 description "Number of times the session went down";
337 }
338
339 leaf session-up-count {
340 type uint32;
341 description "Number of times the session went up";
342 }
343
344 leaf control-packet-input-count {
345 type uint64;
346 description "Number of control packets received";
347 }
348
349 leaf control-packet-output-count {
350 type uint64;
351 description "Number of control packets sent";
352 }
353
354 /*
355 * Echo mode operational data.
356 */
357 leaf negotiated-echo-transmission-interval {
358 type uint32;
359 units microseconds;
360 description "Negotiated echo transmit interval";
361 }
362
363 /*
364 * Statistics.
365 */
366 leaf echo-packet-input-count {
367 type uint64;
368 description "Number of echo packets received";
369 }
370
371 leaf echo-packet-output-count {
372 type uint64;
373 description "Number of echo packets sent";
374 }
375 }
376
377 /*
378 * BFD operational.
379 */
380 container bfdd {
381 container bfd {
382 presence "Present if the BFD protocol is enabled";
383
384 list profile {
385 key "name";
386 description "BFD pre configuration profiles";
387
388 leaf name {
389 type profile-name;
390 description "Profile name";
391 }
392
393 uses session-common;
394 uses session-echo;
395 uses session-multi-hop;
396 }
397
398 container sessions {
399 list single-hop {
400 key "dest-addr interface vrf";
401 description "List of single hop sessions";
402
403 leaf dest-addr {
404 type inet:ip-address;
405 description "IP address of the peer";
406 }
407
408 leaf interface {
409 type frr-interface:interface-ref;
410 description "Interface to use to contact peer";
411 }
412
413 leaf vrf {
414 type frr-vrf:vrf-ref;
415 description "Virtual Routing Domain name";
416 }
417
418 leaf source-addr {
419 type inet:ip-address;
420 description "Local IP address";
421 }
422
423 leaf profile {
424 type profile-ref;
425 description "Override defaults with profile.";
426 }
427
428 uses session-common;
429 uses session-echo;
430
431 container stats {
432 uses session-states;
433 config false;
434 }
435 }
436
437 list multi-hop {
438 key "source-addr dest-addr interface vrf";
439 description "List of multi hop sessions";
440
441 leaf source-addr {
442 type inet:ip-address;
443 description "Local IP address";
444 }
445
446 leaf dest-addr {
447 type inet:ip-address;
448 description "IP address of the peer";
449 }
450
451 leaf interface {
452 type frr-interface:interface-ref;
453 description "Interface to use to contact peer";
454 }
455
456 leaf vrf {
457 type frr-vrf:vrf-ref;
458 description "Virtual Routing Domain name";
459 }
460
461 leaf profile {
462 type profile-ref;
463 description "Override defaults with profile.";
464 }
465
466 uses session-common;
467 uses session-multi-hop;
468
469 container stats {
470 uses session-states;
471 config false;
472 }
473 }
474 }
475 }
476 }
477 }