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