Adding Nicira actions and match for NSH Index and path fields.
[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     
89     grouping ipv4-address-grouping {
90         leaf ipv4-address {
91             type inet:ipv4-address;
92         }
93     }
94     grouping mac-address-grouping {
95         leaf mac-address {
96             type yang:mac-address;
97         }
98     }
99
100     grouping nxm-nx-reg-grouping {
101         container nxm-nx-reg {
102             leaf reg {
103                 type identityref {
104                     base nicira-match:nxm-nx-reg;
105                 }
106             }
107             leaf value {
108                 type uint32;
109             }
110         }
111     }
112     grouping nxm-nx-tun-id-grouping {
113         container nxm-nx-tun-id {
114             leaf value {
115                 type uint64;
116             }
117         }
118     }
119     grouping nxm-nx-arp-sha-grouping {
120         container nxm-nx-arp-sha {
121             uses mac-address-grouping;
122         }
123     }
124     grouping nxm-nx-arp-tha-grouping {
125         container nxm-nx-arp-tha {
126             uses mac-address-grouping;
127         }
128     }
129     grouping nxm-of-arp-op-grouping {
130         container nxm-of-arp-op {
131             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
132             leaf value {
133                 type uint16;
134             }
135         }
136     }
137     grouping nxm-of-arp-spa-grouping {
138         container nxm-of-arp-spa {
139             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
140             uses ipv4-address-grouping;
141         }
142     }
143     grouping nxm-of-arp-tpa-grouping {
144         container nxm-of-arp-tpa {
145             description "Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035.";
146             uses ipv4-address-grouping;
147         }
148     }
149     grouping nxm-nx-tun-ipv4-dst-grouping {
150         container nxm-nx-tun-ipv4-dst {
151             uses ipv4-address-grouping;
152         }
153     }
154     grouping nxm-nx-tun-ipv4-src-grouping {
155         container nxm-nx-tun-ipv4-src {
156             uses ipv4-address-grouping;
157         }
158     }
159     grouping nxm-of-eth-src-grouping {
160         container nxm-of-eth-src {
161             uses mac-address-grouping;
162         }
163     }
164     grouping nxm-of-eth-dst-grouping {
165         container nxm-of-eth-dst {
166             uses mac-address-grouping;
167         }
168     }
169     grouping nxm-of-eth-type-grouping {
170         container nxm-of-eth-type {
171             leaf value {
172                 type uint16;
173             }
174         }
175     }
176     grouping nxm-nx-nsp-grouping {
177         container nxm-nx-nsp {
178             leaf value {
179                 type uint32;
180             }
181         }
182     }
183     grouping nxm-nx-nsi-grouping {
184         container nxm-nx-nsi {
185             leaf nsi {
186                 type uint8;
187             }
188         }
189     }
190
191     
192     grouping all-matches-grouping {
193         uses nxm-nx-reg-grouping;
194         uses nxm-nx-tun-id-grouping;
195         uses nxm-nx-arp-sha-grouping;
196         uses nxm-nx-arp-tha-grouping;
197         uses nxm-of-arp-op-grouping;
198         uses nxm-of-arp-spa-grouping;
199         uses nxm-of-arp-tpa-grouping;
200         uses nxm-nx-tun-ipv4-dst-grouping;
201         uses nxm-nx-tun-ipv4-src-grouping;
202         uses nxm-of-eth-src-grouping;
203         uses nxm-of-eth-dst-grouping;
204         uses nxm-of-eth-type-grouping;
205         uses nxm-nx-nsp-grouping;
206         uses nxm-nx-nsi-grouping;
207     }
208     
209     // MATCH augmentations
210     // RPCS
211     augment "/sal-flow:add-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
212         ext:augment-identifier "nx-aug-match-rpc-add-flow";
213         uses all-matches-grouping;
214     }
215     augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
216         ext:augment-identifier "nx-aug-match-rpc-remove-flow";
217         uses all-matches-grouping;
218     }
219     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
220         ext:augment-identifier "nx-aug-match-rpc-update-flow-original";
221         uses all-matches-grouping;
222     }
223     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
224         ext:augment-identifier "nx-aug-match-rpc-update-flow-updated";
225         uses all-matches-grouping;
226     }
227     
228     // DATA
229     augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:match/ext-gen:extension-list/ext-gen:extension" {
230         ext:augment-identifier "nx-aug-match-nodes-node-table-flow";
231         uses all-matches-grouping;
232     }
233     
234     // NOTIFICATIONS
235     augment "/sal-flow:switch-flow-removed/sal-flow:match/ext-gen:extension-list/ext-gen:extension" {
236         ext:augment-identifier "nx-aug-match-notif-switch-flow-removed";
237         uses all-matches-grouping;
238     }
239     augment "/sal-packet:packet-received/sal-packet:match/ext-gen:extension-list/ext-gen:extension" {
240         ext:augment-identifier "nx-aug-match-notif-packet-in";
241         uses all-matches-grouping;
242     }
243     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" {
244         ext:augment-identifier "nx-aug-match-notif-update-flow-stats";
245         uses all-matches-grouping;
246     }
247
248 }