Mass replace CRLF->LF
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-augments.yang
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8  
9  module openflow-augments {
10     namespace "urn:opendaylight:openflow:augments";
11     prefix "aug";
12     
13     import yang-ext {prefix ext;}
14     import ietf-inet-types {prefix inet;}
15     import ietf-yang-types {prefix yang;}
16
17     import openflow-types {prefix oft;}
18     import openflow-protocol {prefix ofproto;}
19     import openflow-action {prefix ofaction;}
20     import openflow-instruction {prefix ofinstruction;}
21     import openflow-extensible-match {prefix oxm;}
22
23     revision "2013-10-02" {
24         description "OpenFlow 1.3 - augments model. 
25                     Please visit 
26                     https://wiki.opendaylight.org/view/File:OpenFlow_Protocol_Library_-_Project_documentation.pdf
27                      - Augmentation Tables chapter";
28     }
29
30 // OFP_MATCH AUGMENTS
31      augment "/oxm:oxm-container/oxm:match-entries" {
32          ext:augment-identifier "port-number-match-entry";
33          leaf port-number {
34              type oft:port-number;
35          }
36      }
37      augment "/oxm:oxm-container/oxm:match-entries" {
38          ext:augment-identifier "metadata-match-entry";
39          leaf metadata {
40              type binary;
41          }
42      }
43      augment "/oxm:oxm-container/oxm:match-entries" {
44          ext:augment-identifier "mask-match-entry";
45          leaf mask {
46              type binary;
47          }
48      }
49      augment "/oxm:oxm-container/oxm:match-entries" {
50          ext:augment-identifier "mac-address-match-entry";
51          leaf mac-address {
52              type yang:mac-address;
53          }
54      }
55      augment "/oxm:oxm-container/oxm:match-entries" {
56          ext:augment-identifier "eth-type-match-entry";
57          leaf eth-type {
58              type oft:ether-type;
59          }
60      }
61      augment "/oxm:oxm-container/oxm:match-entries" {
62          ext:augment-identifier "vlan-vid-match-entry";
63          leaf vlan-vid {
64              type uint16;
65          }
66          leaf cfi-bit {
67              type boolean;
68          }
69      }
70      augment "/oxm:oxm-container/oxm:match-entries" {
71          ext:augment-identifier "vlan-pcp-match-entry";
72          leaf vlan-pcp {
73              type uint8;
74          }
75      }
76      augment "/oxm:oxm-container/oxm:match-entries" {
77          ext:augment-identifier "dscp-match-entry";
78          leaf dscp {
79              type inet:dscp;
80          }
81      }
82      augment "/oxm:oxm-container/oxm:match-entries" {
83          ext:augment-identifier "ecn-match-entry";
84          leaf ecn {
85              type uint8;
86          }
87      }
88      augment "/oxm:oxm-container/oxm:match-entries" {
89          ext:augment-identifier "protocol-number-match-entry";
90          leaf protocol-number {
91              type uint8;
92          }
93      }
94      augment "/oxm:oxm-container/oxm:match-entries" {
95          ext:augment-identifier "port-match-entry";
96          leaf port {
97              type inet:port-number;
98          }
99      }
100      augment "/oxm:oxm-container/oxm:match-entries" {
101          ext:augment-identifier "icmpv4-type-match-entry";
102          leaf icmpv4-type {
103              type uint8;
104          }
105      }
106      augment "/oxm:oxm-container/oxm:match-entries" {
107          ext:augment-identifier "icmpv4-code-match-entry";
108          leaf icmpv4-code {
109              type uint8;
110          }
111      }
112      augment "/oxm:oxm-container/oxm:match-entries" {
113          ext:augment-identifier "op-code-match-entry";
114          leaf op-code {
115              type uint16;
116          }
117      }
118      augment "/oxm:oxm-container/oxm:match-entries" {
119          ext:augment-identifier "ipv6-flabel-match-entry";
120          leaf ipv6-flabel {
121              type inet:ipv6-flow-label;
122          }
123      }
124      augment "/oxm:oxm-container/oxm:match-entries" {
125          ext:augment-identifier "icmpv6-type-match-entry";
126          leaf icmpv6-type {
127              type uint8;
128          }
129      }
130      augment "/oxm:oxm-container/oxm:match-entries" {
131          ext:augment-identifier "icmpv6-code-match-entry";
132          leaf icmpv6-code {
133              type uint8;
134          }
135      }
136      augment "/oxm:oxm-container/oxm:match-entries" {
137          ext:augment-identifier "ipv6-address-match-entry";
138          leaf ipv6-address {
139              type inet:ipv6-address;
140          }
141      }
142      augment "/oxm:oxm-container/oxm:match-entries" {
143          ext:augment-identifier "ipv4-address-match-entry";
144          leaf ipv4-address {
145              type inet:ipv4-address;
146          }
147      }
148      augment "/oxm:oxm-container/oxm:match-entries" {
149          ext:augment-identifier "mpls-label-match-entry";
150          leaf mpls-label {
151              type uint32;
152          }
153      }
154      augment "/oxm:oxm-container/oxm:match-entries" {
155          ext:augment-identifier "tc-match-entry";
156          leaf tc {
157              type uint8;
158          }
159      }
160      augment "/oxm:oxm-container/oxm:match-entries" {
161          ext:augment-identifier "bos-match-entry";
162          leaf bos {
163              type boolean;
164          }
165      }
166      augment "/oxm:oxm-container/oxm:match-entries" {
167          ext:augment-identifier "isid-match-entry";
168          leaf isid {
169              type uint32;
170          }
171      }
172      augment "/oxm:oxm-container/oxm:match-entries" {
173          ext:augment-identifier "pseudo-field-match-entry";
174          leaf pseudo-field {
175              type oft:ipv6-exthdr-flags;
176          }
177      }
178      augment "/oxm:oxm-container/oxm:match-entries" {
179          ext:augment-identifier "experimenter-id-match-entry";
180          leaf experimenter {
181              type oft:experimenter-id;
182          }
183      }
184      augment "/oxm:oxm-container/oxm:match-entries" {
185          ext:augment-identifier "tcp-flag-match-entry";
186          leaf tcp-flag {
187              type uint16;
188          }
189      }
190      augment "/oxm:oxm-container/oxm:match-entries" {
191          ext:augment-identifier "tunnel-ipv4-dst-match-entry";
192          leaf tunnel-ipv4-dst {
193              type inet:ipv4-address;
194          }
195      }
196      augment "/oxm:oxm-container/oxm:match-entries" {
197          ext:augment-identifier "tunnel-ipv4-src-match-entry";
198          leaf tunnel-ipv4-src {
199              type inet:ipv4-address;
200          }
201      }
202
203 // OFP_ACTION AUGMENTS
204      augment "/ofaction:actions-container/ofaction:action" {
205          ext:augment-identifier "port-action";
206          leaf port {
207              type oft:port-number;
208          }
209      }
210      augment "/ofaction:actions-container/ofaction:action" {
211          ext:augment-identifier "max-length-action";
212          leaf max-length {
213              type uint16;
214          }
215      }
216      augment "/ofaction:actions-container/ofaction:action" {
217          ext:augment-identifier "mpls-ttl-action";
218          leaf mpls-ttl {
219              type uint8;
220          }
221      }
222      augment "/ofaction:actions-container/ofaction:action" {
223          ext:augment-identifier "ethertype-action";
224          leaf ethertype {
225              type oft:ether-type;
226          }
227      }
228      augment "/ofaction:actions-container/ofaction:action" {
229          ext:augment-identifier "queue-id-action";
230          leaf queue-id {
231              type uint32;
232          }
233      }
234      augment "/ofaction:actions-container/ofaction:action" {
235          ext:augment-identifier "group-id-action";
236          leaf group-id {
237              type uint32;
238          }
239      }
240      augment "/ofaction:actions-container/ofaction:action" {
241          ext:augment-identifier "nw-ttl-action";
242          leaf nw-ttl {
243              type uint8;
244          }
245      }
246      augment "/ofaction:actions-container/ofaction:action" {
247          ext:augment-identifier "oxm-fields-action";
248          uses oxm:oxm-fields-grouping;
249      }
250      augment "/ofaction:actions-container/ofaction:action" {
251          ext:augment-identifier "experimenter-id-action";
252          leaf experimenter {
253              type oft:experimenter-id;
254          }
255          leaf sub-type {
256             type identityref {
257                 base ofaction:experimenter-action-sub-type;
258             }
259          }
260      }
261      // OF1.0 structures
262      augment "/ofaction:actions-container/ofaction:action" {
263          ext:augment-identifier "vlan-vid-action";
264          leaf vlan-vid {
265              type uint16;
266          }
267      }
268      augment "/ofaction:actions-container/ofaction:action" {
269          ext:augment-identifier "vlan-pcp-action";
270          leaf vlan-pcp {
271              type uint8;
272          }
273      }
274      augment "/ofaction:actions-container/ofaction:action" {
275          ext:augment-identifier "dl-address-action";
276          leaf dl-address {
277              type yang:mac-address;
278          }
279      }
280      augment "/ofaction:actions-container/ofaction:action" {
281          ext:augment-identifier "nw-tos-action";
282          leaf nw-tos {
283              type uint8;
284          }
285      }
286      augment "/ofaction:actions-container/ofaction:action" {
287          ext:augment-identifier "ip-address-action";
288          leaf ip-address {
289              type inet:ipv4-address;
290          }
291      }
292
293 // OFP_TABLE_FEATURES_PROPERTIES AUGMENTS
294      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
295          ext:augment-identifier "instruction-related-table-feature-property";
296          uses ofinstruction:instructions-grouping;
297      }
298      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
299          ext:augment-identifier "next-table-related-table-feature-property";
300          list next-table-ids {
301              config false;
302              leaf table-id {
303                  type uint8;
304              }
305          }
306      }
307      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
308          ext:augment-identifier "action-related-table-feature-property";
309          uses ofaction:actions-grouping;
310      }
311      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
312          ext:augment-identifier "oxm-related-table-feature-property";
313          uses oxm:oxm-fields-grouping;
314      }
315      augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
316          ext:augment-identifier "experimenter-id-table-feature-property";
317          leaf experimenter {
318              type oft:experimenter-id;
319          }
320          leaf exp-type {
321              type uint32;
322          }
323      }
324
325 // OFP_INSTRUCTION AUGMENTS
326      augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
327          ext:augment-identifier "table-id-instruction";
328          leaf table-id {
329              type uint8;
330          }
331      }
332      augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
333          ext:augment-identifier "metadata-instruction";
334          leaf metadata {
335              type binary;
336          }
337          leaf metadata-mask {
338              type binary;
339          }
340      }
341      augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
342          ext:augment-identifier "actions-instruction";
343          uses ofaction:actions-grouping;
344      }
345      augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
346          ext:augment-identifier "meter-id-instruction";
347          leaf meter-id {
348              type uint32;
349          }
350      }
351      augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
352          ext:augment-identifier "experimenter-id-instruction";
353          leaf experimenter {
354              type oft:experimenter-id;
355          }
356      }
357      
358 // OFP_QUEUE_PROP AUGMENTS
359      augment "/ofproto:queue-prop-container/ofproto:queue-property" {
360          ext:augment-identifier "rate-queue-property";
361          leaf rate {
362              type uint16;
363          }
364      }
365      augment "/ofproto:queue-prop-container/ofproto:queue-property" {
366          ext:augment-identifier "experimenter-id-queue-property";
367          leaf experimenter {
368              type oft:experimenter-id;
369          }
370      }
371      
372 // OFP_ERROR_AUGMENTS (only experimenter till OpenFlow v1.3)
373      augment "/ofproto:error-message" {
374          ext:augment-identifier "experimenter-id-error";
375          leaf experimenter {
376              type oft:experimenter-id;
377          }
378      }
379
380 // OFP_MULTIPART AUGMENTS
381      augment "/ofproto:multipart-request/input/ofproto:multipart-request-body/ofproto:multipart-request-experimenter-case/ofproto:multipart-request-experimenter" {
382          ext:augment-identifier "experimenter-id-multipart-request";
383          leaf experimenter {
384              type oft:experimenter-id;
385          }
386          leaf exp-type {
387              type uint32;
388          }
389      }
390      augment "/ofproto:multipart-reply-message/ofproto:multipart-reply-body/ofproto:multipart-reply-experimenter-case/ofproto:multipart-reply-experimenter" {
391          ext:augment-identifier "experimenter-id-multipart-reply";
392          leaf experimenter {
393              type oft:experimenter-id;
394          }
395          leaf exp-type {
396              type uint32;
397          }
398      }
399
400 // OFP_METER_BAND AUGMENTS
401      augment "/ofproto:meter-band-container/ofproto:meter-band/ofproto:meter-band-experimenter-case/ofproto:meter-band-experimenter" {
402          ext:augment-identifier "experimenter-id-meter-band";
403          leaf experimenter {
404              type oft:experimenter-id;
405          }
406      }
407 }