]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-ospfd.yang
Merge pull request #7303 from mobash-rasool/pim-fixes
[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 must "./upper-bound > ./lower-bound";
686 leaf lower-bound {
687 type uint32 {
688 range "0..1048575";
689 }
690 default "16000";
691 }
692
693 leaf upper-bound {
694 type uint32 {
695 range "0..1048575";
696 }
697 default "23999";
698 }
699 }
700
701 container srlb {
702 description
703 "Local blocks to be advertised.";
704 must "./upper-bound > ./lower-bound";
705 leaf lower-bound {
706 type uint32;
707 default "15000";
708 description
709 "Lower value in the label range.";
710 }
711 leaf upper-bound {
712 type uint32;
713 default "15999";
714 description
715 "Upper value in the label range.";
716 }
717 }
718
719 leaf node-msd {
720 type uint8 {
721 range "1..16";
722 }
723 description
724 "Maximum Stack Depth for this router.";
725 }
726
727 leaf on {
728 type boolean;
729 description
730 "Enable Segment Routing.";
731 }
732
733 list prefix-sid {
734 key "index";
735 leaf index {
736 type uint16;
737 description
738 "SID index for this prefix.";
739 }
740
741 leaf prefix {
742 type inet:ipv4-prefix;
743 description
744 "Prefix SID.";
745 }
746
747 leaf last-hop-behavior {
748 type enumeration {
749 enum "explicit-null" {
750 value 0;
751 description
752 "Use explicit-null for the SID.";
753 }
754 enum "no-php" {
755 value 1;
756 description
757 "Do not use Penultimate Hop Popping (PHP)
758 for the SID.";
759 }
760 enum "php" {
761 value 2;
762 description
763 "Use PHP for the SID.";
764 }
765 }
766 default "php";
767 description
768 "Configure last hop behavior.";
769 }
770 }
771 }
772 }
773
774 grouping ospf-list-group {
775 list neighbor {
776 key "ip";
777 description
778 "Neighbor list.";
779 leaf ip {
780 type inet:ipv4-address;
781 description
782 "Neighbor IP address.";
783 }
784
785 leaf priority {
786 type uint8;
787 description
788 "Neighbor Priority.";
789 }
790
791 leaf poll-interval {
792 type uint16 {
793 range "1..65535";
794 }
795 units "seconds";
796 description
797 "Dead Neighbor Polling interval.";
798 }
799 }
800
801 list network {
802 key "prefix";
803 description
804 "Enable routing on list of IP network.";
805 leaf prefix {
806 type inet:ipv4-prefix;
807 description
808 "Prefix on which routing needs to be enabled.";
809 }
810
811 leaf area {
812 type ospf-area-id;
813 description
814 "Area ID for this network.";
815 }
816 }
817
818 list passive-interface {
819 key "interface";
820 description
821 "Suppress routing updates on list interface.";
822 leaf interface {
823 type frr-interface:interface-ref;
824 description
825 "Suppress routing updates on an interface.";
826 }
827
828 leaf address {
829 type inet:ipv4-address;
830 description
831 "Interface address.";
832 }
833 }
834 }
835
836 grouping interface-ospf-attribute-group {
837 leaf area {
838 type ospf-area-id;
839 description
840 "OSPF area ID.";
841 }
842
843 uses authentication-group;
844
845 leaf cost {
846 type uint16 {
847 range "1..65535";
848 }
849 description
850 "Interface cost";
851 }
852
853 container dead-interval {
854 leaf interval {
855 type uint16 {
856 range "1..65535";
857 }
858 units "seconds";
859 }
860
861 container minimal {
862 leaf hello-multiplier {
863 type uint8 {
864 range "1..10";
865 }
866 }
867 }
868 }
869
870 leaf hello-interval {
871 type uint16 {
872 range "1..65535";
873 }
874 units "seconds";
875 description
876 "Time between HELLO packets.";
877 }
878
879 leaf retransmit-interval {
880 type uint16 {
881 range "1..65535";
882 }
883 units "seconds";
884 description
885 "Time between retransmitting lost link state advertisements.";
886 }
887
888 leaf transmit-delay {
889 type uint16 {
890 range "1..65535";
891 }
892 units "seconds";
893 description
894 "Link state transmit delay.";
895 }
896
897 leaf mtu-ignore {
898 type boolean;
899 description
900 "Disable MTU mismatch detection on this interface.";
901 }
902
903 leaf priority {
904 type uint8;
905 description
906 "Router priority.";
907 }
908 }
909
910 grouping interface-ospf-group {
911 list instance {
912 key "id";
913 leaf id {
914 type uint16;
915 description
916 "OSPF instance ID.";
917 }
918
919 leaf bfd {
920 type boolean;
921 default "false";
922 description
923 "BFD support.";
924 }
925
926 leaf network {
927 type enumeration {
928 enum "broadcast" {
929 value 1;
930 }
931 enum "non-broadcast" {
932 value 2;
933 }
934 enum "point-to-multipoint" {
935 value 3;
936 }
937 enum "point-to-point" {
938 value 4;
939 }
940 }
941 }
942
943 uses interface-ospf-attribute-group;
944
945 list interface-address {
946 key "address";
947 leaf address {
948 type inet:ipv4-address;
949 description
950 "Address of interface";
951 }
952
953 uses interface-ospf-attribute-group;
954 }
955 }
956 }
957
958 augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol" {
959 container ospf {
960 when "../frr-rt:type = 'frr-ospfd:ospf'" {
961 description
962 "This container is only valid for the 'OSPF' routing
963 protocol.";
964 }
965
966 uses route-ospf-leaf-attributes;
967
968 uses default-info-group;
969
970 uses redistribute-group;
971
972 uses distance-group;
973
974 uses distribute-list-group;
975
976 uses max-metric-group;
977
978 uses mpls-te-group;
979
980 uses ospf-group;
981
982 uses timer-group;
983
984 uses segment-routing-group;
985
986 uses ospf-list-group;
987
988 uses area-groupings;
989 }
990 }
991
992 /*
993 * Per-interface configuration data
994 */
995 augment "/frr-interface:lib/frr-interface:interface" {
996 container ospf {
997 description
998 "OSPF interface parameters.";
999 uses interface-ospf-group;
1000 }
1001 }
1002 }