BUG-47 : PCEP migration to generated DTOs.
[bgpcep.git] / pcep / api / src / main / yang / pcep-types.yang
index 8c0bff6c60638c6a0cf196b50a37544940bd856f..56ac4c63aa95291621643d360fac8774f8e2eff3 100644 (file)
@@ -80,6 +80,7 @@ module pcep-types {
                description "NO-PATH-VECTOR TLV";
                reference "https://tools.ietf.org/html/rfc5440#section-7.5";
 
+               uses tlv;
                leaf flags {
                        type bits {
                                bit p2mp-unreachable {
@@ -116,6 +117,7 @@ module pcep-types {
                description "OVERLOAD-DURATION TLV";
                reference "https://tools.ietf.org/html/rfc5440#section-7.14";
 
+               uses tlv;
                leaf duration {
                        type uint32;
                        units seconds;
@@ -126,12 +128,13 @@ module pcep-types {
                description "REQ-MISSING TLV";
                reference "https://tools.ietf.org/html/rfc5440#section-7.5";
 
+               uses tlv;
                leaf request-id {
                        type request-id;
                }
        }
-
-       grouping p2mp-capable-tlv {
+       
+    grouping p2mp-capable-tlv {
                description "P2MP CAPABLE TLV";
                reference "https://tools.ietf.org/html/rfc6006#section-3.1.2";
 
@@ -140,11 +143,13 @@ module pcep-types {
                        mandatory true;
                }
        }
+       
 
        grouping stateful-capability-tlv {
                description "Stateful PCE Capability TLV";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.1.1";
 
+               uses tlv;
                leaf flags {
                        type bits {
                                bit lsp-update-capability {
@@ -165,6 +170,7 @@ module pcep-types {
                description "LSP State Database Version TLV";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.1.2";
 
+               uses tlv;
                leaf version {
                        type uint64;
                        mandatory true;
@@ -175,6 +181,7 @@ module pcep-types {
                description "PCE Redundancy Group Identifier TLV";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.1.3";
 
+               uses tlv;
                leaf identifier {
                        type binary;
                        mandatory true;
@@ -185,6 +192,7 @@ module pcep-types {
                description "LSP Identifiers TLV";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.1";
 
+               uses tlv;
                leaf lsp-id {
                        type rsvp:lsp-id;
                        mandatory true;
@@ -223,6 +231,7 @@ module pcep-types {
                description "Symbolic Path Name TLV";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.2";
 
+               uses tlv;
                leaf path-name {
                        type binary;
                        mandatory true;
@@ -233,6 +242,7 @@ module pcep-types {
                description "LSP Error Code TLV";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.3";
 
+               uses tlv;
                leaf error-code {
                        type uint32;
                        mandatory true;
@@ -243,6 +253,7 @@ module pcep-types {
                description "RSVP Error Spec TLV";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.4";
 
+               uses tlv;
                choice error-type {
                        case rsvp {
                                container rsvp-error {
@@ -261,6 +272,7 @@ module pcep-types {
                description "OF-List TLV";
                reference "https://tools.ietf.org/html/rfc5541#section-2.1";
 
+               uses tlv;
                leaf-list codes {
                        type of-id;
                }
@@ -270,6 +282,7 @@ module pcep-types {
                description "Order TLV";
                reference "https://tools.ietf.org/html/rfc5557#section-5.4";
 
+               uses tlv;
                leaf delete {
                        type uint32;
                        mandatory true;
@@ -493,10 +506,10 @@ module pcep-types {
        grouping bandwidth-object {
                description "BANDWIDTH Object";
                reference "https://tools.ietf.org/html/rfc5440#section-7.7";
+               
+               uses object;
 
                // No possibility to carry TLVs
-               uses object-header;
-
                leaf bandwidth {
                        type ieee754:float32;
                }
@@ -528,12 +541,32 @@ module pcep-types {
                }
        }
 
+       grouping exclude-route-object {
+               description "Exclude Route Object";
+               reference "https://tools.ietf.org/html/rfc5521#section-2.1.1";
+
+               uses object;
+
+               leaf flags {
+                       type bits {
+                               bit fail {
+                                       position 31;
+                               }
+                       }
+                       mandatory true;
+               }
+
+               list subobjects {
+                       uses rsvp:exclude-route-subobjects;
+               }
+       }
+
        grouping explicit-route-object {
                description "Explicit Route Object";
                reference "https://tools.ietf.org/html/rfc5440#section-7.9";
 
                // No possibility of TLVs
-               uses object-header;
+               uses object;
 
                list subobjects {
                        leaf loose {
@@ -550,10 +583,16 @@ module pcep-types {
                reference "https://tools.ietf.org/html/rfc5440#section-7.12";
 
                // No possibility of TLVs
-               uses object-header;
+               uses object;
 
                list subobjects {
-                       uses rsvp:route-subobjects;
+                       uses rsvp:route-subobjects {
+                               augment subobject-type {
+                                       case explicit-exclusion-route {
+                                               uses rsvp:exclude-route-subobjects;
+                                       }
+                               }
+                       }
                }
        }
 
@@ -562,7 +601,7 @@ module pcep-types {
                reference "https://tools.ietf.org/html/rfc5440#section-7.10";
 
                // No possibility of TLVs
-               uses object-header;
+               uses object;
 
                list subobjects {
                        uses rsvp:record-route-subobjects;
@@ -598,7 +637,7 @@ module pcep-types {
                reference "https://tools.ietf.org/html/rfc5440#section-7.13";
 
                // No possibility of TLVs
-               uses object-header;
+               uses object;
 
                leaf link-diverse {
                        type boolean;
@@ -674,7 +713,7 @@ module pcep-types {
                reference "https://tools.ietf.org/html/rfc5440#section-7.16";
 
                // No possibility of TLVs
-               uses object-header;
+               uses object;
 
                leaf max-lsp {
                        type uint8;
@@ -690,20 +729,22 @@ module pcep-types {
                description "CLOSE Object";
                reference "https://tools.ietf.org/html/rfc5440#section-7.17";
 
-               // No possibility of TLVs
                uses object;
 
                leaf reason {
                        type uint8;
                        mandatory true;
                }
+               
+               container tlvs {
+               }
        }
 
        grouping path-key-object {
                description "PATH-KEY Object";
                reference "https://tools.ietf.org/html/rfc5520#section-3.2.2";
 
-               uses object-header;
+               uses object;
 
                list path-keys {
                        min-elements 1;
@@ -837,7 +878,7 @@ module pcep-types {
                description "CLASSTYPE Object";
                reference "https://tools.ietf.org/html/rfc5455#section-3";
 
-               uses object-header;
+               uses object;
 
                leaf class-type {
                        type class-type;
@@ -998,18 +1039,6 @@ module pcep-types {
                                                        uses lsp-object;
                                                }
                                        }
-
-                                       container p2mp {
-                                               when "../rp/p2mp = true";
-
-                                               list trees {
-                                                       container endpoints {
-                                                               uses endpoints-object;
-                                                       }
-
-                                                       // FIXME: finish this
-                                               }
-                                       }
                                }
                        }
 
@@ -1141,13 +1170,13 @@ module pcep-types {
        grouping close-message {
                uses message;
 
-               container close-message {
+               container c-close-message {
                        description "Close Message";
                        reference "https://tools.ietf.org/html/rfc5440#section-6.8";
 
                        uses message-header;
 
-                       container close {
+                       container c-close {
                                uses close-object;
                        }
                }