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