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