]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-ripd.yang
Merge pull request #9104 from idryzhov/topotest-multiline
[mirror_frr.git] / yang / frr-ripd.yang
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 }
15 import frr-vrf {
16 prefix frr-vrf;
17 }
18 import frr-route-map {
19 prefix frr-route-map;
20 }
21 import frr-route-types {
22 prefix frr-route-types;
23 }
24
25 organization
26 "FRRouting";
27 contact
28 "FRR Users List: <mailto:frog@lists.frrouting.org>
29 FRR Development List: <mailto:dev@lists.frrouting.org>";
30 description
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.";
57
58 revision 2019-09-09 {
59 description
60 "Changed interface references to use
61 frr-interface:interface-ref typedef";
62 }
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 /*
73 * Routing instance configuration.
74 */
75 list instance {
76 key "vrf";
77 description
78 "RIP routing instance.";
79
80 leaf vrf {
81 type frr-vrf:vrf-ref;
82 description
83 "VRF name.";
84 }
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 {
152 type frr-interface:interface-ref;
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 {
161 type union {
162 type frr-interface:interface-ref;
163 type enumeration {
164 enum '*' {
165 description
166 "Match all interfaces.";
167 }
168 }
169 }
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'";
213 type frr-interface:interface-ref;
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'";
220 type frr-interface:interface-ref;
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 {
236 type frr-route-map:route-map-ref;
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 must
295 '(. = "1" and ../send = "1") or ' +
296 '(. = "2" and ../send = "2") or ' +
297 '(. = "1-2" and ../send = "2")';
298 type enumeration {
299 enum "1" {
300 value 1;
301 description
302 "Accept RIPv1 updates only.";
303 }
304 enum "2" {
305 value 2;
306 description
307 "Accept RIPv2 updates only.";
308 }
309 enum "1-2" {
310 value 3;
311 description
312 "Accept both RIPv1 and RIPv2 updates.";
313 }
314 }
315 default "1-2";
316 description
317 "Advertisement reception - Version control.";
318 }
319 leaf send {
320 must
321 '(../receive = "1" and . = "1") or ' +
322 '(../receive = "2" and . = "2") or ' +
323 '(../receive = "1-2" and . = "2")';
324 type enumeration {
325 enum "1" {
326 value 1;
327 description
328 "Send RIPv1 updates only.";
329 }
330 enum "2" {
331 value 2;
332 description
333 "Send RIPv2 updates only.";
334 }
335 }
336 default "2";
337 description
338 "Advertisement transmission - Version control.";
339 }
340 }
341
342 /*
343 * Operational data.
344 */
345 container state {
346 config false;
347 description
348 "Operational data.";
349
350 container neighbors {
351 description
352 "Neighbor information.";
353 list neighbor {
354 key "address";
355 description
356 "A RIP neighbor.";
357 leaf address {
358 type inet:ipv4-address;
359 description
360 "IP address that a RIP neighbor is using as its
361 source address.";
362 }
363 leaf last-update {
364 type yang:date-and-time;
365 description
366 "The time when the most recent RIP update was
367 received from this neighbor.";
368 }
369 leaf bad-packets-rcvd {
370 type yang:counter32;
371 description
372 "The number of RIP invalid packets received from
373 this neighbor which were subsequently discarded
374 for any reason (e.g. a version 0 packet, or an
375 unknown command type).";
376 }
377 leaf bad-routes-rcvd {
378 type yang:counter32;
379 description
380 "The number of routes received from this neighbor,
381 in valid RIP packets, which were ignored for any
382 reason (e.g. unknown address family, or invalid
383 metric).";
384 }
385 }
386 }
387 container routes {
388 description
389 "Route information.";
390 list route {
391 key "prefix";
392 description
393 "A RIP IPv4 route.";
394 leaf prefix {
395 type inet:ipv4-prefix;
396 description
397 "IP address (in the form A.B.C.D) and prefix length,
398 separated by the slash (/) character. The range of
399 values for the prefix-length is 0 to 32.";
400 }
401 leaf next-hop {
402 type inet:ipv4-address;
403 description
404 "Next hop IPv4 address.";
405 }
406 leaf interface {
407 type frr-interface:interface-ref;
408 description
409 "The interface that the route uses.";
410 }
411 leaf metric {
412 type uint8 {
413 range "0..16";
414 }
415 description
416 "Route metric.";
417 }
418 }
419 }
420 }
421 }
422 }
423
424 /*
425 * Per-interface configuration data
426 */
427 augment "/frr-interface:lib/frr-interface:interface" {
428 container rip {
429 description
430 "RIP interface parameters.";
431 leaf split-horizon {
432 type enumeration {
433 enum "disabled" {
434 value 0;
435 description
436 "Disables split-horizon processing.";
437 }
438 enum "simple" {
439 value 1;
440 description
441 "Enables simple split-horizon processing.";
442 }
443 enum "poison-reverse" {
444 value 2;
445 description
446 "Enables split-horizon processing with poison
447 reverse.";
448 }
449 }
450 default "simple";
451 description
452 "Controls RIP split-horizon processing on the specified
453 interface.";
454 }
455 leaf v2-broadcast {
456 type boolean;
457 default "false";
458 description
459 "Send IP broadcast v2 update.";
460 }
461 leaf version-receive {
462 type enumeration {
463 enum "unspecified" {
464 value 0;
465 description
466 "Inherit configuration from the routing instance.";
467 }
468 enum "1" {
469 value 1;
470 description
471 "Accept RIPv1 updates only.";
472 }
473 enum "2" {
474 value 2;
475 description
476 "Accept RIPv2 updates only.";
477 }
478 enum "both" {
479 value 3;
480 description
481 "Accept both RIPv1 and RIPv2 updates.";
482 }
483 enum "none" {
484 value 4;
485 description
486 "Do not accept neither RIPv1 nor RIPv2 updates.";
487 }
488 }
489 default "unspecified";
490 description
491 "Advertisement reception - Version control.";
492 }
493 leaf version-send {
494 type enumeration {
495 enum "unspecified" {
496 value 0;
497 description
498 "Inherit configuration from the routing instance.";
499 }
500 enum "1" {
501 value 1;
502 description
503 "Send RIPv1 updates only.";
504 }
505 enum "2" {
506 value 2;
507 description
508 "Send RIPv2 updates only.";
509 }
510 enum "both" {
511 value 3;
512 description
513 "Send both RIPv1 and RIPv2 updates.";
514 }
515 enum "none" {
516 value 4;
517 description
518 "Do not send neither RIPv1 nor RIPv2 updates.";
519 }
520 }
521 default "unspecified";
522 description
523 "Advertisement transmission - Version control.";
524 }
525 container authentication-scheme {
526 description
527 "Specify the authentication scheme for the RIP interface";
528 leaf mode {
529 type enumeration {
530 enum "none" {
531 value 0;
532 description
533 "No authentication.";
534 }
535 enum "plain-text" {
536 value 2;
537 description
538 "Plain-text authentication.";
539 }
540 enum "md5" {
541 value 3;
542 description
543 "MD5 authentication.";
544 }
545 }
546 default "none";
547 description
548 "Specify the authentication mode.";
549 }
550 leaf md5-auth-length {
551 when "../mode = 'md5'";
552 type enumeration {
553 enum "16" {
554 value 16;
555 description
556 "RFC compatible.";
557 }
558 enum "20" {
559 value 20;
560 description
561 "Old ripd compatible.";
562 }
563 }
564 default "20";
565 description
566 "MD5 authentication data length.";
567 }
568 }
569 choice authentication-data {
570 description
571 "Choose whether to use a simple password or a key-chain.";
572 leaf authentication-password {
573 type string {
574 length "1..16";
575 }
576 description
577 "Authentication string.";
578 }
579 leaf authentication-key-chain {
580 type string;
581 description
582 "Key-chain name.";
583 }
584 }
585 }
586 }
587
588 /*
589 * RPCs
590 */
591 rpc clear-rip-route {
592 description
593 "Clears RIP routes from the IP routing table and routes
594 redistributed into the RIP protocol.";
595
596 input {
597 leaf vrf {
598 type frr-vrf:vrf-ref;
599 description
600 "VRF name identifying a specific RIP instance.
601 This leaf is optional for the rpc.
602 If it is specified, the rpc will clear all routes in the
603 specified RIP instance;
604 if it is not specified, the rpc will clear all routes in
605 all RIP instances.";
606 }
607 }
608 }
609
610 /*
611 * Notifications
612 */
613 notification authentication-type-failure {
614 description
615 "This notification is sent when the system
616 receives a PDU with the wrong authentication type
617 field.";
618 leaf interface-name {
619 type frr-interface:interface-ref;
620 description
621 "Describes the name of the RIP interface.";
622 }
623 leaf raw-pdu {
624 type binary;
625 description
626 "Received raw PDU.";
627 }
628 }
629 notification authentication-failure {
630 description
631 "This notification is sent when the system
632 receives a PDU with the wrong authentication
633 information.";
634 leaf interface-name {
635 type frr-interface:interface-ref;
636 description
637 "Describes the name of the RIP interface.";
638 }
639 leaf raw-pdu {
640 type binary;
641 description
642 "Received raw PDU.";
643 }
644 }
645 }