Merge "Fix Ipv6 format compression" into stable/boron
[openflowplugin.git] / extension / openflowplugin-extension-nicira / src / main / yang / openflowplugin-extension-nicira-match.yang
1 module openflowplugin-extension-nicira-match {
2     yang-version 1;
3
4     namespace "urn:opendaylight:openflowplugin:extension:nicira:match";
5     prefix "openflowplugin-nicira-match";
6
7     import yang-ext {prefix ext; revision-date "2013-07-09";}
8     import flow-node-inventory {prefix fni; revision-date 2013-08-19; }
9     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
10     import sal-flow {prefix sal-flow;revision-date "2013-08-19";}
11     import packet-processing {prefix sal-packet;revision-date "2013-07-09";}
12     import openflowplugin-extension-general {prefix ext-gen;revision-date "2014-07-14";}
13     import opendaylight-flow-statistics {prefix odl-flow-stats;revision-date "2013-08-19";}
14     import nicira-match {prefix nicira-match;revision-date "2014-04-21";}
15     import ietf-inet-types {prefix inet; revision-date "2013-07-15";}
16     import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
17
18     description
19         "Nicira openflow match extensions.";
20
21     revision "2014-07-14" {
22         description "Initial revision";
23     }
24
25     identity nxm-nx-reg0-key {
26         base ext-gen:extension-key;
27     }
28     identity nxm-nx-reg1-key {
29         base ext-gen:extension-key;
30     }
31     identity nxm-nx-reg2-key {
32         base ext-gen:extension-key;
33     }
34     identity nxm-nx-reg3-key {
35         base ext-gen:extension-key;
36     }
37     identity nxm-nx-reg4-key {
38         base ext-gen:extension-key;
39     }
40     identity nxm-nx-reg5-key {
41         base ext-gen:extension-key;
42     }
43     identity nxm-nx-reg6-key {
44         base ext-gen:extension-key;
45     }
46     identity nxm-nx-reg7-key {
47         base ext-gen:extension-key;
48     }
49     identity nxm-nx-tun-id-key {
50         base ext-gen:extension-key;
51     }
52     identity nxm-nx-arp-sha-key {
53         base ext-gen:extension-key;
54     }
55     identity nxm-nx-arp-tha-key {
56         base ext-gen:extension-key;
57     }
58     identity nxm-of-arp-op-key {
59         base ext-gen:extension-key;
60     }
61     identity nxm-of-arp-spa-key {
62         base ext-gen:extension-key;
63     }
64     identity nxm-of-arp-tpa-key {
65         base ext-gen:extension-key;
66     }
67     identity nxm-nx-tun-ipv4-dst-key {
68         base ext-gen:extension-key;
69     }
70     identity nxm-nx-tun-ipv4-src-key {
71         base ext-gen:extension-key;
72     }
73     identity nxm-of-eth-src-key {
74         base ext-gen:extension-key;
75     }
76     identity nxm-of-eth-dst-key {
77         base ext-gen:extension-key;
78     }
79     identity nxm-of-eth-type-key {
80         base ext-gen:extension-key;
81     }
82     identity nxm-nx-nsp-key {
83         base ext-gen:extension-key;
84     }
85     identity nxm-nx-nsi-key {
86         base ext-gen:extension-key;
87     }
88     identity nxm-nx-nshc-1-key {
89         base ext-gen:extension-key;
90     }
91     identity nxm-nx-nshc-2-key {
92         base ext-gen:extension-key;
93     }
94     identity nxm-nx-nshc-3-key {
95         base ext-gen:extension-key;
96     }
97     identity nxm-nx-nshc-4-key {
98         base ext-gen:extension-key;
99     }
100     identity nxm-of-tcp-src-key {
101         base ext-gen:extension-key;
102     }
103     identity nxm-of-tcp-dst-key {
104         base ext-gen:extension-key;
105     }
106     identity nxm-of-udp-src-key {
107         base ext-gen:extension-key;
108     }
109     identity nxm-of-udp-dst-key {
110         base ext-gen:extension-key;
111     }
112     identity nxm-nx-ct-state-key {
113         base ext-gen:extension-key;
114     }
115     identity nxm-nx-ct-zone-key {
116         base ext-gen:extension-key;
117     }
118     identity nxm-of-ip-dst-key {
119         base ext-gen:extension-key;
120     }
121     identity nxm-of-ip-src-key {
122         base ext-gen:extension-key;
123     }
124     identity nxm-of-icmp-type-key {
125         base ext-gen:extension-key;
126     }
127     identity nxm-nx-encap-eth-type-key {
128         base ext-gen:extension-key;
129     }
130     identity nxm-nx-encap-eth-src-key {
131         base ext-gen:extension-key;
132     }
133     identity nxm-nx-encap-eth-dst-key {
134         base ext-gen:extension-key;
135     }
136     identity nxm-nx-nsh-mdtype-key {
137         base ext-gen:extension-key;
138     }
139     identity nxm-nx-nsh-np-key {
140         base ext-gen:extension-key;
141     }
142     identity nxm-nx-tun-gpe-np-key {
143         base ext-gen:extension-key;
144     }
145     grouping ipv4-address-grouping {
146         leaf ipv4-address {
147             type inet:ipv4-address;
148         }
149     }
150     grouping mac-address-grouping {
151         leaf mac-address {
152             type yang:mac-address;
153         }
154     }
155
156     grouping nxm-nx-reg-grouping {
157         container nxm-nx-reg {
158             leaf reg {
159                 type identityref {
160                     base nicira-match:nxm-nx-reg;
161                 }
162             }
163             leaf value {
164                 type uint32;
165             }
166         }
167     }
168     grouping nxm-nx-tun-id-grouping {
169         container nxm-nx-tun-id {
170             leaf value {
171                 type uint64;
172             }
173         }
174     }
175     grouping nxm-nx-arp-sha-grouping {
176         container nxm-nx-arp-sha {
177             uses mac-address-grouping;
178         }
179     }
180     grouping nxm-nx-arp-tha-grouping {
181         container nxm-nx-arp-tha {
182             uses mac-address-grouping;
183         }
184     }
185     grouping nxm-of-arp-op-grouping {
186         container nxm-of-arp-op {
187             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
188             leaf value {
189                 type uint16;
190             }
191         }
192     }
193     grouping nxm-of-arp-spa-grouping {
194         container nxm-of-arp-spa {
195             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
196             uses ipv4-address-grouping;
197         }
198     }
199     grouping nxm-of-tcp-src-grouping {
200         container nxm-of-tcp-src {
201             leaf port {
202                type inet:port-number;
203             }
204             leaf mask {
205                type uint16;
206             }
207         }
208     }
209     grouping nxm-of-tcp-dst-grouping {
210         container nxm-of-tcp-dst {
211             leaf port {
212                 type inet:port-number;
213             }
214             leaf mask {
215                type uint16;
216             }
217         }
218     }
219     grouping nxm-of-udp-src-grouping {
220         container nxm-of-udp-src {
221             leaf port {
222                type inet:port-number;
223             }
224             leaf mask {
225                type uint16;
226             }
227         }
228     }
229     grouping nxm-of-udp-dst-grouping {
230         container nxm-of-udp-dst {
231             leaf port {
232                         type inet:port-number;
233             }
234             leaf mask {
235                type uint16;
236             }
237         }
238     }
239     grouping nxm-of-arp-tpa-grouping {
240         container nxm-of-arp-tpa {
241             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
242             uses ipv4-address-grouping;
243         }
244     }
245     grouping nxm-nx-tun-ipv4-dst-grouping {
246         container nxm-nx-tun-ipv4-dst {
247             uses ipv4-address-grouping;
248         }
249     }
250     grouping nxm-nx-tun-ipv4-src-grouping {
251         container nxm-nx-tun-ipv4-src {
252             uses ipv4-address-grouping;
253         }
254     }
255     grouping nxm-of-eth-src-grouping {
256         container nxm-of-eth-src {
257             uses mac-address-grouping;
258         }
259     }
260     grouping nxm-of-eth-dst-grouping {
261         container nxm-of-eth-dst {
262             uses mac-address-grouping;
263         }
264     }
265     grouping nxm-of-eth-type-grouping {
266         container nxm-of-eth-type {
267             leaf value {
268                 type uint16;
269             }
270         }
271     }
272     grouping nxm-nx-nsp-grouping {
273         container nxm-nx-nsp {
274             leaf value {
275                 type uint32;
276             }
277         }
278     }
279     grouping nxm-nx-nsi-grouping {
280         container nxm-nx-nsi {
281             leaf nsi {
282                 type uint8;
283             }
284         }
285     }
286     grouping nxm-nx-nshc-1-grouping {
287         container nxm-nx-nshc-1 {
288             leaf value {
289                 type uint32;
290             }
291         }
292     }
293     grouping nxm-nx-nshc-2-grouping {
294         container nxm-nx-nshc-2 {
295             leaf value {
296                 type uint32;
297             }
298         }
299     }
300     grouping nxm-nx-nshc-3-grouping {
301         container nxm-nx-nshc-3 {
302             leaf value {
303                 type uint32;
304             }
305         }
306     }
307     grouping nxm-nx-nshc-4-grouping {
308         container nxm-nx-nshc-4 {
309             leaf value {
310                 type uint32;
311             }
312         }
313     }
314     grouping nxm-nx-ct-state-grouping {
315          container nxm-nx-ct-state {
316             leaf ct-state {
317                type uint32;
318             }
319              leaf mask {
320                type uint32;
321             }
322         }
323     }
324     grouping nxm-nx-ct-zone-grouping {
325          container nxm-nx-ct-zone {
326             leaf ct-zone {
327                type uint16;
328             }
329         }
330     }
331     grouping nxm-of-ip-dst-grouping {
332         container nxm-of-ip-dst {
333             uses ipv4-address-grouping;
334         }
335     }
336     grouping nxm-of-ip-src-grouping {
337         container nxm-of-ip-src {
338             uses ipv4-address-grouping;
339         }
340     }
341     grouping nxm-of-icmp-type-grouping {
342         container nxm-of-icmp-type {
343             leaf value {
344                 type uint8;
345             }
346         }
347     }
348     grouping nxm-nx-encap-eth-type-grouping {
349         container nxm-nx-encap-eth-type {
350             leaf value {
351                 type uint16;
352             }
353         }
354     }
355     grouping nxm-nx-encap-eth-src-grouping {
356         container nxm-nx-encap-eth-src {
357             uses mac-address-grouping;
358         }
359     }
360     grouping nxm-nx-encap-eth-dst-grouping {
361         container nxm-nx-encap-eth-dst {
362             uses mac-address-grouping;
363         }
364     }
365     grouping nxm-nx-nsh-mdtype-grouping {
366         container nxm-nx-nsh-mdtype {
367             leaf value {
368                 type uint8;
369             }
370         }
371     }
372     grouping nxm-nx-nsh-np-grouping {
373         container nxm-nx-nsh-np {
374             leaf value {
375                 type uint8;
376             }
377         }
378     }
379     grouping nxm-nx-tun-gpe-np-grouping {
380         container nxm-nx-tun-gpe-np {
381             leaf value {
382                 type uint8;
383             }
384         }
385     }
386
387
388     grouping all-matches-grouping {
389         uses nxm-nx-reg-grouping;
390         uses nxm-nx-tun-id-grouping;
391         uses nxm-nx-arp-sha-grouping;
392         uses nxm-nx-arp-tha-grouping;
393         uses nxm-of-arp-op-grouping;
394         uses nxm-of-arp-spa-grouping;
395         uses nxm-of-arp-tpa-grouping;
396         uses nxm-nx-tun-ipv4-dst-grouping;
397         uses nxm-nx-tun-ipv4-src-grouping;
398         uses nxm-of-eth-src-grouping;
399         uses nxm-of-eth-dst-grouping;
400         uses nxm-of-eth-type-grouping;
401         uses nxm-nx-nsp-grouping;
402         uses nxm-nx-nsi-grouping;
403         uses nxm-nx-nshc-1-grouping;
404         uses nxm-nx-nshc-2-grouping;
405         uses nxm-nx-nshc-3-grouping;
406         uses nxm-nx-nshc-4-grouping;
407         uses nxm-nx-encap-eth-type-grouping;
408         uses nxm-nx-encap-eth-src-grouping;
409         uses nxm-nx-encap-eth-dst-grouping;
410         uses nxm-nx-nsh-mdtype-grouping;
411         uses nxm-nx-nsh-np-grouping;
412         uses nxm-nx-tun-gpe-np-grouping;
413         uses nxm-of-tcp-src-grouping;
414         uses nxm-of-tcp-dst-grouping;
415         uses nxm-of-udp-src-grouping;
416         uses nxm-of-udp-dst-grouping;
417         uses nxm-nx-ct-state-grouping;
418         uses nxm-nx-ct-zone-grouping;
419         uses nxm-of-ip-dst-grouping;
420         uses nxm-of-ip-src-grouping;
421         uses nxm-of-icmp-type-grouping;
422     }
423
424     // MATCH augmentations
425     // RPCS
426     augment "/sal-flow:add-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
427         ext:augment-identifier "nx-aug-match-rpc-add-flow";
428         uses all-matches-grouping;
429     }
430     augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
431         ext:augment-identifier "nx-aug-match-rpc-remove-flow";
432         uses all-matches-grouping;
433     }
434     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
435         ext:augment-identifier "nx-aug-match-rpc-update-flow-original";
436         uses all-matches-grouping;
437     }
438     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
439         ext:augment-identifier "nx-aug-match-rpc-update-flow-updated";
440         uses all-matches-grouping;
441     }
442
443     // DATA
444     augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:match/ext-gen:extension-list/ext-gen:extension" {
445         ext:augment-identifier "nx-aug-match-nodes-node-table-flow";
446         uses all-matches-grouping;
447     }
448
449     // NOTIFICATIONS
450     augment "/sal-flow:switch-flow-removed/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
451         ext:augment-identifier "nx-aug-match-notif-switch-flow-removed";
452         uses all-matches-grouping;
453     }
454     augment "/sal-packet:packet-received/sal-packet:match/ext-gen:extension-list/ext-gen:extension" {
455         ext:augment-identifier "nx-aug-match-notif-packet-in";
456         uses all-matches-grouping;
457     }
458     augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:match/ext-gen:extension-list/ext-gen:extension" {
459         ext:augment-identifier "nx-aug-match-notif-update-flow-stats";
460         uses all-matches-grouping;
461     }
462
463 }