Merge "OF 1.3: Remove range check for max-length attribute for Output action."
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / opendaylight-action-types.yang
1 module opendaylight-action-types {
2     namespace "urn:opendaylight:action:types";
3     prefix action;
4
5     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
6     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
7     import opendaylight-l2-types {prefix l2t; revision-date "2013-08-27";}
8     import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
9     
10     revision "2013-11-12" {
11         description "Initial revision of action service";
12     }
13     
14     typedef vlan-cfi {
15         type int32;    
16     }
17
18     grouping address {
19         choice address {
20             case ipv4 {
21                 leaf ipv4-address {
22                     type inet:ipv4-prefix;
23                 }
24             }
25             case ipv6 {
26                 leaf ipv6-address {
27                     type inet:ipv6-prefix;
28                 }
29             }
30         }
31     }  
32     
33     grouping action-list {
34         list action {
35             key "order";
36             leaf order {
37                 type int32;
38             }
39             uses action;
40         }
41     }
42     
43     grouping action {
44         choice action {
45             case output-action-case {
46                 container output-action {
47                     leaf output-node-connector {
48                         type inet:uri;
49                     }
50                     
51                     leaf max-length {
52                         type uint16;
53                     }
54                 }
55             }
56
57             case controller-action-case {
58                 container controller-action {
59                  leaf max-length {
60                      type uint16;
61                  }
62              }
63             }
64              
65
66
67             case set-field-case {
68                 container set-field {
69                      uses match:match;
70                  }
71              }
72              
73
74             case set-queue-action-case {
75                 container set-queue-action {
76                  leaf queue {
77                      type string; 
78                  }
79                  leaf queue-id {
80                      type uint32; 
81                  }
82              }
83             }
84
85            case pop-mpls-action-case {
86                 container pop-mpls-action {
87                  leaf ethernet-type {
88                      type uint16; // TODO: define ethertype type
89                  }
90              }
91             }
92  
93
94             case set-mpls-ttl-action-case {
95                 container set-mpls-ttl-action {
96                  leaf mpls-ttl {
97                      type uint8;
98                  }
99              }
100             }
101  
102
103             case set-nw-ttl-action-case {
104                 container set-nw-ttl-action {
105                  leaf nw-ttl {
106                      type uint8;
107                  }
108              }
109             }
110  
111
112             case push-pbb-action-case {
113                 container push-pbb-action {
114                  leaf ethernet-type {
115                      type uint16; // TODO: define ethertype type
116                  }
117              }
118             }
119  
120
121             case pop-pbb-action-case {
122                 container pop-pbb-action {
123                  
124              }
125             }
126              
127
128             case push-mpls-action-case {
129                 container push-mpls-action {
130                  leaf ethernet-type {
131                      type uint16; // TODO: define ethertype type
132                  }
133              }
134             }
135              
136
137             case dec-mpls-ttl-case {
138                 container dec-mpls-ttl {
139                 }
140              }
141              
142
143             case dec-nw-ttl-case {
144                 container dec-nw-ttl {
145                 }
146              }
147              
148
149             case drop-action-case {
150                 container drop-action {
151                 }
152              }
153              
154
155             case flood-action-case {
156                 container flood-action {
157                 }
158              }
159              
160
161             case flood-all-action-case {
162                 container flood-all-action {
163                 }
164              }
165              
166
167             case hw-path-action-case {
168                 container hw-path-action {
169                 }
170              }
171              
172
173             case loopback-action-case {
174                 container loopback-action {
175                 }
176              }
177              
178
179             case pop-vlan-action-case {
180                 container pop-vlan-action {
181                 }
182              }
183              
184             
185             
186             case push-vlan-action-case {
187                 container push-vlan-action {
188                  leaf ethernet-type {
189                      type uint16; // TODO: define ethertype type
190                  }
191                 leaf tag {               // TPID - 16 bits
192                     type int32;
193                 } 
194                 leaf pcp {               // PCP - 3 bits
195                     type int32;
196                 }
197                 leaf cfi {               // CFI - 1 bit (drop eligible)
198                     type vlan-cfi;
199                 }
200                 leaf vlan-id {           // VID - 12 bits
201                     type l2t:vlan-id;
202                 }
203 //                leaf tci {               //TCI = [PCP + CFI + VID]
204 //                }
205 //                leaf header {            //header = [TPID + TCI] 
206 //                }
207                 }
208              }
209             
210             case copy-ttl-out-case {
211                 container copy-ttl-out {
212                 }
213              }
214              
215
216             case copy-ttl-in-case {
217                 container copy-ttl-in {
218                 }
219              }
220              
221
222             case set-dl-dst-action-case {
223                 container set-dl-dst-action {
224                  leaf address {
225                      type yang:mac-address;
226                  }
227              }
228             }
229              
230
231             case set-dl-src-action-case {
232                 container set-dl-src-action {
233                  leaf address {
234                      type yang:mac-address;
235                  }
236              }
237
238             }
239             case group-action-case {
240                 container group-action {
241                  leaf group {
242                      type string;
243                  }
244                 
245                 leaf group-id {
246                     type uint32;
247                 }
248              }
249             }
250             
251             case set-dl-type-action-case {
252                 container set-dl-type-action {
253                  leaf dl-type {
254                      type l2t:ether-type;
255                  }
256              }
257             }
258              
259
260             case set-next-hop-action-case {
261                 container set-next-hop-action {
262                  uses address;
263              }
264             }
265              
266
267             case set-nw-dst-action-case {
268                 container set-nw-dst-action {
269                  uses address;            
270              }
271             }
272              
273
274             case set-nw-src-action-case {
275                 container set-nw-src-action {
276                  uses address;            
277              }
278             }
279              
280
281             case set-nw-tos-action-case {
282                 container set-nw-tos-action {
283                  leaf tos {
284                      type int32;
285                  }
286              }
287             }
288              
289
290             case set-tp-dst-action-case {
291                 container set-tp-dst-action {
292                  leaf port {
293                      type inet:port-number;
294                  }                
295              }
296
297             }
298             case set-tp-src-action-case {
299                 container set-tp-src-action {
300                  leaf port {
301                      type inet:port-number;
302                  }                
303              }
304
305             }
306             case set-vlan-cfi-action-case {
307                 container set-vlan-cfi-action {
308                  leaf vlan-cfi {
309                      type vlan-cfi;
310                  }
311              }
312             }
313              
314
315             case set-vlan-id-action-case {
316                 container set-vlan-id-action {
317                  leaf vlan-id {
318                      type l2t:vlan-id;
319                  } 
320              }
321             }
322              
323
324             case set-vlan-pcp-action-case {
325                 container set-vlan-pcp-action {
326                  leaf vlan-pcp {
327                      type l2t:vlan-pcp;
328                  }            
329              }
330             }
331
332             case strip-vlan-action-case {
333                 container strip-vlan-action {
334                 }
335              }
336
337             case sw-path-action-case {            
338                 container sw-path-action {
339                 }  
340              }  
341          }
342      }
343 }