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