a20da32c277239422ac491cec5c3c7407e4174c4
[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     grouping ipv4-address-grouping {
101         leaf ipv4-address {
102             type inet:ipv4-address;
103         }
104     }
105     grouping mac-address-grouping {
106         leaf mac-address {
107             type yang:mac-address;
108         }
109     }
110
111     grouping nxm-nx-reg-grouping {
112         container nxm-nx-reg {
113             leaf reg {
114                 type identityref {
115                     base nicira-match:nxm-nx-reg;
116                 }
117             }
118             leaf value {
119                 type uint32;
120             }
121         }
122     }
123     grouping nxm-nx-tun-id-grouping {
124         container nxm-nx-tun-id {
125             leaf value {
126                 type uint64;
127             }
128         }
129     }
130     grouping nxm-nx-arp-sha-grouping {
131         container nxm-nx-arp-sha {
132             uses mac-address-grouping;
133         }
134     }
135     grouping nxm-nx-arp-tha-grouping {
136         container nxm-nx-arp-tha {
137             uses mac-address-grouping;
138         }
139     }
140     grouping nxm-of-arp-op-grouping {
141         container nxm-of-arp-op {
142             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
143             leaf value {
144                 type uint16;
145             }
146         }
147     }
148     grouping nxm-of-arp-spa-grouping {
149         container nxm-of-arp-spa {
150             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
151             uses ipv4-address-grouping;
152         }
153     }
154     grouping nxm-of-arp-tpa-grouping {
155         container nxm-of-arp-tpa {
156             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
157             uses ipv4-address-grouping;
158         }
159     }
160     grouping nxm-nx-tun-ipv4-dst-grouping {
161         container nxm-nx-tun-ipv4-dst {
162             uses ipv4-address-grouping;
163         }
164     }
165     grouping nxm-nx-tun-ipv4-src-grouping {
166         container nxm-nx-tun-ipv4-src {
167             uses ipv4-address-grouping;
168         }
169     }
170     grouping nxm-of-eth-src-grouping {
171         container nxm-of-eth-src {
172             uses mac-address-grouping;
173         }
174     }
175     grouping nxm-of-eth-dst-grouping {
176         container nxm-of-eth-dst {
177             uses mac-address-grouping;
178         }
179     }
180     grouping nxm-of-eth-type-grouping {
181         container nxm-of-eth-type {
182             leaf value {
183                 type uint16;
184             }
185         }
186     }
187     grouping nxm-nx-nsp-grouping {
188         container nxm-nx-nsp {
189             leaf value {
190                 type uint32;
191             }
192         }
193     }
194     grouping nxm-nx-nsi-grouping {
195         container nxm-nx-nsi {
196             leaf nsi {
197                 type uint8;
198             }
199         }
200     }
201     grouping nxm-nx-nshc-1-grouping {
202         container nxm-nx-nshc-1 {
203             leaf value {
204                 type uint32;
205             }
206         }
207     }
208     grouping nxm-nx-nshc-2-grouping {
209         container nxm-nx-nshc-2 {
210             leaf value {
211                 type uint32;
212             }
213         }
214     }
215     grouping nxm-nx-nshc-3-grouping {
216         container nxm-nx-nshc-3 {
217             leaf value {
218                 type uint32;
219             }
220         }
221     }
222     grouping nxm-nx-nshc-4-grouping {
223         container nxm-nx-nshc-4 {
224             leaf value {
225                 type uint32;
226             }
227         }
228     }
229
230     
231     grouping all-matches-grouping {
232         uses nxm-nx-reg-grouping;
233         uses nxm-nx-tun-id-grouping;
234         uses nxm-nx-arp-sha-grouping;
235         uses nxm-nx-arp-tha-grouping;
236         uses nxm-of-arp-op-grouping;
237         uses nxm-of-arp-spa-grouping;
238         uses nxm-of-arp-tpa-grouping;
239         uses nxm-nx-tun-ipv4-dst-grouping;
240         uses nxm-nx-tun-ipv4-src-grouping;
241         uses nxm-of-eth-src-grouping;
242         uses nxm-of-eth-dst-grouping;
243         uses nxm-of-eth-type-grouping;
244         uses nxm-nx-nsp-grouping;
245         uses nxm-nx-nsi-grouping;
246         uses nxm-nx-nshc-1-grouping;
247         uses nxm-nx-nshc-2-grouping;
248         uses nxm-nx-nshc-3-grouping;
249         uses nxm-nx-nshc-4-grouping;
250     }
251     
252     // MATCH augmentations
253     // RPCS
254     augment "/sal-flow:add-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
255         ext:augment-identifier "nx-aug-match-rpc-add-flow";
256         uses all-matches-grouping;
257     }
258     augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
259         ext:augment-identifier "nx-aug-match-rpc-remove-flow";
260         uses all-matches-grouping;
261     }
262     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
263         ext:augment-identifier "nx-aug-match-rpc-update-flow-original";
264         uses all-matches-grouping;
265     }
266     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
267         ext:augment-identifier "nx-aug-match-rpc-update-flow-updated";
268         uses all-matches-grouping;
269     }
270     
271     // DATA
272     augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:match/ext-gen:extension-list/ext-gen:extension" {
273         ext:augment-identifier "nx-aug-match-nodes-node-table-flow";
274         uses all-matches-grouping;
275     }
276     
277     // NOTIFICATIONS
278     augment "/sal-flow:switch-flow-removed/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
279         ext:augment-identifier "nx-aug-match-notif-switch-flow-removed";
280         uses all-matches-grouping;
281     }
282     augment "/sal-packet:packet-received/sal-packet:match/ext-gen:extension-list/ext-gen:extension" {
283         ext:augment-identifier "nx-aug-match-notif-packet-in";
284         uses all-matches-grouping;
285     }
286     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" {
287         ext:augment-identifier "nx-aug-match-notif-update-flow-stats";
288         uses all-matches-grouping;
289     }
290
291 }