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