Revert "BUG-47 : unfinished PCEP migration to generated DTOs."
[bgpcep.git] / pcep / api / src / main / yang / rsvp.yang
1 module rsvp {
2         yang-version 1;
3         namespace "urn:opendaylight:params:xml:ns:yang:rsvp";
4         prefix "rsvp";
5
6         import iana { prefix iana; revision-date 2013-08-16; }
7         import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
8
9         organization "Cisco Systems, Inc.";
10         contact "Robert Varga <rovarga@cisco.com>";
11
12         description
13                 "This module contains the definition of types related to
14                 Resource Reservation Protocol (RSVP).
15
16                 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
17
18                 This program and the accompanying materials are made available
19                 under the terms of the Eclipse Public License v1.0 which
20                 accompanies this distribution, and is available at
21                 http://www.eclipse.org/legal/epl-v10.html";
22
23         revision "2013-08-20" {
24                 description
25                         "Initial revision.";
26                 reference "https://tools.ietf.org/html/rfc2205";
27         }
28
29         typedef attribute-filter {
30                 type uint32;
31         }
32
33         grouping attribute-filters {
34                 leaf include-any {
35                         type attribute-filter;
36                         mandatory true;
37                 }
38
39                 leaf exclude-any {
40                         type attribute-filter;
41                         mandatory true;
42                 }
43
44                 leaf include-all {
45                         type attribute-filter;
46                         mandatory true;
47                 }
48         }
49
50         typedef lsp-id {
51                 type uint32;
52                 reference "https://tools.ietf.org/html/rfc3209#section-4.6.2.1";
53         }
54
55         typedef tunnel-id {
56                 type uint16;
57                 reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.1";
58         }
59
60         typedef ipv4-extended-tunnel-id {
61                 type inet:ipv4-address;
62                 reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.1";
63         }
64
65         typedef ipv6-extended-tunnel-id {
66                 type inet:ipv6-address;
67                 reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.2";
68         }
69
70         grouping error-spec {
71                 reference "https://tools.ietf.org/html/rfc2205#page-81";
72
73                 leaf node {
74                         type inet:ip-address;
75                         mandatory true;
76                 }
77
78                 leaf flags {
79                         type bits {
80                                 bit in-place {
81                                         position 7;
82                                 }
83                                 bit not-guilty {
84                                         position 6;
85                                 }
86                         }
87                 }
88
89                 leaf code {
90                         type uint8;
91                         mandatory true;
92                 }
93
94                 leaf value {
95                         type uint16;
96                         mandatory true;
97                 }
98         }
99
100         grouping user-error-spec {
101                 reference "https://tools.ietf.org/html/rfc5284#section-3";
102
103                 leaf enterprise {
104                         type iana:enterprise-number;
105                         mandatory true;
106                 }
107
108                 leaf sub-org {
109                         type uint8;
110                         default 0;
111                 }
112
113                 leaf value {
114                         type uint16;
115                         mandatory true;
116                 }
117
118                 leaf description {
119                         type string;
120                         default "";
121                 }
122
123                 container subobjects {
124                         // Filled by enterprise-specific augmentations
125                 }
126         }
127
128         grouping ip-prefix-subobject {
129                 leaf ip-prefix {
130                         reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.1";
131                         type inet:ip-prefix;
132                         mandatory true;
133                 }
134         }
135
136         grouping as-number-subobject {
137                 leaf as-number {
138                         reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.4";
139                         type inet:as-number;
140                         mandatory true;
141                 }
142         }
143
144         grouping label-subobject {
145                 leaf c-type {
146                         type uint8;
147                         mandatory true;
148                 }
149
150                 leaf uni-directional {
151                         type boolean;
152                         mandatory true;
153                 }
154
155                 leaf-list labels {
156                         type uint32;
157                 }
158         }
159
160         grouping unnumbered-subobject {
161                 leaf router-id {
162                         type uint32;
163                         mandatory true;
164                 }
165
166                 leaf interface-id {
167                         type uint32;
168                         mandatory true;
169                 }
170         }
171
172         grouping record-route-subobjects {
173                 leaf protection-available {
174                         type boolean;
175                         default false;
176                 }
177
178                 leaf protection-in-use {
179                         type boolean;
180                         default false;
181                 }
182
183                 choice subobject-type {
184                         case ip-prefix {
185                                 uses ip-prefix-subobject;
186                         }
187
188                         case label {
189                                 uses label-subobject;
190                         }
191
192                         case unnumbered {
193                                 uses unnumbered-subobject;
194                         }
195                 }
196         }
197
198         grouping route-subobjects {
199                 choice subobject-type {
200                         case as-number {
201                                 uses as-number-subobject;
202                         }
203
204                         case ip-prefix {
205                                 uses ip-prefix-subobject;
206                         }
207
208                         case label {
209                                 uses label-subobject;
210                         }
211
212                         case unnumbered {
213                                 uses unnumbered-subobject;
214                         }
215                 }
216         }
217 }
218