Merge "Added Conntrack Support in Nicira Extenstion."
[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 "2010-09-24";}
16     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
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-nx-tun-ipv4-dst-key {
68         base ext-gen:extension-key;
69     }
70     identity nxm-nx-tun-ipv4-src-key {
71         base ext-gen:extension-key;
72     }
73     identity nxm-of-eth-src-key {
74         base ext-gen:extension-key;
75     }
76     identity nxm-of-eth-dst-key {
77         base ext-gen:extension-key;
78     }
79     identity nxm-of-eth-type-key {
80         base ext-gen:extension-key;
81     }
82     identity nxm-nx-nsp-key {
83         base ext-gen:extension-key;
84     }
85     identity nxm-nx-nsi-key {
86         base ext-gen:extension-key;
87     }
88     identity nxm-nx-nshc-1-key {
89         base ext-gen:extension-key;
90     }
91     identity nxm-nx-nshc-2-key {
92         base ext-gen:extension-key;
93     }
94     identity nxm-nx-nshc-3-key {
95         base ext-gen:extension-key;
96     }
97     identity nxm-nx-nshc-4-key {
98         base ext-gen:extension-key;
99     }
100     identity nxm-of-tcp-src-key {
101         base ext-gen:extension-key;
102     }
103     identity nxm-of-tcp-dst-key {
104         base ext-gen:extension-key;
105     }
106     identity nxm-of-udp-src-key {
107         base ext-gen:extension-key;
108     }
109     identity nxm-of-udp-dst-key {
110         base ext-gen:extension-key;
111     }
112     identity nxm-nx-ct-state-key {
113         base ext-gen:extension-key;
114     }
115     identity nxm-nx-ct-zone-key {
116         base ext-gen:extension-key;
117     }
118     grouping ipv4-address-grouping {
119         leaf ipv4-address {
120             type inet:ipv4-address;
121         }
122     }
123     grouping mac-address-grouping {
124         leaf mac-address {
125             type yang:mac-address;
126         }
127     }
128
129     grouping nxm-nx-reg-grouping {
130         container nxm-nx-reg {
131             leaf reg {
132                 type identityref {
133                     base nicira-match:nxm-nx-reg;
134                 }
135             }
136             leaf value {
137                 type uint32;
138             }
139         }
140     }
141     grouping nxm-nx-tun-id-grouping {
142         container nxm-nx-tun-id {
143             leaf value {
144                 type uint64;
145             }
146         }
147     }
148     grouping nxm-nx-arp-sha-grouping {
149         container nxm-nx-arp-sha {
150             uses mac-address-grouping;
151         }
152     }
153     grouping nxm-nx-arp-tha-grouping {
154         container nxm-nx-arp-tha {
155             uses mac-address-grouping;
156         }
157     }
158     grouping nxm-of-arp-op-grouping {
159         container nxm-of-arp-op {
160             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
161             leaf value {
162                 type uint16;
163             }
164         }
165     }
166     grouping nxm-of-arp-spa-grouping {
167         container nxm-of-arp-spa {
168             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
169             uses ipv4-address-grouping;
170         }
171     }
172     grouping nxm-of-tcp-src-grouping {
173         container nxm-of-tcp-src {
174             leaf port {
175                type inet:port-number;
176             }
177             leaf mask {
178                type uint16;
179             }
180         }
181     }
182     grouping nxm-of-tcp-dst-grouping {
183         container nxm-of-tcp-dst {
184             leaf port {
185                 type inet:port-number;
186             }
187             leaf mask {
188                type uint16;
189             }
190         }
191     }
192     grouping nxm-of-udp-src-grouping {
193         container nxm-of-udp-src {
194             leaf port {
195                type inet:port-number;
196             }
197             leaf mask {
198                type uint16;
199             }
200         }
201     }
202     grouping nxm-of-udp-dst-grouping {
203         container nxm-of-udp-dst {
204             leaf port {
205                         type inet:port-number;
206             }
207             leaf mask {
208                type uint16;
209             }
210         }
211     }
212     grouping nxm-of-arp-tpa-grouping {
213         container nxm-of-arp-tpa {
214             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
215             uses ipv4-address-grouping;
216         }
217     }
218     grouping nxm-nx-tun-ipv4-dst-grouping {
219         container nxm-nx-tun-ipv4-dst {
220             uses ipv4-address-grouping;
221         }
222     }
223     grouping nxm-nx-tun-ipv4-src-grouping {
224         container nxm-nx-tun-ipv4-src {
225             uses ipv4-address-grouping;
226         }
227     }
228     grouping nxm-of-eth-src-grouping {
229         container nxm-of-eth-src {
230             uses mac-address-grouping;
231         }
232     }
233     grouping nxm-of-eth-dst-grouping {
234         container nxm-of-eth-dst {
235             uses mac-address-grouping;
236         }
237     }
238     grouping nxm-of-eth-type-grouping {
239         container nxm-of-eth-type {
240             leaf value {
241                 type uint16;
242             }
243         }
244     }
245     grouping nxm-nx-nsp-grouping {
246         container nxm-nx-nsp {
247             leaf value {
248                 type uint32;
249             }
250         }
251     }
252     grouping nxm-nx-nsi-grouping {
253         container nxm-nx-nsi {
254             leaf nsi {
255                 type uint8;
256             }
257         }
258     }
259     grouping nxm-nx-nshc-1-grouping {
260         container nxm-nx-nshc-1 {
261             leaf value {
262                 type uint32;
263             }
264         }
265     }
266     grouping nxm-nx-nshc-2-grouping {
267         container nxm-nx-nshc-2 {
268             leaf value {
269                 type uint32;
270             }
271         }
272     }
273     grouping nxm-nx-nshc-3-grouping {
274         container nxm-nx-nshc-3 {
275             leaf value {
276                 type uint32;
277             }
278         }
279     }
280     grouping nxm-nx-nshc-4-grouping {
281         container nxm-nx-nshc-4 {
282             leaf value {
283                 type uint32;
284             }
285         }
286     }
287     grouping nxm-nx-ct-state-grouping {
288          container nxm-nx-ct-state {
289             leaf ct-state {
290                type uint32;
291             }
292              leaf mask {
293                type uint32;
294             }
295         }
296     }
297     grouping nxm-nx-ct-zone-grouping {
298          container nxm-nx-ct-zone {
299             leaf ct-zone {
300                type uint16;
301             }
302         }
303     }
304
305
306     grouping all-matches-grouping {
307         uses nxm-nx-reg-grouping;
308         uses nxm-nx-tun-id-grouping;
309         uses nxm-nx-arp-sha-grouping;
310         uses nxm-nx-arp-tha-grouping;
311         uses nxm-of-arp-op-grouping;
312         uses nxm-of-arp-spa-grouping;
313         uses nxm-of-arp-tpa-grouping;
314         uses nxm-nx-tun-ipv4-dst-grouping;
315         uses nxm-nx-tun-ipv4-src-grouping;
316         uses nxm-of-eth-src-grouping;
317         uses nxm-of-eth-dst-grouping;
318         uses nxm-of-eth-type-grouping;
319         uses nxm-nx-nsp-grouping;
320         uses nxm-nx-nsi-grouping;
321         uses nxm-nx-nshc-1-grouping;
322         uses nxm-nx-nshc-2-grouping;
323         uses nxm-nx-nshc-3-grouping;
324         uses nxm-nx-nshc-4-grouping;
325         uses nxm-of-tcp-src-grouping;
326         uses nxm-of-tcp-dst-grouping;
327         uses nxm-of-udp-src-grouping;
328         uses nxm-of-udp-dst-grouping;
329         uses nxm-nx-ct-state-grouping;
330         uses nxm-nx-ct-zone-grouping;
331     }
332
333     // MATCH augmentations
334     // RPCS
335     augment "/sal-flow:add-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
336         ext:augment-identifier "nx-aug-match-rpc-add-flow";
337         uses all-matches-grouping;
338     }
339     augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
340         ext:augment-identifier "nx-aug-match-rpc-remove-flow";
341         uses all-matches-grouping;
342     }
343     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
344         ext:augment-identifier "nx-aug-match-rpc-update-flow-original";
345         uses all-matches-grouping;
346     }
347     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
348         ext:augment-identifier "nx-aug-match-rpc-update-flow-updated";
349         uses all-matches-grouping;
350     }
351
352     // DATA
353     augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:match/ext-gen:extension-list/ext-gen:extension" {
354         ext:augment-identifier "nx-aug-match-nodes-node-table-flow";
355         uses all-matches-grouping;
356     }
357
358     // NOTIFICATIONS
359     augment "/sal-flow:switch-flow-removed/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
360         ext:augment-identifier "nx-aug-match-notif-switch-flow-removed";
361         uses all-matches-grouping;
362     }
363     augment "/sal-packet:packet-received/sal-packet:match/ext-gen:extension-list/ext-gen:extension" {
364         ext:augment-identifier "nx-aug-match-notif-packet-in";
365         uses all-matches-grouping;
366     }
367     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" {
368         ext:augment-identifier "nx-aug-match-notif-update-flow-stats";
369         uses all-matches-grouping;
370     }
371
372 }