Add arbitrary mask for nxm-reg
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / yang / nicira-match.yang
1 module nicira-match {
2     yang-version 1;
3
4     namespace "urn:opendaylight:openflowjava:nx:match";
5     prefix "nicira-match";
6
7     import openflow-extensible-match {prefix ofoxm;}
8     import openflow-types {prefix oft;}
9     import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
10     import yang-ext {prefix ext; revision-date "2013-07-09";}
11     import ietf-inet-types {prefix inet; revision-date "2013-07-15";}
12
13     description
14         "Nicira openflow extensions of match.";
15
16     revision "2014-04-21" {
17         description "Initial revision";
18     }
19
20     identity nxm-nx-reg {
21         base ofoxm:match-field;
22     }
23
24     identity nxm-nx-reg0 {
25         base nxm-nx-reg;
26     }
27     identity nxm-nx-reg1 {
28         base nxm-nx-reg;
29     }
30     identity nxm-nx-reg2 {
31         base nxm-nx-reg;
32     }
33     identity nxm-nx-reg3 {
34         base nxm-nx-reg;
35     }
36     identity nxm-nx-reg4 {
37         base nxm-nx-reg;
38     }
39     identity nxm-nx-reg5 {
40         base nxm-nx-reg;
41     }
42     identity nxm-nx-reg6 {
43         base nxm-nx-reg;
44     }
45     identity nxm-nx-reg7 {
46         base nxm-nx-reg;
47     }
48     identity nxm-nx-tun-id {
49         base ofoxm:match-field;
50     }
51     identity nxm-nx-arp-sha {
52         base ofoxm:match-field;
53     }
54     identity nxm-nx-arp-tha {
55         base ofoxm:match-field;
56     }
57     identity nxm-of-arp-op {
58         base ofoxm:match-field;
59     }
60     identity nxm-of-arp-spa {
61         base ofoxm:match-field;
62     }
63     identity nxm-of-arp-tpa {
64         base ofoxm:match-field;
65     }
66     identity nxm-of-in-port {
67         base ofoxm:match-field;
68     }
69     identity nxm-nx-tun-ipv4-dst {
70         base ofoxm:match-field;
71     }
72     identity nxm-nx-tun-ipv4-src {
73         base ofoxm:match-field;
74     }
75     identity nxm-of-eth-src {
76         base ofoxm:match-field;
77     }
78     identity nxm-of-eth-dst {
79         base ofoxm:match-field;
80     }
81     identity nxm-of-eth-type {
82         base ofoxm:match-field;
83     }
84     identity nxm-nx-nsp {
85         base ofoxm:match-field;
86     }
87     identity nxm-nx-nsi {
88         base ofoxm:match-field;
89     }
90     identity nxm-nx-nshc-1 {
91         base ofoxm:match-field;
92     }
93     identity nxm-nx-nshc-2 {
94         base ofoxm:match-field;
95     }
96     identity nxm-nx-nshc-3 {
97         base ofoxm:match-field;
98     }
99     identity nxm-nx-nshc-4 {
100         base ofoxm:match-field;
101     }
102     identity nxm-of-tcp-src {
103         base ofoxm:match-field;
104     }
105     identity nxm-of-tcp-dst {
106         base ofoxm:match-field;
107     }
108     identity nxm-of-udp-src {
109         base ofoxm:match-field;
110     }
111     identity nxm-of-udp-dst {
112         base ofoxm:match-field;
113     }
114     identity nxm-nx-ct-state {
115         base ofoxm:match-field;
116     }
117     identity nxm-nx-ct-zone {
118         base ofoxm:match-field;
119     }
120     identity nxm-of-ip-dst {
121         base ofoxm:match-field;
122     }
123     identity nxm-of-ip-src {
124         base ofoxm:match-field;
125     }
126     identity nxm-of-icmp-type {
127         base ofoxm:match-field;
128     }
129     identity nxm-nx-encap-eth-type {
130         base ofoxm:match-field;
131     }
132     identity nxm-nx-encap-eth-src {
133         base ofoxm:match-field;
134     }
135     identity nxm-nx-encap-eth-dst {
136         base ofoxm:match-field;
137     }
138     identity nxm-nx-nsh-mdtype {
139         base ofoxm:match-field;
140     }
141     identity nxm-nx-nsh-np {
142         base ofoxm:match-field;
143     }
144     identity nxm-nx-tun-gpe-np {
145         base ofoxm:match-field;
146     }
147     identity nxm-of-mpls-label {
148         base ofoxm:match-field;
149     }
150
151     grouping ofj-nxm-nx-match-reg-grouping {
152         container reg-values {
153             leaf value {
154                 type uint32;
155             }
156             leaf mask {
157                 type uint32;
158             }
159         }
160     }
161
162     grouping ofj-oxm-of-mpls-label-grouping {
163         container mpls-label-values {
164              leaf mpls-label {
165                  type uint32;
166              }
167         }
168     }
169
170     grouping ofj-nxm-nx-match-tun-id-grouping {
171         container tun-id-values {
172             leaf value {
173                 type uint64;
174             }
175         }
176     }
177
178     grouping ofj-nxm-nx-match-arp-sha-grouping {
179         container arp-sha-values {
180             leaf mac-address {
181                 type yang:mac-address;
182             }
183         }
184     }
185
186     grouping ofj-nxm-nx-match-arp-tha-grouping {
187         container arp-tha-values {
188             leaf mac-address {
189                 type yang:mac-address;
190             }
191         }
192     }
193
194     grouping ofj-nxm-of-match-arp-op-grouping {
195         container arp-op-values {
196             leaf value {
197                 type uint16;
198             }
199         }
200     }
201
202     grouping ofj-nxm-of-match-arp-spa-grouping {
203         container arp-spa-values {
204             leaf value {
205                 type uint32;
206             }
207         }
208     }
209
210     grouping ofj-nxm-of-match-arp-tpa-grouping {
211         container arp-tpa-values {
212             leaf value {
213                 type uint32;
214             }
215         }
216     }
217
218     grouping ofj-nxm-of-in-port-type-grouping {
219         container nxm-of-in-port-values {
220             leaf value {
221                 type uint16;
222             }
223         }
224     }
225
226     grouping ofj-nxm-nx-match-tun-ipv4-dst-grouping {
227         container tun-ipv4-dst-values {
228             leaf value {
229                 type uint32;
230             }
231         }
232     }
233
234     grouping ofj-nxm-nx-match-tun-ipv4-src-grouping {
235         container tun-ipv4-src-values {
236             leaf value {
237                 type uint32;
238             }
239         }
240     }
241
242     grouping ofj-nxm-of-match-eth-src-grouping {
243         container eth-src-values {
244             leaf mac-address {
245                 type yang:mac-address;
246             }
247         }
248     }
249
250     grouping ofj-nxm-of-match-eth-dst-grouping {
251         container eth-dst-values {
252             leaf mac-address {
253                 type yang:mac-address;
254             }
255         }
256     }
257
258     grouping ofj-nxm-of-match-eth-type-grouping {
259         container eth-type-values {
260             leaf value {
261                 type uint16;
262             }
263         }
264     }
265
266     grouping ofj-nxm-nx-match-nsp-grouping {
267         container nsp-values {
268             leaf nsp {
269                 type uint32;
270             }
271         }
272     }
273
274     grouping ofj-nxm-nx-match-nsi-grouping {
275         container nsi-values {
276             leaf nsi {
277                 type uint8;
278             }
279         }
280     }
281
282     grouping ofj-nxm-nx-match-nshc-grouping {
283         leaf nshc {
284             type uint32;
285         }
286     }
287
288     grouping ofj-nxm-nx-match-nshc-1-grouping {
289         container nshc-1-values {
290             uses ofj-nxm-nx-match-nshc-grouping;
291         }
292     }
293
294     grouping ofj-nxm-nx-match-nshc-2-grouping {
295         container nshc-2-values {
296             uses ofj-nxm-nx-match-nshc-grouping;
297         }
298     }
299
300     grouping ofj-nxm-nx-match-nshc-3-grouping {
301         container nshc-3-values {
302             uses ofj-nxm-nx-match-nshc-grouping;
303         }
304     }
305
306     grouping ofj-nxm-nx-match-nshc-4-grouping {
307         container nshc-4-values {
308             uses ofj-nxm-nx-match-nshc-grouping;
309         }
310     }
311
312     grouping ofj-nxm-of-match-tcp-src-grouping {
313         container tcp-src-values {
314             leaf port {
315                type inet:port-number;
316             }
317             leaf mask {
318                type uint16;
319             }
320         }
321     }
322
323     grouping ofj-nxm-of-match-tcp-dst-grouping {
324         container tcp-dst-values {
325             leaf port {
326                type inet:port-number;
327             }
328             leaf mask {
329                type uint16;
330             }
331         }
332     }
333
334     grouping ofj-nxm-of-match-udp-src-grouping {
335         container udp-src-values {
336             leaf port {
337                type inet:port-number;
338             }
339             leaf mask {
340                type uint16;
341             }
342         }
343     }
344
345     grouping ofj-nxm-of-match-udp-dst-grouping {
346         container udp-dst-values {
347             leaf port {
348                type inet:port-number;
349             }
350             leaf mask {
351                type uint16;
352             }
353         }
354     }
355
356     grouping ofj-nxm-nx-match-ct-state-grouping{
357          container ct-state-values {
358             leaf ct-state {
359                type uint32;
360             }
361              leaf mask {
362                type uint32;
363             }
364         }
365     }
366
367     grouping ofj-nxm-nx-match-ct-zone-grouping{
368          container ct-zone-values {
369             leaf ct-zone {
370                type uint16;
371             }
372         }
373     }
374
375     grouping ofj-nxm-of-match-ip-dst-grouping {
376         container ip-dst-values {
377             leaf value {
378                 type uint32;
379             }
380         }
381     }
382
383     grouping ofj-nxm-of-match-ip-src-grouping {
384         container ip-src-values {
385             leaf value {
386                 type uint32;
387             }
388         }
389     }
390
391     grouping ofj-nxm-of-match-icmp-type-grouping {
392         container icmp-type-values {
393             leaf value {
394                 type uint8;
395             }
396         }
397     }
398
399     grouping ofj-nxm-nx-match-encap-eth-type-grouping {
400         container encap-eth-type-values {
401             leaf encap-eth-type {
402                 type uint16;
403             }
404         }
405     }
406
407     grouping ofj-nxm-nx-match-encap-eth-src-grouping {
408         container encap-eth-src-values {
409             leaf mac-address {
410                 type yang:mac-address;
411             }
412         }
413     }
414
415     grouping ofj-nxm-nx-match-encap-eth-dst-grouping {
416         container encap-eth-dst-values {
417             leaf mac-address {
418                 type yang:mac-address;
419             }
420         }
421     }
422
423     grouping ofj-nxm-nx-match-nsh-mdtype-grouping {
424         container nsh-mdtype-values {
425             leaf value {
426                 type uint8;
427             }
428         }
429     }
430
431     grouping ofj-nxm-nx-match-nsh-np-grouping {
432         container nsh-np-values {
433             leaf value {
434                 type uint8;
435             }
436         }
437     }
438
439     grouping ofj-nxm-nx-match-tun-gpe-np-grouping {
440         container tun-gpe-np-values {
441             leaf value {
442                 type uint8;
443             }
444         }
445     }
446
447     augment "/ofoxm:oxm-container/ofoxm:match-entry-value" {
448         ext:augment-identifier "ofj-aug-nx-match";
449         case reg-case-value {
450             uses ofj-nxm-nx-match-reg-grouping;
451         }
452         case tun-id-case-value {
453             uses ofj-nxm-nx-match-tun-id-grouping;
454         }
455         case arp-sha-case-value {
456             uses ofj-nxm-nx-match-arp-sha-grouping;
457         }
458         case arp-tha-case-value {
459             uses ofj-nxm-nx-match-arp-tha-grouping;
460         }
461         case arp-op-case-value {
462             uses ofj-nxm-of-match-arp-op-grouping;
463         }
464         case arp-spa-case-value {
465             uses ofj-nxm-of-match-arp-spa-grouping;
466         }
467         case arp-tpa-case-value {
468             uses ofj-nxm-of-match-arp-tpa-grouping;
469         }
470         case of-in-port-case-value {
471             uses ofj-nxm-of-in-port-type-grouping;
472         }
473         case tun-ipv4-dst-case-value {
474             uses ofj-nxm-nx-match-tun-ipv4-dst-grouping;
475         }
476         case tun-ipv4-src-case-value {
477             uses ofj-nxm-nx-match-tun-ipv4-src-grouping;
478         }
479         case eth-src-case-value {
480             uses ofj-nxm-of-match-eth-src-grouping;
481         }
482         case of-mpls-label-case-value {
483             uses ofj-oxm-of-mpls-label-grouping;
484         }
485         case eth-dst-case-value {
486             uses ofj-nxm-of-match-eth-dst-grouping;
487         }
488         case encap-eth-type-case-value {
489             uses ofj-nxm-nx-match-encap-eth-type-grouping;
490         }
491         case encap-eth-src-case-value {
492             uses ofj-nxm-nx-match-encap-eth-src-grouping;
493         }
494         case encap-eth-dst-case-value {
495             uses ofj-nxm-nx-match-encap-eth-dst-grouping;
496         }
497         case nsh-mdtype-case-value {
498             uses ofj-nxm-nx-match-nsh-mdtype-grouping;
499         }
500         case nsh-np-case-value {
501             uses ofj-nxm-nx-match-nsh-np-grouping;
502         }
503         case tun-gpe-np-case-value {
504             uses ofj-nxm-nx-match-tun-gpe-np-grouping;
505         }
506         case eth-type-case-value {
507             uses ofj-nxm-of-match-eth-type-grouping;
508         }
509         case nsp-case-value {
510             uses ofj-nxm-nx-match-nsp-grouping;
511         }
512         case nsi-case-value {
513             uses ofj-nxm-nx-match-nsi-grouping;
514         }
515         case nshc-1-case-value {
516             uses ofj-nxm-nx-match-nshc-1-grouping;
517         }
518         case nshc-2-case-value {
519             uses ofj-nxm-nx-match-nshc-2-grouping;
520         }
521         case nshc-3-case-value {
522             uses ofj-nxm-nx-match-nshc-3-grouping;
523         }
524         case nshc-4-case-value {
525             uses ofj-nxm-nx-match-nshc-4-grouping;
526         }
527         case tcp-src-case-value {
528             uses ofj-nxm-of-match-tcp-src-grouping;
529         }
530         case tcp-dst-case-value {
531             uses ofj-nxm-of-match-tcp-dst-grouping;
532         }
533         case udp-src-case-value {
534             uses ofj-nxm-of-match-udp-src-grouping;
535         }
536         case udp-dst-case-value {
537             uses ofj-nxm-of-match-udp-dst-grouping;
538         }
539         case ct-state-case-value {
540             uses ofj-nxm-nx-match-ct-state-grouping;
541         }
542         case ct-zone-case-value {
543             uses ofj-nxm-nx-match-ct-zone-grouping;
544         }
545         case ip-dst-case-value {
546             uses ofj-nxm-of-match-ip-dst-grouping;
547         }
548         case ip-src-case-value {
549             uses ofj-nxm-of-match-ip-src-grouping;
550         }
551         case icmp-type-case-value {
552             uses ofj-nxm-of-match-icmp-type-grouping;
553         }
554     }
555
556 }