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