BUG-4132 add ip src,dst and icmp type match attrs
[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 "2010-09-24";}
10     import yang-ext {prefix ext; revision-date "2013-07-09";}
11     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
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
127     grouping ofj-nxm-nx-match-reg-grouping {
128         container reg-values {
129             leaf value {
130                 type uint32;
131             }
132         }
133     }
134     grouping ofj-nxm-nx-match-tun-id-grouping {
135         container tun-id-values {
136             leaf value {
137                 type uint64;
138             }
139         }
140     }
141     grouping ofj-nxm-nx-match-arp-sha-grouping {
142         container arp-sha-values {
143             leaf mac-address {
144                 type yang:mac-address;
145             }
146         }
147     }
148     grouping ofj-nxm-nx-match-arp-tha-grouping {
149         container arp-tha-values {
150             leaf mac-address {
151                 type yang:mac-address;
152             }
153         }
154     }
155     grouping ofj-nxm-of-match-arp-op-grouping {
156         container arp-op-values {
157             leaf value {
158                 type uint16;
159             }
160         }
161     }
162     grouping ofj-nxm-of-match-arp-spa-grouping {
163         container arp-spa-values {
164             leaf value {
165                 type uint32;
166             }
167         }
168     }
169     grouping ofj-nxm-of-match-arp-tpa-grouping {
170         container arp-tpa-values {
171             leaf value {
172                 type uint32;
173             }
174         }
175     }
176     grouping ofj-nxm-nx-match-tun-ipv4-dst-grouping {
177         container tun-ipv4-dst-values {
178             leaf value {
179                 type uint32;
180             }
181         }
182     }
183     grouping ofj-nxm-nx-match-tun-ipv4-src-grouping {
184         container tun-ipv4-src-values {
185             leaf value {
186                 type uint32;
187             }
188         }
189     }
190     grouping ofj-nxm-of-match-eth-src-grouping {
191         container eth-src-values {
192             leaf mac-address {
193                 type yang:mac-address;
194             }
195         }
196     }
197     grouping ofj-nxm-of-match-eth-dst-grouping {
198         container eth-dst-values {
199             leaf mac-address {
200                 type yang:mac-address;
201             }
202         }
203     }
204     grouping ofj-nxm-of-match-eth-type-grouping {
205         container eth-type-values {
206             leaf value {
207                 type uint16;
208             }
209         }
210     }
211
212     grouping ofj-nxm-nx-match-nsp-grouping {
213         container nsp-values {
214             leaf nsp {
215                 type uint32;
216             }
217         }
218     }
219
220     grouping ofj-nxm-nx-match-nsi-grouping {
221         container nsi-values {
222             leaf nsi {
223                 type uint8;
224             }
225         }
226     }
227
228     grouping ofj-nxm-nx-match-nshc-grouping {
229         leaf nshc {
230             type uint32;
231         }
232     }
233
234     grouping ofj-nxm-nx-match-nshc-1-grouping {
235         container nshc-1-values {
236             uses ofj-nxm-nx-match-nshc-grouping;
237         }
238     }
239     grouping ofj-nxm-nx-match-nshc-2-grouping {
240         container nshc-2-values {
241             uses ofj-nxm-nx-match-nshc-grouping;
242         }
243     }
244     grouping ofj-nxm-nx-match-nshc-3-grouping {
245         container nshc-3-values {
246             uses ofj-nxm-nx-match-nshc-grouping;
247         }
248     }
249     grouping ofj-nxm-nx-match-nshc-4-grouping {
250         container nshc-4-values {
251             uses ofj-nxm-nx-match-nshc-grouping;
252         }
253     }
254     grouping ofj-nxm-of-match-tcp-src-grouping {
255         container tcp-src-values {
256             leaf port {
257                type inet:port-number;
258             }
259             leaf mask {
260                type uint16;
261             }
262         }
263     }
264     grouping ofj-nxm-of-match-tcp-dst-grouping {
265         container tcp-dst-values {
266             leaf port {
267                type inet:port-number;
268             }
269             leaf mask {
270                type uint16;
271             }
272         }
273     }
274      grouping ofj-nxm-of-match-udp-src-grouping {
275         container udp-src-values {
276             leaf port {
277                type inet:port-number;
278             }
279             leaf mask {
280                type uint16;
281             }
282         }
283     }
284     grouping ofj-nxm-of-match-udp-dst-grouping {
285         container udp-dst-values {
286             leaf port {
287                type inet:port-number;
288             }
289             leaf mask {
290                type uint16;
291             }
292         }
293     }
294     grouping ofj-nxm-nx-match-ct-state-grouping{
295          container ct-state-values {
296             leaf ct-state {
297                type uint32;
298             }
299              leaf mask {
300                type uint32;
301             }
302         }
303     }
304     grouping ofj-nxm-nx-match-ct-zone-grouping{
305          container ct-zone-values {
306             leaf ct-zone {
307                type uint16;
308             }
309         }
310     }
311     grouping ofj-nxm-of-match-ip-dst-grouping {
312         container ip-dst-values {
313             leaf value {
314                 type uint32;
315             }
316         }
317     }
318     grouping ofj-nxm-of-match-ip-src-grouping {
319         container ip-src-values {
320             leaf value {
321                 type uint32;
322             }
323         }
324     }
325     grouping ofj-nxm-of-match-icmp-type-grouping {
326         container icmp-type-values {
327             leaf value {
328                 type uint8;
329             }
330         }
331     }
332
333     augment "/ofoxm:oxm-container/ofoxm:match-entry-value" {
334         ext:augment-identifier "ofj-aug-nx-match";
335         case reg-case-value {
336             uses ofj-nxm-nx-match-reg-grouping;
337         }
338         case tun-id-case-value {
339             uses ofj-nxm-nx-match-tun-id-grouping;
340         }
341         case arp-sha-case-value {
342             uses ofj-nxm-nx-match-arp-sha-grouping;
343         }
344         case arp-tha-case-value {
345             uses ofj-nxm-nx-match-arp-tha-grouping;
346         }
347         case arp-op-case-value {
348             uses ofj-nxm-of-match-arp-op-grouping;
349         }
350         case arp-spa-case-value {
351             uses ofj-nxm-of-match-arp-spa-grouping;
352         }
353         case arp-tpa-case-value {
354             uses ofj-nxm-of-match-arp-tpa-grouping;
355         }
356         case tun-ipv4-dst-case-value {
357             uses ofj-nxm-nx-match-tun-ipv4-dst-grouping;
358         }
359         case tun-ipv4-src-case-value {
360             uses ofj-nxm-nx-match-tun-ipv4-src-grouping;
361         }
362         case eth-src-case-value {
363             uses ofj-nxm-of-match-eth-src-grouping;
364         }
365         case eth-dst-case-value {
366             uses ofj-nxm-of-match-eth-dst-grouping;
367         }
368
369         case eth-type-case-value {
370             uses ofj-nxm-of-match-eth-type-grouping;
371         }
372         case nsp-case-value {
373             uses ofj-nxm-nx-match-nsp-grouping;
374         }
375         case nsi-case-value {
376             uses ofj-nxm-nx-match-nsi-grouping;
377         }
378         case nshc-1-case-value {
379             uses ofj-nxm-nx-match-nshc-1-grouping;
380         }
381         case nshc-2-case-value {
382             uses ofj-nxm-nx-match-nshc-2-grouping;
383         }
384         case nshc-3-case-value {
385             uses ofj-nxm-nx-match-nshc-3-grouping;
386         }
387         case nshc-4-case-value {
388             uses ofj-nxm-nx-match-nshc-4-grouping;
389         }
390         case tcp-src-case-value {
391             uses ofj-nxm-of-match-tcp-src-grouping;
392         }
393         case tcp-dst-case-value {
394             uses ofj-nxm-of-match-tcp-dst-grouping;
395         }
396         case udp-src-case-value {
397             uses ofj-nxm-of-match-udp-src-grouping;
398         }
399         case udp-dst-case-value {
400             uses ofj-nxm-of-match-udp-dst-grouping;
401         }
402         case ct-state-case-value {
403             uses ofj-nxm-nx-match-ct-state-grouping;
404         }
405         case ct-zone-case-value {
406             uses ofj-nxm-nx-match-ct-zone-grouping;
407         }
408         case ip-dst-case-value {
409             uses ofj-nxm-of-match-ip-dst-grouping;
410         }
411         case ip-src-case-value {
412             uses ofj-nxm-of-match-ip-src-grouping;
413         }
414         case icmp-type-case-value {
415             uses ofj-nxm-of-match-icmp-type-grouping;
416         }
417
418     }
419
420 }