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