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