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