BUG-47 : 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         typedef srlg-id {
71                 type uint32;
72         }
73
74         grouping error-spec {
75                 reference "https://tools.ietf.org/html/rfc2205#page-81";
76
77                 leaf node {
78                         type inet:ip-address;
79                         mandatory true;
80                 }
81
82                 leaf flags {
83                         type bits {
84                                 bit in-place {
85                                         position 7;
86                                 }
87                                 bit not-guilty {
88                                         position 6;
89                                 }
90                         }
91                 }
92
93                 leaf code {
94                         type uint8;
95                         mandatory true;
96                 }
97
98                 leaf value {
99                         type uint16;
100                         mandatory true;
101                 }
102         }
103
104         grouping user-error-spec {
105                 reference "https://tools.ietf.org/html/rfc5284#section-3";
106
107                 leaf enterprise {
108                         type iana:enterprise-number;
109                         mandatory true;
110                 }
111
112                 leaf sub-org {
113                         type uint8;
114                         default 0;
115                 }
116
117                 leaf value {
118                         type uint16;
119                         mandatory true;
120                 }
121
122                 leaf description {
123                         type string;
124                         default "";
125                 }
126
127                 container subobjects {
128                         // Filled by enterprise-specific augmentations
129                 }
130         }
131         
132         //marker
133         grouping c-subobject {
134         
135         }
136
137         grouping ip-prefix-subobject {
138                 uses c-subobject;
139                 leaf ip-prefix {
140                         reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.1";
141                         type inet:ip-prefix;
142                         mandatory true;
143                 }
144         }
145
146         grouping as-number-subobject {
147                 uses c-subobject;
148                 leaf as-number {
149                         reference "http://tools.ietf.org/html/rfc3209#section-4.3.3.4";
150                         type inet:as-number;
151                         mandatory true;
152                 }
153         }
154
155         grouping label-subobject {
156                 uses c-subobject;
157                 leaf c-type {
158                         type uint8;
159                         mandatory true;
160                 }
161
162                 leaf uni-directional {
163                         type boolean;
164                         mandatory true;
165                 }
166
167                 leaf-list labels {
168                         type uint32;
169                 }
170         }
171
172         grouping unnumbered-subobject {
173                 uses c-subobject;
174                 leaf router-id {
175                         type uint32;
176                         mandatory true;
177                 }
178
179                 leaf interface-id {
180                         type uint32;
181                         mandatory true;
182                 }
183         }
184
185         grouping srlg-subobject {
186                 uses c-subobject;
187                 leaf srlg-id {
188                         type srlg-id;
189                         mandatory true;
190                 }
191         }
192
193         grouping record-route-subobjects {
194                 leaf protection-available {
195                         type boolean;
196                         default false;
197                 }
198
199                 leaf protection-in-use {
200                         type boolean;
201                         default false;
202                 }
203
204                 choice subobject-type {
205                         case ip-prefix {
206                                 uses ip-prefix-subobject;
207                         }
208
209                         case label {
210                                 uses label-subobject;
211                         }
212
213                         case unnumbered {
214                                 uses unnumbered-subobject;
215                         }
216                 }
217         }
218
219         grouping route-subobjects {
220                 choice subobject-type {
221                         case as-number {
222                                 uses as-number-subobject;
223                         }
224
225                         case ip-prefix {
226                                 uses ip-prefix-subobject;
227                         }
228
229                         case label {
230                                 uses label-subobject;
231                         }
232
233                         case unnumbered {
234                                 uses unnumbered-subobject;
235                         }
236                 }
237         }
238
239         grouping exclude-route-subobjects {
240                 description "Subobject of an Exclude Route Object";
241                 reference "https://tools.ietf.org/html/rfc4874#section-3.1";
242
243                 leaf mandatory {
244                         type boolean;
245                         default false;
246                 }
247
248                 leaf attribute {
249                         type uint8;
250                         mandatory true;
251                 }
252
253                 choice subobject-type {
254                         case as-number {
255                                 uses as-number-subobject;
256                         }
257                         case ip-prefix {
258                                 uses ip-prefix-subobject;
259                         }
260                         case srlg {
261                                 uses srlg-subobject;
262                         }
263                         case unnumbered {
264                                 uses unnumbered-subobject;
265                         }
266                 }
267         }
268
269 }
270