Bug-479: Implementation of Vendor-Information TLV
[bgpcep.git] / pcep / ietf-stateful02 / src / main / yang / odl-pcep-ietf-stateful02.yang
1 module odl-pcep-ietf-stateful02 {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:pcep:crabbe:stateful:02";
4     prefix "stateful02";
5
6     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
7     import pcep-types { prefix pcep; revision-date 2013-10-05; }
8     import pcep-message { prefix msg; revision-date 2013-10-07; }
9     import rsvp { prefix rsvp; revision-date 2013-08-20; }
10     import network-topology { prefix nt; revision-date 2013-10-21; }
11     import network-topology-pcep { prefix topo; revision-date 2013-10-24; }
12     import topology-tunnel { prefix tt; revision-date 2013-08-19; }
13     import topology-tunnel-pcep { prefix tun; revision-date 2013-08-20; }
14     import topology-tunnel-pcep-programming { prefix ttpp; revision-date 2013-10-30; }
15
16     organization "Cisco Systems, Inc.";
17     contact "Dana Kutenicsova <dkutenic@cisco.com>";
18
19     description
20         "This module contains the data model of PCEP extensions defined
21         in draft-ietf-pce-stateful-pce.
22
23         Copyright (c)2014 Cisco Systems, Inc. All rights reserved.
24
25         This program and the accompanying materials are made available
26         under the terms of the Eclipse Public License v1.0 which
27         accompanies this distribution, and is available at
28         http://www.eclipse.org/legal/epl-v10.html";
29
30     revision "2014-01-10" {
31         description
32             "Initial revision.";
33         reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02";
34     }
35
36     typedef plsp-id {
37         type uint32 {
38             range 0..1048576;
39         }
40     }
41
42     typedef symbolic-path-name {
43         type binary {
44             length 1..65535;
45         }
46     }
47
48     typedef node-identifier {
49         type binary {
50             length 1..65535;
51         }
52     }
53
54     grouping lsp-db-version-tlv {
55         description "LSP State Database Version TLV";
56         reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-7.2.3";
57
58         container lsp-db-version {
59             uses pcep:tlv;
60             leaf version {
61                 type uint64;
62                 mandatory true;
63             }
64         }
65     }
66
67     grouping node-identifier-tlv {
68         description "Node Identifier TLV";
69         reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-7.1.3";
70
71         container node-identifier {
72             uses pcep:tlv;
73             leaf node-id {
74                 type node-identifier;
75                 mandatory true;
76             }
77         }
78     }
79
80     grouping rsvp-error-spec-tlv {
81         description "RSVP Error Spec TLV";
82         reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-7.2.2";
83         container rsvp-error-spec {
84             uses pcep:tlv;
85             container rsvp-error {
86                 uses rsvp:error-spec;
87             }
88         }
89     }
90
91     grouping stateful-capability-tlv {
92         description "Stateful PCE Capability TLV";
93         reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-7.1.1";
94
95         container stateful {
96             uses pcep:tlv;
97
98             leaf lsp-update-capability {
99                 type boolean;
100                 default false;
101             }
102             leaf include-db-version {
103                 type boolean;
104                 default false;
105             }
106         }
107     }
108
109     grouping symbolic-path-name-tlv {
110         description "Symbolic Path Name TLV";
111         reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-7.2.1";
112         container symbolic-path-name {
113             uses pcep:tlv;
114             leaf path-name {
115                 type symbolic-path-name;
116                 mandatory true;
117             }
118         }
119     }
120
121     grouping lsp-object {
122         description "LSP Object";
123         reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-7.2";
124
125         container lsp {
126             uses pcep:object;
127             container "tlvs" {
128                 uses lsp-db-version-tlv;
129
130                 uses rsvp-error-spec-tlv;
131
132                 uses symbolic-path-name-tlv;
133
134                 uses pcep:vendor-information-tlvs;
135             }
136
137             leaf plsp-id {
138                 type plsp-id;
139                 mandatory true;
140             }
141
142             leaf delegate {
143                 type boolean;
144                 default false;
145             }
146
147             leaf sync {
148                 type boolean;
149                 default false;
150             }
151
152             leaf remove {
153                 type boolean;
154                 default false;
155             }
156
157             leaf operational {
158                 type boolean;
159                 default false;
160             }
161         }
162     }
163
164     grouping pcupd-message {
165         uses pcep:message;
166
167         container pcupd-message {
168             description "State Update Request Message";
169             reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-6.2";
170
171             uses pcep:message-header;
172
173             list updates {
174                 uses lsp-object;
175
176                 container path {
177                     uses pcep:path-definition;
178                 }
179             }
180         }
181     }
182
183     grouping pcrpt-message {
184         uses pcep:message;
185
186         container pcrpt-message {
187             description "State Report Message";
188             reference "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-6.1";
189
190             uses pcep:message-header;
191
192             list reports {
193                 uses lsp-object;
194
195                 container path {
196                     uses pcep:path-definition;
197                 }
198             }
199         }
200     }
201
202     notification pcupd {
203         uses pcupd-message;
204     }
205
206     notification pcrpt {
207         uses pcrpt-message;
208     }
209
210     augment "/msg:open/msg:open-message/msg:open/msg:tlvs" {
211         uses stateful-capability-tlv;
212
213         uses node-identifier-tlv;
214     }
215
216     augment "/msg:pcerr/msg:pcerr-message/msg:error-type/msg:session-case/msg:session/msg:open/msg:tlvs" {
217         uses stateful-capability-tlv;
218
219         uses node-identifier-tlv;
220     }
221
222     augment "/msg:pcreq/msg:pcreq-message/msg:requests/msg:segment-computation/msg:p2p" {
223         uses lsp-object;
224     }
225
226     augment "/msg:pcrep/msg:pcrep-message/msg:replies" {
227         uses lsp-object;
228     }
229
230     augment "/msg:pcreq/msg:pcreq-message/msg:requests/msg:segment-computation/msg:p2p/msg:lspa/msg:tlvs" {
231         uses symbolic-path-name-tlv;
232     }
233
234     augment "/nt:network-topology/nt:topology/nt:node/topo:path-computation-client/topo:reported-lsp" {
235         uses lsp-object;
236     }
237
238     augment "/nt:network-topology/nt:topology/nt:node/topo:path-computation-client/topo:stateful-tlv" {
239         uses stateful-capability-tlv;
240     }
241
242     augment "/topo:ensure-lsp-operational/topo:input/topo:arguments" {
243         leaf operational {
244             type boolean;
245         }
246     }
247
248     augment "/topo:update-lsp/topo:input/topo:arguments" {
249         leaf operational {
250             type boolean;
251         }
252     }
253
254     typedef administrative-status {
255         type enumeration {
256             enum active;
257             enum inactive;
258         }
259         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-02#section-7.2";
260     }
261
262     grouping cfg-attributes {
263         leaf administrative-status {
264             type administrative-status;
265         }
266     }
267
268     grouping oper-attributes {
269         leaf operational-status {
270             type boolean;
271             config false;
272         }
273     }
274
275     augment "/nt:network-topology/nt:topology/nt:link" {
276         when "../../tunnel-types/pcep-tunnel";
277
278         uses cfg-attributes;
279         uses oper-attributes;
280     }
281
282     augment "/nt:network-topology/nt:topology/tt:paths" {
283         when "../../tunnel-types/pcep-tunnel";
284
285         uses cfg-attributes;
286         uses oper-attributes;
287     }
288
289     augment "/ttpp:pcep-create-p2p-tunnel/ttpp:input" {
290         uses cfg-attributes;
291     }
292
293     augment "/ttpp:pcep-update-tunnel/ttpp:input" {
294         uses cfg-attributes;
295     }
296 }