Split RSVP model out for reuse in bgp-linkstate
[bgpcep.git] / rsvp / api / src / main / yang / rsvp.yang
diff --git a/rsvp/api/src/main/yang/rsvp.yang b/rsvp/api/src/main/yang/rsvp.yang
new file mode 100644 (file)
index 0000000..672fdf5
--- /dev/null
@@ -0,0 +1,380 @@
+module rsvp {
+        yang-version 1;
+        namespace "urn:opendaylight:params:xml:ns:yang:rsvp";
+        prefix "rsvp";
+
+       import iana { prefix iana; revision-date 2013-08-16; }
+       import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+
+        organization "Cisco Systems, Inc.";
+        contact "Robert Varga <rovarga@cisco.com>";
+
+        description
+                "This module contains the definition of types related to
+                Resource Reservation Protocol (RSVP).
+
+                Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
+
+                This program and the accompanying materials are made available
+                under the terms of the Eclipse Public License v1.0 which
+                accompanies this distribution, and is available at
+                http://www.eclipse.org/legal/epl-v10.html";
+
+        revision "2013-08-20" {
+                description
+                        "Initial revision.";
+                reference "https://tools.ietf.org/html/rfc2205";
+        }
+
+       typedef attribute-filter {
+               type uint32;
+       }
+
+       grouping attribute-filters {
+               leaf include-any {
+                       type attribute-filter;
+                       mandatory true;
+               }
+
+               leaf exclude-any {
+                       type attribute-filter;
+                       mandatory true;
+               }
+
+               leaf include-all {
+                       type attribute-filter;
+                       mandatory true;
+               }
+       }
+
+       typedef lsp-id {
+               type uint32;
+               reference "https://tools.ietf.org/html/rfc3209#section-4.6.2.1";
+       }
+
+       typedef tunnel-id {
+               type uint16;
+               reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.1";
+       }
+
+       typedef ipv4-extended-tunnel-id {
+               type inet:ipv4-address;
+               reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.1";
+       }
+
+       typedef ipv6-extended-tunnel-id {
+               type inet:ipv6-address;
+               reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.2";
+       }
+
+       typedef srlg-id {
+               type uint32;
+               reference "http://tools.ietf.org/html/rfc4202#section-2.3";
+       }
+
+       grouping error-spec {
+               reference "https://tools.ietf.org/html/rfc2205#page-81";
+
+               leaf node {
+                       type inet:ip-address;
+                       mandatory true;
+               }
+
+               leaf flags {
+                       type bits {
+                               bit in-place {
+                                       position 7;
+                               }
+                               bit not-guilty {
+                                       position 6;
+                               }
+                       }
+               }
+
+               leaf code {
+                       type uint8;
+                       mandatory true;
+               }
+
+               leaf value {
+                       type uint16;
+                       mandatory true;
+               }
+       }
+
+       grouping user-error-spec {
+               reference "https://tools.ietf.org/html/rfc5284#section-3";
+
+               leaf enterprise {
+                       type iana:enterprise-number;
+                       mandatory true;
+               }
+
+               leaf sub-org {
+                       type uint8;
+                       default 0;
+               }
+
+               leaf value {
+                       type uint16;
+                       mandatory true;
+               }
+
+               leaf description {
+                       type string;
+                       default "";
+               }
+
+               container subobjects {
+                       // Filled by enterprise-specific augmentations
+               }
+       }
+
+       // Marker
+       grouping c-label;
+
+       grouping type1-label {
+               reference "https://tools.ietf.org/html/rfc3209#section-4.1";
+
+               uses c-label;
+
+               leaf type1-label {
+                       type uint32;
+                       mandatory true;
+               }
+       }
+
+       grouping generalized-label {
+               reference "https://tools.ietf.org/html/rfc3473#section-2.3";
+
+               uses c-label;
+
+               leaf generalized-label {
+                       type binary;
+                       mandatory true;
+               }
+       }
+
+       grouping waveband-switching-label {
+               reference "https://tools.ietf.org/html/rfc3473#section-2.4";
+
+               uses c-label;
+
+               leaf end-label {
+                       type uint32;
+                       mandatory true;
+               }
+               leaf start-label {
+                       type uint32;
+                       mandatory true;
+               }
+               leaf waveband-id {
+                       type uint32;
+                       mandatory true;
+               }
+       }
+
+       grouping label-set {
+               reference "https://tools.ietf.org/html/rfc3473#section-2.6";
+
+               leaf action {
+                       type enumeration {
+                               enum inclusive-list {
+                                       value 0;
+                               }
+                               enum exclusive-list {
+                                       value 1;
+                               }
+                               enum inclusive-range {
+                                       value 2;
+                               }
+                               enum exclusive-range {
+                                       value 3;
+                               }
+                       }
+               }
+
+               container label-type {
+                       // Technology-specific
+               }
+
+               list subchannels {
+
+               }
+       }
+
+       grouping generalized-channel-set-label {
+               reference "https://tools.ietf.org/html/rfc6002#section-3.2";
+
+               uses c-label;
+
+               list subobjects {
+                       uses label-set;
+               }
+       }
+
+       //marker
+       grouping c-subobject {
+       
+       }
+
+       grouping ip-prefix-subobject {
+               uses c-subobject;
+               leaf ip-prefix {
+                       reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.1";
+                       type inet:ip-prefix;
+                       mandatory true;
+               }
+       }
+
+       grouping as-number-subobject {
+               uses c-subobject;
+               leaf as-number {
+                       reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.4";
+                       type inet:as-number;
+                       mandatory true;
+               }
+       }
+
+       grouping label-subobject {
+               uses c-subobject;
+               leaf c-type {
+                       type uint8;
+                       mandatory true;
+               }
+
+               leaf uni-directional {
+                       type boolean;
+                       mandatory true;
+               }
+
+               choice label-type {
+                       case type1-label {
+                               uses type1-label;
+                       }
+                       case generalized-label {
+                               uses generalized-label;
+                       }
+                       case waveband-switching-label {
+                               uses waveband-switching-label;
+                       }
+                       case generalized-channel-set-label {
+                               uses generalized-channel-set-label;
+                       }
+               }
+       }
+
+       grouping unnumbered-subobject {
+               uses c-subobject;
+               leaf router-id {
+                       type uint32;
+                       mandatory true;
+               }
+
+               leaf interface-id {
+                       type uint32;
+                       mandatory true;
+               }
+       }
+
+       grouping srlg-subobject {
+               uses c-subobject;
+               leaf srlg-id {
+                       type srlg-id;
+                       mandatory true;
+               }
+       }
+
+       grouping record-route-subobjects {
+               leaf protection-available {
+                       type boolean;
+                       default false;
+               }
+
+               leaf protection-in-use {
+                       type boolean;
+                       default false;
+               }
+
+               choice subobject-type {
+                       case ip-prefix {
+                               uses ip-prefix-subobject;
+                       }
+
+                       case label {
+                               uses label-subobject;
+
+                               leaf global {
+                                       type boolean;
+                                       default false;
+                               }
+                       }
+
+                       case unnumbered {
+                               uses unnumbered-subobject;
+                       }
+               }
+       }
+
+       grouping basic-explicit-route-subobjects {
+               description "Subobjects shared between XRO and ERO";
+               reference "https://tools.ietf.org/html/rfc4874#section-4.1";
+
+               choice subobject-type {
+                       case as-number {
+                               uses as-number-subobject;
+                       }
+                       case ip-prefix {
+                               uses ip-prefix-subobject;
+                       }
+                       case label {
+                               uses label-subobject;
+                       }
+                       case unnumbered {
+                               uses unnumbered-subobject;
+                       }
+               }
+       }
+
+       grouping exclude-route-subobjects {
+               description "Subobject of an Exclude Route Object";
+               reference "https://tools.ietf.org/html/rfc4874#section-3.1";
+
+               leaf mandatory {
+                       type boolean;
+                       default false;
+               }
+
+               leaf attribute {
+                       type enumeration {
+                               enum interface {
+                                       value 0;
+                               }
+                               enum node {
+                                       value 1;
+                               }
+                               enum srlg {
+                                       value 2;
+                               }
+                       }
+                       mandatory true;
+               }
+
+               uses basic-explicit-route-subobjects;
+       }
+
+       grouping explicit-route-subobjects {
+               description "Subobject of an Explicit Route Object";
+               reference "https://tools.ietf.org/html/rfc4874#section-4.1";
+               uses basic-explicit-route-subobjects {
+//                     augment "subobject-type" {
+//                             case exrs {
+//                                     container exrs {
+//                                             uses exclude-route-subobjects;
+//                                     }
+//                             }
+//                     }
+               }
+       }
+}
+