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