summaryrefslogtreecommitdiffstats
path: root/yang/frr-ospfd.yang
blob: b0150cc0612a751ccd53ae4085d5914707a6735f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
module frr-ospfd {
  yang-version 1.1;
  namespace "http://frrouting.org/yang/ospfd";
  prefix frr-ospfd;

  import frr-routing {
    prefix frr-rt;
  }

  import ietf-inet-types {
    prefix inet;
  }

  import frr-interface {
    prefix frr-interface;
  }

  import frr-route-map {
    prefix frr-route-map;
  }

  import frr-route-types {
    prefix frr-route-types;
  }

  organization
    "FRRouting";
  contact
    "FRR Users List: <mailto:frog@lists.frrouting.org>
     FRR Development List: <mailto:dev@lists.frrouting.org>";
  description
    "This module defines a model for managing FRR OSPFd information.
     This YANG module augments the basic routing with additional
     OSPF information";

  revision 2020-07-21 {
    description
      "Initial revision.";
  }

  identity ospf {
    base frr-rt:routing-protocol;
    description
      "'OSPF' routing ospf-protocol.";
  }

  /* Policy types to be removed later, once policy Yang finalized */
  typedef plist-ref {
    type string;
  }

  typedef access-list-ref {
    type string;
  }

  typedef ospf-area-id {
    type union {
      type inet:ipv4-address;
      type uint32;
    }
    description "OSPF Area ID.";
  }

  grouping nssa-grouping {
    container nssa {
      presence "Present if the nssa is enabled";
      leaf no-summary {
        type boolean;
        default "false";
        description
          "Do not inject inter-area routes into nssa";
      }

      leaf translate-always {
        type boolean;
        default "false";
        description
          "NSSA-ABR to always translate";
      }

      leaf translate-candidate {
        type boolean;
        default "false";
        description
          "NSSA-ABR for translate election";
      }

      leaf translate-never {
        type boolean;
        default "false";
        description
          "NSSA-ABR to never translate";
      }
    }
  }

  grouping range-grouping {
    container ranges {
      list range {
        key "prefix";
        description
          "A list of range objects";
        leaf prefix {
          type inet:ipv4-prefix;
          description
            "Area range prefix";
        }

        leaf advertise {
          type boolean;
          description
            "Advertise this range";
        }

        leaf not-advertise {
          type boolean;
          default "false";
          description
            "Do not advertise this range";
        }

        leaf cost {
          type uint32 {
            range "0..16777215";
          }
          description
            "Metric for this range";
        }

        leaf substitute {
          type inet:ipv4-prefix;
          description
            "Network prefix to be announced instead of range";
        }
      }
    }
  }

  grouping stub-grouping {
    container stub {
      presence "Present when area is stub";
      leaf no-summary {
        type boolean;
        default "false";
        description
          "Do not inject inter-area routes into stub";
      }
    }
  }

  grouping shortcut-grouping {
    container shortcut {
      leaf default {
        type boolean;
        default "false";
        description
          "Default shortcutting behavior";
      }

      leaf disable {
        type boolean;
        description
          "Disable shortcutting through the area";
      }

      leaf enable {
        type boolean;
        description
          "Enable shortcutting through the area";
      }
    }
  }

  grouping authentication-group {
    container authentication {
      presence "Enable authentication.";
      description
        "Enable authentication on this virtual link.";
      leaf message-digest {
        type boolean;
        description
          "Use message-digest authentication.";
      }

      leaf null {
        type boolean;
        description
          "Use null authentication.";
      }
    }

    list message-digest-key {
      key "key-id";
      leaf key-id {
        type uint8;
        description
          "Key id";
      }

      leaf mds-key {
        type string;
        description
          "The OSPF password.";
      }
    }

    leaf authentication-key {
      type string;
      description
        "The OSPF password.";
    }
  }

  grouping virtual-link-group {
    list virtual-link {
      key "neighbor area-id";
      description
        "Virtual link parameters.";
      leaf neighbor {
        type inet:ipv4-address;
        description
          "Router ID of the remote ABR.";
      }

      leaf area-id {
        mandatory true;
        type ospf-area-id;
      }

      uses authentication-group;

      container timers {
        leaf dead-interval {
          type uint16;
          units "seconds";
          description
            "Interval time after which a neighbor is declared down.";
        }

        leaf hello-interval {
          type uint16 {
            range "1..65535";
          }
          units "seconds";
          description
            "Time between HELLO packets.";
        }

        leaf retransmit-interval {
          type uint16 {
            range "1..65535";
          }
          units "seconds";
          description
            "Time between retransmitting lost link state advertisements.";
        }

        leaf transmit-delay {
          type uint16 {
            range "1..65535";
          }
          units "seconds";
          description
            "Link state transmit delay.";
        }
      }
    }
  }

