98bea96d979471aa4f03f75a03167d83d33a86a1
[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-nx-tun-ipv4-dst {
67         base ofoxm:match-field;
68     }
69     identity nxm-nx-tun-ipv4-src {
70         base ofoxm:match-field;
71     }
72     identity nxm-of-eth-src {
73         base ofoxm:match-field;
74     }
75     identity nxm-of-eth-dst {
76         base ofoxm:match-field;
77     }
78     identity nxm-of-eth-type {
79         base ofoxm:match-field;
80     }
81     identity nxm-nx-nsp {
82         base ofoxm:match-field;
83     }
84     identity nxm-nx-nsi {
85         base ofoxm:match-field;
86     }
87     identity nxm-nx-nshc-1 {
88         base ofoxm:match-field;
89     }
90     identity nxm-nx-nshc-2 {
91         base ofoxm:match-field;
92     }
93     identity nxm-nx-nshc-3 {
94         base ofoxm:match-field;
95     }
96     identity nxm-nx-nshc-4 {
97         base ofoxm:match-field;
98     }
99     identity nxm-of-tcp-src {
100         base ofoxm:match-field;
101     }
102     identity nxm-of-tcp-dst {
103         base ofoxm:match-field;
104     }
105     identity nxm-of-udp-src {
106         base ofoxm:match-field;
107     }
108     identity nxm-of-udp-dst {
109         base ofoxm:match-field;
110     }
111     identity nxm-nx-ct-state {
112         base ofoxm:match-field;
113     }
114     identity nxm-nx-ct-zone {
115         base ofoxm:match-field;
116     }
117     identity nxm-of-ip-dst {
118         base ofoxm:match-field;
119     }
120     identity nxm-of-ip-src {
121         base ofoxm:match-field;
122     }
123     identity nxm-of-icmp-type {
124         base ofoxm:match-field;
125     }
126     identity nxm-nx-encap-eth-type {
127         base ofoxm:match-field;
128     }
129     identity nxm-nx-encap-eth-src {
130         base ofoxm:match-field;
131     }
132     identity nxm-nx-encap-eth-dst {
133         base ofoxm:match-field;
134     }
135     identity nxm-nx-nsh-mdtype {
136         base ofoxm:match-field;
137     }
138     identity nxm-nx-nsh-np {
139         base ofoxm:match-field;
140     }
141     identity nxm-nx-tun-gpe-np {
142         base ofoxm:match-field;
143     }
144
145
146     grouping ofj-nxm-nx-match-reg-grouping {
147         container reg-values {
148             leaf value {
149                 type uint32;
150             }
151         }
152     }
153     grouping ofj-nxm-nx-match-tun-id-grouping {
154         container tun-id-values {
155             leaf value {
156                 type uint64;
157             }
158         }
159     }
160     grouping ofj-nxm-nx-match-arp-sha-grouping {
161         container arp-sha-values {
162             leaf mac-address {
163                 type yang:mac-address;
164             }
165         }
166     }
167     grouping ofj-nxm-nx-match-arp-tha-grouping {
168         container arp-tha-values {
169             leaf mac-address {
170                 type yang:mac-address;
171             }
172         }
173     }
174     grouping ofj-nxm-of-match-arp-op-grouping {
175         container arp-op-values {
176             leaf value {
177                 type uint16;
178             }
179         }
180     }
181     grouping ofj-nxm-of-match-arp-spa-grouping {
182         container arp-spa-values {
183             leaf value {
184                 type uint32;
185             }
186         }
187     }
188     grouping ofj-nxm-of-match-arp-tpa-grouping {
189         container arp-tpa-values {
190             leaf value {
191                 type uint32;
192             }
193         }
194     }
195     grouping ofj-nxm-nx-match-tun-ipv4-dst-grouping {
196         container tun-ipv4-dst-values {
197             leaf value {
198                 type uint32;
199             }
200         }
201     }
202     grouping ofj-nxm-nx-match-tun-ipv4-src-grouping {
203         container tun-ipv4-src-values {
204             leaf value {
205                 type uint32;
206             }
207         }
208     }
209     grouping ofj-nxm-of-match-eth-src-grouping {
210         container eth-src-values {
211             leaf mac-address {
212                 type yang:mac-address;
213             }
214         }
215     }
216     grouping ofj-nxm-of-match-eth-dst-grouping {
217         container eth-dst-values {
218             leaf mac-address {
219                 type yang:mac-address;
220             }
221         }
222     }
223     grouping ofj-nxm-of-match-eth-type-grouping {
224         container eth-type-values {
225             leaf value {
226                 type uint16;
227             }
228         }
229     }
230
231     grouping ofj-nxm-nx-match-nsp-grouping {
232         container nsp-values {
233             leaf nsp {
234                 type uint32;
235             }
236         }
237     }
238
239     grouping ofj-nxm-nx-match-nsi-grouping {
240         container nsi-values {
241             leaf nsi {
242                 type uint8;
243             }
244         }
245     }
246
247     grouping ofj-nxm-nx-match-nshc-grouping {
248         leaf nshc {
249             type uint32;
250         }
251     }
252
253     grouping ofj-nxm-nx-match-nshc-1-grouping {
254         container nshc-1-values {
255             uses ofj-nxm-nx-match-nshc-grouping;
256         }
257     }
258     grouping ofj-nxm-nx-match-nshc-2-grouping {
259         container nshc-2-values {
260             uses ofj-nxm-nx-match-nshc-grouping;
261         }
262     }
263     grouping ofj-nxm-nx-match-nshc-3-grouping {
264         container nshc-3-values {
265             uses ofj-nxm-nx-match-nshc-grouping;
266         }
267     }
268     grouping ofj-nxm-nx-match-nshc-4-grouping {
269         container nshc-4-values {
270             uses ofj-nxm-nx-match-nshc-grouping;
271         }
272     }
273     grouping ofj-nxm-of-match-tcp-src-grouping {
274         container tcp-src-values {
275             leaf port {
276                type inet:port-number;
277             }
278             leaf mask {
279                type uint16;
280             }
281         }
282     }
283     grouping ofj-nxm-of-match-tcp-dst-grouping {
284         container tcp-dst-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-udp-src-grouping {
294         container udp-src-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-dst-grouping {
304         container udp-dst-values {
305             leaf port {
306                type inet:port-number;
307             }
308             leaf mask {
309                type uint16;
310             }
311         }
312     }
313     grouping ofj-nxm-nx-match-ct-state-grouping{
314          container ct-state-values {
315             leaf ct-state {
316                type uint32;
317             }
318              leaf mask {
319                type uint32;
320             }
321         }
322     }
323     grouping ofj-nxm-nx-match-ct-zone-grouping{
324          container ct-zone-values {
325             leaf ct-zone {
326                type uint16;
327             }
328         }
329     }
330     grouping ofj-nxm-of-match-ip-dst-grouping {
331         container ip-dst-values {
332             leaf value {
333                 type uint32;
334             }
335         }
336     }
337     grouping ofj-nxm-of-match-ip-src-grouping {
338         container ip-src-values {
339             leaf value {
340                 type uint32;
341             }
342         }
343     }
344     grouping ofj-nxm-of-match-icmp-type-grouping {
345         container icmp-type-values {
346             leaf value {
347                 type uint8;
348             }
349         }
350     }
351     grouping ofj-nxm-nx-match-encap-eth-type-grouping {
352         container encap-eth-type-values {
353             leaf encap-eth-type {
354                 type uint16;
355             }
356         }
357     }
358     grouping ofj-nxm-nx-match-encap-eth-src-grouping {
359         container encap-eth-src-values {
360             leaf mac-address {
361                 type yang:mac-address;
362             }
363         }
364     }
365     grouping ofj-nxm-nx-match-encap-eth-dst-grouping {
366         container encap-eth-dst-values {
367             leaf mac-address {
368                 type yang:mac-address;
369             }
370         }
371     }
372     grouping ofj-nxm-nx-match-nsh-mdtype-grouping {
373         container nsh-mdtype-values {
374             leaf value {
375                 type uint8;
376             }
377         }
378     }
379     grouping ofj-nxm-nx-match-nsh-np-grouping {
380         container nsh-np-values {
381             leaf value {
382                 type uint8;
383             }
384         }
385     }
386     grouping ofj-nxm-nx-match-tun-gpe-np-grouping {
387         container tun-gpe-np-values {
388             leaf value {
389                 type uint8;
390             }
391         }
392     }
393
394     augment "/ofoxm:oxm-container/ofoxm:match-entry-value" {
395         ext:augment-identifier "ofj-aug-nx-match";
396         case reg-case-value {
397             uses ofj-nxm-nx-match-reg-grouping;
398         }
399         case tun-id-case-value {
400             uses ofj-nxm-nx-match-tun-id-grouping;
401         }
402         case arp-sha-case-value {
403             uses ofj-nxm-nx-match-arp-sha-grouping;
404         }
405         case arp-tha-case-value {
406             uses ofj-nxm-nx-match-arp-tha-grouping;
407         }
408         case arp-op-case-value {
409             uses ofj-nxm-of-match-arp-op-grouping;
410         }
411         case arp-spa-case-value {
412             uses ofj-nxm-of-match-arp-spa-grouping;
413         }
414         case arp-tpa-case-value {
415             uses ofj-nxm-of-match-arp-tpa-grouping;
416         }
417         case tun-ipv4-dst-case-value {
418             uses ofj-nxm-nx-match-tun-ipv4-dst-grouping;
419         }
420         case tun-ipv4-src-case-value {
421             uses ofj-nxm-nx-match-tun-ipv4-src-grouping;
422         }
423         case eth-src-case-value {
424             uses ofj-nxm-of-match-eth-src-grouping;
425         }
426         case eth-dst-case-value {
427             uses ofj-nxm-of-match-eth-dst-grouping;
428         }
429         case encap-eth-type-case-value {
430             uses ofj-nxm-nx-match-encap-eth-type-grouping;
431         }
432         case encap-eth-src-case-value {
433             uses ofj-nxm-nx-match-encap-eth-src-grouping;
434         }
435         case encap-eth-dst-case-value {
436             uses ofj-nxm-nx-match-encap-eth-dst-grouping;
437         }
438         case nsh-mdtype-case-value {
439             uses ofj-nxm-nx-match-nsh-mdtype-grouping;
440         }
441         case nsh-np-case-value {
442             uses ofj-nxm-nx-match-nsh-np-grouping;
443         }
444         case tun-gpe-np-case-value {
445             uses ofj-nxm-nx-match-tun-gpe-np-grouping;
446         }
447
448         case eth-type-case-value {
449             uses ofj-nxm-of-match-eth-type-grouping;
450         }
451         case nsp-case-value {
452             uses ofj-nxm-nx-match-nsp-grouping;
453         }
454         case nsi-case-value {
455             uses ofj-nxm-nx-match-nsi-grouping;
456         }
457         case nshc-1-case-value {
458             uses ofj-nxm-nx-match-nshc-1-grouping;
459         }
460         case nshc-2-case-value {
461             uses ofj-nxm-nx-match-nshc-2-grouping;
462         }
463         case nshc-3-case-value {
464             uses ofj-nxm-nx-match-nshc-3-grouping;
465         }
466         case nshc-4-case-value {
467             uses ofj-nxm-nx-match-nshc-4-grouping;
468         }
469         case tcp-src-case-value {
470             uses ofj-nxm-of-match-tcp-src-grouping;
471         }
472         case tcp-dst-case-value {
473             uses ofj-nxm-of-match-tcp-dst-grouping;
474         }
475         case udp-src-case-value {
476             uses ofj-nxm-of-match-udp-src-grouping;
477         }
478         case udp-dst-case-value {
479             uses ofj-nxm-of-match-udp-dst-grouping;
480         }
481         case ct-state-case-value {
482             uses ofj-nxm-nx-match-ct-state-grouping;
483         }
484         case ct-zone-case-value {
485             uses ofj-nxm-nx-match-ct-zone-grouping;
486         }
487         case ip-dst-case-value {
488             uses ofj-nxm-of-match-ip-dst-grouping;
489         }
490         case ip-src-case-value {
491             uses ofj-nxm-of-match-ip-src-grouping;
492         }
493         case icmp-type-case-value {
494             uses ofj-nxm-of-match-icmp-type-grouping;
495         }
496
497     }
498
499 }