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