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