Fix junit dependencies in poms. Reuse existing from parent,
[bgpcep.git] / pcep / api / src / main / yang / pcep-types.yang
index 0a31ab9b9166fe4511082c6528a96de1aaacc901..7734c0364e24545eef7b1fc2bb8941c851660ff1 100644 (file)
@@ -60,6 +60,10 @@ module pcep-types {
                type uint16;
        }
 
+       typedef path-key {
+               type uint16;
+       }
+
        typedef pce-id {
                type union {
                        type binary {
@@ -80,6 +84,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 +121,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 +132,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 +147,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 +174,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 +185,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 +196,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 +235,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 +246,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 +257,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 +276,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 +286,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;
@@ -300,37 +317,32 @@ module pcep-types {
        grouping object {
                description "Core object structure with optional TLVs";
                uses object-header;
-
-               container tlvs {
-
-               }
        }
 
        grouping open-object {
                description "OPEN Object";
                reference "https://tools.ietf.org/html/rfc5440#section-7.3";
 
-               uses object {
-                       augment "tlvs" {
-                               container of-list {
-                                       uses of-list-tlv;
-                               }
+               uses object;
+               container "tlvs" {
+                       container of-list {
+                               uses of-list-tlv;
+                       }
 
-                               container p2mp {
-                                       uses p2mp-capable-tlv;
-                               }
+                       container p2mp {
+                               uses p2mp-capable-tlv;
+                       }
 
-                               container stateful {
-                                       uses stateful-capability-tlv;
-                               }
+                       container stateful {
+                               uses stateful-capability-tlv;
+                       }
 
-                               container predundancy-group-id {
-                                       uses predundancy-group-id-tlv;
-                               }
+                       container predundancy-group-id {
+                               uses predundancy-group-id-tlv;
+                       }
 
-                               container lsp-db-version {
-                                       uses lsp-db-version-tlv;
-                               }
+                       container lsp-db-version {
+                               uses lsp-db-version-tlv;
                        }
                }
 
@@ -364,11 +376,10 @@ module pcep-types {
                description "RP Object";
                reference "https://tools.ietf.org/html/rfc5440#section-7.4";
 
-               uses object {
-                       augment "tlvs" {
-                               container order {
-                                       uses order-tlv;
-                               }
+               uses object;
+               container "tlvs" {
+                       container order {
+                               uses order-tlv;
                        }
                }
 
@@ -499,10 +510,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;
                }
@@ -534,12 +545,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 {
@@ -547,7 +578,16 @@ module pcep-types {
                                mandatory true;
                        }
 
-                       uses rsvp:route-subobjects;
+                       uses rsvp:explicit-route-subobjects {
+// FIXME: yangtools bug
+//                             augment "subobject-type" {
+//                                     case path-key {
+//                                             container path-key {
+//                                                     uses path-key-subobject;
+//                                             }
+//                                     }
+//                             }
+                       }
                }
        }
 
@@ -556,10 +596,10 @@ 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:explicit-route-subobjects;
                }
        }
 
@@ -568,7 +608,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;
@@ -604,7 +644,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;
@@ -631,13 +671,12 @@ module pcep-types {
                reference "https://tools.ietf.org/html/rfc5440#section-7.14";
 
                // No possibility of TLVs
-               uses object {
-                       augment "tlvs" {
-                               container overload-duration {
-                                       when "../type = 2 and ../value = 1";
+               uses object;
+               container "tlvs" {
+                       container overload-duration {
+                               when "../type = 2 and ../value = 1";
 
-                                       uses overload-duration-tlv;
-                               }
+                               uses overload-duration-tlv;
                        }
                }
 
@@ -657,12 +696,11 @@ module pcep-types {
                reference "https://tools.ietf.org/html/rfc5440#section-7.15";
 
                // No possibility of TLVs
-               uses object {
-                       augment "tlvs" {
-                               container req-missing {
-                                       when "../type = 7";
-                                       uses req-missing-tlv;
-                               }
+               uses object;
+               container "tlvs" {
+                       container req-missing {
+                               when "../type = 7";
+                               uses req-missing-tlv;
                        }
                }
 
@@ -682,7 +720,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;
@@ -698,20 +736,38 @@ 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-subobject {
+               reference "https://tools.ietf.org/html/rfc5520#section-3.1";
+               uses rsvp:c-subobject;
+
+               leaf pce-id {
+                       type pce-id;
+                       mandatory true;
+               }
+
+               leaf path-key {
+                       type path-key;
+                       mandatory true;
+               }
        }
 
        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;
@@ -721,10 +777,7 @@ module pcep-types {
                                default false;
                        }
 
-                       leaf pce-id {
-                               type pce-id;
-                               mandatory true;
-                       }
+                       uses path-key-subobject;
                }
        }
 
@@ -752,23 +805,22 @@ module pcep-types {
                description "SRP Object";
                reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3";
 
-               uses object {
-                       augment "tlvs" {
-                               container lsp-error-code {
-                                       uses lsp-error-code-tlv;
-                               }
+               uses object;
+               container "tlvs" {
+                       container lsp-error-code {
+                               uses lsp-error-code-tlv;
+                       }
 
-                               container lsp-identifiers {
-                                       uses lsp-identifiers-tlv;
-                               }
+                       container lsp-identifiers {
+                               uses lsp-identifiers-tlv;
+                       }
 
-                               container rsvp-error-spec {
-                                       uses rsvp-error-spec-tlv;
-                               }
+                       container rsvp-error-spec {
+                               uses rsvp-error-spec-tlv;
+                       }
 
-                               container symblic-path-name {
-                                       uses symbolic-path-name-tlv;
-                               }
+                       container symblic-path-name {
+                               uses symbolic-path-name-tlv;
                        }
                }
 
@@ -846,7 +898,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;
@@ -944,6 +996,10 @@ module pcep-types {
                        uses metric-object;
                }
 
+               container exclude-route {
+                       uses exclude-route-object;
+               }
+
                container include-route {
                        uses include-route-object;
                }
@@ -1007,18 +1063,6 @@ module pcep-types {
                                                        uses lsp-object;
                                                }
                                        }
-
-                                       container p2mp {
-                                               when "../rp/p2mp = true";
-
-                                               list trees {
-                                                       container endpoints {
-                                                               uses endpoints-object;
-                                                       }
-
-                                                       // FIXME: finish this
-                                               }
-                                       }
                                }
                        }
 
@@ -1028,11 +1072,12 @@ module pcep-types {
                                container of {
                                        uses of-object;
                                }
-
                                container gc {
                                        uses gc-object;
                                }
-
+                               container xro {
+                                       uses exclude-route-object;
+                               }
                                list metric {
                                        uses metric-object;
                                }
@@ -1077,11 +1122,10 @@ module pcep-types {
                                        }
                                        case failure {
                                                container no-path {
-                                                       uses no-path-object {
-                                                               augment "tlvs" {
-                                                                       container no-path-vector {
-                                                                               uses no-path-vector-tlv;
-                                                                       }
+                                                       uses no-path-object;
+                                                       container "tlvs" {
+                                                               container no-path-vector {
+                                                                       uses no-path-vector-tlv;
                                                                }
                                                        }
                                                }
@@ -1151,13 +1195,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;
                        }
                }