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