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