  grouping area-groupings {
    container areas {
      list area {
        key "area-id";
        description
          "A list of area objects";
        leaf area-id {
          type ospf-area-id;
        }

        container authentication {
          presence "Enable authentication";
          leaf message-digest {
            type boolean;
            description
              "Use message-digest authentication";
          }
        }

        leaf default-cost {
          type uint32 {
            range "0..16777215";
          }
          description
            "Advertised default summary cost";
        }

        leaf export-list {
          type access-list-ref;
          description
            "Filter for networks announced to other areas.";
        }

        leaf import-list {
          type access-list-ref;
          description
            "Filter for networks from other areas announced to the specified one.";
        }

        container filter-list {
          leaf prefix {
            type plist-ref;
            description
              "Filter networks between OSPF areas.";
          }

          leaf in {
            type boolean;
          }

          leaf out {
            type boolean;
          }
        }

        uses nssa-grouping;

        uses range-grouping;

        uses stub-grouping;

        uses shortcut-grouping;

        uses virtual-link-group;
      }
    }
  }

  /* router ospf attributes */
  grouping route-ospf-leaf-attributes {
    leaf auto-cost-reference-bandwidth {
      type uint32 {
        range "1..4294967";
      }
      units "Mbits";
      description
        "The reference bandwidth in terms of Mbits per second.";
    }

    leaf use-arp {
      type boolean;
      default "true";
      description 
        "ARP for neighbor table entry.";
    }

    leaf capability-opaque {
      type boolean;
      default "false";
      description
        "Opaque LSA.";
    }

    leaf compatible-rfc1583 {
      type boolean;
      description
        "Compatible with RFC 1583.";
    }

    leaf default-metric {
      type uint32 {
        range "0..16777214";
      }
      description
        "Metric of redistributed routes.";
    }

    leaf write-multiplier {
      type uint8 {
        range "1..100";
      }
      description
        "Maximum number of interfaces serviced per write.";
    }

    container router-info {
      choice router-info {
        case as {
          leaf as {
            type boolean;
            description
              "Enable the Router Information functionality with AS flooding scope.";
          }
        }
        case area {
          leaf area {
            type ospf-area-id;
            description
            "Enable the Router Information functionality with Area flooding scope.";
          }
        }
      }
    }
  }

  grouping metric-common-group {
    leaf metric {
      type uint32 {
        range "0..16777214";
      }
      description
        "OSPF default metric.";
    }

    leaf metric-type {
      type enumeration {
        enum "type-1" {
          value 1;
        }
        enum "type-2" {
          value 2;
        }
      }
      description
        "Metric type (1/2).";
    }

    leaf route-map {
      type frr-route-map:route-map-ref;
      description
        "Route map reference.";
    }
  }

  grouping default-info-group {
    container default-information {
      leaf originate {
        type boolean;
        description
          "Advertise a default route";
      }

      leaf always {
        type boolean;
        description
          "Always advertise default route.";
      }

      uses metric-common-group;
    }
  }

  grouping redistribute-group {
    list redistribute {
      key "protocol";
      leaf protocol {
        type frr-route-types:frr-route-types-v4;
        description
          "Protocol.";
      }

      uses metric-common-group;
    }
  }

  grouping distance-group {
    container distance {
      leaf admin-value {
        type uint8 {
          range "1..255";
        }
        description
          "Admin value.";
      }

      container ospf {
        leaf external {
          type uint8 {
            range "1..255";
          }
          description
            "Distance for external routes.";
        }

        leaf inter-area {
          type uint8 {
            range "1..255";
          }
          description
            "Distance for inter-area routes.";
        }

        leaf intra-area {
          type uint8 {
            range "1..255";
          }
          description
            "Distance for intra-area routes.";
        }
      }
    }
  }

