Placeholder for YANG used in Restconfapicallnode
[sdnc/oam.git] / platform-logic / restconfapi-yang / src / main / yang / ietf-te-types@2018-07-01.yang
1 module ietf-te-types {
2
3   namespace "urn:ietf:params:xml:ns:yang:ietf-te-types";
4
5   /* Replace with IANA when assigned */
6   prefix "te-types";
7
8   import ietf-inet-types {
9     prefix inet;
10   }
11
12   import ietf-yang-types {
13     prefix "yang";
14   }
15
16   import ietf-routing-types {
17     prefix "rt-types";
18   }
19
20   organization
21     "IETF Traffic Engineering Architecture and Signaling (TEAS)
22      Working Group";
23
24   contact
25     "WG Web:   <http://tools.ietf.org/wg/teas/>
26      WG List:  <mailto:teas@ietf.org>
27      WG Chair: Lou Berger
28                <mailto:lberger@labn.net>
29      WG Chair: Vishnu Pavan Beeram
30                <mailto:vbeeram@juniper.net>
31      Editor:   Tarek Saad
32                <mailto:tsaad@cisco.com>
33      Editor:   Rakesh Gandhi
34                <mailto:rgandhi@cisco.com>
35      Editor:   Vishnu Pavan Beeram
36                <mailto:vbeeram@juniper.net>
37      Editor:   Himanshu Shah
38                <mailto:hshah@ciena.com>
39      Editor:   Xufeng Liu
40                <mailto:xufeng.liu@ericsson.com>
41      Editor:   Igor Bryskin
42                <mailto:Igor.Bryskin@huawei.com>";
43
44   description
45     "This module contains a collection of generally
46     useful TE specific YANG data type defintions.";
47
48   revision "2018-07-01" {
49     description "Latest revision of TE types";
50     reference "RFC3209";
51   }
52
53   /*
54    * Identities
55    */
56   identity association-type {
57     description "Base identity for tunnel association";
58     reference "RFC6780, RFC4872, RFC4873";
59   }
60   identity association-type-recovery {
61     base association-type;
62     description
63       "Association Type Recovery used to association LSPs of
64        same tunnel for recovery";
65     reference "RFC4872";
66   }
67   identity association-type-resource-sharing {
68     base association-type;
69     description
70       "Association Type Resource Sharing used to enable resource
71        sharing during make-before-break.";
72     reference "RFC4873";
73   }
74   identity association-type-double-sided-bidir {
75     base association-type;
76     description
77       "Association Type Double Sided bidirectional used to associate
78        two LSPs of two tunnels that are independently configured on
79        either endpoint";
80     reference "RFC7551";
81   }
82   identity association-type-single-sided-bidir {
83     base association-type;
84     description
85       "Association Type Single Sided bidirectional used to associate
86        two LSPs of two tunnels, where a tunnel is configured on one
87        side/endpoint, and the other tunnel is dynamically created on
88        the other endpoint";
89     reference "RFC7551";
90   }
91
92   identity objective-function-type {
93     description "Base objective function type";
94     reference "RFC4657";
95   }
96   identity of-minimize-cost-path {
97     base objective-function-type;
98     description
99         "Mimimuze cost of path objective function";
100   }
101   identity of-minimize-load-path {
102     base objective-function-type;
103     description
104         "Minimize the load on path(s) objective
105          function";
106   }
107   identity of-maximize-residual-bandwidth {
108     base objective-function-type;
109     description
110         "Maximize the residual bandwidth objective
111          function";
112   }
113   identity of-minimize-agg-bandwidth-consumption {
114     base objective-function-type;
115     description
116         "minimize the aggregate bandwidth consumption
117          objective function";
118   }
119   identity of-minimize-load-most-loaded-link {
120     base objective-function-type;
121     description
122         "Minimize the load on the most loaded link
123          objective function";
124   }
125   identity of-minimize-cost-path-set {
126     base objective-function-type;
127     description
128         "Minimize the cost on a path set objective
129          function";
130   }
131
132   identity path-computation-method {
133     description
134      "base identity for supported path computation
135       mechanisms";
136   }
137
138   identity path-locally-computed {
139     base path-computation-method;
140     description
141       "indicates a constrained-path LSP in which the
142       path is computed by the local LER";
143   }
144
145   identity path-externally-queried {
146     base path-computation-method;
147     description
148      "Constrained-path LSP in which the path is
149       obtained by querying an external source, such as a PCE server.
150       In the case that an LSP is defined to be externally queried, it
151       may also have associated explicit definitions (provided
152       to the external source to aid computation); and the path that is
153       returned by the external source is not required to provide a
154       wholly resolved path back to the originating system - that is to
155       say, some local computation may also be required";
156   }
157
158   identity path-explicitly-defined {
159     base path-computation-method;
160     description
161      "constrained-path LSP in which the path is
162       explicitly specified as a collection of strict or/and loose
163       hops";
164   }
165   /**
166    * Typedefs
167    */
168
169   typedef te-bandwidth {
170     type string {
171       pattern
172         '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
173       + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
174       + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+'
175       + '(,(0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
176       + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
177       + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+))*';
178     }
179     description
180       "This is the generic bandwidth type that is a string containing
181        a list of numbers separated by commas, with each of these
182        number can be non-negative decimal, hex integer, or hex float:
183        (dec | hex | float)[*(','(dec | hex | float))]
184        For packet switching type, a float number is used, such as
185        0x1p10.
186        For OTN switching type, a list of integers can be used, such
187        as '0,2,3,1', indicating 2 odu0's and 1 odu3.
188        For DWDM, a list of pairs of slot number and width can be
189        used, such as '0, 2, 3, 3', indicating a frequency slot 0 with
190        slot width 2 and a frequency slot 3 with slot width 3.";
191   } // te-bandwidth
192
193   typedef te-ds-class {
194     type uint8 {
195       range "0..7";
196     }
197     description
198       "The Differentiatied Class-Type of traffic.";
199     reference "RFC4124: section-4.3.1";
200   }
201
202   typedef te-link-direction {
203     type enumeration {
204       enum INCOMING {
205         description
206           "explicit route represents an incoming link on a node";
207       }
208       enum OUTGOING {
209         description
210           "explicit route represents an outgoing link on a node";
211       }
212     }
213     description
214      "enumerated type for specifying direction of link on a node";
215   }
216
217   typedef te-label-direction {
218     type enumeration {
219       enum FORWARD {
220         description
221           "Label allocated for the forward LSP direction";
222       }
223       enum REVERSE {
224         description
225           "Label allocated for the reverse LSP direction";
226       }
227     }
228     description
229      "enumerated type for specifying the forward or reverse
230      label";
231   }
232
233   typedef te-hop-type {
234     type enumeration {
235       enum LOOSE {
236         description
237           "loose hop in an explicit path";
238       }
239       enum STRICT {
240         description
241           "strict hop in an explicit path";
242       }
243     }
244     description
245      "enumerated type for specifying loose or strict
246       paths";
247     reference "RFC3209: section-4.3.2";
248   }
249
250   identity LSP_METRIC_TYPE {
251     description
252       "Base identity for types of LSP metric specification";
253   }
254
255   identity LSP_METRIC_RELATIVE {
256     base LSP_METRIC_TYPE;
257     description
258       "The metric specified for the LSPs to which this identity refers
259       is specified as a relative value to the IGP metric cost to the
260       LSP's tail-end.";
261   }
262
263   identity LSP_METRIC_ABSOLUTE {
264     base LSP_METRIC_TYPE;
265     description
266       "The metric specified for the LSPs to which this identity refers
267       is specified as an absolute value";
268   }
269
270   identity LSP_METRIC_INHERITED {
271     base LSP_METRIC_TYPE;
272     description
273       "The metric for for the LSPs to which this identity refers is
274       not specified explicitly - but rather inherited from the IGP
275       cost directly";
276   }
277
278   identity tunnel-type {
279     description
280       "Base identity from which specific tunnel types are
281       derived.";
282   }
283
284   identity tunnel-p2p {
285     base tunnel-type;
286     description
287       "TE point-to-point tunnel type.";
288   }
289
290   identity tunnel-p2mp {
291     base tunnel-type;
292     description
293       "TE point-to-multipoint tunnel type.";
294     reference "RFC4875";
295   }
296
297   identity tunnel-action-type {
298     description
299       "Base identity from which specific tunnel action types
300        are derived.";
301   }
302
303   identity tunnel-action-resetup {
304     base tunnel-action-type;
305     description
306       "TE tunnel action resetup. Tears the
307       tunnel's current LSP (if any) and
308       attempts to re-establish a new LSP";
309   }
310
311   identity tunnel-action-reoptimize {
312     base tunnel-action-type;
313     description
314       "TE tunnel action reoptimize.
315        Reoptimizes placement of the tunnel LSP(s)";
316   }
317
318   identity tunnel-action-switchpath {
319     base tunnel-action-type;
320     description
321       "TE tunnel action reoptimize
322        Switches the tunnel's LSP to use the specified path";
323   }
324
325   identity te-action-result {
326     description
327       "Base identity from which specific TE action results
328        are derived.";
329   }
330
331   identity te-action-success {
332     base te-action-result;
333     description "TE action successul.";
334   }
335
336   identity te-action-fail {
337     base te-action-result;
338     description "TE action failed.";
339   }
340
341   identity tunnel-action-inprogress {
342     base te-action-result;
343     description "TE action inprogress.";
344   }
345
346   identity tunnel-admin-state-type {
347     description
348       "Base identity for TE tunnel admin states";
349   }
350
351   identity tunnel-admin-state-up {
352     base tunnel-admin-state-type;
353     description "Tunnel administratively state up";
354   }
355
356   identity tunnel-admin-state-down {
357     base tunnel-admin-state-type;
358     description "Tunnel administratively state down";
359   }
360
361   identity tunnel-state-type {
362     description
363       "Base identity for TE tunnel states";
364   }
365
366   identity tunnel-state-up {
367     base tunnel-state-type;
368     description "Tunnel state up";
369   }
370
371   identity tunnel-state-down {
372     base tunnel-state-type;
373     description "Tunnel state down";
374   }
375
376   identity lsp-state-type {
377     description
378       "Base identity for TE LSP states";
379   }
380
381   identity lsp-path-computing {
382     base lsp-state-type;
383     description
384       "State path compute in progress";
385   }
386
387   identity lsp-path-computation-ok {
388     base lsp-state-type;
389     description
390       "State path compute successful";
391   }
392
393   identity lsp-path-computatione-failed {
394     base lsp-state-type;
395     description
396       "State path compute failed";
397   }
398
399   identity lsp-state-setting-up {
400     base lsp-state-type;
401     description
402       "State setting up";
403   }
404
405   identity lsp-state-setup-ok {
406     base lsp-state-type;
407     description
408       "State setup successful";
409   }
410
411   identity lsp-state-setup-failed {
412     base lsp-state-type;
413     description
414       "State setup failed";
415   }
416
417   identity lsp-state-up {
418     base lsp-state-type;
419     description "State up";
420   }
421
422   identity lsp-state-tearing-down {
423     base lsp-state-type;
424     description
425       "State tearing down";
426   }
427
428   identity lsp-state-down {
429     base lsp-state-type;
430     description "State down";
431   }
432
433   identity path-invalidation-action-type {
434     description
435       "Base identity for TE path invalidation action types";
436   }
437
438   identity path-invalidation-action-drop-type {
439     base path-invalidation-action-type;
440     description
441       "TE path invalidation action drop";
442   }
443
444   identity path-invalidation-action-drop-tear {
445     base path-invalidation-action-type;
446     description
447       "TE path invalidation action tear";
448   }
449
450   identity lsp-restoration-type {
451     description
452       "Base identity from which LSP restoration types are
453        derived.";
454   }
455
456   identity lsp-restoration-restore-any {
457     base lsp-restoration-type;
458     description
459       "Restores when any of the LSPs is affected by a failure";
460   }
461
462   identity lsp-restoration-restore-all {
463     base lsp-restoration-type;
464     description
465       "Restores when all the tunnel LSPs are affected by failure";
466   }
467
468   identity restoration-scheme-type {
469     description
470       "Base identity for LSP restoration schemes";
471     reference "RFC4872";
472   }
473
474   identity restoration-scheme-preconfigured {
475     base restoration-scheme-type;
476     description
477       "Restoration LSP is preconfigured prior to the failure";
478   }
479
480   identity restoration-scheme-precomputed {
481     base restoration-scheme-type;
482     description
483       "Restoration LSP is precomputed prior to the failure";
484   }
485
486   identity restoration-scheme-presignaled {
487     base restoration-scheme-type;
488     description
489       "Restoration LSP is presignaledd prior to the failure";
490   }
491
492   identity lsp-protection-type {
493     description
494       "Base identity from which LSP protection types are
495       derived.";
496   }
497
498   identity lsp-protection-unprotected {
499     base lsp-protection-type;
500     description
501       "LSP protection 'Unprotected'";
502     reference "RFC4872";
503   }
504
505   identity lsp-protection-reroute-extra {
506     base lsp-protection-type;
507     description
508       "LSP protection '(Full) Rerouting'";
509     reference "RFC4872";
510   }
511
512   identity lsp-protection-reroute {
513     base lsp-protection-type;
514     description
515       "LSP protection 'Rerouting without Extra-Traffic'";
516     reference "RFC4872";
517   }
518
519   identity lsp-protection-1-for-n {
520     base lsp-protection-type;
521     description
522       "LSP protection '1:N Protection with Extra-Traffic'";
523     reference "RFC4872";
524   }
525
526   identity lsp-protection-unidir-1-to-1 {
527     base lsp-protection-type;
528     description
529       "LSP protection '1+1 Unidirectional Protection'";
530     reference "RFC4872";
531   }
532
533   identity lsp-protection-bidir-1-to-1 {
534     base lsp-protection-type;
535     description
536       "LSP protection '1+1 Bidirectional Protection'";
537     reference "RFC4872";
538   }
539
540   identity lsp-protection-extra-traffic {
541     base lsp-protection-type;
542     description
543       "LSP protection 'Extra-Traffic'";
544     reference
545       "ITU-T G.808, RFC 4427.";
546   }
547
548   identity lsp-protection-state {
549     description
550       "Base identity of protection states for reporting
551        purposes.";
552   }
553
554   identity normal {
555     base lsp-protection-state;
556     description "Normal state.";
557   }
558
559   identity signal-fail-of-protection {
560     base lsp-protection-state;
561     description
562         "There is a SF condition on the protection transport
563         entity which has higher priority than the FS command.";
564     reference
565         "ITU-T G.873.1, G.8031, G.8131";
566   }
567
568   identity lockout-of-protection {
569     base lsp-protection-state;
570     description
571         "A Loss of Protection (LoP) command is active.";
572     reference
573         "ITU-T G.808, RFC 4427";
574   }
575
576   identity forced-switch {
577     base lsp-protection-state;
578     description
579         "A forced switch (FS) command is active.";
580     reference
581         "ITU-T G.808, RFC 4427";
582   }
583
584   identity signal-fail {
585     base lsp-protection-state;
586     description
587         "There is a SF condition on either the working
588         or the protection path.";
589     reference
590         "ITU-T G.808, RFC 4427";
591   }
592
593   identity signal-degrade {
594     base lsp-protection-state;
595     description
596         "There is an SD condition on either the working or the
597          protection path.";
598     reference
599         "ITU-T G.808, RFC 4427";
600   }
601
602   identity manual-switch {
603     base lsp-protection-state;
604     description
605         "A manual switch (MS) command is active.";
606     reference
607         "ITU-T G.808, RFC 4427";
608   }
609
610   identity wait-to-restore {
611     base lsp-protection-state;
612     description
613         "A wait time to restore (WTR) is running.";
614     reference
615         "ITU-T G.808, RFC 4427";
616   }
617
618   identity do-not-revert {
619     base lsp-protection-state;
620     description
621         "A DNR condition is active because of a non-revertive
622          behavior.";
623     reference
624         "ITU-T G.808, RFC 4427";
625   }
626
627   identity failure-of-protocol {
628     base lsp-protection-state;
629     description
630         "The protection is not working because of a failure of
631          protocol condition.";
632     reference
633         "ITU-T G.873.1, G.8031, G.8131";
634   }
635
636   identity protection-external-commands {
637     description
638       "Protection external commands for trouble shooting
639       purposes.";
640   }
641
642   identity action-freeze {
643     base protection-external-commands;
644     description
645       "A temporary configuration action initiated by an operator
646        command to prevent any switch action to be taken and as such
647        freezes the current state.";
648     reference
649       "ITU-T G.808, RFC 4427";
650   }
651
652   identity clear-freeze {
653     base protection-external-commands;
654     description
655       "An action that clears the active freeze state.";
656     reference
657       "ITU-T G.808, RFC 4427";
658   }
659
660   identity action-lockout-of-normal {
661     base protection-external-commands;
662     description
663       "A temporary configuration action initiated by an operator
664        command to ensure that the normal traffic is not allowed
665        to use the protection transport entity.";
666     reference
667       "ITU-T G.808, RFC 4427";
668   }
669
670   identity clear-lockout-of-normal {
671     base protection-external-commands;
672     description
673       "An action that clears the active lockout of normal state.";
674     reference
675       "ITU-T G.808, RFC 4427";
676   }
677
678   identity action-lockout-of-protection {
679     base protection-external-commands;
680     description
681       "A temporary configuration action initiated by an operator
682        command to ensure that the protection transport entity is
683        temporarily not available to transport a traffic signal
684        (either normal or extra traffic).";
685     reference
686         "ITU-T G.808, RFC 4427";
687   }
688
689   identity action-forced-switch {
690     base protection-external-commands;
691     description
692         "A switch action initiated by an operator command to swith
693          the extra traffic signal, the normal traffic signal, or the
694          null signal to the protection transport entity, unless an
695          equal or higher priority switch command is in effect.";
696     reference
697         "ITU-T G.808, RFC 4427";
698   }
699
700   identity action-manual-switch {
701     base protection-external-commands;
702     description
703         "A switch action initiated by an operator command to swith
704          the extra traffic signal, the normal traffic signal #i, or
705          the null signal to the protection transport entity, unless
706          a fault condition exists on other transport entities or an
707          equal or higher priority switch command is in effect.";
708     reference
709         "ITU-T G.808, RFC 4427";
710   }
711
712   identity action-exercise {
713     base protection-external-commands;
714     description
715         "An action to start testing if the APS communication is
716          operating correctly. It is lower priority than any other
717          state or command.";
718     reference
719         "ITU-T G.808, RFC 4427";
720   }
721
722   identity clear {
723     base protection-external-commands;
724     description
725         "An action that clears the active near-end lockout of
726          protection, forced switch, manual switch, WTR state,
727          or exercise command.";
728     reference
729         "ITU-T G.808, RFC 4427";
730   }
731
732   identity switching-capabilities {
733     description
734       "Base identity for interface switching capabilities";
735     reference "RFC3471";
736   }
737
738   identity switching-psc1 {
739     base switching-capabilities;
740     description
741       "Packet-Switch Capable-1 (PSC-1)";
742     reference "RFC3471";
743   }
744
745   identity switching-evpl {
746     base switching-capabilities;
747     description
748       "Ethernet Virtual Private Line (EVPL)";
749   }
750
751   identity switching-l2sc {
752     base switching-capabilities;
753     description
754       "Layer-2 Switch Capable (L2SC)";
755     reference "RFC3471";
756   }
757
758   identity switching-tdm {
759     base switching-capabilities;
760     description
761       "Time-Division-Multiplex Capable (TDM)";
762     reference "RFC3471";
763   }
764
765   identity switching-otn {
766     base switching-capabilities;
767     description
768       "OTN-TDM capable";
769   }
770
771   identity switching-dcsc {
772     base switching-capabilities;
773     description
774       "Data Channel Switching Capable (DCSC)";
775   }
776
777   identity switching-lsc {
778     base switching-capabilities;
779     description
780       "Lambda-Switch Capable (LSC)";
781     reference "RFC3471";
782   }
783
784   identity switching-fsc {
785     base switching-capabilities;
786     description
787       "Fiber-Switch Capable (FSC)";
788     reference "RFC3471";
789   }
790
791   identity lsp-encoding-types {
792     description
793       "Base identity for encoding types";
794     reference "RFC3471";
795   }
796
797   identity lsp-encoding-packet {
798     base lsp-encoding-types;
799     description
800       "Packet LSP encoding";
801     reference "RFC3471";
802   }
803
804   identity lsp-encoding-ethernet {
805     base lsp-encoding-types;
806     description
807       "Ethernet LSP encoding";
808     reference "RFC3471";
809   }
810
811   identity lsp-encoding-pdh {
812     base lsp-encoding-types;
813     description
814       "ANSI/ETSI LSP encoding";
815     reference "RFC3471";
816   }
817
818   identity lsp-encoding-sdh {
819     base lsp-encoding-types;
820     description
821       "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding";
822     reference "RFC3471";
823   }
824
825   identity lsp-encoding-digital-wrapper {
826     base lsp-encoding-types;
827     description
828       "Digital Wrapper LSP encoding";
829     reference "RFC3471";
830   }
831
832   identity lsp-encoding-lambda {
833     base lsp-encoding-types;
834     description
835       "Lambda (photonic) LSP encoding";
836     reference "RFC3471";
837   }
838
839   identity lsp-encoding-fiber {
840     base lsp-encoding-types;
841     description
842       "Fiber LSP encoding";
843     reference "RFC3471";
844   }
845
846   identity lsp-encoding-fiber-channel {
847     base lsp-encoding-types;
848     description
849       "FiberChannel LSP encoding";
850     reference "RFC3471";
851   }
852
853   identity lsp-encoding-oduk {
854     base lsp-encoding-types;
855     description
856       "G.709 ODUk (Digital Path)LSP encoding";
857   }
858
859   identity lsp-encoding-optical-channel {
860     base lsp-encoding-types;
861     description
862       "Line (e.g., 8B/10B) LSP encoding";
863   }
864
865   identity lsp-encoding-line {
866     base lsp-encoding-types;
867     description
868       "Line (e.g., 8B/10B) LSP encoding";
869   }
870
871   identity path-signaling-type {
872     description
873       "base identity from which specific LSPs path
874        setup types are derived";
875   }
876
877   identity path-setup-static {
878     base path-signaling-type;
879     description
880       "Static LSP provisioning path setup";
881   }
882
883   identity path-setup-rsvp {
884     base path-signaling-type;
885     description
886       "RSVP-TE signaling path setup";
887     reference "RFC3209";
888   }
889
890   identity path-setup-sr {
891     base path-signaling-type;
892     description
893       "Segment-routing path setup";
894   }
895
896   identity path-scope-type {
897     description
898       "base identity from which specific path
899        scope types are derived";
900   }
901
902   identity path-scope-segment {
903     base path-scope-type;
904     description
905       "Path scope segment";
906   }
907
908   identity path-scope-end-to-end {
909     base path-scope-type;
910     description
911       "Path scope end to end";
912   }
913
914   /* TE basic features */
915   feature p2mp-te {
916     description
917       "Indicates support for P2MP-TE";
918     reference "RFC4875";
919   }
920
921   feature frr-te {
922     description
923       "Indicates support for TE FastReroute (FRR)";
924     reference "RFC4090";
925   }
926
927   feature extended-admin-groups {
928     description
929       "Indicates support for TE link extended admin
930       groups.";
931     reference "RFC7308";
932   }
933
934   feature named-path-affinities {
935     description
936       "Indicates support for named path affinities";
937   }
938
939   feature named-extended-admin-groups {
940     description
941       "Indicates support for named extended admin groups";
942   }
943
944   feature named-srlg-groups {
945     description
946       "Indicates support for named SRLG groups";
947   }
948
949   feature named-path-constraints {
950     description
951       "Indicates support for named path constraints";
952   }
953
954   feature path-optimization-metric {
955     description
956       "Indicates support for path optimization metric";
957   }
958
959   feature path-optimization-objective-function {
960     description
961       "Indicates support for path optimization objective function";
962   }
963
964   identity route-usage-type {
965     description
966       "Base identity for route usage";
967   }
968
969   identity route-include-ero {
970     base route-usage-type;
971     description
972       "Include ERO from route";
973   }
974
975   identity route-exclude-ero {
976     base route-usage-type;
977     description
978       "Exclude ERO from route";
979   }
980
981   identity route-exclude-srlg {
982     base route-usage-type;
983     description
984       "Exclude SRLG from route";
985   }
986
987   identity path-metric-type {
988     description
989       "Base identity for path metric type";
990   }
991
992   identity path-metric-te {
993     base path-metric-type;
994     description
995       "TE path metric";
996     reference "RFC3785";
997   }
998
999   identity path-metric-igp {
1000     base path-metric-type;
1001     description
1002       "IGP path metric";
1003     reference "RFC3785";
1004   }
1005
1006   identity path-metric-hop {
1007     base path-metric-type;
1008     description
1009       "Hop path metric";
1010   }
1011
1012   identity path-metric-delay-average {
1013     base path-metric-type;
1014     description
1015       "Unidirectional average link delay";
1016     reference "RFC7471";
1017   }
1018
1019   identity path-metric-residual-bandwidth {
1020     base path-metric-type;
1021     description
1022       "Unidirectional Residual Bandwidth, which is defined to be
1023        Maximum Bandwidth [RFC3630] minus the bandwidth currently
1024        allocated to  LSPs.";
1025     reference "RFC7471";
1026   }
1027   identity path-metric-optimize-includes {
1028     base path-metric-type;
1029     description
1030       "A metric that optimizes the number of included resources
1031        specified in a set";
1032   }
1033
1034   identity path-metric-optimize-excludes {
1035     base path-metric-type;
1036     description
1037       "A metric that optimizes the number of excluded resources
1038        specified in a set";
1039   }
1040
1041   identity path-tiebreaker-type {
1042     description
1043       "Base identity for path tie-breaker type";
1044   }
1045
1046   identity path-tiebreaker-minfill {
1047     base path-tiebreaker-type;
1048     description
1049       "Min-Fill LSP path placement";
1050   }
1051
1052   identity path-tiebreaker-maxfill {
1053     base path-tiebreaker-type;
1054     description
1055       "Max-Fill LSP path placement";
1056   }
1057
1058   identity path-tiebreaker-randoom {
1059     base path-tiebreaker-type;
1060     description
1061       "Random LSP path placement";
1062   }
1063
1064   identity bidir-provisioning-mode {
1065     description
1066       "Base identity for bidirectional provisioning
1067       mode.";
1068     reference "RFC7551";
1069   }
1070
1071   identity bidir-provisioning-single-sided {
1072     base bidir-provisioning-mode;
1073     description
1074       "Single-sided bidirectional provioning mode";
1075     reference "RFC7551";
1076   }
1077
1078   identity bidir-provisioning-double-sided {
1079     base bidir-provisioning-mode;
1080     description
1081       "Double-sided bidirectional provioning mode";
1082     reference "RFC7551";
1083   }
1084
1085   identity bidir-association-type {
1086     description
1087       "Base identity for bidirectional association type";
1088     reference "RFC7551";
1089   }
1090
1091   identity bidir-assoc-corouted {
1092     base bidir-association-type;
1093     description
1094       "Co-routed bidirectional association type";
1095     reference "RFC7551";
1096   }
1097
1098   identity bidir-assoc-non-corouted {
1099     base bidir-association-type;
1100     description
1101       "Non co-routed bidirectional association type";
1102     reference "RFC7551";
1103   }
1104
1105   identity resource-affinities-type {
1106     description
1107       "Base identity for resource affinities";
1108     reference "RFC2702";
1109   }
1110
1111   identity resource-aff-include-all {
1112     base resource-affinities-type;
1113     description
1114       "The set of attribute filters associated with a
1115       tunnel all of which must be present for a link
1116       to be acceptable";
1117     reference "RFC2702 and RFC3209";
1118   }
1119
1120   identity resource-aff-include-any {
1121     base resource-affinities-type;
1122     description
1123       "The set of attribute filters associated with a
1124       tunnel any of which must be present for a link
1125       to be acceptable";
1126     reference "RFC2702 and RFC3209";
1127   }
1128
1129   identity resource-aff-exclude-any {
1130     base resource-affinities-type;
1131     description
1132       "The set of attribute filters associated with a
1133       tunnel any of which renders a link unacceptable";
1134     reference "RFC2702 and RFC3209";
1135   }
1136
1137   typedef optimization-goal {
1138     type enumeration {
1139       enum minimize {
1140         description "Pick lowest path metric goal";
1141       }
1142       enum maximize {
1143         description "Pick highest path metric goal";
1144       }
1145       enum randomize {
1146         description
1147           "Pick a path at random from list of
1148            equally favorable ones";
1149       }
1150     }
1151     description "TE optimization goal";
1152   }
1153
1154   identity te-optimization-criterion {
1155     description
1156       "Base identity for TE optimization criterion.";
1157     reference
1158       "RFC3272: Overview and Principles of Internet Traffic
1159        Engineering.";
1160   }
1161
1162   identity not-optimized {
1163     base te-optimization-criterion;
1164     description "Optimization is not applied.";
1165   }
1166
1167   identity cost {
1168     base te-optimization-criterion;
1169     description "Optimized on cost.";
1170   }
1171   identity delay {
1172     base te-optimization-criterion;
1173     description "Optimized on delay.";
1174   }
1175
1176   /*
1177    * Typedefs
1178    */
1179
1180   typedef percentage {
1181     type uint8 {
1182       range "0..100";
1183     }
1184     description
1185       "Integer indicating a percentage value";
1186   }
1187
1188   typedef performance-metric-normality {
1189     type enumeration {
1190       enum "unknown" {
1191         value 0;
1192         description
1193           "Unknown.";
1194       }
1195       enum "normal" {
1196         value 1;
1197         description
1198           "Normal.";
1199       }
1200       enum "abnormal" {
1201         value 2;
1202         description
1203           "Abnormal. The anomalous bit is set.";
1204       }
1205     }
1206     description
1207       "Indicates whether a performance metric is normal, abnormal, or
1208        unknown.";
1209     reference
1210       "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
1211        RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
1212        RFC7823: Performance-Based Path Selection for Explicitly
1213        Routed Label Switched Paths (LSPs) Using TE Metric
1214        Extensions";
1215   }
1216
1217   typedef te-admin-status {
1218     type enumeration {
1219       enum up {
1220         description
1221           "Enabled.";
1222       }
1223       enum down {
1224         description
1225           "Disabled.";
1226       }
1227       enum testing {
1228         description
1229           "In some test mode.";
1230       }
1231       enum preparing-maintenance {
1232         description
1233           "Resource is disabled in the control plane to prepare for
1234            graceful shutdown for maintenance purposes.";
1235         reference
1236           "RFC5817: Graceful Shutdown in MPLS and Generalized MPLS
1237            Traffic Engineering Networks";
1238       }
1239       enum maintenance {
1240         description
1241           "Resource is disabled in the data plane for maintenance
1242            purposes.";
1243       }
1244     }
1245     description
1246       "Defines a type representing the administrative status of
1247        a TE resource.";
1248   }
1249
1250   typedef te-global-id {
1251     type uint32;
1252     description
1253       "An identifier to uniquely identify an operator, which can be
1254        either a provider or a client.
1255        The definition of this type is taken from RFC6370 and RFC5003.
1256        This attribute type is used solely to provide a globally
1257        unique context for TE topologies.";
1258   }
1259
1260   typedef te-link-access-type {
1261     type enumeration {
1262       enum point-to-point {
1263         description
1264           "The link is point-to-point.";
1265       }
1266       enum multi-access {
1267         description
1268           "The link is multi-access, including broacast and NBMA.";
1269       }
1270     }
1271     description
1272       "Defines a type representing the access type of a TE link.";
1273     reference
1274       "RFC3630: Traffic Engineering (TE) Extensions to OSPF
1275        Version 2.";
1276   }
1277
1278   typedef te-node-id {
1279     type yang:dotted-quad;
1280     description
1281       "An identifier for a node in a topology.
1282        The identifier is represented as 32-bit unsigned integer in
1283        the dotted-quad notation.
1284        This attribute is mapped to Router ID in
1285        RFC3630, RFC5329, RFC5305, and RFC6119.";
1286   }
1287
1288   typedef te-oper-status {
1289     type enumeration {
1290       enum up {
1291         description
1292         "Operational up.";
1293       }
1294       enum down {
1295         description
1296         "Operational down.";
1297       }
1298       enum testing {
1299         description
1300         "In some test mode.";
1301       }
1302       enum unknown {
1303         description
1304         "Status cannot be determined for some reason.";
1305       }
1306       enum preparing-maintenance {
1307         description
1308           "Resource is disabled in the control plane to prepare for
1309            graceful shutdown for maintenance purposes.";
1310         reference
1311           "RFC5817: Graceful Shutdown in MPLS and Generalized MPLS
1312            Traffic Engineering Networks";
1313       }
1314       enum maintenance {
1315         description
1316           "Resource is disabled in the data plane for maintenance
1317            purposes.";
1318       }
1319     }
1320     description
1321       "Defines a type representing the operational status of
1322        a TE resource.";
1323   }
1324
1325   typedef te-path-disjointness {
1326     type bits {
1327       bit node {
1328         position 0;
1329         description "Node disjoint.";
1330       }
1331       bit link {
1332         position 1;
1333         description "Link disjoint.";
1334       }
1335       bit srlg {
1336         position 2;
1337         description "SRLG (Shared Risk Link Group) disjoint.";
1338       }
1339     }
1340     description
1341       "Type of the resource disjointness for a TE tunnel path.";
1342     reference
1343       "RFC4872: RSVP-TE Extensions in Support of End-to-End
1344        Generalized Multi-Protocol Label Switching (GMPLS)
1345        Recovery";
1346   } // te-path-disjointness
1347
1348   typedef te-recovery-status {
1349     type enumeration {
1350       enum normal {
1351         description
1352           "Both the recovery and working spans are fully
1353            allocated and active, data traffic is being
1354            transported over (or selected from) the working
1355            span, and no trigger events are reported.";
1356       }
1357       enum recovery-started {
1358         description
1359           "The recovery action has been started, but not completed.";
1360       }
1361       enum recovery-succeeded {
1362         description
1363           "The recovery action has succeeded. The working span has
1364            reported a failure/degrade condition and the user traffic
1365            is being transported (or selected) on the recovery span.";
1366       }
1367       enum recovery-failed {
1368         description
1369           "The recovery action has failed.";
1370       }
1371       enum reversion-started {
1372         description
1373           "The reversion has started.";
1374       }
1375       enum reversion-failed {
1376         description
1377           "The reversion has failed.";
1378       }
1379       enum recovery-unavailable {
1380         description
1381           "The recovery is unavailable -- either as a result of an
1382            operator Lockout command or a failure condition detected
1383            on the recovery span.";
1384       }
1385       enum recovery-admin {
1386         description
1387           "The operator has issued a command switching the user
1388            traffic to the recovery span.";
1389       }
1390       enum wait-to-restore {
1391         description
1392           "The recovery domain is recovering from a failuer/degrade
1393            condition on the working span that is being controlled by
1394            the Wait-to-Restore (WTR) timer.";
1395       }
1396     }
1397     description
1398       "Defines the status of a recovery action.";
1399     reference
1400       "RFC4427: Recovery (Protection and Restoration) Terminology
1401        for Generalized Multi-Protocol Label Switching (GMPLS).
1402        RFC6378: MPLS Transport Profile (MPLS-TP) Linear Protection";
1403   }
1404
1405   typedef te-template-name {
1406     type string {
1407       pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
1408     }
1409     description
1410       "A type for the name of a TE node template or TE link
1411        template.";
1412   }
1413
1414   typedef te-topology-event-type {
1415     type enumeration {
1416       enum "add" {
1417         value 0;
1418         description
1419           "A TE node or te-link has been added.";
1420       }
1421       enum "remove" {
1422         value 1;
1423         description
1424           "A TE node or te-link has been removed.";
1425       }
1426       enum "update" {
1427         value 2;
1428         description
1429           "A TE node or te-link has been updated.";
1430       }
1431     }
1432     description "TE  Event type for notifications";
1433   } // te-topology-event-type
1434
1435   typedef te-topology-id {
1436     type string {
1437       pattern
1438         '([a-zA-Z0-9\-_.]+:)*'
1439       + '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
1440     }
1441     description
1442       "An identifier for a topology.
1443        It is optional to have one or more prefixes at the begining,
1444        separated by colons. The prefixes can be the network-types,
1445        defined in ietf-network.yang, to help user to understand the
1446        topology better before further inquiry.";
1447   }
1448
1449   typedef te-tp-id {
1450     type union {
1451       type uint32;          // Unnumbered
1452       type inet:ip-address; // IPv4 or IPv6 address
1453     }
1454     description
1455       "An identifier for a TE link endpoint on a node.
1456        This attribute is mapped to local or remote link identifier in
1457        RFC3630 and RFC5305.";
1458   }
1459   typedef admin-group {
1460     type binary {
1461       length 4;
1462     }
1463     description
1464       "Administrative group/Resource class/Color.";
1465     reference "RFC3630 and RFC5305";
1466   }
1467
1468   typedef extended-admin-group {
1469     type binary;
1470     description
1471       "Extended administrative group/Resource class/Color.";
1472     reference "RFC7308";
1473   }
1474
1475   typedef admin-groups {
1476     type union {
1477       type admin-group;
1478       type extended-admin-group;
1479     }
1480     description "TE administrative group derived type";
1481   }
1482
1483   typedef srlg {
1484     type uint32;
1485     description "SRLG type";
1486     reference "RFC4203 and RFC5307";
1487   }
1488
1489   identity path-computation-srlg-type {
1490     description
1491       "Base identity for SRLG path computation";
1492   }
1493
1494   identity srlg-ignore {
1495     base path-computation-srlg-type;
1496     description
1497       "Ignores SRLGs in path computation";
1498   }
1499
1500   identity srlg-strict {
1501     base path-computation-srlg-type;
1502     description
1503       "Include strict SRLG check in path computation";
1504   }
1505
1506   identity srlg-preferred {
1507     base path-computation-srlg-type;
1508     description
1509       "Include preferred SRLG check in path computation";
1510   }
1511
1512   identity srlg-weighted {
1513     base path-computation-srlg-type;
1514     description
1515       "Include weighted SRLG check in path computation";
1516   }
1517
1518   typedef te-metric {
1519     type uint32;
1520     description
1521       "TE link metric";
1522     reference "RFC3785";
1523   }
1524
1525   /**
1526    * TE bandwidth groupings
1527    **/
1528   identity otn-rate-type {
1529     description
1530       "Base type to identify OTN bit rates of various information
1531        structures.";
1532     reference "RFC7139";
1533   }
1534   identity odu0 {
1535     base otn-rate-type;
1536     description
1537         "ODU0 bit rate.";
1538   }
1539   identity odu1 {
1540     base otn-rate-type;
1541     description
1542         "ODU1 bit rate.";
1543   }
1544   identity odu2 {
1545     base otn-rate-type;
1546     description
1547         "ODU2 bit rate.";
1548   }
1549   identity odu3 {
1550     base otn-rate-type;
1551     description
1552         "ODU3 bit rate.";
1553   }
1554   identity odu4 {
1555     base otn-rate-type;
1556     description
1557         "ODU4 bit rate.";
1558   }
1559   identity odu2e {
1560     base otn-rate-type;
1561     description
1562         "ODU2e bit rate.";
1563   }
1564   identity oduc {
1565     base otn-rate-type;
1566     description
1567         "ODUCn bit rate.";
1568   }
1569   identity oduflex {
1570     base otn-rate-type;
1571     description
1572         "ODUflex bit rate.";
1573   }
1574
1575   identity wdm-spectrum-type {
1576     description
1577       "Base type to identify WDM spectrum type.";
1578   }
1579   identity cwdm {
1580     base wdm-spectrum-type;
1581     description "CWDM.";
1582     reference "RFC6205";
1583   }
1584   identity dwdm {
1585     base wdm-spectrum-type;
1586     description "DWDM.";
1587     reference "RFC6205";
1588   }
1589   identity flexible-grid {
1590     base wdm-spectrum-type;
1591     description "Flexible grid.";
1592     reference "RFC6205";
1593   }
1594
1595   grouping te-bandwidth {
1596     description
1597       "This grouping defines the generic TE bandwidth.
1598        For some known data plane technologies, specific modeling
1599        structures are specified. The string encoded te-bandwidth
1600        type is used for un-specified technologies.
1601        The modeling structure can be augmented later for other
1602        technologies.";
1603     container te-bandwidth {
1604       description
1605         "Container that specifies TE bandwidth.";
1606       choice technology {
1607         default generic;
1608         description
1609           "Data plane technology type.";
1610         case generic {
1611           leaf generic {
1612             type te-bandwidth;
1613             description
1614               "Bandwidth specified in a generic format.";
1615           }
1616         }
1617       }
1618     }
1619   }
1620
1621   /**
1622    * TE label groupings
1623    **/
1624   grouping te-label {
1625     description
1626       "This grouping defines the generic TE label.
1627        The modeling structure can be augmented for each technology.
1628        For un-specified technologies, rt-types:generalized-label
1629        is used.";
1630     container te-label {
1631       description
1632         "Container that specifies TE label.";
1633       choice technology {
1634         default generic;
1635         description
1636           "Data plane technology type.";
1637         case generic {
1638           leaf generic {
1639             type rt-types:generalized-label;
1640             description
1641               "TE label specified in a generic format.";
1642           }
1643         }
1644       }
1645       leaf direction {
1646         type te-label-direction;
1647         description "Label direction";
1648       }
1649     }
1650   }
1651   /**
1652    * TE performance metric groupings
1653    **/
1654   grouping performance-metric-container {
1655     description
1656       "A container containing performance metric attributes.";
1657     container performance-metric {
1658       description
1659         "Link performance information in real time.";
1660       reference
1661         "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
1662          RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
1663          RFC7823: Performance-Based Path Selection for Explicitly
1664          Routed Label Switched Paths (LSPs) Using TE Metric
1665          Extensions";
1666       container measurement {
1667         description
1668           "Measured performance metric values. Static configuration
1669            and manual overrides of these measurements are also
1670            allowed.";
1671         uses performance-metric-attributes;
1672       }
1673       container normality
1674       {
1675         description
1676           "Performance metric normality values.";
1677         uses performance-metric-normality-attributes;
1678       }
1679       uses performance-metric-throttle-container;
1680     }
1681   } // performance-metric-container
1682
1683   grouping te-topology-identifier {
1684     description
1685       "Augmentation for TE topology.";
1686     container te-topology-identifier {
1687       description "TE topology identifier container";
1688       leaf provider-id {
1689         type te-types:te-global-id;
1690         description
1691           "An identifier to uniquely identify a provider.";
1692       }
1693       leaf client-id {
1694         type te-types:te-global-id;
1695         description
1696           "An identifier to uniquely identify a client.";
1697       }
1698       leaf topology-id {
1699         type te-types:te-topology-id;
1700         description
1701           "It is presumed that a datastore will contain many
1702            topologies. To distinguish between topologies it is
1703            vital to have UNIQUE topology identifiers.";
1704       }
1705     }
1706   }
1707
1708   grouping performance-metric-attributes {
1709     description
1710       "Link performance information in real time.";
1711     reference
1712       "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
1713        RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
1714        RFC7823: Performance-Based Path Selection for Explicitly
1715        Routed Label Switched Paths (LSPs) Using TE Metric
1716        Extensions";
1717     leaf unidirectional-delay {
1718       type uint32 {
1719         range 0..16777215;
1720       }
1721       description "Delay or latency in micro seconds.";
1722     }
1723     leaf unidirectional-min-delay {
1724       type uint32 {
1725         range 0..16777215;
1726       }
1727       description "Minimum delay or latency in micro seconds.";
1728     }
1729     leaf unidirectional-max-delay {
1730       type uint32 {
1731         range 0..16777215;
1732       }
1733       description "Maximum delay or latency in micro seconds.";
1734     }
1735     leaf unidirectional-delay-variation {
1736       type uint32 {
1737         range 0..16777215;
1738       }
1739       description "Delay variation in micro seconds.";
1740     }
1741     leaf unidirectional-packet-loss {
1742       type decimal64 {
1743         fraction-digits 6;
1744         range "0 .. 50.331642";
1745       }
1746       description
1747         "Packet loss as a percentage of the total traffic sent
1748          over a configurable interval. The finest precision is
1749          0.000003%.";
1750     }
1751     leaf unidirectional-residual-bandwidth {
1752       type rt-types:bandwidth-ieee-float32;
1753       description
1754         "Residual bandwidth that subtracts tunnel
1755          reservations from Maximum Bandwidth (or link capacity)
1756          [RFC3630] and provides an aggregated remainder across QoS
1757          classes.";
1758     }
1759     leaf unidirectional-available-bandwidth {
1760       type rt-types:bandwidth-ieee-float32;
1761       description
1762         "Available bandwidth that is defined to be residual
1763          bandwidth minus the measured bandwidth used for the
1764          actual forwarding of non-RSVP-TE LSP packets.  For a
1765          bundled link, available bandwidth is defined to be the
1766          sum of the component link available bandwidths.";
1767     }
1768     leaf unidirectional-utilized-bandwidth {
1769       type rt-types:bandwidth-ieee-float32;
1770       description
1771         "Bandwidth utilization that represents the actual
1772          utilization of the link (i.e. as measured in the router).
1773          For a bundled link, bandwidth utilization is defined to
1774          be the sum of the component link bandwidth
1775          utilizations.";
1776     }
1777   } // performance-metric-attributes
1778
1779   grouping performance-metric-normality-attributes {
1780     description
1781       "Link performance metric normality attributes.";
1782     reference
1783       "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
1784        RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
1785        RFC7823: Performance-Based Path Selection for Explicitly
1786        Routed Label Switched Paths (LSPs) Using TE Metric
1787        Extensions";
1788     leaf unidirectional-delay {
1789       type te-types:performance-metric-normality;
1790       description "Delay normality.";
1791     }
1792     leaf unidirectional-min-delay {
1793       type te-types:performance-metric-normality;
1794       description "Minimum delay or latency normality.";
1795     }
1796     leaf unidirectional-max-delay {
1797       type te-types:performance-metric-normality;
1798       description "Maximum delay or latency normality.";
1799     }
1800     leaf unidirectional-delay-variation {
1801       type te-types:performance-metric-normality;
1802       description "Delay variation normality.";
1803     }
1804     leaf unidirectional-packet-loss {
1805       type te-types:performance-metric-normality;
1806       description "Packet loss normality.";
1807     }
1808     leaf unidirectional-residual-bandwidth {
1809       type te-types:performance-metric-normality;
1810       description "Residual bandwidth normality.";
1811     }
1812     leaf unidirectional-available-bandwidth {
1813       type te-types:performance-metric-normality;
1814       description "Available bandwidth normality.";
1815     }
1816     leaf unidirectional-utilized-bandwidth {
1817       type te-types:performance-metric-normality;
1818       description "Bandwidth utilization normality.";
1819     }
1820   } // performance-metric-normality-attributes
1821
1822   grouping performance-metric-throttle-container {
1823     description
1824       "A container controlling performance metric throttle.";
1825     container throttle {
1826       must "suppression-interval >= measure-interval" {
1827         error-message
1828           "suppression-interval cannot be less then
1829            measure-interval.";
1830         description
1831           "Constraint on suppression-interval and
1832            measure-interval.";
1833       }
1834       description
1835         "Link performance information in real time.";
1836       reference
1837         "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
1838          RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
1839          RFC7823: Performance-Based Path Selection for Explicitly
1840          Routed Label Switched Paths (LSPs) Using TE Metric
1841          Extensions";
1842       leaf unidirectional-delay-offset {
1843         type uint32 {
1844           range 0..16777215;
1845         }
1846         description
1847           "Offset value to be added to the measured delay value.";
1848       }
1849       leaf measure-interval {
1850         type uint32;
1851         default 30;
1852         description
1853           "Interval in seconds to measure the extended metric
1854            values.";
1855       }
1856       leaf advertisement-interval {
1857         type uint32;
1858         description
1859           "Interval in seconds to advertise the extended metric
1860            values.";
1861       }
1862       leaf suppression-interval {
1863         type uint32 {
1864           range "1 .. max";
1865         }
1866         default 120;
1867         description
1868           "Interval in seconds to suppress advertising the extended
1869            metric values.";
1870       }
1871       container threshold-out {
1872         uses performance-metric-attributes;
1873         description
1874           "If the measured parameter falls outside an upper bound
1875            for all but the min delay metric (or lower bound for
1876            min-delay metric only) and the advertised value is not
1877            already outside that bound, anomalous announcement will be
1878            triggered.";
1879       }
1880       container threshold-in {
1881         uses performance-metric-attributes;
1882         description
1883           "If the measured parameter falls inside an upper bound
1884            for all but the min delay metric (or lower bound for
1885            min-delay metric only) and the advertised value is not
1886            already inside that bound, normal (anomalous-flag cleared)
1887            announcement will be triggered.";
1888       }
1889       container threshold-accelerated-advertisement {
1890         description
1891           "When the difference between the last advertised value and
1892            current measured value exceed this threshold, anomalous
1893            announcement will be triggered.";
1894         uses performance-metric-attributes;
1895       }
1896     }
1897   } // performance-metric-throttle-container
1898
1899   /**
1900    * TE tunnel generic groupings
1901    **/
1902
1903   /* Tunnel path selection parameters */
1904   grouping explicit-route-hop {
1905     description
1906       "The explicit route subobject grouping";
1907     leaf index {
1908       type uint32;
1909       description "ERO subobject index";
1910     }
1911     choice type {
1912       description
1913         "The explicit route subobject type";
1914       case num-unnum-hop {
1915         container num-unnum-hop {
1916           leaf node-id {
1917             type te-types:te-node-id;
1918             description
1919               "The identifier of a node in the TE topology.";
1920           }
1921           leaf link-tp-id {
1922             type te-types:te-tp-id;
1923               description
1924                 "TE link termination point identifier. The combination
1925                  of TE link ID and the TE node ID is used to identify an
1926                  unnumbered TE link.";
1927           }
1928           leaf hop-type {
1929             type te-hop-type;
1930             description "strict or loose hop";
1931           }
1932           leaf direction {
1933             type te-link-direction;
1934             description "Unnumbered Link ERO direction";
1935           }
1936           description
1937             "Numbered and Unnumbered link/node explicit route
1938              subobject";
1939           reference
1940             "RFC3209: section 4.3 for EXPLICIT_ROUTE in RSVP-TE
1941              RFC3477: Signalling Unnumbered Links in RSVP-TE";
1942         }
1943       }
1944       case as-number {
1945         container as-number-hop {
1946           leaf as-number {
1947             type binary {
1948               length 16;
1949             }
1950             description "AS number";
1951           }
1952           leaf hop-type {
1953             type te-hop-type;
1954               description
1955                 "strict or loose hop";
1956           }
1957           description
1958             "Autonomous System explicit route subobject";
1959         }
1960       }
1961       case label {
1962         container label-hop {
1963           description "Label hop type";
1964           uses te-label;
1965         }
1966         description
1967           "The Label ERO subobject";
1968       }
1969     }
1970   }
1971
1972   grouping record-route-subobject_state {
1973     description
1974       "The record route subobject grouping";
1975     leaf index {
1976       type uint32;
1977       description "RRO subobject index";
1978     }
1979     choice type {
1980       description
1981         "The record route subobject type";
1982       case numbered {
1983         leaf address {
1984           type te-types:te-tp-id;
1985           description
1986             "Numbered link TE termination point address.";
1987         }
1988         leaf ip-flags {
1989           type binary {
1990             length 8;
1991           }
1992           description
1993             "RRO IP address sub-object flags";
1994           reference "RFC3209";
1995         }
1996       }
1997       case unnumbered {
1998         leaf node-id {
1999           type te-types:te-node-id;
2000           description
2001             "The identifier of a node in the TE topology.";
2002         }
2003         leaf link-tp-id {
2004           type te-types:te-tp-id;
2005             description
2006               "TE link termination point identifier, used
2007                together with te-node-id to identify the
2008                link termination point";
2009         }
2010         description
2011           "Unnumbered link record route subobject";
2012         reference
2013           "RFC3477: Signalling Unnumbered Links in
2014            RSVP-TE";
2015       }
2016       case label {
2017         container label-hop {
2018           description "Label hop type";
2019           uses te-label;
2020           leaf label-flags {
2021             type binary {
2022               length 8;
2023             }
2024             description
2025               "Label sub-object flags";
2026             reference "RFC3209";
2027           }
2028         }
2029         description
2030           "The Label RRO subobject";
2031       }
2032     }
2033   }
2034
2035   grouping label-restriction-info {
2036     description "Label set item info";
2037     leaf restriction {
2038       type enumeration {
2039         enum inclusive {
2040           description "The label or label range is inclusive.";
2041         }
2042         enum exclusive {
2043           description "The label or label range is exclusive.";
2044         }
2045       }
2046       description
2047         "Whether the list item is inclusive or exclusive.";
2048     }
2049     leaf index {
2050       type uint32;
2051       description
2052         "Then index of the label restriction list entry.";
2053     }
2054     container label-start {
2055       description
2056         "This is the starting label if a label range is specified.
2057          This is the label value if a single label is specified,
2058          in which case, attribute 'label-end' is not set.";
2059       uses te-label;
2060     }
2061     container label-end {
2062       description
2063         "The ending label if a label range is specified;
2064          This attribute is not set, If a single label is
2065          specified.";
2066       uses te-label;
2067     }
2068     leaf range-bitmap {
2069       type binary;
2070       description
2071         "When there are gaps between label-start and label-end,
2072          this attribute is used to specified the possitions
2073          of the used labels.";
2074     }
2075   }
2076
2077   grouping label-set-info {
2078     description
2079       "Grouping for List of label restrictions specifying what labels
2080        may or may not be used on a link connectivity.";
2081     container label-restrictions {
2082       description
2083         "The label restrictions container";
2084       list label-restriction {
2085         key "index";
2086         description
2087           "The absence of label-set implies that all labels are
2088            acceptable; otherwise only restricted labels are
2089            available.";
2090         reference
2091           "RFC7579: General Network Element Constraint Encoding
2092            for GMPLS-Controlled Networks";
2093         uses label-restriction-info;
2094       }
2095     }
2096   }
2097
2098   /*** End of TE tunnel groupings ***/
2099   grouping optimizations_config {
2100     description "Optimization metrics configuration grouping";
2101     leaf metric-type {
2102       type identityref {
2103         base te-types:path-metric-type;
2104       }
2105       description "TE path metric type";
2106     }
2107     leaf weight {
2108       type uint8;
2109       description "TE path metric normalization weight";
2110     }
2111     container explicit-route-exclude-objects {
2112       when "../metric-type = " +
2113            "'te-types:path-metric-optimize-excludes'";
2114       description
2115         "Container for the exclude route object list";
2116       uses path-route-exclude-objects;
2117     }
2118     container explicit-route-include-objects {
2119       when "../metric-type = " +
2120            "'te-types:path-metric-optimize-includes'";
2121       description
2122         "Container for the include route object list";
2123       uses path-route-include-objects;
2124     }
2125   }
2126
2127   grouping common-constraints_config {
2128     description
2129       "Common constraints grouping that can be set on
2130        a constraint set or directly on the tunnel";
2131
2132     uses te-types:te-bandwidth {
2133       description
2134         "A requested bandwidth to use for path computation";
2135     }
2136
2137     leaf setup-priority {
2138       type uint8 {
2139         range "0..7";
2140       }
2141       description
2142         "TE LSP requested setup priority";
2143       reference "RFC3209";
2144     }
2145     leaf hold-priority {
2146       type uint8 {
2147         range "0..7";
2148       }
2149       description
2150         "TE LSP requested hold priority";
2151       reference "RFC3209";
2152     }
2153     leaf signaling-type {
2154       type identityref {
2155         base te-types:path-signaling-type;
2156       }
2157       description "TE tunnel path signaling type";
2158     }
2159   }
2160
2161   grouping tunnel-constraints_config {
2162     description
2163       "Tunnel constraints grouping that can be set on
2164        a constraint set or directly on the tunnel";
2165     uses te-types:te-topology-identifier;
2166     uses te-types:common-constraints_config;
2167   }
2168
2169   grouping path-metrics-bounds_config {
2170     description "TE path metric bounds grouping";
2171     leaf metric-type {
2172       type identityref {
2173         base te-types:path-metric-type;
2174       }
2175       description "TE path metric type";
2176     }
2177     leaf upper-bound {
2178       type uint64;
2179       description "Upper bound on end-to-end TE path metric";
2180     }
2181   }
2182
2183   grouping path-objective-function_config {
2184     description "Optimization metrics configuration grouping";
2185     leaf objective-function-type {
2186       type identityref {
2187         base te-types:objective-function-type;
2188       }
2189       description
2190         "Objective function entry";
2191     }
2192   }
2193
2194   /**
2195    * TE interface generic groupings
2196    **/
2197   grouping path-route-objects {
2198     description
2199       "List of EROs to be included or excluded when performing
2200        the path computation.";
2201     container explicit-route-objects {
2202       description
2203         "Container for the exclude route object list";
2204       list route-object-exclude-always {
2205         key index;
2206         description
2207           "List of explicit route objects to always exclude
2208            from path computation";
2209         uses te-types:explicit-route-hop;
2210       }
2211       list route-object-include-exclude {
2212         key index;
2213         description
2214           "List of explicit route objects to include or
2215            exclude in path computation";
2216         leaf explicit-route-usage {
2217           type identityref {
2218             base te-types:route-usage-type;
2219           }
2220           description "Explicit-route usage.";
2221         }
2222         uses te-types:explicit-route-hop {
2223           augment "type" {
2224             case srlg {
2225               container srlg {
2226                 description "SRLG container";
2227                 leaf srlg {
2228                   type uint32;
2229                   description "SRLG value";
2230                 }
2231               }
2232               description "An SRLG value to be included or excluded";
2233             }
2234             description
2235               "Augmentation to generic explicit route for SRLG
2236                exclusion";
2237           }
2238         }
2239       }
2240     }
2241   }
2242
2243   grouping path-route-include-objects {
2244     description
2245       "List of EROs to be included when performing
2246        the path computation.";
2247     list route-object-include-object {
2248       key index;
2249       description
2250         "List of explicit route objects to be included
2251          in path computation";
2252       uses te-types:explicit-route-hop;
2253     }
2254   }
2255
2256   grouping path-route-exclude-objects {
2257     description
2258       "List of EROs to be included when performing
2259        the path computation.";
2260     list route-object-exclude-object {
2261       key index;
2262       description
2263         "List of explicit route objects to be excluded
2264          in path computation";
2265       uses te-types:explicit-route-hop {
2266         augment "type" {
2267           case srlg {
2268             container srlg {
2269               description "SRLG container";
2270               leaf srlg {
2271                 type uint32;
2272                 description "SRLG value";
2273               }
2274             }
2275             description "An SRLG value to be included or excluded";
2276           }
2277           description
2278             "Augmentation to generic explicit route for SRLG exclusion";
2279         }
2280       }
2281     }
2282   }
2283
2284   grouping generic-path-metric-bounds {
2285     description "TE path metric bounds grouping";
2286     container path-metric-bounds {
2287       description "TE path metric bounds container";
2288       list path-metric-bound {
2289         key metric-type;
2290         description "List of TE path metric bounds";
2291         uses path-metrics-bounds_config;
2292       }
2293     }
2294   }
2295
2296   grouping generic-path-optimization {
2297     description "TE generic path optimization grouping";
2298
2299     container optimizations {
2300       description
2301         "The objective function container that includes
2302          attributes to impose when computing a TE path";
2303
2304       choice algorithm {
2305         description "Optimizations algorithm.";
2306         case metric {
2307           if-feature path-optimization-metric;
2308           /* Optimize by metric */
2309           list optimization-metric {
2310             key "metric-type";
2311             description "TE path metric type";
2312             uses optimizations_config;
2313           }
2314           /* Tiebreakers */
2315           container tiebreakers {
2316             description
2317               "The list of tiebreaker criterion to apply
2318                on an equally favored set of paths to pick best";
2319             list tiebreaker {
2320               key "tiebreaker-type";
2321               description
2322                 "The list of tiebreaker criterion to apply
2323                  on an equally favored set of paths to pick best";
2324               leaf tiebreaker-type {
2325                 type identityref {
2326                   base te-types:path-metric-type;
2327                 }
2328                 description "The objective function";
2329               }
2330             }
2331           }
2332         }
2333         case objective-function {
2334           if-feature path-optimization-objective-function;
2335           /* Objective functions */
2336           container objective-function {
2337             description
2338               "The objective function container that includes
2339                attributes to impose when computing a TE path";
2340             uses path-objective-function_config;
2341           }
2342         }
2343       }
2344     }
2345   }
2346
2347   grouping generic-path-affinities {
2348     description
2349       "Path affinities grouping";
2350     container path-affinities {
2351       description
2352         "Path affinities container";
2353       list constraint {
2354         key "usage";
2355         description
2356           "List of named affinity constraints";
2357         leaf usage {
2358           type identityref {
2359             base resource-affinities-type;
2360           }
2361           description "Affinities usage";
2362         }
2363         leaf value {
2364           type admin-groups;
2365           description "Affinity value";
2366         }
2367       }
2368     }
2369   }
2370
2371   grouping generic-path-srlgs {
2372     description
2373       "Path SRLG grouping";
2374     container path-srlgs {
2375       description
2376         "Path SRLG properties container";
2377       leaf usage {
2378         type identityref {
2379           base te-types:route-exclude-srlg;
2380         }
2381         description "SRLG usage";
2382       }
2383       leaf-list values {
2384         type srlg;
2385         description "SRLG value";
2386       }
2387     }
2388   }
2389
2390   grouping generic-path-disjointness {
2391     description "Path disjointness grouping";
2392     leaf disjointness {
2393       type te-types:te-path-disjointness;
2394       description
2395         "The type of resource disjointness.
2396          Under primary path, disjointness level applies to
2397          all secondary LSPs. Under secondary, disjointness
2398          level overrides the one under primary";
2399     }
2400   }
2401
2402   grouping common-path-constraints-attributes {
2403     description
2404       "Common path constraints configuration grouping";
2405     uses common-constraints_config;
2406     uses generic-path-metric-bounds;
2407     uses generic-path-affinities;
2408     uses generic-path-srlgs;
2409   }
2410
2411   grouping generic-path-constraints {
2412     description
2413       "Global named path constraints configuration
2414       grouping";
2415     container path-constraints {
2416       description "TE named path constraints container";
2417       uses common-path-constraints-attributes;
2418       uses generic-path-disjointness;
2419     }
2420   }
2421
2422   grouping generic-path-properties {
2423     description "TE generic path properties grouping";
2424     container path-properties {
2425       config false;
2426       description "The TE path properties";
2427       list path-metric {
2428         key metric-type;
2429         description "TE path metric type";
2430         leaf metric-type {
2431           type identityref {
2432             base te-types:path-metric-type;
2433           }
2434           description "TE path metric type";
2435         }
2436         leaf accumulative-value {
2437           type uint64;
2438           description "TE path metric accumulative value";
2439         }
2440       }
2441       uses generic-path-affinities;
2442       uses generic-path-srlgs;
2443       container path-route-objects {
2444         description
2445           "Container for the list of route objects either returned by
2446            the computation engine or actually used by an LSP";
2447         list path-route-object {
2448           key index;
2449           description
2450             "List of route objects either returned by the computation
2451              engine or actually used by an LSP";
2452           uses explicit-route-hop;
2453         }
2454       }
2455     }
2456   }
2457 }