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