Bug 2756 - Action model update
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-action.yang
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9  module openflow-action {
10     namespace "urn:opendaylight:openflow:common:action";
11     prefix "ofaction";
12
13     import ietf-inet-types {prefix inet;}
14     import ietf-yang-types {prefix yang;}
15
16     import openflow-types { prefix oft; }
17     import openflow-extensible-match { prefix oxm;}
18
19     revision "2015-02-03" {
20         description "OpenFlow 1.3 - action model";
21     }
22
23     identity experimenter-action-sub-type {
24         description "The base identity for vendor's actions.";
25     }
26
27     container action-container {
28         uses action-grouping;
29     }
30
31     grouping actions-grouping {
32         list action {
33             uses action-grouping;
34         }
35     }
36
37     grouping action-grouping {
38         choice action-choice {
39             case output-action-case {
40                 container output-action {
41                     leaf port {
42                         type oft:port-number;
43                     }
44                     leaf max-length {
45                         type uint16;
46                     }
47                 }
48             }
49             case copy-ttl-out-case {
50                 // empty action
51             }
52             case copy-ttl-in-case {
53                 // empty action
54             }
55             case set-mpls-ttl-case {
56                 container set-mpls-ttl-action {
57                     leaf mpls-ttl {
58                         type uint8;
59                     }
60                 }
61             }
62             case dec-mpls-ttl-case {
63                 // empty action
64             }
65             case push-vlan-case {
66                 container push-vlan-action {
67                     leaf ethertype {
68                         type oft:ether-type;
69                     }
70                 }
71             }
72             case pop-vlan-case {
73                 // empty action
74             }
75             case push-mpls-case {
76                 container push-mpls-action {
77                     leaf ethertype {
78                         type oft:ether-type;
79                     }
80                 }
81             }
82             case pop-mpls-case {
83                 container pop-mpls-action {
84                     leaf ethertype {
85                         type oft:ether-type;
86                     }
87                 }
88             }
89             case set-queue-case {
90                 container set-queue-action {
91                     leaf queue-id {
92                         type uint32;
93                     }
94                 }
95             }
96             case group-case {
97                 container group-action {
98                     leaf group-id {
99                         type uint32;
100                     }
101                 }
102             }
103             case set-nw-ttl-case {
104                 container set-nw-ttl-action {
105                     leaf nw-ttl {
106                         type uint8;
107                     }
108                 }
109             }
110             case dec-nw-ttl-case {
111                 // empty action
112             }
113             case set-field-case {
114                 container set-field-action {
115                     uses oxm:match-entries-grouping;
116                 }
117             }
118             case push-pbb-case {
119                 container push-pbb-action {
120                     leaf ethertype {
121                         type oft:ether-type;
122                     }
123                 }
124             }
125             case pop-pbb-case {
126                 // empty action
127             }
128         // OF1.0 structures
129             case set-vlan-vid-case {
130                 container set-vlan-vid-action {
131                     leaf vlan-vid {
132                         type uint16;
133                     }
134                 }
135             }
136             case set-vlan-pcp-case {
137                 container set-vlan-pcp-action {
138                     leaf vlan-pcp {
139                         type uint8;
140                     }
141                 }
142             }
143             case strip-vlan-case {
144                 // empty action
145             }
146             case set-dl-src-case {
147                 container set-dl-src-action {
148                     leaf dl-src-address {
149                         type yang:mac-address;
150                     }
151                 }
152             }
153             case set-dl-dst-case {
154                 container set-dl-dst-action {
155                     leaf dl-dst-address {
156                         type yang:mac-address;
157                     }
158                 }
159             }
160             case set-nw-src-case {
161                 container set-nw-src-action {
162                     leaf ip-address {
163                         type inet:ipv4-address;
164                     }
165                 }
166             }
167             case set-nw-dst-case {
168                 container set-nw-dst-action {
169                     leaf ip-address {
170                         type inet:ipv4-address;
171                     }
172                 }
173             }
174             case set-nw-tos-case {
175                 container set-nw-tos-action {
176                     leaf nw-tos {
177                         type uint8;
178                     }
179                 }
180             }
181             case set-tp-src-case {
182                 container set-tp-src-action {
183                     leaf port {
184                         type oft:port-number;
185                     }
186                 }
187             }
188             case set-tp-dst-case {
189                 container set-tp-dst-action {
190                     leaf port {
191                         type oft:port-number;
192                     }
193                 }
194             }
195             case enqueue-case {
196                 container enqueue-action {
197                     leaf port {
198                         type oft:port-number;
199                     }
200                     leaf queue-id {
201                         type oft:queue-id;
202                     }
203                 }
204             }
205         }
206     }
207
208 }