  grouping distribute-list-group {
    container distribute-list {
      list dlist {
        key "name protocol";
        leaf name {
          type string;
          description
            "Filter networks in routing updates.";
        }

        leaf protocol {
          type frr-route-types:frr-route-types-v4;
          description
            "Out protocol.";
        }
      }
    }
  }

  grouping max-metric-group {
    container max-metric {
      container router-lsa {
        description
          "Advertise own Router-LSA with infinite distance (stub router).";
        leaf administrative {
          type boolean;
          description
            "Administratively applied, for an indefinite period.";
        }

        leaf on-shutdown {
          type uint8 {
            range "5..100";
          }
          description
            "Advertise stub-router prior to full shutdown of OSPF.";
        }

        leaf on-startup {
          type uint32 {
            range "5..86400";
          }
          description
            "Automatically advertise stub Router-LSA on startup of OSPF.";
        }
      }
    }
  }

  grouping mpls-te-group {
    container mpls-te {
      leaf on {
        type boolean;
        description
          "Enable the MPLS-TE functionality.";
      }

      leaf router-address {
        type inet:ipv4-address;
        description
          "Stable IP address of the advertising router.";
      }

      container inter-as {
        leaf as {
          type boolean;
          description
            "AS native mode self originate INTER-AS LSA with Type 11 (as flooding scope).";
        }

        leaf area {
          type ospf-area-id;
          description
            "AREA native mode self originate INTER-AS LSA with Type 10 (area flooding scope).";
        }
      }
    }
  }

  grouping ospf-group {
    container ospf {
      leaf abr-type {
        type enumeration {
          enum "cisco" {
            value 1;
            description
              "Alternative ABR, Cisco implementation.";
          }
          enum "ibm" {
            value 2;
            description
              "Alternative ABR,  IBM implementation.";
          }
          enum "shortcut" {
            value 3;
            description
              "Shortcut ABR.";
          }
          enum "standard" {
            value 4;
            description
              "Standard behavior (RFC2328).";
          }
        }
      }

      leaf opaque-lsa {
        type boolean;
        description
          "Enable the Opaque-LSA capability (RFC2370)";
      }

      leaf rfc1583compatibility {
        type boolean;
        description
          "Enable the RFC 1583 compatibility flag.";
      }

      leaf router-id {
        type inet:ipv4-address;
        description
          "Router-id for the OSPF process.";
      }

      leaf write-multiplier {
        type uint8 {
          range "1..100";
        }
        description
          "Write multiplier.";
      }
    }
  }

  grouping timer-group {
    container timers {
      leaf refresh-interval {
        type uint16 {
          range "10..1800";
        }
        units "seconds";
        description
          "The maximum time between distinct originations of any particular
           LSA, value in units seconds.";
      }

      leaf lsa-min-arrival {
        type uint32 {
          range "0..600000";
        }
        units "milliseconds";
        description
          "Minimum delay in receiving new version of an LSA.";
      }

      container throttle {
        leaf lsa-all {
          type uint16 {
            range "0..5000";
          }
          units "milliseconds";
          description
            "LSA delay between transmissions.";
        }

        leaf spf {
          type uint32 {
            range "0..600000";
          }
          units "milliseconds";
          description
            "Delay from first change received till SPF calculation.";
        }
      }
    }
  }

  grouping segment-routing-group {
    container segment-routing {
      container global-block {
        description
          "Segment Routing Global Block label range.";
        leaf lower-bound {
          must "../upper-bound > .";
          type uint32 {
            range "0..1048575";
          }
          default "16000";
        }

        leaf upper-bound {
          must ". > ../lower-bound";
          type uint32 {
            range "0..1048575";
          }
          default "23999";
        }
      }

      container srlb {
        description
          "Local blocks to be advertised.";
        leaf lower-bound {
          must "../upper-bound > .";
          type uint32;
          default "15000";
          description
            "Lower value in the label range.";
        }
        leaf upper-bound {
          must ". > ../lower-bound";
          type uint32;
          default "15999";
          description
            "Upper value in the label range.";
        }
      }

      leaf node-msd {
        type uint8 {
          range "1..16";
        }
        description
          "Maximum Stack Depth for this router.";
      }

      leaf on {
        type boolean;
        description
          "Enable Segment Routing.";
      }

      list prefix-sid {
        key "index";
        leaf index {
          type uint16;
          description
            "SID index for this prefix.";
        }

        leaf prefix {
          type inet:ipv4-prefix;
          description
            "Prefix SID.";
        }

        leaf last-hop-behavior {
          type enumeration {
            enum "explicit-null" {
              value 0;
              description
                "Use explicit-null for the SID.";
            }
            enum "no-php" {
              value 1;
              description
                "Do not use Penultimate Hop Popping (PHP)
                   for the SID.";
             }
             enum "php" {
               value 2;
               description
                 "Use PHP for the SID.";
             }
           }
           default "php";
             description
               "Configure last hop behavior.";
        }
      }
    }
  }

