Merge "BUG-4062: Flows,Groups,Meters not getting deleted during switch flap"
[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
40     grouping ofj-nx-action-reg-load-grouping {
41         container nx-action-reg-load {
42             leaf ofs_nbits {
43                 type uint16;
44             }
45             leaf dst {
46                 type uint32;
47             }
48             leaf value {
49                 type uint64;
50             }
51             leaf experimenter-id {
52                 type oft:experimenter-id;
53             }
54         }
55     }
56     grouping ofj-nx-action-reg-move-grouping {
57         container nx-action-reg-move {
58                 leaf n_bits {
59                     type uint16;
60                 }
61                 leaf src_ofs {
62                     type uint16;
63                 }
64                 leaf dst_ofs {
65                     type uint16;
66                 }
67                 leaf src {
68                     type uint32;
69                 }
70                 leaf dst {
71                     type uint32;
72                 }
73                 leaf experimenter-id {
74                     type oft:experimenter-id;
75                 }
76         }
77     }
78     grouping ofj-nx-action-output-reg-grouping {
79         container nx-action-output-reg {
80             leaf n_bits {
81                 type uint16;
82             }
83             leaf src {
84                 type uint32;
85             }
86             leaf max_len {
87                 type uint16;
88             }
89             leaf experimenter-id {
90                 type oft:experimenter-id;
91             }
92         }
93     }
94
95     grouping ofj-nx-action-resubmit-grouping {
96         container nx-action-resubmit {
97             leaf in-port {
98                 type uint16;
99                 default 0xfff8; // OFPP_INPORT
100             }
101             leaf table {
102                 type uint8 {
103                     range "0 .. 255";
104                 }
105                 default 255; // Current Table
106             }
107             leaf experimenter-id {
108                 type oft:experimenter-id;
109             }
110         }
111     }
112
113     typedef ofj-nx-hash-fields {
114         type enumeration {
115             enum NX_HASH_FIELDS_ETH_SRC {
116                 value 0;
117                 description "eth src address only";
118             }
119             enum NX_HASH_FIELDS_SYMMETRIC_L4 {
120                 value 1;
121                 description "L2 through L4 fields";
122             }
123         }
124     }
125
126     typedef ofj-nx-mp-algorithm {
127         type enumeration {
128             enum NX_MP_ALG_MODULO_N {
129                 value 0;
130             }
131             enum NX_MP_ALG_HASH_THRESHOLD {
132                 value 1;
133             }
134             enum NX_MP_ALG_HRW {
135                 value 2;
136             }
137             enum NX_MP_ALG_ITER_HASH {
138                 value 3;
139             }
140         }
141     }
142
143     grouping ofj-nx-action-multipath-grouping {
144         container nx-action-multipath {
145             leaf fields {
146                 type ofj-nx-hash-fields;
147             }
148             leaf basis {
149                 type uint16;
150                 default 0x400;
151             }
152             leaf algorithm {
153                 type ofj-nx-mp-algorithm;
154             }
155             leaf max-link {
156                 type uint16;
157             }
158             leaf arg {
159                 type uint32;
160             }
161             leaf ofs-nbits {
162                 type uint16;
163             }
164             leaf dst {
165                 type uint32;
166             }
167             leaf experimenter-id {
168                 type oft:experimenter-id;
169             }
170         }
171     }
172
173     grouping ofj-nx-action-set-nsp-grouping {
174         container nx-action-set-nsp {
175             leaf nsp {
176                 type uint32;
177             }
178             leaf experimenter-id {
179                 type oft:experimenter-id;
180             }
181         }
182     }
183
184     grouping ofj-nx-action-set-nsi-grouping {
185         container nx-action-set-nsi {
186             leaf nsi {
187                 type uint8;
188             }
189             leaf experimenter-id {
190                 type oft:experimenter-id;
191             }
192         }
193     }
194     
195     grouping ofj-nx-action-set-nshc-grouping {
196         leaf nshc {
197             type uint32;
198         }
199         leaf experimenter-id {
200             type oft:experimenter-id;
201         }
202     }
203     
204     grouping ofj-nx-action-set-nshc-1-grouping {
205         container nx-action-set-nshc-1 {
206             uses ofj-nx-action-set-nshc-grouping;
207         }
208     }
209     grouping ofj-nx-action-set-nshc-2-grouping {
210         container nx-action-set-nshc-2 {
211             uses ofj-nx-action-set-nshc-grouping;
212         }
213     }
214     grouping ofj-nx-action-set-nshc-3-grouping {
215         container nx-action-set-nshc-3 {
216             uses ofj-nx-action-set-nshc-grouping;
217         }
218     }
219     grouping ofj-nx-action-set-nshc-4-grouping {
220         container nx-action-set-nshc-4 {
221             uses ofj-nx-action-set-nshc-grouping;
222         }
223     }
224
225     augment "/ofaction:action-container/ofaction:action-choice" {
226         ext:augment-identifier "ofj-aug-nx-action";
227         case action-reg-load {
228             uses ofj-nx-action-reg-load-grouping;
229         }
230         case action-reg-move {
231             uses ofj-nx-action-reg-move-grouping;
232         }
233         case action-output-reg {
234             uses ofj-nx-action-output-reg-grouping;
235         }
236         case action-resubmit {
237             uses ofj-nx-action-resubmit-grouping;
238         }
239         case action-multipath {
240             uses ofj-nx-action-multipath-grouping;
241         }
242         case action-set-nsp {
243             uses ofj-nx-action-set-nsp-grouping;
244         }
245         case action-set-nsi {
246             uses ofj-nx-action-set-nsi-grouping;
247         }
248         case action-set-nshc-1 {
249             uses ofj-nx-action-set-nshc-1-grouping;
250         }
251         case action-set-nshc-2 {
252             uses ofj-nx-action-set-nshc-2-grouping;
253         }
254         case action-set-nshc-3 {
255             uses ofj-nx-action-set-nshc-3-grouping;
256         }
257         case action-set-nshc-4 {
258             uses ofj-nx-action-set-nshc-4-grouping;
259         }
260     }
261 }