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