cd4c5890eaa905c3d0cc3b651db061f3c1151453
[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-state-key {
117         base ext-gen:extension-key;
118     }
119     identity nxm-nx-ct-zone-key {
120         base ext-gen:extension-key;
121     }
122     identity nxm-of-ip-dst-key {
123         base ext-gen:extension-key;
124     }
125     identity nxm-of-ip-src-key {
126         base ext-gen:extension-key;
127     }
128     identity nxm-of-icmp-type-key {
129         base ext-gen:extension-key;
130     }
131     identity nxm-nx-encap-eth-type-key {
132         base ext-gen:extension-key;
133     }
134     identity nxm-nx-encap-eth-src-key {
135         base ext-gen:extension-key;
136     }
137     identity nxm-nx-encap-eth-dst-key {
138         base ext-gen:extension-key;
139     }
140     identity nxm-nx-nsh-mdtype-key {
141         base ext-gen:extension-key;
142     }
143     identity nxm-nx-nsh-np-key {
144         base ext-gen:extension-key;
145     }
146     identity nxm-nx-tun-gpe-np-key {
147         base ext-gen:extension-key;
148     }
149     grouping ipv4-address-grouping {
150         leaf ipv4-address {
151             type inet:ipv4-address;
152         }
153     }
154     grouping mac-address-grouping {
155         leaf mac-address {
156             type yang:mac-address;
157         }
158     }
159
160     grouping nxm-nx-reg-grouping {
161         container nxm-nx-reg {
162             leaf reg {
163                 type identityref {
164                     base nicira-match:nxm-nx-reg;
165                 }
166             }
167             leaf value {
168                 type uint32;
169             }
170         }
171     }
172     grouping nxm-nx-tun-id-grouping {
173         container nxm-nx-tun-id {
174             leaf value {
175                 type uint64;
176             }
177         }
178     }
179     grouping nxm-nx-arp-sha-grouping {
180         container nxm-nx-arp-sha {
181             uses mac-address-grouping;
182         }
183     }
184     grouping nxm-nx-arp-tha-grouping {
185         container nxm-nx-arp-tha {
186             uses mac-address-grouping;
187         }
188     }
189     grouping nxm-of-arp-op-grouping {
190         container nxm-of-arp-op {
191             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
192             leaf value {
193                 type uint16;
194             }
195         }
196     }
197     grouping nxm-of-arp-spa-grouping {
198         container nxm-of-arp-spa {
199             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
200             uses ipv4-address-grouping;
201         }
202     }
203     grouping nxm-of-in-port-grouping {
204         container of-in-port {
205             leaf value {
206                 type uint16;
207             }
208         }
209     }
210     grouping nxm-of-tcp-src-grouping {
211         container nxm-of-tcp-src {
212             leaf port {
213                type inet:port-number;
214             }
215             leaf mask {
216                type uint16;
217             }
218         }
219     }
220     grouping nxm-of-tcp-dst-grouping {
221         container nxm-of-tcp-dst {
222             leaf port {
223                 type inet:port-number;
224             }
225             leaf mask {
226                type uint16;
227             }
228         }
229     }
230     grouping nxm-of-udp-src-grouping {
231         container nxm-of-udp-src {
232             leaf port {
233                type inet:port-number;
234             }
235             leaf mask {
236                type uint16;
237             }
238         }
239     }
240     grouping nxm-of-udp-dst-grouping {
241         container nxm-of-udp-dst {
242             leaf port {
243                         type inet:port-number;
244             }
245             leaf mask {
246                type uint16;
247             }
248         }
249     }
250     grouping nxm-of-arp-tpa-grouping {
251         container nxm-of-arp-tpa {
252             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
253             uses ipv4-address-grouping;
254         }
255     }
256     grouping nxm-nx-tun-ipv4-dst-grouping {
257         container nxm-nx-tun-ipv4-dst {
258             uses ipv4-address-grouping;
259         }
260     }
261     grouping nxm-nx-tun-ipv4-src-grouping {
262         container nxm-nx-tun-ipv4-src {
263             uses ipv4-address-grouping;
264         }
265     }
266     grouping nxm-of-eth-src-grouping {
267         container nxm-of-eth-src {
268             uses mac-address-grouping;
269         }
270     }
271     grouping nxm-of-eth-dst-grouping {
272         container nxm-of-eth-dst {
273             uses mac-address-grouping;
274         }
275     }
276     grouping nxm-of-eth-type-grouping {
277         container nxm-of-eth-type {
278             leaf value {
279                 type uint16;
280             }
281         }
282     }
283     grouping nxm-nx-nsp-grouping {
284         container nxm-nx-nsp {
285             leaf value {
286                 type uint32;
287             }
288         }
289     }
290     grouping nxm-nx-nsi-grouping {
291         container nxm-nx-nsi {
292             leaf nsi {
293                 type uint8;
294             }
295         }
296     }
297     grouping nxm-nx-nshc-1-grouping {
298         container nxm-nx-nshc-1 {
299             leaf value {
300                 type uint32;
301             }
302         }
303     }
304     grouping nxm-nx-nshc-2-grouping {
305         container nxm-nx-nshc-2 {
306             leaf value {
307                 type uint32;
308             }
309         }
310     }
311     grouping nxm-nx-nshc-3-grouping {
312         container nxm-nx-nshc-3 {
313             leaf value {
314                 type uint32;
315             }
316         }
317     }
318     grouping nxm-nx-nshc-4-grouping {
319         container nxm-nx-nshc-4 {
320             leaf value {
321                 type uint32;
322             }
323         }
324     }
325     grouping nxm-nx-ct-state-grouping {
326          container nxm-nx-ct-state {
327             leaf ct-state {
328                type uint32;
329             }
330              leaf mask {
331                type uint32;
332             }
333         }
334     }
335     grouping nxm-nx-ct-zone-grouping {
336          container nxm-nx-ct-zone {
337             leaf ct-zone {
338                type uint16;
339             }
340         }
341     }
342     grouping nxm-of-ip-dst-grouping {
343         container nxm-of-ip-dst {
344             uses ipv4-address-grouping;
345         }
346     }
347     grouping nxm-of-ip-src-grouping {
348         container nxm-of-ip-src {
349             uses ipv4-address-grouping;
350         }
351     }
352     grouping nxm-of-icmp-type-grouping {
353         container nxm-of-icmp-type {
354             leaf value {
355                 type uint8;
356             }
357         }
358     }
359     grouping nxm-nx-encap-eth-type-grouping {
360         container nxm-nx-encap-eth-type {
361             leaf value {
362                 type uint16;
363             }
364         }
365     }
366     grouping nxm-nx-encap-eth-src-grouping {
367         container nxm-nx-encap-eth-src {
368             uses mac-address-grouping;
369         }
370     }
371     grouping nxm-nx-encap-eth-dst-grouping {
372         container nxm-nx-encap-eth-dst {
373             uses mac-address-grouping;
374         }
375     }
376     grouping nxm-nx-nsh-mdtype-grouping {
377         container nxm-nx-nsh-mdtype {
378             leaf value {
379                 type uint8;
380             }
381         }
382     }
383     grouping nxm-nx-nsh-np-grouping {
384         container nxm-nx-nsh-np {
385             leaf value {
386                 type uint8;
387             }
388         }
389     }
390     grouping nxm-nx-tun-gpe-np-grouping {
391         container nxm-nx-tun-gpe-np {
392             leaf value {
393                 type uint8;
394             }
395         }
396     }
397
398
399     grouping all-matches-grouping {
400         uses nxm-nx-reg-grouping;
401         uses nxm-nx-tun-id-grouping;
402         uses nxm-nx-arp-sha-grouping;
403         uses nxm-nx-arp-tha-grouping;
404         uses nxm-of-arp-op-grouping;
405         uses nxm-of-arp-spa-grouping;
406         uses nxm-of-arp-tpa-grouping;
407         uses nxm-of-in-port-grouping;
408         uses nxm-nx-tun-ipv4-dst-grouping;
409         uses nxm-nx-tun-ipv4-src-grouping;
410         uses nxm-of-eth-src-grouping;
411         uses nxm-of-eth-dst-grouping;
412         uses nxm-of-eth-type-grouping;
413         uses nxm-nx-nsp-grouping;
414         uses nxm-nx-nsi-grouping;
415         uses nxm-nx-nshc-1-grouping;
416         uses nxm-nx-nshc-2-grouping;
417         uses nxm-nx-nshc-3-grouping;
418         uses nxm-nx-nshc-4-grouping;
419         uses nxm-nx-encap-eth-type-grouping;
420         uses nxm-nx-encap-eth-src-grouping;
421         uses nxm-nx-encap-eth-dst-grouping;
422         uses nxm-nx-nsh-mdtype-grouping;
423         uses nxm-nx-nsh-np-grouping;
424         uses nxm-nx-tun-gpe-np-grouping;
425         uses nxm-of-tcp-src-grouping;
426         uses nxm-of-tcp-dst-grouping;
427         uses nxm-of-udp-src-grouping;
428         uses nxm-of-udp-dst-grouping;
429         uses nxm-nx-ct-state-grouping;
430         uses nxm-nx-ct-zone-grouping;
431         uses nxm-of-ip-dst-grouping;
432         uses nxm-of-ip-src-grouping;
433         uses nxm-of-icmp-type-grouping;
434     }
435
436     // MATCH augmentations
437     // RPCS
438     augment "/sal-flow:add-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
439         ext:augment-identifier "nx-aug-match-rpc-add-flow";
440         uses all-matches-grouping;
441     }
442     augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
443         ext:augment-identifier "nx-aug-match-rpc-remove-flow";
444         uses all-matches-grouping;
445     }
446     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
447         ext:augment-identifier "nx-aug-match-rpc-update-flow-original";
448         uses all-matches-grouping;
449     }
450     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
451         ext:augment-identifier "nx-aug-match-rpc-update-flow-updated";
452         uses all-matches-grouping;
453     }
454
455     // DATA
456     augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:match/ext-gen:extension-list/ext-gen:extension" {
457         ext:augment-identifier "nx-aug-match-nodes-node-table-flow";
458         uses all-matches-grouping;
459     }
460
461     // NOTIFICATIONS
462     augment "/sal-flow:switch-flow-removed/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
463         ext:augment-identifier "nx-aug-match-notif-switch-flow-removed";
464         uses all-matches-grouping;
465     }
466     augment "/sal-packet:packet-received/sal-packet:match/ext-gen:extension-list/ext-gen:extension" {
467         ext:augment-identifier "nx-aug-match-notif-packet-in";
468         uses all-matches-grouping;
469     }
470     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" {
471         ext:augment-identifier "nx-aug-match-notif-update-flow-stats";
472         uses all-matches-grouping;
473     }
474     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" {
475         ext:augment-identifier "nx-aug-match-rpc-get-flow-stats";
476         uses all-matches-grouping;
477     }
478
479 }