]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-ospfd.yang
Merge pull request #9378 from AnuradhaKaruppiah/evpn-mh-cleanup
[mirror_frr.git] / yang / frr-ospfd.yang
1 module frr-ospfd {
2 yang-version 1.1;
3 namespace "http://frrouting.org/yang/ospfd";
4 prefix frr-ospfd;
5
6 import frr-routing {
7 prefix frr-rt;
8 }
9
10 import ietf-inet-types {
11 prefix inet;
12 }
13
14 import frr-interface {
15 prefix frr-interface;
16 }
17
18 import frr-route-map {
19 prefix frr-route-map;
20 }
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 OSPFd information.
33 This YANG module augments the basic routing with additional
34 OSPF information";
35
36 revision 2020-07-21 {
37 description
38 "Initial revision.";
39 }
40
41 identity ospf {
42 base frr-rt:routing-protocol;
43 description
44 "'OSPF' routing ospf-protocol.";
45 }
46
47 /* Policy types to be removed later, once policy Yang finalized */
48 typedef plist-ref {
49 type string;
50 }
51
52 typedef access-list-ref {
53 type string;
54 }
55
56 typedef ospf-area-id {
57 type union {
58 type inet:ipv4-address;
59 type uint32;
60 }
61 description "OSPF Area ID.";
62 }
63
64 grouping nssa-grouping {
65 container nssa {
66 presence "Present if the nssa is enabled";
67 leaf no-summary {
68 type boolean;
69 default "false";
70 description
71 "Do not inject inter-area routes into nssa";
72 }
73
74 leaf translate-always {
75 type boolean;
76 default "false";
77 description
78 "NSSA-ABR to always translate";
79 }
80
81 leaf translate-candidate {
82 type boolean;
83 default "false";
84 description
85 "NSSA-ABR for translate election";
86 }
87
88 leaf translate-never {
89 type boolean;
90 default "false";
91 description
92 "NSSA-ABR to never translate";
93 }
94 }
95 }
96
97 grouping range-grouping {
98 container ranges {
99 list range {
100 key "prefix";
101 description
102 "A list of range objects";
103 leaf prefix {
104 type inet:ipv4-prefix;
105 description
106 "Area range prefix";
107 }
108
109 leaf advertise {
110 type boolean;
111 description
112 "Advertise this range";
113 }
114
115 leaf not-advertise {
116 type boolean;
117 default "false";
118 description
119 "Do not advertise this range";
120 }
121
122 leaf cost {
123 type uint32 {
124 range "0..16777215";
125 }
126 description
127 "Metric for this range";
128 }
129
130 leaf substitute {
131 type inet:ipv4-prefix;
132 description
133 "Network prefix to be announced instead of range";
134 }
135 }
136 }
137 }
138
139 grouping stub-grouping {
140 container stub {
141 presence "Present when area is stub";
142 leaf no-summary {
143 type boolean;
144 default "false";
145 description
146 "Do not inject inter-area routes into stub";
147 }
148 }
149 }
150
151 grouping shortcut-grouping {
152 container shortcut {
153 leaf default {
154 type boolean;
155 default "false";
156 description
157 "Default shortcutting behavior";
158 }
159
160 leaf disable {
161 type boolean;
162 description
163 "Disable shortcutting through the area";
164 }
165
166 leaf enable {
167 type boolean;
168 description
169 "Enable shortcutting through the area";
170 }
171 }
172 }
173
174 grouping authentication-group {
175 container authentication {
176 presence "Enable authentication.";
177 description
178 "Enable authentication on this virtual link.";
179 leaf message-digest {
180 type boolean;
181 description
182 "Use message-digest authentication.";
183 }
184
185 leaf null {
186 type boolean;
187 description
188 "Use null authentication.";
189 }
190 }
191
192 list message-digest-key {
193 key "key-id";
194 leaf key-id {
195 type uint8;
196 description
197 "Key id";
198 }
199
200 leaf mds-key {
201 type string;
202 description
203 "The OSPF password.";
204 }
205 }
206
207 leaf authentication-key {
208 type string;
209 description
210 "The OSPF password.";
211 }
212 }
213
214 grouping virtual-link-group {
215 list virtual-link {
216 key "neighbor area-id";
217 description
218 "Virtual link parameters.";
219 leaf neighbor {
220 type inet:ipv4-address;
221 description
222 "Router ID of the remote ABR.";
223 }
224
225 leaf area-id {
226 mandatory true;
227 type ospf-area-id;
228 }
229
230 uses authentication-group;
231
232 container timers {
233 leaf dead-interval {
234 type uint16;
235 units "seconds";
236 description
237 "Interval time after which a neighbor is declared down.";
238 }
239
240 leaf hello-interval {
241 type uint16 {
242 range "1..65535";
243 }
244 units "seconds";
245 description
246 "Time between HELLO packets.";
247 }
248
249 leaf retransmit-interval {
250 type uint16 {
251 range "1..65535";
252 }
253 units "seconds";
254 description
255 "Time between retransmitting lost link state advertisements.";
256 }
257
258 leaf transmit-delay {
259 type uint16 {
260 range "1..65535";
261 }
262 units "seconds";
263 description
264 "Link state transmit delay.";
265 }
266 }
267 }
268 }
269
270 grouping area-groupings {
271 container areas {
272 list area {
273 key "area-id";
274 description
275 "A list of area objects";
276 leaf area-id {
277 type ospf-area-id;
278 }
279
280 container authentication {
281 presence "Enable authentication";
282 leaf message-digest {
283 type boolean;
284 description
285 "Use message-digest authentication";
286 }
287 }
288
289 leaf default-cost {
290 type uint32 {
291 range "0..16777215";
292 }
293 description
294 "Advertised default summary cost";
295 }
296
297 leaf export-list {
298 type access-list-ref;
299 description
300 "Filter for networks announced to other areas.";
301 }
302
303 leaf import-list {
304 type access-list-ref;
305 description
306 "Filter for networks from other areas announced to the specified one.";
307 }
308
309 container filter-list {
310 leaf prefix {
311 type plist-ref;
312 description
313 "Filter networks between OSPF areas.";
314 }
315
316 leaf in {
317 type boolean;
318 }
319
320 leaf out {
321 type boolean;
322 }
323 }
324
325 uses nssa-grouping;
326
327 uses range-grouping;
328
329 uses stub-grouping;
330
331 uses shortcut-grouping;
332
333 uses virtual-link-group;
334 }
335 }
336 }
337
338 /* router ospf attributes */
339 grouping route-ospf-leaf-attributes {
340 leaf auto-cost-reference-bandwidth {
341 type uint32 {
342 range "1..4294967";
343 }
344 units "Mbits";
345 description
346 "The reference bandwidth in terms of Mbits per second.";
347 }
348
349 leaf use-arp {
350 type boolean;
351 default "true";
352 description
353 "ARP for neighbor table entry.";
354 }
355
356 leaf capability-opaque {
357 type boolean;
358 default "false";
359 description
360 "Opaque LSA.";
361 }
362
363 leaf compatible-rfc1583 {
364 type boolean;
365 description
366 "Compatible with RFC 1583.";
367 }
368
369 leaf default-metric {
370 type uint32 {
371 range "0..16777214";
372 }
373 description
374 "Metric of redistributed routes.";
375 }
376
377 leaf write-multiplier {
378 type uint8 {
379 range "1..100";
380 }
381 description
382 "Maximum number of interfaces serviced per write.";
383 }
384
385 container router-info {
386 choice router-info {
387 case as {
388 leaf as {
389 type boolean;
390 description
391 "Enable the Router Information functionality with AS flooding scope.";
392 }
393 }
394 case area {
395 leaf area {
396 type ospf-area-id;
397 description
398 "Enable the Router Information functionality with Area flooding scope.";
399 }
400 }
401 }
402 }
403 }
404
405 grouping metric-common-group {
406 leaf metric {
407 type uint32 {
408 range "0..16777214";
409 }
410 description
411 "OSPF default metric.";
412 }
413
414 leaf metric-type {
415 type enumeration {
416 enum "type-1" {
417 value 1;
418 }
419 enum "type-2" {
420 value 2;
421 }
422 }
423 description
424 "Metric type (1/2).";
425 }
426
427 leaf route-map {
428 type frr-route-map:route-map-ref;
429 description
430 "Route map reference.";
431 }
432 }
433
434 grouping default-info-group {
435 container default-information {
436 leaf originate {
437 type boolean;
438 description
439 "Advertise a default route";
440 }
441
442 leaf always {
443 type boolean;
444 description
445 "Always advertise default route.";
446 }
447
448 uses metric-common-group;
449 }
450 }
451
452 grouping redistribute-group {
453 list redistribute {
454 key "protocol";
455 leaf protocol {
456 type frr-route-types:frr-route-types-v4;
457 description
458 "Protocol.";
459 }
460
461 uses metric-common-group;
462 }
463 }
464
465 grouping distance-group {
466 container distance {
467 leaf admin-value {
468 type uint8 {
469 range "1..255";
470 }
471 description
472 "Admin value.";
473 }
474
475 container ospf {
476 leaf external {
477 type uint8 {
478 range "1..255";
479 }
480 description
481 "Distance for external routes.";
482 }
483
484 leaf inter-area {
485 type uint8 {
486 range "1..255";
487 }
488 description
489 "Distance for inter-area routes.";
490 }
491
492 leaf intra-area {
493 type uint8 {
494 range "1..255";
495 }
496 description
497 "Distance for intra-area routes.";
498 }
499 }
500 }
501 }
502
503 grouping distribute-list-group {
504 container distribute-list {
505 list dlist {
506 key "name protocol";
507 leaf name {
508 type string;
509 description
510 "Filter networks in routing updates.";
511 }
512
513 leaf protocol {
514 type frr-route-types:frr-route-types-v4;
515 description
516 "Out protocol.";
517 }
518 }
519 }
520 }
521
522 grouping max-metric-group {
523 container max-metric {
524 container router-lsa {
525 description
526 "Advertise own Router-LSA with infinite distance (stub router).";
527 leaf administrative {
528 type boolean;
529 description
530 "Administratively applied, for an indefinite period.";
531 }
532
533 leaf on-shutdown {
534 type uint8 {
535 range "5..100";
536 }
537 description
538 "Advertise stub-router prior to full shutdown of OSPF.";
539 }
540
541 leaf on-startup {
542 type uint32 {
543 range "5..86400";
544 }
545 description
546 "Automatically advertise stub Router-LSA on startup of OSPF.";
547 }
548 }
549 }
550 }
551
552 grouping mpls-te-group {
553 container mpls-te {
554 leaf on {
555 type boolean;
556 description
557 "Enable the MPLS-TE functionality.";
558 }
559
560 leaf router-address {
561 type inet:ipv4-address;
562 description
563 "Stable IP address of the advertising router.";
564 }
565
566 container inter-as {
567 leaf as {
568 type boolean;
569 description
570 "AS native mode self originate INTER-AS LSA with Type 11 (as flooding scope).";
571 }
572
573 leaf area {
574 type ospf-area-id;
575 description
576 "AREA native mode self originate INTER-AS LSA with Type 10 (area flooding scope).";
577 }
578 }
579 }
580 }
581
582 grouping ospf-group {
583 container ospf {
584 leaf abr-type {
585 type enumeration {
586 enum "cisco" {
587 value 1;
588 description
589 "Alternative ABR, Cisco implementation.";
590 }
591 enum "ibm" {
592 value 2;
593 description
594 "Alternative ABR, IBM implementation.";
595 }
596 enum "shortcut" {
597 value 3;
598 description
599 "Shortcut ABR.";
600 }
601 enum "standard" {
602 value 4;
603 description
604 "Standard behavior (RFC2328).";
605 }
606 }
607 }
608
609 leaf opaque-lsa {
610 type boolean;
611 description
612 "Enable the Opaque-LSA capability (RFC2370)";
613 }
614
615 leaf rfc1583compatibility {
616 type boolean;
617 description
618 "Enable the RFC 1583 compatibility flag.";
619 }
620
621 leaf router-id {
622 type inet:ipv4-address;
623 description
624 "Router-id for the OSPF process.";
625 }
626
627 leaf write-multiplier {
628 type uint8 {
629 range "1..100";
630 }
631 description
632 "Write multiplier.";
633 }
634 }
635 }
636
637 grouping timer-group {
638 container timers {
639 leaf refresh-interval {
640 type uint16 {
641 range "10..1800";
642 }
643 units "seconds";
644 description
645 "The maximum time between distinct originations of any particular
646 LSA, value in units seconds.";
647 }
648
649 leaf lsa-min-arrival {
650 type uint32 {
651 range "0..600000";
652 }
653 units "milliseconds";
654 description
655 "Minimum delay in receiving new version of an LSA.";
656 }
657
658 container throttle {
659 leaf lsa-all {
660 type uint16 {
661 range "0..5000";
662 }
663 units "milliseconds";
664 description
665 "LSA delay between transmissions.";
666 }
667
668 leaf spf {
669 type uint32 {
670 range "0..600000";
671 }
672 units "milliseconds";
673 description
674 "Delay from first change received till SPF calculation.";
675 }
676 }
677 }
678 }
679
680 grouping segment-routing-group {
681 container segment-routing {
682 container global-block {
683 description
684 "Segment Routing Global Block label range.";
685 leaf lower-bound {
686 must "../upper-bound > .";
687 type uint32 {
688 range "0..1048575";
689 }
690 default "16000";
691 }
692
693 leaf upper-bound {
694 must ". > ../lower-bound";
695 type uint32 {
696 range "0..1048575";
697 }
698 default "23999";
699 }
700 }
701
702 container srlb {
703 description
704 "Local blocks to be advertised.";
705 leaf lower-bound {
706 must "../upper-bound > .";
707 type uint32;
708 default "15000";
709 description
710 "Lower value in the label range.";
711 }
712 leaf upper-bound {
713 must ". > ../lower-bound";
714 type uint32;
715 default "15999";
716 description
717 "Upper value in the label range.";
718 }
719 }
720
721 leaf node-msd {
722 type uint8 {
723 range "1..16";
724 }
725 description
726 "Maximum Stack Depth for this router.";
727 }
728
729 leaf on {
730 type boolean;
731 description
732 "Enable Segment Routing.";
733 }
734
735 list prefix-sid {
736 key "index";
737 leaf index {
738 type uint16;
739 description
740 "SID index for this prefix.";
741 }
742
743 leaf prefix {
744 type inet:ipv4-prefix;
745 description
746 "Prefix SID.";
747 }
748
749 leaf last-hop-behavior {
750 type enumeration {
751 enum "explicit-null" {
752 value 0;
753 description
754 "Use explicit-null for the SID.";
755 }
756 enum "no-php" {
757 value 1;
758 description
759 "Do not use Penultimate Hop Popping (PHP)
760 for the SID.";
761 }
762 enum "php" {
763 value 2;
764 description
765 "Use PHP for the SID.";
766 }
767 }
768 default "php";
769 description
770 "Configure last hop behavior.";
771 }
772 }
773 }
774 }
775
776 grouping ospf-list-group {
777 list neighbor {
778 key "ip";
779 description
780 "Neighbor list.";
781 leaf ip {
782 type inet:ipv4-address;
783 description
784 "Neighbor IP address.";
785 }
786
787 leaf priority {
788 type uint8;
789 description
790 "Neighbor Priority.";
791 }
792
793 leaf poll-interval {
794 type uint16 {
795 range "1..65535";
796 }
797 units "seconds";
798 description
799 "Dead Neighbor Polling interval.";
800 }
801 }
802
803 list network {
804 key "prefix";
805 description
806 "Enable routing on list of IP network.";
807 leaf prefix {
808 type inet:ipv4-prefix;
809 description
810 "Prefix on which routing needs to be enabled.";
811 }
812
813 leaf area {
814 type ospf-area-id;
815 description
816 "Area ID for this network.";
817 }
818 }
819
820 list passive-interface {
821 key "interface";
822 description
823 "Suppress routing updates on list interface.";
824 leaf interface {
825 type frr-interface:interface-ref;
826 description
827 "Suppress routing updates on an interface.";
828 }
829
830 leaf address {
831 type inet:ipv4-address;
832 description
833 "Interface address.";
834 }
835 }
836 }
837
838 grouping interface-ospf-attribute-group {
839 leaf area {
840 type ospf-area-id;
841 description
842 "OSPF area ID.";
843 }
844
845 uses authentication-group;
846
847 leaf cost {
848 type uint16 {
849 range "1..65535";
850 }
851 description
852 "Interface cost";
853 }
854
855 container dead-interval {
856 leaf interval {
857 type uint16 {
858 range "1..65535";
859 }
860 units "seconds";
861 }
862
863 container minimal {
864 leaf hello-multiplier {
865 type uint8 {
866 range "1..10";
867 }
868 }
869 }
870 }
871
872 leaf hello-interval {
873 type uint16 {
874 range "1..65535";
875 }
876 units "seconds";
877 description
878 "Time between HELLO packets.";
879 }
880
881 leaf retransmit-interval {
882 type uint16 {
883 range "1..65535";
884 }
885 units "seconds";
886 description
887 "Time between retransmitting lost link state advertisements.";
888 }
889
890 leaf transmit-delay {
891 type uint16 {
892 range "1..65535";
893 }
894 units "seconds";
895 description
896 "Link state transmit delay.";
897 }
898
899 leaf mtu-ignore {
900 type boolean;
901 description
902 "Disable MTU mismatch detection on this interface.";
903 }
904
905 leaf priority {
906 type uint8;
907 description
908 "Router priority.";
909 }
910 }
911
912 grouping interface-ospf-group {
913 list instance {
914 key "id";
915 leaf id {
916 type uint16;
917 description
918 "OSPF instance ID.";
919 }
920
921 leaf bfd {
922 type boolean;
923 default "false";
924 description
925 "BFD support.";
926 }
927
928 leaf network {
929 type enumeration {
930 enum "broadcast" {
931 value 1;
932 }
933 enum "non-broadcast" {
934 value 2;
935 }
936 enum "point-to-multipoint" {
937 value 3;
938 }
939 enum "point-to-point" {
940 value 4;
941 }
942 }
943 }
944
945 uses interface-ospf-attribute-group;
946
947 list interface-address {
948 key "address";
949 leaf address {
950 type inet:ipv4-address;
951 description
952 "Address of interface";
953 }
954
955 uses interface-ospf-attribute-group;
956 }
957 }
958 }
959
960 augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol" {
961 container ospf {
962 when "../frr-rt:type = 'frr-ospfd:ospf'" {
963 description
964 "This container is only valid for the 'OSPF' routing
965 protocol.";
966 }
967
968 uses route-ospf-leaf-attributes;
969
970 uses default-info-group;
971
972 uses redistribute-group;
973
974 uses distance-group;
975
976 uses distribute-list-group;
977
978 uses max-metric-group;
979
980 uses mpls-te-group;
981
982 uses ospf-group;
983
984 uses timer-group;
985
986 uses segment-routing-group;
987
988 uses ospf-list-group;
989
990 uses area-groupings;
991 }
992 }
993
994 /*
995 * Per-interface configuration data
996 */
997 augment "/frr-interface:lib/frr-interface:interface" {
998 container ospf {
999 description
1000 "OSPF interface parameters.";
1001 uses interface-ospf-group;
1002 }
1003 }
1004 }