Reduce noise from BGPSessionImpl
[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 unreach-destination-object {
521         description "UNREACH-DESTINATION Object";
522         reference "https://tools.ietf.org/html/rfc8306#section-3.14";
523
524         container unreach-destination-obj {
525             uses object;
526
527             choice destination {
528                 case ipv4-destination-case {
529                     uses ipv4-destinations;
530                 }
531                 case ipv6-destination-case {
532                     uses ipv6-destinations;
533                 }
534             }
535         }
536     }
537
538     grouping bandwidth {
539         // No possibility to carry TLVs
540         leaf bandwidth {
541             type netc:bandwidth;
542         }
543     }
544
545     grouping bandwidth-object {
546         description "BANDWIDTH Object";
547         reference "https://tools.ietf.org/html/rfc5440#section-7.7";
548         container bandwidth {
549             uses object;
550             uses bandwidth;
551         }
552     }
553
554     grouping reoptimization-bandwidth-object {
555         description "BANDWIDTH Object";
556         reference "https://tools.ietf.org/html/rfc5440#section-7.7";
557         container reoptimization-bandwidth {
558             uses object;
559             uses bandwidth;
560         }
561     }
562
563     grouping metric-object {
564         description "METRIC Object";
565         reference "https://tools.ietf.org/html/rfc5440#section-7.8";
566         container metric {
567             uses object;
568
569             leaf metric-type {
570                 type uint8;
571                 mandatory true;
572             }
573
574             leaf bound {
575                 type boolean;
576                 default false;
577             }
578
579             leaf computed {
580                 type boolean;
581                 default false;
582             }
583
584             leaf value {
585                 type ieee754:float32;
586             }
587         }
588     }
589
590     grouping exclude-route-object {
591         description "Exclude Route Object";
592         reference "https://tools.ietf.org/html/rfc5521#section-2.1.1";
593
594         container xro {
595             uses object;
596
597             leaf flags {
598                 type bits {
599                     bit fail {
600                         position 31;
601                     }
602                 }
603                 mandatory true;
604             }
605
606             list subobject {
607                 uses rsvp:exclude-route-subobjects;
608                 ordered-by user;
609             }
610         }
611     }
612
613     grouping explicit-route-object {
614         description "Explicit Route Object";
615         reference "https://tools.ietf.org/html/rfc5440#section-7.9";
616
617         container ero {
618             // No possibility of TLVs
619             uses object;
620
621             list subobject {
622                 leaf loose {
623                     type boolean;
624                     mandatory true;
625                 }
626
627                 uses rsvp:explicit-route-subobjects;
628                 ordered-by user;
629             }
630         }
631     }
632
633     grouping secondary-explicit-route-object {
634         description "Secondary Explicit Route Object";
635         reference "https://tools.ietf.org/html/rfc8306#section-3.2";
636         container sero {
637             // No possibility of TLVs
638             uses object;
639
640             list subobject {
641                 leaf loose {
642                     type boolean;
643                     mandatory true;
644                 }
645
646                 uses rsvp:secondary-explicit-route-subobjects;
647                 ordered-by user;
648             }
649         }
650     }
651
652     grouping include-route-object {
653         description "Include Route Object";
654         reference "https://tools.ietf.org/html/rfc7896#section-2.1";
655
656         container iro {
657             // No possibility of TLVs
658             uses object;
659
660             list subobject {
661                 leaf loose {
662                     type boolean;
663                     mandatory true;
664                 }
665
666                 uses rsvp:explicit-route-subobjects;
667                 ordered-by user;
668             }
669         }
670     }
671
672     grouping reported-route-object {
673         description "Reported Route Object";
674         reference "https://tools.ietf.org/html/rfc5440#section-7.10";
675
676         container rro {
677             // No possibility of TLVs
678             uses object;
679
680             list subobject {
681                 uses rsvp:record-route-subobjects;
682                 ordered-by user;
683             }
684         }
685     }
686
687     grouping secondary-reported-route-object {
688         description "Reported Route Object";
689         reference "https://tools.ietf.org/html/rfc8306#section-3.2";
690
691         container srro {
692             // No possibility of TLVs
693             uses object;
694
695             list subobject {
696                 uses rsvp:secondary-record-route-subobjects;
697                 ordered-by user;
698             }
699         }
700     }
701
702     grouping lspa-object {
703         description "LSPA Object";
704         reference "https://tools.ietf.org/html/rfc5440#section-7.11";
705
706         container lspa {
707             uses object;
708             uses rsvp:tunnel-attributes;
709             container "tlvs" {
710                 uses vendor-information-tlvs;
711             }
712         }
713     }
714
715     grouping svec-object {
716         description "Synchronization Vector Object";
717         reference "https://tools.ietf.org/html/rfc5440#section-7.13";
718
719         container svec {
720             // No possibility of TLVs
721             uses object;
722
723             leaf link-diverse {
724                 type boolean;
725                 default false;
726             }
727
728             leaf node-diverse {
729                 type boolean;
730                 default false;
731             }
732
733             leaf srlg-diverse {
734                 type boolean;
735                 default false;
736             }
737
738             leaf partial-path-diverse {
739                 type boolean;
740                 default false;
741             }
742
743             leaf link-direction-diverse {
744                 type boolean;
745                 default false;
746             }
747
748             leaf-list requests-ids {
749                 type request-id;
750             }
751         }
752     }
753
754     grouping notification-object {
755         description "NOTIFICATION Object";
756         reference "https://tools.ietf.org/html/rfc5440#section-7.14";
757         container c-notification {
758             uses object;
759             container "tlvs" {
760                 when "../type = 2 and ../value = 1";
761
762                 uses overload-duration-tlv;
763                 uses vendor-information-tlvs;
764             }
765
766             leaf type {
767                 type uint8;
768                 mandatory true;
769             }
770
771             leaf value {
772                 type uint8;
773                 mandatory true;
774             }
775         }
776     }
777
778     grouping pcep-error-object {
779         description "PCEP-ERROR Object";
780         reference "https://tools.ietf.org/html/rfc5440#section-7.15";
781         container error-object {
782             uses object;
783             container "tlvs" {
784                 when "../type = 7";
785                 uses req-missing-tlv;
786                 uses vendor-information-tlvs;
787             }
788
789             leaf type {
790                 type uint8;
791                 mandatory true;
792             }
793
794             leaf value {
795                 type uint8;
796                 mandatory true;
797             }
798         }
799     }
800
801     grouping load-balancing-object {
802         description "LOAD-BALANCING Object";
803         reference "https://tools.ietf.org/html/rfc5440#section-7.16";
804
805         container load-balancing {
806             // No possibility of TLVs
807             uses object;
808
809             leaf max-lsp {
810                 type uint8;
811                 mandatory true;
812             }
813
814             leaf min-bandwidth {
815                 type netc:bandwidth;
816             }
817         }
818     }
819
820     grouping close-object {
821         description "CLOSE Object";
822         reference "https://tools.ietf.org/html/rfc5440#section-7.17";
823
824         container c-close {
825             uses object;
826
827             leaf reason {
828                 type uint8;
829                 mandatory true;
830             }
831
832             container tlvs {
833                 uses vendor-information-tlvs;
834             }
835         }
836     }
837
838
839
840     grouping path-key-object {
841         description "PATH-KEY Object";
842         reference "https://tools.ietf.org/html/rfc5520#section-3.2.2";
843         container path-key {
844             uses object;
845
846             list path-keys {
847                 min-elements 1;
848
849                 leaf loose {
850                     type boolean;
851                     default false;
852                 }
853
854                 uses rsvp:path-key-subobject;
855                 ordered-by user;
856             }
857         }
858     }
859
860     grouping of-object {
861         description "OF Object";
862         reference "https://tools.ietf.org/html/rfc5541#section-3.1";
863         container of {
864             uses object;
865
866             leaf code {
867                 type of-id;
868                 mandatory true;
869             }
870
871             container tlvs {
872                 uses vendor-information-tlvs;
873             }
874         }
875     }
876
877     grouping monitoring-object {
878         description "The MONITORING object is used to specify the
879         set of requested PCEP state metrics.";
880         reference "https://tools.ietf.org/html/rfc5886#section-4.1";
881         container monitoring {
882             uses object;
883
884             leaf flags {
885                 type bits {
886                     bit incomplete {
887                         description "Indicates that PCE cannot provide any of
888                         the set of requested performance metrics for unspecified reasons.";
889                         position 19;
890                     }
891                     bit overload {
892                         description "Indicates that the overload status is
893                         a metric of interest.";
894                         position 20;
895                     }
896                     bit processing-time {
897                         description "Indicates that the processing times is
898                         a metric of interest.";
899                         position 21;
900                     }
901                     bit general {
902                         description "Indicates that the monitoring
903                         request is a general monitoring request.";
904                         position 22;
905                     }
906                     bit liveness {
907                         description "Indicates that the state metric
908                         of interest is the PCE's liveness.";
909                         position 23;
910                     }
911                 }
912             }
913
914             leaf monitoring-id {
915                 description "The Monitoring-id-number combined with
916                 the PCC-REQ-ID identifying the requesting PCC uniquely
917                 identifies the monitoring request context.";
918                 type uint32;
919                 mandatory true;
920             }
921
922             container tlvs {
923                 description "Optional TLV(s).";
924                 uses vendor-information-tlvs;
925             }
926         }
927     }
928
929     grouping pcc-id-req-object {
930         description "The PCC-ID-REQ object is used to specify the IP
931         address of the requesting PCC.";
932         reference "https://tools.ietf.org/html/rfc5886#section-4.2";
933         container pcc-id-req {
934             uses object;
935             leaf ip-address {
936                 type inet:ip-address-no-zone;
937             }
938         }
939     }
940
941     grouping pce-id-object {
942         description "The PCE-ID object is used to specify a PCE's IP address.";
943         reference "https://tools.ietf.org/html/rfc5886#section-4.3";
944         container pce-id {
945             uses object;
946             leaf ip-address {
947                 type inet:ip-address-no-zone;
948             }
949         }
950     }
951
952     grouping proc-time-object {
953         description "The PROC-TIME object is used to report various processing time
954         related metrics.";
955         reference "https://tools.ietf.org/html/rfc5886#section-4.4";
956         container proc-time {
957             uses object;
958
959             leaf estimated {
960                 description "Indicates that the reported metric value is
961                 based on estimated processing time as opposed to
962                 actual computations.";
963                 type boolean;
964                 mandatory true;
965             }
966
967             leaf current-proc-time {
968                 description "Indicates, in milliseconds, the
969                 processing time for the path computation of interest
970                 characterized in the corresponding PCMonReq message.";
971                 type uint32;
972             }
973
974             leaf min-proc-time {
975                 description "The minimum processing time in milliseconds";
976                 type uint32;
977                 mandatory true;
978             }
979
980             leaf max-proc-time {
981                 description "The maximum processing time in milliseconds";
982                 type uint32;
983                 mandatory true;
984             }
985
986             leaf average-proc-time {
987                 description "The average processing time in milliseconds";
988                 type uint32;
989                 mandatory true;
990             }
991
992             leaf variance-proc-time {
993                 description "The variance of processing times in milliseconds";
994                 type uint32;
995                 mandatory true;
996             }
997         }
998     }
999
1000     grouping overload-object {
1001         description "The OVERLOAD object is used to report a PCE processing
1002         congestion state.";
1003         reference "https://tools.ietf.org/html/rfc5886#section-4.5";
1004         container overload {
1005             uses object;
1006             leaf duration {
1007                 description "This field indicates the amount of time,
1008                 in seconds, that the responding PCE expects that it may continue to
1009                 be overloaded from the time that the response message was generated.";
1010                 type uint16;
1011                 mandatory true;
1012             }
1013         }
1014     }
1015
1016     typedef class-type {
1017         type uint8 {
1018             range 1..7;
1019         }
1020     }
1021
1022     grouping classtype-object {
1023         description "CLASSTYPE Object";
1024         reference "https://tools.ietf.org/html/rfc5455#section-3";
1025
1026         container class-type {
1027             uses object;
1028
1029             leaf class-type {
1030                 type class-type;
1031                 mandatory true;
1032             }
1033         }
1034     }
1035
1036     grouping gc-object {
1037         description "GLOBAL CONSTRAINTS (GC) Object";
1038         reference "https://tools.ietf.org/html/rfc5557#section-5.5";
1039         container gc {
1040             uses object;
1041
1042             leaf max-hop {
1043                 type uint8;
1044                 mandatory true;
1045             }
1046
1047             leaf max-utilization {
1048                 type uint8 {
1049                     range 0..100;
1050                 }
1051                 units percent;
1052                 mandatory true;
1053             }
1054
1055             leaf min-utilization {
1056                 type uint8 {
1057                     range 0..100;
1058                 }
1059                 units percent;
1060                 mandatory true;
1061             }
1062
1063             leaf over-booking-factor {
1064                 type uint8 {
1065                     range 0..100;
1066                 }
1067                 units percent;
1068                 mandatory true;
1069             }
1070
1071             container tlvs {
1072                 uses vendor-information-tlvs;
1073             }
1074         }
1075     }
1076
1077     // Messages
1078     grouping message {
1079         description "Marker grouping for message groupings.";
1080     }
1081
1082     grouping message-header {
1083         description "Common Header";
1084         reference "https://tools.ietf.org/html/rfc5440#section-6.1";
1085
1086         leaf version {
1087             type protocol-version;
1088             default 1;
1089         }
1090     }
1091
1092     grouping open-message {
1093         uses message;
1094
1095         container open-message {
1096             description "Open Message";
1097             reference "https://tools.ietf.org/html/rfc5440#section-6.2";
1098
1099             uses message-header;
1100
1101             uses open-object;
1102         }
1103     }
1104
1105     grouping keepalive-message {
1106         uses message;
1107
1108         container keepalive-message {
1109             description "Keepalive Message";
1110             reference "https://tools.ietf.org/html/rfc5440#section-6.3";
1111
1112             uses message-header;
1113         }
1114     }
1115
1116     grouping lsp-attributes {
1117         uses lspa-object;
1118
1119         uses bandwidth-object;
1120         uses reoptimization-bandwidth-object;
1121
1122         list metrics {
1123             uses metric-object;
1124         }
1125         uses include-route-object;
1126
1127         uses reported-route-object;
1128
1129         uses exclude-route-object;
1130
1131         uses of-object;
1132
1133         uses classtype-object;
1134     }
1135
1136     grouping pcreq-message {
1137         uses message;
1138
1139         container pcreq-message {
1140             description "Path Computation Request Message";
1141             reference "https://tools.ietf.org/html/rfc5440#section-6.4";
1142
1143             uses message-header;
1144
1145             list requests {
1146                 uses rp-object;
1147
1148                 container path-key-expansion {
1149                     when "rp/path-key = true";
1150                     uses path-key-object;
1151                 }
1152
1153                 container segment-computation {
1154                     when "rp/path-key = false";
1155
1156                     container p2p {
1157                         when "../rp/p2mp = false";
1158
1159                         uses endpoints-object;
1160
1161                         container reported-route {
1162                             uses reported-route-object;
1163
1164                             uses reoptimization-bandwidth-object;
1165                         }
1166
1167                         uses vendor-information-objects;
1168
1169                         uses load-balancing-object;
1170
1171                         uses lsp-attributes;
1172                     }
1173
1174                     container p2mp {
1175                         when "../rp/p2mp = true";
1176
1177                         reference "https://tools.ietf.org/html/rfc8306#section-3.4";
1178
1179                         list endpoint-rro-pair {
1180                             uses endpoints-object;
1181
1182                             list rros {
1183                                 choice route-object {
1184                                     case reported-route-object-case {
1185                                         uses reported-route-object;
1186                                     }
1187                                     case secondary-reported-route-object-case {
1188                                         uses secondary-reported-route-object;
1189                                     }
1190                                 }
1191                             }
1192
1193                             uses reoptimization-bandwidth-object;
1194
1195                             min-elements 1;
1196                         }
1197
1198                         uses of-object;
1199
1200                         uses lspa-object;
1201
1202                         uses bandwidth-object;
1203
1204                         list metric {
1205                             uses metric-object;
1206                         }
1207
1208                         choice iro-bnc-choice {
1209                             case iro-case {
1210                                 uses include-route-object;
1211                             }
1212                             case bnc-case {
1213                                 uses bnc-object;
1214                             }
1215                         }
1216
1217                         uses load-balancing-object;
1218                     }
1219                 }
1220
1221                 uses vendor-information-objects;
1222             }
1223
1224             list svec {
1225                 uses svec-object;
1226
1227                 uses of-object;
1228
1229                 uses gc-object;
1230
1231                 uses exclude-route-object;
1232
1233                 list metric {
1234                     uses metric-object;
1235                 }
1236
1237                 uses vendor-information-objects;
1238             }
1239
1240             container monitoring-request {
1241                 uses monitoring;
1242
1243                 list pce-id-list {
1244                     uses pce-id-object;
1245                 }
1246             }
1247         }
1248     }
1249
1250     grouping path-definition {
1251         uses explicit-route-object;
1252
1253         uses lsp-attributes;
1254     }
1255
1256     grouping monitoring {
1257         uses monitoring-object;
1258         uses pcc-id-req-object;
1259     }
1260
1261     grouping monitoring-metrics {
1262         list metric-pce {
1263             uses pce-id-object;
1264             uses proc-time-object;
1265             uses overload-object;
1266         }
1267     }
1268
1269     grouping monitoring-response {
1270         uses monitoring;
1271         choice monitoring-metrics-list {
1272             case specific-metrics-list {
1273                 list specific-metrics {
1274                     uses rp-object;
1275                     uses monitoring-metrics;
1276                 }
1277             }
1278
1279             case general-metrics-list {
1280                 uses monitoring-metrics;
1281             }
1282         }
1283     }
1284
1285     grouping pcmonrep-message {
1286         description "The PCMonRep message is used to provide PCE
1287         state metrics back to the requester for out-of-band monitoring requests.";
1288         reference "https://tools.ietf.org/html/rfc5886#section-9.2";
1289
1290         uses message;
1291         container pcmonrep-message {
1292             uses monitoring-response;
1293         }
1294     }
1295
1296     grouping pcrep-message {
1297         uses message;
1298
1299         container pcrep-message {
1300             description "Path Computation Reply Message";
1301             reference "https://tools.ietf.org/html/rfc5440#section-6.5";
1302
1303             uses message-header;
1304
1305             list replies {
1306                 uses rp-object;
1307                 uses vendor-information-objects;
1308                 uses monitoring;
1309                 uses monitoring-metrics;
1310
1311                 choice result {
1312                     case success-case {
1313                         container success {
1314                             list paths {
1315                                 uses path-definition;
1316                             }
1317                             uses vendor-information-objects;
1318                         }
1319                     }
1320                     case failure-case {
1321                         container no-path {
1322                             uses no-path-object;
1323                             container "tlvs" {
1324                                 uses vendor-information-tlvs;
1325                                 container no-path-vector {
1326                                     uses no-path-vector-tlv;
1327                                 }
1328                             }
1329                         }
1330                         uses lsp-attributes;
1331                     }
1332                 }
1333             }
1334         }
1335     }
1336
1337     grouping pcntf-message {
1338         uses message;
1339
1340         container pcntf-message {
1341             description "Notification Message";
1342             reference "https://tools.ietf.org/html/rfc5440#section-6.6";
1343
1344             uses message-header;
1345
1346             list notifications {
1347                 list rps {
1348                     uses rp-object;
1349                 }
1350
1351                 list notifications {
1352                     uses notification-object;
1353                 }
1354             }
1355         }
1356     }
1357
1358     grouping pcerr-message {
1359         uses message;
1360
1361         container pcerr-message {
1362             description "Error Message";
1363             reference "https://tools.ietf.org/html/rfc5440#section-6.7";
1364
1365             uses message-header;
1366
1367             list errors {
1368                 uses pcep-error-object;
1369             }
1370
1371             choice error-type {
1372                 case request-case {
1373                     container request {
1374                         list rps {
1375                             uses rp-object;
1376                         }
1377                     }
1378                 }
1379
1380                 case session-case {
1381                     container session {
1382                         uses open-object;
1383                     }
1384                 }
1385             }
1386         }
1387     }
1388
1389     grouping close-message {
1390         uses message;
1391
1392         container c-close-message {
1393             description "Close Message";
1394             reference "https://tools.ietf.org/html/rfc5440#section-6.8";
1395
1396             uses message-header;
1397
1398             uses close-object;
1399         }
1400     }
1401
1402     grouping start-tls-message {
1403         uses message;
1404
1405         container start-tls-message {
1406             description "StartTLS Message";
1407             reference "https://tools.ietf.org/html/draft-ietf-pce-pceps-02#section-3.3";
1408
1409             uses message-header;
1410         }
1411     }
1412 }