Removed checkstyle warnings.
[bgpcep.git] / rsvp / 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         }
37
38         leaf exclude-any {
39             type attribute-filter;
40         }
41
42         leaf include-all {
43             type attribute-filter;
44         }
45     }
46
47     grouping tunnel-attributes {
48         leaf hold-priority {
49             type uint8;
50             default 0;
51         }
52
53         leaf setup-priority {
54             type uint8;
55             default 0;
56         }
57
58         leaf local-protection-desired {
59             type boolean;
60             default false;
61         }
62
63         uses attribute-filters;
64     }
65
66     typedef lsp-id {
67         type uint32;
68         reference "https://tools.ietf.org/html/rfc3209#section-4.6.2.1";
69     }
70
71     typedef tunnel-id {
72         type uint16;
73         reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.1";
74     }
75
76     typedef ipv4-extended-tunnel-id {
77         type inet:ipv4-address;
78         reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.1";
79     }
80
81     typedef ipv6-extended-tunnel-id {
82         type inet:ipv6-address;
83         reference "https://tools.ietf.org/html/rfc3209#section-4.6.1.2";
84     }
85
86     typedef srlg-id {
87         type uint32;
88         reference "http://tools.ietf.org/html/rfc4202#section-2.3";
89     }
90
91     grouping error-spec {
92         reference "https://tools.ietf.org/html/rfc2205#page-81";
93
94         leaf node {
95             type inet:ip-address;
96             mandatory true;
97         }
98
99         leaf flags {
100             type bits {
101                 bit in-place {
102                     position 7;
103                 }
104                 bit not-guilty {
105                     position 6;
106                 }
107             }
108         }
109
110         leaf code {
111             type uint8;
112             mandatory true;
113         }
114
115         leaf value {
116             type uint16;
117             mandatory true;
118         }
119     }
120
121     grouping user-error-spec {
122         reference "https://tools.ietf.org/html/rfc5284#section-3";
123
124         leaf enterprise {
125             type iana:enterprise-number;
126             mandatory true;
127         }
128
129         leaf sub-org {
130             type uint8;
131             default 0;
132         }
133
134         leaf value {
135             type uint16;
136             mandatory true;
137         }
138
139         leaf description {
140             type string;
141             default "";
142         }
143
144         container subobjects {
145             // Filled by enterprise-specific augmentations
146         }
147     }
148
149     // Marker
150     grouping c-label;
151
152     grouping type1-label {
153         reference "https://tools.ietf.org/html/rfc3209#section-4.1";
154
155         uses c-label;
156
157         leaf type1-label {
158             type uint32;
159             mandatory true;
160         }
161     }
162
163     grouping generalized-label {
164         reference "https://tools.ietf.org/html/rfc3473#section-2.3";
165
166         uses c-label;
167
168         leaf generalized-label {
169             type binary;
170             mandatory true;
171         }
172     }
173
174     grouping waveband-switching-label {
175         reference "https://tools.ietf.org/html/rfc3473#section-2.4";
176
177         uses c-label;
178
179         leaf end-label {
180             type uint32;
181             mandatory true;
182         }
183         leaf start-label {
184             type uint32;
185             mandatory true;
186         }
187         leaf waveband-id {
188             type uint32;
189             mandatory true;
190         }
191     }
192
193     grouping label-set {
194         reference "https://tools.ietf.org/html/rfc3473#section-2.6";
195
196         leaf action {
197             type enumeration {
198                 enum inclusive-list {
199                     value 0;
200                 }
201                 enum exclusive-list {
202                     value 1;
203                 }
204                 enum inclusive-range {
205                     value 2;
206                 }
207                 enum exclusive-range {
208                     value 3;
209                 }
210             }
211         }
212
213         container label-type {
214             // Technology-specific
215         }
216
217         list subchannels {
218
219         }
220     }
221
222     //marker
223     grouping c-subobject {
224
225     }
226
227     grouping ip-prefix-subobject {
228         uses c-subobject;
229         leaf ip-prefix {
230             reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.1";
231             type inet:ip-prefix;
232             mandatory true;
233         }
234     }
235
236     grouping as-number-subobject {
237         uses c-subobject;
238         leaf as-number {
239             reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.4";
240             type inet:as-number;
241             mandatory true;
242         }
243     }
244
245     grouping label-subobject {
246         uses c-subobject;
247
248         leaf uni-directional {
249             type boolean;
250             mandatory true;
251         }
252
253         choice label-type {
254             case type1-label-case {
255                 container type1-label {
256                     uses type1-label;
257                 }
258             }
259             case generalized-label-case {
260                 container generalized-label {
261                     uses generalized-label;
262                 }
263             }
264             case waveband-switching-label-case {
265                 container waveband-switching-label {
266                     uses waveband-switching-label;
267                 }
268             }
269         }
270     }
271
272     grouping unnumbered-subobject {
273         uses c-subobject;
274         leaf router-id {
275             type uint32;
276             mandatory true;
277         }
278
279         leaf interface-id {
280             type uint32;
281             mandatory true;
282         }
283     }
284
285     grouping srlg-subobject {
286         uses c-subobject;
287         leaf srlg-id {
288             type srlg-id;
289             mandatory true;
290         }
291     }
292
293     grouping record-route-subobjects {
294         leaf protection-available {
295             type boolean;
296             default false;
297         }
298
299         leaf protection-in-use {
300             type boolean;
301             default false;
302         }
303
304         choice subobject-type {
305             case ip-prefix-case {
306                 container ip-prefix {
307                     uses ip-prefix-subobject;
308                 }
309             }
310
311             case label-case {
312                 container label {
313                     uses label-subobject;
314
315                     leaf global {
316                         type boolean;
317                         default false;
318                     }
319                 }
320             }
321
322             case unnumbered-case {
323                 container unnumbered {
324                     uses unnumbered-subobject;
325                 }
326             }
327         }
328     }
329
330     grouping basic-explicit-route-subobjects {
331         description "Subobjects shared between XRO and ERO";
332         reference "https://tools.ietf.org/html/rfc4874#section-4.1";
333
334         choice subobject-type {
335             case as-number-case {
336                 container as-number {
337                     uses as-number-subobject;
338                 }
339             }
340             case ip-prefix-case {
341                 container ip-prefix {
342                     uses ip-prefix-subobject;
343                 }
344             }
345             case label-case {
346                 container label {
347                     uses label-subobject;
348                 }
349             }
350             case srlg-case {
351                 container srlg {
352                     uses srlg-subobject;
353                 }
354             }
355             case unnumbered-case {
356                 container unnumbered {
357                     uses unnumbered-subobject;
358                 }
359             }
360         }
361     }
362
363     grouping exclude-route-subobjects {
364         description "Subobject of an Exclude Route Object";
365         reference "https://tools.ietf.org/html/rfc4874#section-3.1";
366
367         leaf mandatory {
368             type boolean;
369             default false;
370         }
371
372         leaf attribute {
373             type enumeration {
374                 enum interface {
375                     value 0;
376                 }
377                 enum node {
378                     value 1;
379                 }
380                 enum srlg {
381                     value 2;
382                 }
383             }
384             mandatory true;
385         }
386
387         uses basic-explicit-route-subobjects;
388     }
389
390     grouping explicit-route-subobjects {
391         description "Subobject of an Explicit Route Object";
392         reference "https://tools.ietf.org/html/rfc4874#section-4.1";
393         uses basic-explicit-route-subobjects {
394             augment "subobject-type" {
395                 case exrs-case {
396                     container exrs {
397                         list exrs {
398                             uses exclude-route-subobjects;
399                         }
400                     }
401                 }
402             }
403         }
404     }
405 }