4ea7dd700709ec7a44cda15b0a0706d5f6d244ef
[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
148
149     grouping ofj-nxm-nx-match-reg-grouping {
150         container reg-values {
151             leaf value {
152                 type uint32;
153             }
154         }
155     }
156     grouping ofj-nxm-nx-match-tun-id-grouping {
157         container tun-id-values {
158             leaf value {
159                 type uint64;
160             }
161         }
162     }
163     grouping ofj-nxm-nx-match-arp-sha-grouping {
164         container arp-sha-values {
165             leaf mac-address {
166                 type yang:mac-address;
167             }
168         }
169     }
170     grouping ofj-nxm-nx-match-arp-tha-grouping {
171         container arp-tha-values {
172             leaf mac-address {
173                 type yang:mac-address;
174             }
175         }
176     }
177     grouping ofj-nxm-of-match-arp-op-grouping {
178         container arp-op-values {
179             leaf value {
180                 type uint16;
181             }
182         }
183     }
184     grouping ofj-nxm-of-match-arp-spa-grouping {
185         container arp-spa-values {
186             leaf value {
187                 type uint32;
188             }
189         }
190     }
191     grouping ofj-nxm-of-match-arp-tpa-grouping {
192         container arp-tpa-values {
193             leaf value {
194                 type uint32;
195             }
196         }
197     }
198     grouping ofj-nxm-of-in-port-type-grouping {
199         container nxm-of-in-port-values {
200             leaf value {
201                 type uint16;
202             }
203         }
204     }
205     grouping ofj-nxm-nx-match-tun-ipv4-dst-grouping {
206         container tun-ipv4-dst-values {
207             leaf value {
208                 type uint32;
209             }
210         }
211     }
212     grouping ofj-nxm-nx-match-tun-ipv4-src-grouping {
213         container tun-ipv4-src-values {
214             leaf value {
215                 type uint32;
216             }
217         }
218     }
219     grouping ofj-nxm-of-match-eth-src-grouping {
220         container eth-src-values {
221             leaf mac-address {
222                 type yang:mac-address;
223             }
224         }
225     }
226     grouping ofj-nxm-of-match-eth-dst-grouping {
227         container eth-dst-values {
228             leaf mac-address {
229                 type yang:mac-address;
230             }
231         }
232     }
233     grouping ofj-nxm-of-match-eth-type-grouping {
234         container eth-type-values {
235             leaf value {
236                 type uint16;
237             }
238         }
239     }
240
241     grouping ofj-nxm-nx-match-nsp-grouping {
242         container nsp-values {
243             leaf nsp {
244                 type uint32;
245             }
246         }
247     }
248
249     grouping ofj-nxm-nx-match-nsi-grouping {
250         container nsi-values {
251             leaf nsi {
252                 type uint8;
253             }
254         }
255     }
256
257     grouping ofj-nxm-nx-match-nshc-grouping {
258         leaf nshc {
259             type uint32;
260         }
261     }
262
263     grouping ofj-nxm-nx-match-nshc-1-grouping {
264         container nshc-1-values {
265             uses ofj-nxm-nx-match-nshc-grouping;
266         }
267     }
268     grouping ofj-nxm-nx-match-nshc-2-grouping {
269         container nshc-2-values {
270             uses ofj-nxm-nx-match-nshc-grouping;
271         }
272     }
273     grouping ofj-nxm-nx-match-nshc-3-grouping {
274         container nshc-3-values {
275             uses ofj-nxm-nx-match-nshc-grouping;
276         }
277     }
278     grouping ofj-nxm-nx-match-nshc-4-grouping {
279         container nshc-4-values {
280             uses ofj-nxm-nx-match-nshc-grouping;
281         }
282     }
283     grouping ofj-nxm-of-match-tcp-src-grouping {
284         container tcp-src-values {
285             leaf port {
286                type inet:port-number;
287             }
288             leaf mask {
289                type uint16;
290             }
291         }
292     }
293     grouping ofj-nxm-of-match-tcp-dst-grouping {
294         container tcp-dst-values {
295             leaf port {
296                type inet:port-number;
297             }
298             leaf mask {
299                type uint16;
300             }
301         }
302     }
303      grouping ofj-nxm-of-match-udp-src-grouping {
304         container udp-src-values {
305             leaf port {
306                type inet:port-number;
307             }
308             leaf mask {
309                type uint16;
310             }
311         }
312     }
313     grouping ofj-nxm-of-match-udp-dst-grouping {
314         container udp-dst-values {
315             leaf port {
316                type inet:port-number;
317             }
318             leaf mask {
319                type uint16;
320             }
321         }
322     }
323     grouping ofj-nxm-nx-match-ct-state-grouping{
324          container ct-state-values {
325             leaf ct-state {
326                type uint32;
327             }
328              leaf mask {
329                type uint32;
330             }
331         }
332     }
333     grouping ofj-nxm-nx-match-ct-zone-grouping{
334          container ct-zone-values {
335             leaf ct-zone {
336                type uint16;
337             }
338         }
339     }
340     grouping ofj-nxm-of-match-ip-dst-grouping {
341         container ip-dst-values {
342             leaf value {
343                 type uint32;
344             }
345         }
346     }
347     grouping ofj-nxm-of-match-ip-src-grouping {
348         container ip-src-values {
349             leaf value {
350                 type uint32;
351             }
352         }
353     }
354     grouping ofj-nxm-of-match-icmp-type-grouping {
355         container icmp-type-values {
356             leaf value {
357                 type uint8;
358             }
359         }
360     }
361     grouping ofj-nxm-nx-match-encap-eth-type-grouping {
362         container encap-eth-type-values {
363             leaf encap-eth-type {
364                 type uint16;
365             }
366         }
367     }
368     grouping ofj-nxm-nx-match-encap-eth-src-grouping {
369         container encap-eth-src-values {
370             leaf mac-address {
371                 type yang:mac-address;
372             }
373         }
374     }
375     grouping ofj-nxm-nx-match-encap-eth-dst-grouping {
376         container encap-eth-dst-values {
377             leaf mac-address {
378                 type yang:mac-address;
379             }
380         }
381     }
382     grouping ofj-nxm-nx-match-nsh-mdtype-grouping {
383         container nsh-mdtype-values {
384             leaf value {
385                 type uint8;
386             }
387         }
388     }
389     grouping ofj-nxm-nx-match-nsh-np-grouping {
390         container nsh-np-values {
391             leaf value {
392                 type uint8;
393             }
394         }
395     }
396     grouping ofj-nxm-nx-match-tun-gpe-np-grouping {
397         container tun-gpe-np-values {
398             leaf value {
399                 type uint8;
400             }
401         }
402     }
403
404     augment "/ofoxm:oxm-container/ofoxm:match-entry-value" {
405         ext:augment-identifier "ofj-aug-nx-match";
406         case reg-case-value {
407             uses ofj-nxm-nx-match-reg-grouping;
408         }
409         case tun-id-case-value {
410             uses ofj-nxm-nx-match-tun-id-grouping;
411         }
412         case arp-sha-case-value {
413             uses ofj-nxm-nx-match-arp-sha-grouping;
414         }
415         case arp-tha-case-value {
416             uses ofj-nxm-nx-match-arp-tha-grouping;
417         }
418         case arp-op-case-value {
419             uses ofj-nxm-of-match-arp-op-grouping;
420         }
421         case arp-spa-case-value {
422             uses ofj-nxm-of-match-arp-spa-grouping;
423         }
424         case arp-tpa-case-value {
425             uses ofj-nxm-of-match-arp-tpa-grouping;
426         }
427         case of-in-port-case-value {
428             uses ofj-nxm-of-in-port-type-grouping;
429         }
430         case tun-ipv4-dst-case-value {
431             uses ofj-nxm-nx-match-tun-ipv4-dst-grouping;
432         }
433         case tun-ipv4-src-case-value {
434             uses ofj-nxm-nx-match-tun-ipv4-src-grouping;
435         }
436         case eth-src-case-value {
437             uses ofj-nxm-of-match-eth-src-grouping;
438         }
439         case eth-dst-case-value {
440             uses ofj-nxm-of-match-eth-dst-grouping;
441         }
442         case encap-eth-type-case-value {
443             uses ofj-nxm-nx-match-encap-eth-type-grouping;
444         }
445         case encap-eth-src-case-value {
446             uses ofj-nxm-nx-match-encap-eth-src-grouping;
447         }
448         case encap-eth-dst-case-value {
449             uses ofj-nxm-nx-match-encap-eth-dst-grouping;
450         }
451         case nsh-mdtype-case-value {
452             uses ofj-nxm-nx-match-nsh-mdtype-grouping;
453         }
454         case nsh-np-case-value {
455             uses ofj-nxm-nx-match-nsh-np-grouping;
456         }
457         case tun-gpe-np-case-value {
458             uses ofj-nxm-nx-match-tun-gpe-np-grouping;
459         }
460
461         case eth-type-case-value {
462             uses ofj-nxm-of-match-eth-type-grouping;
463         }
464         case nsp-case-value {
465             uses ofj-nxm-nx-match-nsp-grouping;
466         }
467         case nsi-case-value {
468             uses ofj-nxm-nx-match-nsi-grouping;
469         }
470         case nshc-1-case-value {
471             uses ofj-nxm-nx-match-nshc-1-grouping;
472         }
473         case nshc-2-case-value {
474             uses ofj-nxm-nx-match-nshc-2-grouping;
475         }
476         case nshc-3-case-value {
477             uses ofj-nxm-nx-match-nshc-3-grouping;
478         }
479         case nshc-4-case-value {
480             uses ofj-nxm-nx-match-nshc-4-grouping;
481         }
482         case tcp-src-case-value {
483             uses ofj-nxm-of-match-tcp-src-grouping;
484         }
485         case tcp-dst-case-value {
486             uses ofj-nxm-of-match-tcp-dst-grouping;
487         }
488         case udp-src-case-value {
489             uses ofj-nxm-of-match-udp-src-grouping;
490         }
491         case udp-dst-case-value {
492             uses ofj-nxm-of-match-udp-dst-grouping;
493         }
494         case ct-state-case-value {
495             uses ofj-nxm-nx-match-ct-state-grouping;
496         }
497         case ct-zone-case-value {
498             uses ofj-nxm-nx-match-ct-zone-grouping;
499         }
500         case ip-dst-case-value {
501             uses ofj-nxm-of-match-ip-dst-grouping;
502         }
503         case ip-src-case-value {
504             uses ofj-nxm-of-match-ip-src-grouping;
505         }
506         case icmp-type-case-value {
507             uses ofj-nxm-of-match-icmp-type-grouping;
508         }
509
510     }
511
512 }