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