]>
Commit | Line | Data |
---|---|---|
990e89e5 RZ |
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 | } | |
806defc8 IR |
15 | import frr-vrf { |
16 | prefix frr-vrf; | |
17 | } | |
990e89e5 RZ |
18 | import frr-route-types { |
19 | prefix frr-route-types; | |
20 | } | |
21 | ||
8678d638 | 22 | organization "FRRouting"; |
990e89e5 RZ |
23 | contact |
24 | "FRR Users List: <mailto:frog@lists.frrouting.org> | |
25 | FRR Development List: <mailto:dev@lists.frrouting.org>"; | |
26 | description | |
fe3b629a RW |
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."; | |
990e89e5 RZ |
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). | |
0ff1fb53 | 60 | RFC 5883: Bidirectional Forwarding Detection (BFD) for Multihop Paths."; |
990e89e5 RZ |
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 | ||
abf1ba08 RZ |
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 | ||
990e89e5 RZ |
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; | |
8a676ce6 RZ |
174 | units microseconds; |
175 | default 300000; | |
990e89e5 RZ |
176 | description "Minimum desired control packet transmission interval"; |
177 | } | |
178 | ||
179 | leaf required-receive-interval { | |
180 | type uint32; | |
8a676ce6 RZ |
181 | units microseconds; |
182 | default 300000; | |
990e89e5 RZ |
183 | description "Minimum required control packet receive interval"; |
184 | } | |
185 | ||
186 | leaf administrative-down { | |
187 | type boolean; | |
59dad813 | 188 | default false; |
990e89e5 RZ |
189 | description "Disables or enables the session administratively"; |
190 | } | |
8733bc48 RZ |
191 | |
192 | leaf passive-mode { | |
193 | type boolean; | |
194 | default false; | |
195 | description | |
196 | "Don't attempt to start session establishment."; | |
197 | } | |
990e89e5 RZ |
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; | |
8a676ce6 RZ |
211 | units microseconds; |
212 | default 50000; | |
4df3e31c IR |
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"; | |
990e89e5 RZ |
221 | } |
222 | } | |
223 | ||
8733bc48 RZ |
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 | ||
990e89e5 RZ |
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; | |
8a676ce6 | 289 | units microseconds; |
990e89e5 RZ |
290 | } |
291 | ||
292 | leaf negotiated-receive-interval { | |
293 | description "Negotiated receive interval"; | |
294 | type uint32; | |
8a676ce6 | 295 | units microseconds; |
990e89e5 RZ |
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; | |
f79f7a7b | 336 | description "Number of times the session went down"; |
990e89e5 RZ |
337 | } |
338 | ||
339 | leaf session-up-count { | |
340 | type uint32; | |
f79f7a7b | 341 | description "Number of times the session went up"; |
990e89e5 RZ |
342 | } |
343 | ||
344 | leaf control-packet-input-count { | |
345 | type uint64; | |
f79f7a7b | 346 | description "Number of control packets received"; |
990e89e5 RZ |
347 | } |
348 | ||
349 | leaf control-packet-output-count { | |
350 | type uint64; | |
f79f7a7b | 351 | description "Number of control packets sent"; |
990e89e5 RZ |
352 | } |
353 | ||
354 | /* | |
355 | * Echo mode operational data. | |
356 | */ | |
357 | leaf negotiated-echo-transmission-interval { | |
358 | type uint32; | |
8a676ce6 | 359 | units microseconds; |
990e89e5 RZ |
360 | description "Negotiated echo transmit interval"; |
361 | } | |
362 | ||
363 | /* | |
364 | * Statistics. | |
365 | */ | |
366 | leaf echo-packet-input-count { | |
367 | type uint64; | |
f79f7a7b | 368 | description "Number of echo packets received"; |
990e89e5 RZ |
369 | } |
370 | ||
371 | leaf echo-packet-output-count { | |
372 | type uint64; | |
f79f7a7b | 373 | description "Number of echo packets sent"; |
990e89e5 RZ |
374 | } |
375 | } | |
376 | ||
377 | /* | |
378 | * BFD operational. | |
379 | */ | |
380 | container bfdd { | |
381 | container bfd { | |
382 | presence "Present if the BFD protocol is enabled"; | |
383 | ||
abf1ba08 RZ |
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; | |
8733bc48 | 395 | uses session-multi-hop; |
abf1ba08 RZ |
396 | } |
397 | ||
990e89e5 RZ |
398 | container sessions { |
399 | list single-hop { | |
400 | key "dest-addr interface vrf"; | |
401 | description "List of single hop sessions"; | |
402 | ||
990e89e5 RZ |
403 | leaf dest-addr { |
404 | type inet:ip-address; | |
405 | description "IP address of the peer"; | |
406 | } | |
407 | ||
408 | leaf interface { | |
806defc8 | 409 | type frr-interface:interface-ref; |
990e89e5 RZ |
410 | description "Interface to use to contact peer"; |
411 | } | |
412 | ||
413 | leaf vrf { | |
806defc8 | 414 | type frr-vrf:vrf-ref; |
990e89e5 RZ |
415 | description "Virtual Routing Domain name"; |
416 | } | |
417 | ||
7f121ef7 RZ |
418 | leaf source-addr { |
419 | type inet:ip-address; | |
420 | description "Local IP address"; | |
421 | } | |
422 | ||
abf1ba08 RZ |
423 | leaf profile { |
424 | type profile-ref; | |
425 | description "Override defaults with profile."; | |
426 | } | |
427 | ||
990e89e5 RZ |
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 { | |
874ca769 | 438 | key "source-addr dest-addr vrf"; |
990e89e5 RZ |
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 | ||
990e89e5 | 451 | leaf vrf { |
806defc8 | 452 | type frr-vrf:vrf-ref; |
990e89e5 RZ |
453 | description "Virtual Routing Domain name"; |
454 | } | |
455 | ||
abf1ba08 RZ |
456 | leaf profile { |
457 | type profile-ref; | |
458 | description "Override defaults with profile."; | |
459 | } | |
460 | ||
990e89e5 | 461 | uses session-common; |
8733bc48 | 462 | uses session-multi-hop; |
990e89e5 RZ |
463 | |
464 | container stats { | |
465 | uses session-states; | |
466 | config false; | |
467 | } | |
468 | } | |
469 | } | |
470 | } | |
471 | } | |
472 | } |