SVEC object flags
[bgpcep.git] / pcep / api / src / main / yang / pcep-types.yang
1 module pcep-types {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:pcep:types";
4     prefix "pcep-t";
5
6     import ieee754 { prefix ieee754; revision-date 2013-08-19; }
7     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
8     import network-concepts { prefix netc; revision-date 2013-11-25; }
9     import rsvp { prefix rsvp; revision-date 2015-08-20; }
10     import iana { prefix iana; revision-date 2013-08-16; }
11
12     organization "Cisco Systems, Inc.";
13     contact "Robert Varga <rovarga@cisco.com>";
14
15     description
16         "This module contains the base data model of a PCEP message.
17         It rolls up the definitions contained in RFC5440, RFC7896, RFC5520
18         and RFC8306, RFC5886.
19
20         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
21
22         This program and the accompanying materials are made available
23         under the terms of the Eclipse Public License v1.0 which
24         accompanies this distribution, and is available at
25         http://www.eclipse.org/legal/epl-v10.html";
26
27     revision "2018-11-09" {
28         description
29             "P2MP extension.";
30         reference "RFC8306";
31     }
32
33     revision "2013-10-05" {
34         description
35             "Initial revision.";
36         reference "RFC5440";
37     }
38
39     // NOTE: this model uses counts bits in fields from left to right,
40     //       just as IANA does for PCEP protocol.
41
42     // Types
43     typedef protocol-version {
44         type uint8 {
45             range 1..7;
46         }
47     }
48
49     typedef request-id {
50         type uint32 {
51             range 1..max;
52         }
53     }
54
55     typedef of-id {
56         type uint16;
57     }
58
59     grouping vendor-information {
60         description "VENDOR-INFORMATION format";
61         reference "http://tools.ietf.org/html/draft-ietf-pce-rfc7150bis-00#section-4";
62
63         leaf enterprise-number {
64             type iana:enterprise-number;
65         }
66
67         choice enterprise-specific-information {
68         }
69     }
70
71     // TLVs
72     grouping tlv {
73         description "Marker grouping for TLV groupings.";
74     }
75
76     grouping no-path-vector-tlv {
77         description "NO-PATH-VECTOR TLV";
78         reference "https://tools.ietf.org/html/rfc5440#section-7.5";
79
80         uses tlv;
81         leaf flags {
82             type bits {
83                 bit p2mp-unreachable {
84                     position 24;
85                 }
86                 bit no-gco-solution {
87                     position 25;
88                 }
89                 bit no-gco-migration {
90                     position 26;
91                 }
92                 bit path-key {
93                     reference "https://tools.ietf.org/html/rfc5520#section-7.4";
94                     position 27;
95                 }
96                 bit chain-unavailable {
97                     position 28;
98                 }
99                 bit unknown-source {
100                     position 29;
101                 }
102                 bit unknown-destination {
103                     position 30;
104                 }
105                 bit pce-unavailable {
106                     position 31;
107                 }
108             }
109             mandatory true;
110         }
111     }
112
113     grouping overload-duration-tlv {
114         description "OVERLOAD-DURATION TLV";
115         reference "https://tools.ietf.org/html/rfc5440#section-7.14";
116         container overload-duration {
117             uses tlv;
118             leaf duration {
119                 type uint32;
120                 units seconds;
121             }
122         }
123     }
124
125     grouping req-missing-tlv {
126         description "REQ-MISSING TLV";
127         reference "https://tools.ietf.org/html/rfc5440#section-7.5";
128         container req-missing {
129             uses tlv;
130             leaf request-id {
131                 type request-id;
132             }
133         }
134     }
135
136     grouping of-list-tlv {
137         description "OF-List TLV";
138         reference "https://tools.ietf.org/html/rfc5541#section-2.1";
139         container of-list {
140             uses tlv;
141             leaf-list codes {
142                 type of-id;
143             }
144         }
145     }
146
147     grouping order-tlv {
148         description "Order TLV";
149         reference "https://tools.ietf.org/html/rfc5557#section-5.4";
150         container order {
151             uses tlv;
152             leaf delete {
153                 type uint32;
154                 mandatory true;
155             }
156
157             leaf setup {
158                 type uint32;
159                 mandatory true;
160             }
161         }
162     }
163
164     grouping vs-tlv {
165         description "Vendor-specific TLV.";
166         container vs-tlv {
167                 status obsolete;
168                 description "This model is obsolete, please use vendor-information-tlvs instead";
169
170                 uses tlv;
171
172                 leaf enterprise-number {
173                     type iana:enterprise-number;
174                 }
175
176                 choice vendor-payload {
177                 }
178         }
179     }
180
181     grouping path-setup-type-tlv {
182         description "PATH-SETUP-TYPE TLV";
183         reference "https://tools.ietf.org/html/draft-ietf-pce-lsp-setup-type-00#section-3";
184
185         container path-setup-type {
186             uses tlv;
187             leaf pst {
188                 description "PST=0: Path is setup via RSVP-TE signaling protocol(default).";
189                 type uint8;
190                 default 0;
191             }
192         }
193     }
194
195     // Objects
196     grouping object-header {
197         description "Common Object Header";
198         reference "https://tools.ietf.org/html/rfc5440#section-7.2";
199
200         leaf processing-rule {
201             type boolean;
202             default false;
203         }
204
205         leaf ignore {
206             type boolean;
207             default false;
208         }
209     }
210
211     grouping object {
212         description "Core object structure with optional TLVs";
213         uses object-header;
214     }
215
216     grouping vendor-information-tlvs {
217         list vendor-information-tlv {
218             description "VENDOR-INFORMATION-TLV";
219             reference "http://tools.ietf.org/html/draft-ietf-pce-rfc7150bis-00#section-3";
220             uses tlv;
221             uses vendor-information;
222         }
223     }
224
225     grouping vendor-information-objects {
226         list vendor-information-object {
227             description "VENDOR-INFORMATION-OBJECT";
228             reference "http://tools.ietf.org/html/draft-ietf-pce-rfc7150bis-00#section-2";
229             uses object;
230             uses vendor-information;
231         }
232     }
233
234     grouping open-object {
235         description "OPEN Object";
236         reference "https://tools.ietf.org/html/rfc5440#section-7.3";
237
238         container open {
239             uses object;
240             container "tlvs" {
241                 uses of-list-tlv;
242                 uses vendor-information-tlvs;
243             }
244
245             leaf version {
246                 type protocol-version;
247                 default 1;
248             }
249
250             leaf keepalive {
251                 type uint8 {
252                     range 0..255;
253                 }
254                 mandatory true;
255             }
256
257             leaf dead-timer {
258                 type uint8 {
259                     range 0..255;
260                 }
261                 mandatory true;
262             }
263
264             leaf session-id {
265                 type uint8;
266             }
267         }
268     }
269
270     grouping rp-object {
271         description "RP Object";
272         reference "https://tools.ietf.org/html/rfc5440#section-7.4";
273         container rp {
274             uses object;
275             container "tlvs" {
276                 uses order-tlv;
277                 uses vendor-information-tlvs;
278                 uses path-setup-type-tlv;
279             }
280
281             leaf priority {
282                 type uint8 {
283                     range 1..7;
284                 }
285             }
286
287             leaf request-id {
288                 type request-id;
289                 mandatory true;
290             }
291
292             leaf reoptimization {
293                 type boolean;
294                 default false;
295             }
296
297             leaf bi-directional {
298                 type boolean;
299                 default false;
300             }
301
302             leaf loose {
303                 type boolean;
304                 default false;
305             }
306
307             leaf path-key {
308                 type boolean;
309                 default false;
310                 reference "https://tools.ietf.org/html/rfc5520#section-3.2.1";
311             }
312
313             leaf fragmentation {
314                 type boolean;
315                 default false;
316                 reference "https://tools.ietf.org/html/rfc8306#section-3.3.1";
317             }
318
319             leaf p2mp {
320                 type boolean;
321                 default false;
322                 reference "https://tools.ietf.org/html/rfc8306#section-3.3.1";
323             }
324
325             leaf ero-compression {
326                 type boolean;
327                 default false;
328                 reference "https://tools.ietf.org/html/rfc8306#section-3.3.1";
329             }
330
331             leaf supply-of {
332                 type boolean;
333                 default false;
334                 reference "https://tools.ietf.org/html/rfc5541#section-3.3";
335             }
336
337             leaf order {
338                 type boolean;
339                 default false;
340                 reference "https://tools.ietf.org/html/rfc5557#section-5.3";
341             }
342
343             leaf make-before-break {
344                 type boolean;
345                 default false;
346                 reference "https://tools.ietf.org/html/rfc5557#section-5.3";
347             }
348         }
349     }
350
351     grouping no-path-object {
352         description "NO-PATH Object";
353         reference "https://tools.ietf.org/html/rfc5440#section-7.5";
354
355         uses object;
356
357         leaf nature-of-issue {
358             type uint8;
359             mandatory true;
360         }
361
362         leaf unsatisfied-constraints {
363             when "nature-of-issue = 0" {
364                 description
365                     "The C flag has no meaning
366                     and is ignored unless the NI
367                     field is set to 0x00.";
368             }
369             type boolean;
370             default false;
371         }
372     }
373
374     typedef p2mp-leaves {
375         reference "https://tools.ietf.org/html/rfc8306#section-3.3.2";
376         description "Types of leaves in a P2MP request.";
377         type enumeration {
378             enum new-leaves-to-add {
379                 value 1;
380             }
381             enum old-leaves-to-remove {
382                 value 2;
383             }
384             enum old-leaves-path-modified-reoptimized {
385                 value 3;
386             }
387             enum old-leaves-path-unchanged {
388                 value 4;
389             }
390         }
391     }
392
393     grouping p2mp-leaves-leaf {
394         leaf p2mp-leaves {
395             type p2mp-leaves;
396             mandatory true;
397         }
398     }
399
400     grouping endpoints-ipv4-source {
401         leaf source-ipv4-address {
402             type inet:ipv4-address-no-zone;
403             mandatory true;
404         }
405     }
406
407     grouping endpoints-ipv6-source {
408         leaf source-ipv6-address {
409             type inet:ipv6-address-no-zone;
410             mandatory true;
411         }
412     }
413
414     grouping ipv6-destinations {
415         leaf-list destination-ipv6-address {
416             type inet:ipv6-address-no-zone;
417             min-elements 1;
418         }
419     }
420
421     grouping ipv4-destinations {
422         leaf-list destination-ipv4-address {
423             type inet:ipv4-address-no-zone;
424             min-elements 1;
425         }
426     }
427
428     grouping endpoints {
429         choice address-family {
430             mandatory true;
431
432             case ipv4-case {
433                 container ipv4 {
434                     uses endpoints-ipv4-source;
435                     leaf destination-ipv4-address {
436                         type inet:ipv4-address-no-zone;
437                         mandatory true;
438                     }
439                 }
440             }
441             case ipv6-case {
442                 container ipv6 {
443                     uses endpoints-ipv6-source;
444                     leaf destination-ipv6-address {
445                         type inet:ipv6-address-no-zone;
446                         mandatory true;
447                     }
448                 }
449             }
450             case p2mp-ipv4-case {
451                 container p2mp-ipv4 {
452                     uses p2mp-leaves-leaf;
453                     uses endpoints-ipv4-source;
454                     uses ipv4-destinations;
455                 }
456             }
457             case p2mp-ipv6-case {
458                 container p2mp-ipv6 {
459                     uses p2mp-leaves-leaf;
460                     uses endpoints-ipv6-source;
461                     uses ipv6-destinations;
462                 }
463             }
464         }
465     }
466
467     grouping endpoints-object {
468         description "END-POINTS Object";
469         reference "https://tools.ietf.org/html/rfc5440#section-7.6";
470
471         container endpoints-obj {
472             uses object;
473             uses endpoints;
474         }
475     }
476
477     grouping bnc {
478         uses object;
479         // No possibility of TLVs
480         list subobject {
481             leaf loose {
482                 type boolean;
483                 mandatory true;
484             }
485
486             uses rsvp:ip-prefix-subobject;
487             ordered-by user;
488         }
489     }
490
491     grouping branch-node-object {
492         description "Branch Node Object";
493         reference "https://tools.ietf.org/html/rfc8306#section-3.11.1";
494
495         container branch-node-list {
496             uses bnc;
497         }
498     }
499
500     grouping non-branch-node-object {
501         description "Branch Node Object";
502         reference "https://tools.ietf.org/html/rfc8306#section-3.11.1";
503
504         container non-branch-node-list {
505             uses bnc;
506         }
507     }
508
509     grouping bnc-object {
510         choice branch-node-type {
511             case branch-node-case {
512                 uses branch-node-object;
513             }
514             case non-branch-node-case {
515                 uses non-branch-node-object;
516             }
517         }
518     }
519
520     grouping bandwidth {
521         // No possibility to carry TLVs
522         leaf bandwidth {
523             type netc:bandwidth;
524         }
525     }
526
527     grouping bandwidth-object {
528         description "BANDWIDTH Object";
529         reference "https://tools.ietf.org/html/rfc5440#section-7.7";
530         container bandwidth {
531             uses object;
532             uses bandwidth;
533         }
534     }
535
536     grouping reoptimization-bandwidth-object {
537         description "BANDWIDTH Object";
538         reference "https://tools.ietf.org/html/rfc5440#section-7.7";
539         container reoptimization-bandwidth {
540             uses object;
541             uses bandwidth;
542         }
543     }
544
545     grouping metric-object {
546         description "METRIC Object";
547         reference "https://tools.ietf.org/html/rfc5440#section-7.8";
548         container metric {
549             uses object;
550
551             leaf metric-type {
552                 type uint8;
553                 mandatory true;
554             }
555
556             leaf bound {
557                 type boolean;
558                 default false;
559             }
560
561             leaf computed {
562                 type boolean;
563                 default false;
564             }
565
566             leaf value {
567                 type ieee754:float32;
568             }
569         }
570     }
571
572     grouping exclude-route-object {
573         description "Exclude Route Object";
574         reference "https://tools.ietf.org/html/rfc5521#section-2.1.1";
575
576         container xro {
577             uses object;
578
579             leaf flags {
580                 type bits {
581                     bit fail {
582                         position 31;
583                     }
584                 }
585                 mandatory true;
586             }
587
588             list subobject {
589                 uses rsvp:exclude-route-subobjects;
590                 ordered-by user;
591             }
592         }
593     }
594
595     grouping explicit-route-object {
596         description "Explicit Route Object";
597         reference "https://tools.ietf.org/html/rfc5440#section-7.9";
598
599         container ero {
600             // No possibility of TLVs
601             uses object;
602
603             list subobject {
604                 leaf loose {
605                     type boolean;
606                     mandatory true;
607                 }
608
609                 uses rsvp:explicit-route-subobjects;
610                 ordered-by user;
611             }
612         }
613     }
614
615     grouping secondary-explicit-route-object {
616         description "Secondary Explicit Route Object";
617         reference "https://tools.ietf.org/html/rfc8306#section-3.2";
618         container sero {
619             // No possibility of TLVs
620             uses object;
621
622             list subobject {
623                 leaf loose {
624                     type boolean;
625                     mandatory true;
626                 }
627
628                 uses rsvp:secondary-explicit-route-subobjects;
629                 ordered-by user;
630             }
631         }
632     }
633
634     grouping include-route-object {
635         description "Include Route Object";
636         reference "https://tools.ietf.org/html/rfc7896#section-2.1";
637
638         container iro {
639             // No possibility of TLVs
640             uses object;
641
642             list subobject {
643                 leaf loose {
644                     type boolean;
645                     mandatory true;
646                 }
647
648                 uses rsvp:explicit-route-subobjects;
649                 ordered-by user;
650             }
651         }
652     }
653
654     grouping reported-route-object {
655         description "Reported Route Object";
656         reference "https://tools.ietf.org/html/rfc5440#section-7.10";
657
658         container rro {
659             // No possibility of TLVs
660             uses object;
661
662             list subobject {
663                 uses rsvp:record-route-subobjects;
664                 ordered-by user;
665             }
666         }
667     }
668
669     grouping secondary-reported-route-object {
670         description "Reported Route Object";
671         reference "https://tools.ietf.org/html/rfc8306#section-3.2";
672
673         container srro {
674             // No possibility of TLVs
675             uses object;
676
677             list subobject {
678                 uses rsvp:secondary-record-route-subobjects;
679                 ordered-by user;
680             }
681         }
682     }
683
684     grouping lspa-object {
685         description "LSPA Object";
686         reference "https://tools.ietf.org/html/rfc5440#section-7.11";
687
688         container lspa {
689             uses object;
690             uses rsvp:tunnel-attributes;
691             container "tlvs" {
692                 uses vendor-information-tlvs;
693             }
694         }
695     }
696
697     grouping svec-object {
698         description "Synchronization Vector Object";
699         reference "https://tools.ietf.org/html/rfc5440#section-7.13";
700
701         container svec {
702             // No possibility of TLVs
703             uses object;
704
705             leaf link-diverse {
706                 type boolean;
707                 default false;
708             }
709
710             leaf node-diverse {
711                 type boolean;
712                 default false;
713             }
714
715             leaf srlg-diverse {
716                 type boolean;
717                 default false;
718             }
719
720             leaf partial-path-diverse {
721                 type boolean;
722                 default false;
723             }
724
725             leaf link-direction-diverse {
726                 type boolean;
727                 default false;
728             }
729
730             leaf-list requests-ids {
731                 type request-id;
732             }
733         }
734     }
735
736     grouping notification-object {
737         description "NOTIFICATION Object";
738         reference "https://tools.ietf.org/html/rfc5440#section-7.14";
739         container c-notification {
740             uses object;
741             container "tlvs" {
742                 when "../type = 2 and ../value = 1";
743
744                 uses overload-duration-tlv;
745                 uses vendor-information-tlvs;
746             }
747
748             leaf type {
749                 type uint8;
750                 mandatory true;
751             }
752
753             leaf value {
754                 type uint8;
755                 mandatory true;
756             }
757         }
758     }
759
760     grouping pcep-error-object {
761         description "PCEP-ERROR Object";
762         reference "https://tools.ietf.org/html/rfc5440#section-7.15";
763         container error-object {
764             uses object;
765             container "tlvs" {
766                 when "../type = 7";
767                 uses req-missing-tlv;
768                 uses vendor-information-tlvs;
769             }
770
771             leaf type {
772                 type uint8;
773                 mandatory true;
774             }
775
776             leaf value {
777                 type uint8;
778                 mandatory true;
779             }
780         }
781     }
782
783     grouping load-balancing-object {
784         description "LOAD-BALANCING Object";
785         reference "https://tools.ietf.org/html/rfc5440#section-7.16";
786
787         container load-balancing {
788             // No possibility of TLVs
789             uses object;
790
791             leaf max-lsp {
792                 type uint8;
793                 mandatory true;
794             }
795
796             leaf min-bandwidth {
797                 type netc:bandwidth;
798             }
799         }
800     }
801
802     grouping close-object {
803         description "CLOSE Object";
804         reference "https://tools.ietf.org/html/rfc5440#section-7.17";
805
806         container c-close {
807             uses object;
808
809             leaf reason {
810                 type uint8;
811                 mandatory true;
812             }
813
814             container tlvs {
815                 uses vendor-information-tlvs;
816             }
817         }
818     }
819
820
821
822     grouping path-key-object {
823         description "PATH-KEY Object";
824         reference "https://tools.ietf.org/html/rfc5520#section-3.2.2";
825         container path-key {
826             uses object;
827
828             list path-keys {
829                 min-elements 1;
830
831                 leaf loose {
832                     type boolean;
833                     default false;
834                 }
835
836                 uses rsvp:path-key-subobject;
837                 ordered-by user;
838             }
839         }
840     }
841
842     grouping of-object {
843         description "OF Object";
844         reference "https://tools.ietf.org/html/rfc5541#section-3.1";
845         container of {
846             uses object;
847
848             leaf code {
849                 type of-id;
850                 mandatory true;
851             }
852
853             container tlvs {
854                 uses vendor-information-tlvs;
855             }
856         }
857     }
858
859     grouping monitoring-object {
860         description "The MONITORING object is used to specify the
861         set of requested PCEP state metrics.";
862         reference "https://tools.ietf.org/html/rfc5886#section-4.1";
863         container monitoring {
864             uses object;
865
866             leaf flags {
867                 type bits {
868                     bit incomplete {
869                         description "Indicates that PCE cannot provide any of
870                         the set of requested performance metrics for unspecified reasons.";
871                         position 19;
872                     }
873                     bit overload {
874                         description "Indicates that the overload status is
875                         a metric of interest.";
876                         position 20;
877                     }
878                     bit processing-time {
879                         description "Indicates that the processing times is
880                         a metric of interest.";
881                         position 21;
882                     }
883                     bit general {
884                         description "Indicates that the monitoring
885                         request is a general monitoring request.";
886                         position 22;
887                     }
888                     bit liveness {
889                         description "Indicates that the state metric
890                         of interest is the PCE's liveness.";
891                         position 23;
892                     }
893                 }
894             }
895
896             leaf monitoring-id {
897                 description "The Monitoring-id-number combined with
898                 the PCC-REQ-ID identifying the requesting PCC uniquely
899                 identifies the monitoring request context.";
900                 type uint32;
901                 mandatory true;
902             }
903
904             container tlvs {
905                 description "Optional TLV(s).";
906                 uses vendor-information-tlvs;
907             }
908         }
909     }
910
911     grouping pcc-id-req-object {
912         description "The PCC-ID-REQ object is used to specify the IP
913         address of the requesting PCC.";
914         reference "https://tools.ietf.org/html/rfc5886#section-4.2";
915         container pcc-id-req {
916             uses object;
917             leaf ip-address {
918                 type inet:ip-address-no-zone;
919             }
920         }
921     }
922
923     grouping pce-id-object {
924         description "The PCE-ID object is used to specify a PCE's IP address.";
925         reference "https://tools.ietf.org/html/rfc5886#section-4.3";
926         container pce-id {
927             uses object;
928             leaf ip-address {
929                 type inet:ip-address-no-zone;
930             }
931         }
932     }
933
934     grouping proc-time-object {
935         description "The PROC-TIME object is used to report various processing time
936         related metrics.";
937         reference "https://tools.ietf.org/html/rfc5886#section-4.4";
938         container proc-time {
939             uses object;
940
941             leaf estimated {
942                 description "Indicates that the reported metric value is
943                 based on estimated processing time as opposed to
944                 actual computations.";
945                 type boolean;
946                 mandatory true;
947             }
948
949             leaf current-proc-time {
950                 description "Indicates, in milliseconds, the
951                 processing time for the path computation of interest
952                 characterized in the corresponding PCMonReq message.";
953                 type uint32;
954             }
955
956             leaf min-proc-time {
957                 description "The minimum processing time in milliseconds";
958                 type uint32;
959                 mandatory true;
960             }
961
962             leaf max-proc-time {
963                 description "The maximum processing time in milliseconds";
964                 type uint32;
965                 mandatory true;
966             }
967
968             leaf average-proc-time {
969                 description "The average processing time in milliseconds";
970                 type uint32;
971                 mandatory true;
972             }
973
974             leaf variance-proc-time {
975                 description "The variance of processing times in milliseconds";
976                 type uint32;
977                 mandatory true;
978             }
979         }
980     }
981
982     grouping overload-object {
983         description "The OVERLOAD object is used to report a PCE processing
984         congestion state.";
985         reference "https://tools.ietf.org/html/rfc5886#section-4.5";
986         container overload {
987             uses object;
988             leaf duration {
989                 description "This field indicates the amount of time,
990                 in seconds, that the responding PCE expects that it may continue to
991                 be overloaded from the time that the response message was generated.";
992                 type uint16;
993                 mandatory true;
994             }
995         }
996     }
997
998     typedef class-type {
999         type uint8 {
1000             range 1..7;
1001         }
1002     }
1003
1004     grouping classtype-object {
1005         description "CLASSTYPE Object";
1006         reference "https://tools.ietf.org/html/rfc5455#section-3";
1007
1008         container class-type {
1009             uses object;
1010
1011             leaf class-type {
1012                 type class-type;
1013                 mandatory true;
1014             }
1015         }
1016     }
1017
1018     grouping gc-object {
1019         description "GLOBAL CONSTRAINTS (GC) Object";
1020         reference "https://tools.ietf.org/html/rfc5557#section-5.5";
1021         container gc {
1022             uses object;
1023
1024             leaf max-hop {
1025                 type uint8;
1026                 mandatory true;
1027             }
1028
1029             leaf max-utilization {
1030                 type uint8 {
1031                     range 0..100;
1032                 }
1033                 units percent;
1034                 mandatory true;
1035             }
1036
1037             leaf min-utilization {
1038                 type uint8 {
1039                     range 0..100;
1040                 }
1041                 units percent;
1042                 mandatory true;
1043             }
1044
1045             leaf over-booking-factor {
1046                 type uint8 {
1047                     range 0..100;
1048                 }
1049                 units percent;
1050                 mandatory true;
1051             }
1052
1053             container tlvs {
1054                 uses vendor-information-tlvs;
1055             }
1056         }
1057     }
1058
1059     // Messages
1060     grouping message {
1061         description "Marker grouping for message groupings.";
1062     }
1063
1064     grouping message-header {
1065         description "Common Header";
1066         reference "https://tools.ietf.org/html/rfc5440#section-6.1";
1067
1068         leaf version {
1069             type protocol-version;
1070             default 1;
1071         }
1072     }
1073
1074     grouping open-message {
1075         uses message;
1076
1077         container open-message {
1078             description "Open Message";
1079             reference "https://tools.ietf.org/html/rfc5440#section-6.2";
1080
1081             uses message-header;
1082
1083             uses open-object;
1084         }
1085     }
1086
1087     grouping keepalive-message {
1088         uses message;
1089
1090         container keepalive-message {
1091             description "Keepalive Message";
1092             reference "https://tools.ietf.org/html/rfc5440#section-6.3";
1093
1094             uses message-header;
1095         }
1096     }
1097
1098     grouping lsp-attributes {
1099         uses lspa-object;
1100
1101         uses bandwidth-object;
1102         uses reoptimization-bandwidth-object;
1103
1104         list metrics {
1105             uses metric-object;
1106         }
1107         uses include-route-object;
1108
1109         uses reported-route-object;
1110
1111         uses exclude-route-object;
1112
1113         uses of-object;
1114
1115         uses classtype-object;
1116     }
1117
1118     grouping pcreq-message {
1119         uses message;
1120
1121         container pcreq-message {
1122             description "Path Computation Request Message";
1123             reference "https://tools.ietf.org/html/rfc5440#section-6.4";
1124
1125             uses message-header;
1126
1127             list requests {
1128                 uses rp-object;
1129
1130                 container path-key-expansion {
1131                     when "rp/path-key = true";
1132                     uses path-key-object;
1133                 }
1134
1135                 container segment-computation {
1136                     when "rp/path-key = false";
1137
1138                     container p2p {
1139                         when "../rp/p2mp = false";
1140
1141                         uses endpoints-object;
1142
1143                         container reported-route {
1144                             uses reported-route-object;
1145
1146                             uses reoptimization-bandwidth-object;
1147                         }
1148
1149                         uses vendor-information-objects;
1150
1151                         uses load-balancing-object;
1152
1153                         uses lsp-attributes;
1154                     }
1155                 }
1156
1157                 uses vendor-information-objects;
1158             }
1159
1160             list svec {
1161                 uses svec-object;
1162
1163                 uses of-object;
1164
1165                 uses gc-object;
1166
1167                 uses exclude-route-object;
1168
1169                 list metric {
1170                     uses metric-object;
1171                 }
1172
1173                 uses vendor-information-objects;
1174             }
1175
1176             container monitoring-request {
1177                 uses monitoring;
1178
1179                 list pce-id-list {
1180                     uses pce-id-object;
1181                 }
1182             }
1183         }
1184     }
1185
1186     grouping path-definition {
1187         uses explicit-route-object;
1188
1189         uses lsp-attributes;
1190     }
1191
1192     grouping monitoring {
1193         uses monitoring-object;
1194         uses pcc-id-req-object;
1195     }
1196
1197     grouping monitoring-metrics {
1198         list metric-pce {
1199             uses pce-id-object;
1200             uses proc-time-object;
1201             uses overload-object;
1202         }
1203     }
1204
1205     grouping monitoring-response {
1206         uses monitoring;
1207         choice monitoring-metrics-list {
1208             case specific-metrics-list {
1209                 list specific-metrics {
1210                     uses rp-object;
1211                     uses monitoring-metrics;
1212                 }
1213             }
1214
1215             case general-metrics-list {
1216                 uses monitoring-metrics;
1217             }
1218         }
1219     }
1220
1221     grouping pcmonrep-message {
1222         description "The PCMonRep message is used to provide PCE
1223         state metrics back to the requester for out-of-band monitoring requests.";
1224         reference "https://tools.ietf.org/html/rfc5886#section-9.2";
1225
1226         uses message;
1227         container pcmonrep-message {
1228             uses monitoring-response;
1229         }
1230     }
1231
1232     grouping pcrep-message {
1233         uses message;
1234
1235         container pcrep-message {
1236             description "Path Computation Reply Message";
1237             reference "https://tools.ietf.org/html/rfc5440#section-6.5";
1238
1239             uses message-header;
1240
1241             list replies {
1242                 uses rp-object;
1243                 uses vendor-information-objects;
1244                 uses monitoring;
1245                 uses monitoring-metrics;
1246
1247                 choice result {
1248                     case success-case {
1249                         container success {
1250                             list paths {
1251                                 uses path-definition;
1252                             }
1253                             uses vendor-information-objects;
1254                         }
1255                     }
1256                     case failure-case {
1257                         container no-path {
1258                             uses no-path-object;
1259                             container "tlvs" {
1260                                 uses vendor-information-tlvs;
1261                                 container no-path-vector {
1262                                     uses no-path-vector-tlv;
1263                                 }
1264                             }
1265                         }
1266                         uses lsp-attributes;
1267                     }
1268                 }
1269             }
1270         }
1271     }
1272
1273     grouping pcntf-message {
1274         uses message;
1275
1276         container pcntf-message {
1277             description "Notification Message";
1278             reference "https://tools.ietf.org/html/rfc5440#section-6.6";
1279
1280             uses message-header;
1281
1282             list notifications {
1283                 list rps {
1284                     uses rp-object;
1285                 }
1286
1287                 list notifications {
1288                     uses notification-object;
1289                 }
1290             }
1291         }
1292     }
1293
1294     grouping pcerr-message {
1295         uses message;
1296
1297         container pcerr-message {
1298             description "Error Message";
1299             reference "https://tools.ietf.org/html/rfc5440#section-6.7";
1300
1301             uses message-header;
1302
1303             list errors {
1304                 uses pcep-error-object;
1305             }
1306
1307             choice error-type {
1308                 case request-case {
1309                     container request {
1310                         list rps {
1311                             uses rp-object;
1312                         }
1313                     }
1314                 }
1315
1316                 case session-case {
1317                     container session {
1318                         uses open-object;
1319                     }
1320                 }
1321             }
1322         }
1323     }
1324
1325     grouping close-message {
1326         uses message;
1327
1328         container c-close-message {
1329             description "Close Message";
1330             reference "https://tools.ietf.org/html/rfc5440#section-6.8";
1331
1332             uses message-header;
1333
1334             uses close-object;
1335         }
1336     }
1337
1338     grouping start-tls-message {
1339         uses message;
1340
1341         container start-tls-message {
1342             description "StartTLS Message";
1343             reference "https://tools.ietf.org/html/draft-ietf-pce-pceps-02#section-3.3";
1344
1345             uses message-header;
1346         }
1347     }
1348 }