Merge "Added Conntrack Support in Nicira Extenstion."
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / yang / nicira-action.yang
1 module nicira-action {
2     yang-version 1;
3
4     namespace "urn:opendaylight:openflowjava:nx:action";
5     prefix "nicira-action";
6
7     import openflow-action {prefix ofaction; revision-date "2015-02-03";}
8     import openflow-types {prefix oft;}
9     import yang-ext {prefix ext; revision-date "2013-07-09";}
10
11     description
12         "Nicira openflow extensions of action.";
13
14     revision "2014-04-21" {
15         description "Initial revision";
16     }
17
18     identity nxm-nx-reg-load {
19         base ofaction:experimenter-action-sub-type;
20     }
21     identity nxm-nx-reg-move {
22         base ofaction:experimenter-action-sub-type;
23     }
24     identity nxm-nx-output-reg {
25         base ofaction:experimenter-action-sub-type;
26     }
27     identity nxm-nx-resubmit {
28         base ofaction:experimenter-action-sub-type;
29     }
30     identity nxm-nx-multipath {
31         base ofaction:experimenter-action-sub-type;
32     }
33     identity nxm-nx-set-nsp {
34         base ofaction:experimenter-action-sub-type;
35     }
36     identity nxm-nx-set-nsi {
37         base ofaction:experimenter-action-sub-type;
38     }
39     identity nxm-nx-conntrack {
40         base ofaction:experimenter-action-sub-type;
41     }
42
43     grouping ofj-nx-action-reg-load-grouping {
44         container nx-action-reg-load {
45             leaf ofs_nbits {
46                 type uint16;
47             }
48             leaf dst {
49                 type uint32;
50             }
51             leaf value {
52                 type uint64;
53             }
54             leaf experimenter-id {
55                 type oft:experimenter-id;
56             }
57         }
58     }
59     grouping ofj-nx-action-reg-move-grouping {
60         container nx-action-reg-move {
61                 leaf n_bits {
62                     type uint16;
63                 }
64                 leaf src_ofs {
65                     type uint16;
66                 }
67                 leaf dst_ofs {
68                     type uint16;
69                 }
70                 leaf src {
71                     type uint32;
72                 }
73                 leaf dst {
74                     type uint32;
75                 }
76                 leaf experimenter-id {
77                     type oft:experimenter-id;
78                 }
79         }
80     }
81     grouping ofj-nx-action-output-reg-grouping {
82         container nx-action-output-reg {
83             leaf n_bits {
84                 type uint16;
85             }
86             leaf src {
87                 type uint32;
88             }
89             leaf max_len {
90                 type uint16;
91             }
92             leaf experimenter-id {
93                 type oft:experimenter-id;
94             }
95         }
96     }
97
98     grouping ofj-nx-action-resubmit-grouping {
99         container nx-action-resubmit {
100             leaf in-port {
101                 type uint16;
102                 default 0xfff8; // OFPP_INPORT
103             }
104             leaf table {
105                 type uint8 {
106                     range "0 .. 255";
107                 }
108                 default 255; // Current Table
109             }
110             leaf experimenter-id {
111                 type oft:experimenter-id;
112             }
113         }
114     }
115
116     typedef ofj-nx-hash-fields {
117         type enumeration {
118             enum NX_HASH_FIELDS_ETH_SRC {
119                 value 0;
120                 description "eth src address only";
121             }
122             enum NX_HASH_FIELDS_SYMMETRIC_L4 {
123                 value 1;
124                 description "L2 through L4 fields";
125             }
126         }
127     }
128
129     typedef ofj-nx-mp-algorithm {
130         type enumeration {
131             enum NX_MP_ALG_MODULO_N {
132                 value 0;
133             }
134             enum NX_MP_ALG_HASH_THRESHOLD {
135                 value 1;
136             }
137             enum NX_MP_ALG_HRW {
138                 value 2;
139             }
140             enum NX_MP_ALG_ITER_HASH {
141                 value 3;
142             }
143         }
144     }
145
146     grouping ofj-nx-action-multipath-grouping {
147         container nx-action-multipath {
148             leaf fields {
149                 type ofj-nx-hash-fields;
150             }
151             leaf basis {
152                 type uint16;
153                 default 0x400;
154             }
155             leaf algorithm {
156                 type ofj-nx-mp-algorithm;
157             }
158             leaf max-link {
159                 type uint16;
160             }
161             leaf arg {
162                 type uint32;
163             }
164             leaf ofs-nbits {
165                 type uint16;
166             }
167             leaf dst {
168                 type uint32;
169             }
170             leaf experimenter-id {
171                 type oft:experimenter-id;
172             }
173         }
174     }
175
176     grouping ofj-nx-action-set-nsp-grouping {
177         container nx-action-set-nsp {
178             leaf nsp {
179                 type uint32;
180             }
181             leaf experimenter-id {
182                 type oft:experimenter-id;
183             }
184         }
185     }
186
187     grouping ofj-nx-action-set-nsi-grouping {
188         container nx-action-set-nsi {
189             leaf nsi {
190                 type uint8;
191             }
192             leaf experimenter-id {
193                 type oft:experimenter-id;
194             }
195         }
196     }
197
198     grouping ofj-nx-action-set-nshc-grouping {
199         leaf nshc {
200             type uint32;
201         }
202         leaf experimenter-id {
203             type oft:experimenter-id;
204         }
205     }
206
207     grouping ofj-nx-action-set-nshc-1-grouping {
208         container nx-action-set-nshc-1 {
209             uses ofj-nx-action-set-nshc-grouping;
210         }
211     }
212     grouping ofj-nx-action-set-nshc-2-grouping {
213         container nx-action-set-nshc-2 {
214             uses ofj-nx-action-set-nshc-grouping;
215         }
216     }
217     grouping ofj-nx-action-set-nshc-3-grouping {
218         container nx-action-set-nshc-3 {
219             uses ofj-nx-action-set-nshc-grouping;
220         }
221     }
222     grouping ofj-nx-action-set-nshc-4-grouping {
223         container nx-action-set-nshc-4 {
224             uses ofj-nx-action-set-nshc-grouping;
225         }
226     }
227
228     grouping ofj-nx-action-conntrack-grouping {
229         container nx-action-conntrack {
230             leaf flags {
231                 type uint16;
232             }
233             leaf zone-src {
234                 type uint32;
235             }
236             leaf conntrack-zone {
237                 type uint16;
238             }
239             leaf recirc-table {
240                 type uint8;
241             }
242             leaf experimenter-id {
243                 type oft:experimenter-id;
244             }
245         }
246     }
247
248     augment "/ofaction:action-container/ofaction:action-choice" {
249         ext:augment-identifier "ofj-aug-nx-action";
250         case action-reg-load {
251             uses ofj-nx-action-reg-load-grouping;
252         }
253         case action-reg-move {
254             uses ofj-nx-action-reg-move-grouping;
255         }
256         case action-output-reg {
257             uses ofj-nx-action-output-reg-grouping;
258         }
259         case action-resubmit {
260             uses ofj-nx-action-resubmit-grouping;
261         }
262         case action-multipath {
263             uses ofj-nx-action-multipath-grouping;
264         }
265         case action-set-nsp {
266             uses ofj-nx-action-set-nsp-grouping;
267         }
268         case action-set-nsi {
269             uses ofj-nx-action-set-nsi-grouping;
270         }
271         case action-set-nshc-1 {
272             uses ofj-nx-action-set-nshc-1-grouping;
273         }
274         case action-set-nshc-2 {
275             uses ofj-nx-action-set-nshc-2-grouping;
276         }
277         case action-set-nshc-3 {
278             uses ofj-nx-action-set-nshc-3-grouping;
279         }
280         case action-set-nshc-4 {
281             uses ofj-nx-action-set-nshc-4-grouping;
282         }
283         case action-conntrack {
284             uses ofj-nx-action-conntrack-grouping;
285         }
286     }
287 }