  grouping ospf-list-group {
    list neighbor {
      key "ip";
      description
        "Neighbor list.";
      leaf ip {
        type inet:ipv4-address;
        description
          "Neighbor IP address.";
      }

      leaf priority {
        type uint8;
        description
          "Neighbor Priority.";
      }

      leaf poll-interval {
        type uint16 {
          range "1..65535";
        }
        units "seconds";
        description
          "Dead Neighbor Polling interval.";
      }
    }

    list network {
      key "prefix";
      description
        "Enable routing on list of IP network.";
      leaf prefix {
        type inet:ipv4-prefix;
        description
          "Prefix on which routing needs to be enabled.";
      }

      leaf area {
        type ospf-area-id;
        description
          "Area ID for this network.";
      }
    }

    list passive-interface {
      key "interface";
      description
        "Suppress routing updates on list interface.";
      leaf interface {
        type frr-interface:interface-ref;
        description
          "Suppress routing updates on an interface.";
      }

      leaf address {
        type inet:ipv4-address;
        description
          "Interface address.";
      }
    }
  }

  grouping interface-ospf-attribute-group {
    leaf area {
      type ospf-area-id;
      description
        "OSPF area ID.";
    }

    uses authentication-group;

    leaf cost {
      type uint16 {
        range "1..65535";
      }
      description
        "Interface cost";
    }

    container dead-interval {
      leaf interval {
        type uint16 {
          range "1..65535";
        }
        units "seconds";
      }

      container minimal {
        leaf hello-multiplier {
          type uint8 {
            range "1..10";
          }
        }
      }
    }

    leaf hello-interval {
      type uint16 {
        range "1..65535";
      }
      units "seconds";
      description
        "Time between HELLO packets.";
    }

    leaf retransmit-interval {
      type uint16 {
        range "1..65535";
      }
      units "seconds";
      description
        "Time between retransmitting lost link state advertisements.";
    }

    leaf transmit-delay {
      type uint16 {
        range "1..65535";
      }
      units "seconds";
      description
        "Link state transmit delay.";
    }

    leaf mtu-ignore {
      type boolean;
      description
        "Disable MTU mismatch detection on this interface.";
    }

    leaf priority {
      type uint8;
      description
        "Router priority.";
    }
  }

  grouping interface-ospf-group {
    list instance {
      key "id";
      leaf id {
        type uint16;
        description
          "OSPF instance ID.";
      }

      leaf bfd {
        type boolean;
        default "false";
        description
          "BFD support.";
      }

      leaf network {
        type enumeration {
          enum "broadcast" {
            value 1;
          }
          enum "non-broadcast" {
            value 2;
          }
          enum "point-to-multipoint" {
            value 3;
          }
          enum "point-to-point" {
            value 4;
          }
        }
      }

      uses interface-ospf-attribute-group;

      list interface-address {
        key "address";
        leaf address {
          type inet:ipv4-address;
          description
            "Address of interface";
        }

        uses interface-ospf-attribute-group;
      }
    }
  }

  augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol" {
    container ospf {
      when "../frr-rt:type = 'frr-ospfd:ospf'" {
        description
          "This container is only valid for the 'OSPF' routing
           protocol.";
      }

      uses route-ospf-leaf-attributes;

      uses default-info-group;

      uses redistribute-group;

      uses distance-group;

      uses distribute-list-group;

      uses max-metric-group;

      uses mpls-te-group;

      uses ospf-group;

      uses timer-group;

      uses segment-routing-group;

      uses ospf-list-group;

      uses area-groupings;
    }
  }

  /*
   * Per-interface configuration data
   */
  augment "/frr-interface:lib/frr-interface:interface" {
    container ospf {
      description
        "OSPF interface parameters.";
      uses interface-ospf-group;
    }
  }
}