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