5bfe54e4c32a7132a0fe8e8e9c53908e0e4f6aa0
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / 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 {
46                 leaf output-node-connector {
47                     type inet:uri;
48                 }
49                 
50                 leaf max-length {
51                     type uint16 {
52                         range "0..65294";
53                     }
54                 }                
55             }
56
57             case controller-action {
58                 leaf max-length {
59                     type uint16 {
60                         range "0..65294";
61                     }
62                 }
63             }
64             
65             case set-field {
66                 container match {
67                     uses match:match;
68                 }
69             }
70             
71             case set-queue-action {
72                 leaf queue {
73                     type string; 
74                 }
75                 
76                 leaf queue-id {
77                     type uint32; 
78                 }
79             }
80
81             case pop-mpls-action {
82                 leaf ethernet-type {
83                     type uint16; // TODO: define ethertype type
84                 }
85             }
86
87             case set-mpls-ttl-action {
88                 leaf mpls-ttl {
89                     type uint8;
90                 }
91             }
92
93             case set-nw-ttl-action {
94                 leaf nw-ttl {
95                     type uint8;
96                 }
97             }
98
99             case push-pbb-action {
100                 leaf ethernet-type {
101                     type uint16; // TODO: define ethertype type
102                 }
103             }
104
105             case pop-pbb-action {
106                 
107             }
108             
109             case push-mpls-action {
110                 leaf ethernet-type {
111                     type uint16; // TODO: define ethertype type
112                 }
113             }
114             
115             case dec-mpls-ttl {
116             }
117             
118             case dec-nw-ttl {
119             }
120             
121             case drop-action {
122             }
123             
124             case flood-action {
125             }
126             
127             case flood-all-action {
128             }
129             
130             case hw-path-action {
131             }
132             
133             case loopback-action {
134             }
135             
136             case pop-vlan-action {
137             }
138             
139             case push-vlan-action {
140                 leaf ethernet-type {
141                     type uint16; // TODO: define ethertype type
142                 }
143                 leaf tag {               // TPID - 16 bits
144                     type int32;
145                 } 
146                 leaf pcp {               // PCP - 3 bits
147                     type int32;
148                 }
149                 leaf cfi {               // CFI - 1 bit (drop eligible)
150                     type vlan-cfi;
151                 }
152                 leaf vlan-id {           // VID - 12 bits
153                     type l2t:vlan-id;
154                 }
155 //                leaf tci {               //TCI = [PCP + CFI + VID]
156 //                }
157 //                leaf header {            //header = [TPID + TCI] 
158 //                }
159             }
160             
161             case copy-ttl-out {
162             }
163             
164             case copy-ttl-in {
165             }
166             
167             case set-dl-dst-action {
168                 leaf address {
169                     type yang:mac-address;
170                 }
171             }
172             
173             case set-dl-src-action {
174                 leaf address {
175                     type yang:mac-address;
176                 }
177             }
178             case group-action {
179                 leaf group {
180                     type string;
181                 }
182                 
183                 leaf group-id {
184                     type uint32;
185                 }
186             }
187             
188             case set-dl-type-action {
189                 leaf dl-type {
190                     type l2t:ether-type;
191                 }
192             }
193             
194             case set-next-hop-action {
195                 uses address;
196             }
197             
198             case set-nw-dst-action {
199                 uses address;            
200             }
201             
202             case set-nw-src-action{
203                 uses address;            
204             }
205             
206             case set-nw-tos-action {
207                 leaf tos {
208                     type int32;
209                 }
210             }
211             
212             case set-tp-dst-action {
213                 leaf port {
214                     type inet:port-number;
215                 }                
216             }
217             case set-tp-src-action {
218                 leaf port {
219                     type inet:port-number;
220                 }                
221             }
222             case set-vlan-cfi-action {
223                 leaf vlan-cfi {
224                     type vlan-cfi;
225                 }
226             }
227             
228             case set-vlan-id-action {
229                 leaf vlan-id {
230                     type l2t:vlan-id;
231                 } 
232             }
233             
234             case set-vlan-pcp-action {
235                 leaf vlan-pcp {
236                     type l2t:vlan-pcp;
237                 }            
238             }
239             
240             case sw-path-action {            
241             }  
242         }
243     }
244 }