]>
Commit | Line | Data |
---|---|---|
707656ec RW |
1 | module frr-ripd { |
2 | yang-version 1.1; | |
3 | namespace "http://frrouting.org/yang/ripd"; | |
4 | prefix frr-ripd; | |
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-route-types { | |
16 | prefix frr-route-types; | |
17 | } | |
18 | ||
19 | organization | |
8678d638 | 20 | "FRRouting"; |
707656ec RW |
21 | contact |
22 | "FRR Users List: <mailto:frog@lists.frrouting.org> | |
23 | FRR Development List: <mailto:dev@lists.frrouting.org>"; | |
24 | description | |
fe3b629a RW |
25 | "This module defines a model for managing FRR ripd daemon. |
26 | ||
27 | Copyright 2020 FRRouting | |
28 | ||
29 | Redistribution and use in source and binary forms, with or without | |
30 | modification, are permitted provided that the following conditions | |
31 | are met: | |
32 | ||
33 | 1. Redistributions of source code must retain the above copyright notice, | |
34 | this list of conditions and the following disclaimer. | |
35 | ||
36 | 2. Redistributions in binary form must reproduce the above copyright | |
37 | notice, this list of conditions and the following disclaimer in the | |
38 | documentation and/or other materials provided with the distribution. | |
39 | ||
40 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
41 | \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
42 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
43 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
44 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
45 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
46 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
47 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
48 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
49 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
50 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."; | |
707656ec | 51 | |
f22b9250 QY |
52 | revision 2019-09-09 { |
53 | description | |
54 | "Changed interface references to use | |
55 | frr-interface:interface-ref typedef"; | |
56 | } | |
707656ec RW |
57 | revision 2017-12-06 { |
58 | description | |
59 | "Initial revision."; | |
60 | reference | |
61 | "RFC 1058: Routing Information Protocol. | |
62 | RFC 2453: RIP Version 2."; | |
63 | } | |
64 | ||
65 | container ripd { | |
66 | /* | |
ae7b826a | 67 | * Routing instance configuration. |
707656ec | 68 | */ |
ae7b826a RW |
69 | list instance { |
70 | key "vrf"; | |
707656ec RW |
71 | description |
72 | "RIP routing instance."; | |
73 | ||
ae7b826a RW |
74 | leaf vrf { |
75 | type string; | |
76 | description | |
77 | "VRF name."; | |
78 | } | |
707656ec RW |
79 | leaf allow-ecmp { |
80 | type boolean; | |
81 | default "false"; | |
82 | description | |
83 | "Allow equal-cost multi-path."; | |
84 | } | |
85 | leaf default-information-originate { | |
86 | type boolean; | |
87 | default "false"; | |
88 | description | |
89 | "Control distribution of default route."; | |
90 | } | |
91 | leaf default-metric { | |
92 | type uint8 { | |
93 | range "1..16"; | |
94 | } | |
95 | default "1"; | |
96 | description | |
97 | "Default metric of redistributed routes."; | |
98 | } | |
99 | container distance { | |
100 | description | |
101 | "Administrative distance."; | |
102 | leaf default { | |
103 | type uint8 { | |
104 | range "0..255"; | |
105 | } | |
106 | default "0"; | |
107 | description | |
108 | "Default administrative distance."; | |
109 | } | |
110 | list source { | |
111 | key "prefix"; | |
112 | description | |
113 | "Custom administrative distance per IP prefix."; | |
114 | leaf prefix { | |
115 | type inet:ipv4-prefix; | |
116 | description | |
117 | "Prefix."; | |
118 | } | |
119 | leaf distance { | |
120 | type uint8 { | |
121 | range "1..255"; | |
122 | } | |
123 | mandatory true; | |
124 | description | |
125 | "Administrative distance."; | |
126 | } | |
127 | leaf access-list { | |
128 | type string; | |
129 | description | |
130 | "Access-list name."; | |
131 | } | |
132 | } | |
133 | } | |
134 | leaf-list explicit-neighbor { | |
135 | type inet:ipv4-address; | |
136 | description | |
137 | "Specifies the RIP neighbors. Useful for a | |
138 | non-broadcast multiple access (NBMA) network."; | |
139 | } | |
140 | leaf-list network { | |
141 | type inet:ipv4-prefix; | |
142 | description | |
143 | "Enable RIP on the specified IP network."; | |
144 | } | |
145 | leaf-list interface { | |
f7688027 | 146 | type string; |
707656ec RW |
147 | description |
148 | "Enable RIP on the specified interface."; | |
149 | } | |
150 | list offset-list { | |
151 | key "interface direction"; | |
152 | description | |
153 | "Offset-list to modify route metric."; | |
154 | leaf interface { | |
f22b9250 QY |
155 | type union { |
156 | type frr-interface:interface-ref; | |
157 | type enumeration { | |
158 | enum '*' { | |
159 | description | |
160 | "Match all interfaces."; | |
161 | } | |
162 | } | |
163 | } | |
707656ec RW |
164 | description |
165 | "Interface to match. Use '*' to match all interfaces."; | |
166 | } | |
167 | leaf direction { | |
168 | type enumeration { | |
169 | enum in { | |
170 | value 0; | |
171 | description | |
172 | "Incoming updates."; | |
173 | } | |
174 | enum out { | |
175 | value 1; | |
176 | description | |
177 | "Outgoing updates."; | |
178 | } | |
179 | } | |
180 | description | |
181 | "Incoming or outgoing updates."; | |
182 | } | |
183 | leaf access-list { | |
184 | type string; | |
185 | mandatory true; | |
186 | description | |
187 | "Access-list name."; | |
188 | } | |
189 | leaf metric { | |
190 | type uint8 { | |
191 | range "0..16"; | |
192 | } | |
193 | mandatory true; | |
194 | description | |
195 | "Route metric."; | |
196 | } | |
197 | } | |
198 | leaf passive-default { | |
199 | type boolean; | |
200 | default "false"; | |
201 | description | |
202 | "Control whether interfaces are in the passive mode | |
203 | by default or not."; | |
204 | } | |
205 | leaf-list passive-interface { | |
206 | when "../passive-default = 'false'"; | |
f7688027 | 207 | type string; |
707656ec RW |
208 | description |
209 | "A list of interfaces where the sending of RIP packets | |
210 | is disabled."; | |
211 | } | |
212 | leaf-list non-passive-interface { | |
213 | when "../passive-default = 'true'"; | |
f7688027 | 214 | type string; |
707656ec RW |
215 | description |
216 | "A list of interfaces where the sending of RIP packets | |
217 | is enabled."; | |
218 | } | |
219 | list redistribute { | |
220 | key "protocol"; | |
221 | description | |
222 | "Redistributes routes learned from other routing protocols."; | |
223 | leaf protocol { | |
224 | type frr-route-types:frr-route-types-v4; | |
225 | description | |
226 | "Routing protocol."; | |
227 | must '. != "rip"'; | |
228 | } | |
229 | leaf route-map { | |
230 | type string { | |
231 | length "1..max"; | |
232 | } | |
233 | description | |
234 | "Applies the conditions of the specified route-map to | |
235 | routes that are redistributed into the RIP routing | |
236 | instance."; | |
237 | } | |
238 | leaf metric { | |
239 | type uint8 { | |
240 | range "0..16"; | |
241 | } | |
242 | description | |
243 | "Metric used for the redistributed route. If a metric is | |
244 | not specified, the metric configured with the | |
245 | default-metric attribute in RIP router configuration is | |
246 | used. If the default-metric attribute has not been | |
247 | configured, the default metric for redistributed routes | |
248 | is 0."; | |
249 | } | |
250 | } | |
251 | leaf-list static-route { | |
252 | type inet:ipv4-prefix; | |
253 | description | |
254 | "RIP static routes."; | |
255 | } | |
256 | container timers { | |
257 | description | |
258 | "Settings of basic timers"; | |
259 | leaf flush-interval { | |
260 | type uint32 { | |
261 | range "5..2147483647"; | |
262 | } | |
263 | units "seconds"; | |
264 | default "120"; | |
265 | description | |
266 | "Interval before a route is flushed from the routing | |
267 | table."; | |
268 | } | |
269 | leaf holddown-interval { | |
270 | type uint32 { | |
271 | range "5..2147483647"; | |
272 | } | |
273 | units "seconds"; | |
274 | default "180"; | |
275 | description | |
276 | "Interval before better routes are released."; | |
277 | } | |
278 | leaf update-interval { | |
279 | type uint32 { | |
280 | range "5..2147483647"; | |
281 | } | |
282 | units "seconds"; | |
283 | default "30"; | |
284 | description | |
285 | "Interval at which RIP updates are sent."; | |
286 | } | |
287 | } | |
288 | container version { | |
289 | leaf receive { | |
290 | type enumeration { | |
291 | enum "1" { | |
292 | value 1; | |
293 | description | |
294 | "Accept RIPv1 updates only."; | |
295 | } | |
296 | enum "2" { | |
297 | value 2; | |
298 | description | |
299 | "Accept RIPv2 updates only."; | |
300 | } | |
301 | enum "1-2" { | |
302 | value 3; | |
303 | description | |
304 | "Accept both RIPv1 and RIPv2 updates."; | |
305 | } | |
306 | } | |
307 | default "1-2"; | |
308 | description | |
309 | "Advertisement reception - Version control."; | |
310 | } | |
311 | leaf send { | |
312 | type enumeration { | |
313 | enum "1" { | |
314 | value 1; | |
315 | description | |
316 | "Send RIPv1 updates only."; | |
317 | } | |
318 | enum "2" { | |
319 | value 2; | |
320 | description | |
321 | "Send RIPv2 updates only."; | |
322 | } | |
323 | } | |
324 | default "2"; | |
325 | description | |
326 | "Advertisement transmission - Version control."; | |
327 | } | |
328 | must | |
329 | '(./receive = "1" and ./send = "1") or ' + | |
330 | '(./receive = "2" and ./send = "2") or ' + | |
331 | '(./receive = "1-2" and ./send = "2")'; | |
332 | } | |
707656ec | 333 | |
32600a98 RW |
334 | /* |
335 | * Operational data. | |
336 | */ | |
337 | container state { | |
338 | config false; | |
707656ec | 339 | description |
32600a98 RW |
340 | "Operational data."; |
341 | ||
342 | container neighbors { | |
707656ec | 343 | description |
32600a98 RW |
344 | "Neighbor information."; |
345 | list neighbor { | |
346 | key "address"; | |
707656ec | 347 | description |
32600a98 RW |
348 | "A RIP neighbor."; |
349 | leaf address { | |
350 | type inet:ipv4-address; | |
351 | description | |
352 | "IP address that a RIP neighbor is using as its | |
353 | source address."; | |
354 | } | |
355 | leaf last-update { | |
356 | type yang:date-and-time; | |
357 | description | |
358 | "The time when the most recent RIP update was | |
359 | received from this neighbor."; | |
360 | } | |
361 | leaf bad-packets-rcvd { | |
362 | type yang:counter32; | |
363 | description | |
364 | "The number of RIP invalid packets received from | |
365 | this neighbor which were subsequently discarded | |
366 | for any reason (e.g. a version 0 packet, or an | |
367 | unknown command type)."; | |
368 | } | |
369 | leaf bad-routes-rcvd { | |
370 | type yang:counter32; | |
371 | description | |
372 | "The number of routes received from this neighbor, | |
373 | in valid RIP packets, which were ignored for any | |
374 | reason (e.g. unknown address family, or invalid | |
375 | metric)."; | |
376 | } | |
707656ec RW |
377 | } |
378 | } | |
32600a98 | 379 | container routes { |
707656ec | 380 | description |
32600a98 RW |
381 | "Route information."; |
382 | list route { | |
383 | key "prefix"; | |
707656ec | 384 | description |
32600a98 RW |
385 | "A RIP IPv4 route."; |
386 | leaf prefix { | |
387 | type inet:ipv4-prefix; | |
388 | description | |
389 | "IP address (in the form A.B.C.D) and prefix length, | |
390 | separated by the slash (/) character. The range of | |
391 | values for the prefix-length is 0 to 32."; | |
392 | } | |
393 | leaf next-hop { | |
394 | type inet:ipv4-address; | |
395 | description | |
396 | "Next hop IPv4 address."; | |
397 | } | |
398 | leaf interface { | |
399 | type string; | |
400 | description | |
401 | "The interface that the route uses."; | |
402 | } | |
403 | leaf metric { | |
404 | type uint8 { | |
405 | range "0..16"; | |
406 | } | |
407 | description | |
408 | "Route metric."; | |
707656ec | 409 | } |
707656ec RW |
410 | } |
411 | } | |
412 | } | |
413 | } | |
414 | } | |
415 | ||
416 | /* | |
417 | * Per-interface configuration data | |
418 | */ | |
419 | augment "/frr-interface:lib/frr-interface:interface" { | |
420 | container rip { | |
421 | description | |
422 | "RIP interface parameters."; | |
423 | leaf split-horizon { | |
424 | type enumeration { | |
425 | enum "disabled" { | |
426 | value 0; | |
427 | description | |
428 | "Disables split-horizon processing."; | |
429 | } | |
430 | enum "simple" { | |
431 | value 1; | |
432 | description | |
433 | "Enables simple split-horizon processing."; | |
434 | } | |
435 | enum "poison-reverse" { | |
436 | value 2; | |
437 | description | |
438 | "Enables split-horizon processing with poison | |
439 | reverse."; | |
440 | } | |
441 | } | |
442 | default "simple"; | |
443 | description | |
444 | "Controls RIP split-horizon processing on the specified | |
445 | interface."; | |
446 | } | |
447 | leaf v2-broadcast { | |
448 | type boolean; | |
449 | default "false"; | |
450 | description | |
451 | "Send IP broadcast v2 update."; | |
452 | } | |
453 | leaf version-receive { | |
454 | type enumeration { | |
455 | enum "unspecified" { | |
456 | value 0; | |
457 | description | |
458 | "Inherit configuration from the routing instance."; | |
459 | } | |
460 | enum "1" { | |
461 | value 1; | |
462 | description | |
463 | "Accept RIPv1 updates only."; | |
464 | } | |
465 | enum "2" { | |
466 | value 2; | |
467 | description | |
468 | "Accept RIPv2 updates only."; | |
469 | } | |
470 | enum "both" { | |
471 | value 3; | |
472 | description | |
473 | "Accept both RIPv1 and RIPv2 updates."; | |
474 | } | |
475 | enum "none" { | |
476 | value 4; | |
477 | description | |
478 | "Do not accept neither RIPv1 nor RIPv2 updates."; | |
479 | } | |
480 | } | |
481 | default "unspecified"; | |
482 | description | |
483 | "Advertisement reception - Version control."; | |
484 | } | |
485 | leaf version-send { | |
486 | type enumeration { | |
487 | enum "unspecified" { | |
488 | value 0; | |
489 | description | |
490 | "Inherit configuration from the routing instance."; | |
491 | } | |
492 | enum "1" { | |
493 | value 1; | |
494 | description | |
495 | "Send RIPv1 updates only."; | |
496 | } | |
497 | enum "2" { | |
498 | value 2; | |
499 | description | |
500 | "Send RIPv2 updates only."; | |
501 | } | |
502 | enum "both" { | |
503 | value 3; | |
504 | description | |
505 | "Send both RIPv1 and RIPv2 updates."; | |
506 | } | |
507 | enum "none" { | |
508 | value 4; | |
509 | description | |
510 | "Do not send neither RIPv1 nor RIPv2 updates."; | |
511 | } | |
512 | } | |
513 | default "unspecified"; | |
514 | description | |
515 | "Advertisement transmission - Version control."; | |
516 | } | |
517 | container authentication-scheme { | |
518 | description | |
519 | "Specify the authentication scheme for the RIP interface"; | |
520 | leaf mode { | |
521 | type enumeration { | |
522 | enum "none" { | |
523 | value 0; | |
524 | description | |
525 | "No authentication."; | |
526 | } | |
527 | enum "plain-text" { | |
528 | value 2; | |
529 | description | |
530 | "Plain-text authentication."; | |
531 | } | |
532 | enum "md5" { | |
533 | value 3; | |
534 | description | |
535 | "MD5 authentication."; | |
536 | } | |
537 | } | |
538 | default "none"; | |
539 | description | |
540 | "Specify the authentication mode."; | |
541 | } | |
542 | leaf md5-auth-length { | |
543 | when "../mode = 'md5'"; | |
544 | type enumeration { | |
545 | enum "16" { | |
546 | value 16; | |
547 | description | |
548 | "RFC compatible."; | |
549 | } | |
550 | enum "20" { | |
551 | value 20; | |
552 | description | |
553 | "Old ripd compatible."; | |
554 | } | |
555 | } | |
556 | default "20"; | |
557 | description | |
558 | "MD5 authentication data length."; | |
559 | } | |
560 | } | |
561 | choice authentication-data { | |
562 | description | |
563 | "Choose whether to use a simple password or a key-chain."; | |
564 | leaf authentication-password { | |
565 | type string { | |
566 | length "1..16"; | |
567 | } | |
568 | description | |
569 | "Authentication string."; | |
570 | } | |
571 | leaf authentication-key-chain { | |
572 | type string; | |
573 | description | |
574 | "Key-chain name."; | |
575 | } | |
576 | } | |
577 | } | |
578 | } | |
579 | ||
580 | /* | |
581 | * RPCs | |
582 | */ | |
583 | rpc clear-rip-route { | |
584 | description | |
585 | "Clears RIP routes from the IP routing table and routes | |
586 | redistributed into the RIP protocol."; | |
14f17e63 RW |
587 | |
588 | input { | |
589 | leaf vrf { | |
590 | type string; | |
591 | description | |
592 | "VRF name identifying a specific RIP instance. | |
593 | This leaf is optional for the rpc. | |
594 | If it is specified, the rpc will clear all routes in the | |
595 | specified RIP instance; | |
596 | if it is not specified, the rpc will clear all routes in | |
597 | all RIP instances."; | |
598 | } | |
599 | } | |
707656ec RW |
600 | } |
601 | ||
602 | /* | |
603 | * Notifications | |
604 | */ | |
605 | notification authentication-type-failure { | |
606 | description | |
607 | "This notification is sent when the system | |
608 | receives a PDU with the wrong authentication type | |
609 | field."; | |
610 | leaf interface-name { | |
611 | type string; | |
612 | description | |
613 | "Describes the name of the RIP interface."; | |
614 | } | |
615 | leaf raw-pdu { | |
616 | type binary; | |
617 | description | |
618 | "Received raw PDU."; | |
619 | } | |
620 | } | |
621 | notification authentication-failure { | |
622 | description | |
623 | "This notification is sent when the system | |
624 | receives a PDU with the wrong authentication | |
625 | information."; | |
626 | leaf interface-name { | |
627 | type string; | |
628 | description | |
629 | "Describes the name of the RIP interface."; | |
630 | } | |
631 | leaf raw-pdu { | |
632 | type binary; | |
633 | description | |
634 | "Received raw PDU."; | |
635 | } | |
636 | } | |
637 | } |