Merge "added content of grouping in of-protocol"
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-action.yang
1 module openflow-action {
2     namespace "urn:opendaylight:openflow:common:action";
3     prefix "ofaction";
4
5     import openflow-types { prefix oft; }
6
7     revision "2013-07-31" {
8         description "Initial model";
9     }
10
11     /*
12     identity output {
13         description " Output to switch port. ";
14         base oft:action;
15     }
16     identity copy_ttl_out {
17         description " Copy TTL "outwards" -- from next-to-outermost to outermost ";
18         base oft:action;
19     }
20     identity copy_ttl_in {
21         description " Copy TTL "inwards" -- from outermost to next-to-outermost ";
22         base oft:action;
23     }
24     identity set_mpls_ttl {
25         description " MPLS TTL ";
26         base oft:action;
27     }
28     identity dec_mpls_ttl {
29         description " Decrement MPLS TTL ";
30         base oft:action;
31     }
32     identity push_vlan {
33         description " Push a new VLAN tag ";
34         base oft:action;
35     }
36     identity pop_vlan {
37         description " Pop the outer VLAN tag ";
38         base oft:action;
39     }
40     identity push_mpls {
41         description " Push a new MPLS tag ";
42         base oft:action;
43     }
44     identity pop_mpls {
45         description " Pop the outer MPLS tag ";
46         base oft:action;
47     }
48     identity set_queue {
49         description " Set queue id when outputting to a port ";
50         base oft:action;
51     }
52     identity group {
53         description " Apply group. ";
54         base oft:action;
55     }
56     identity set_nw_ttl {
57         description " IP TTL. ";
58         base oft:action;
59     }
60     identity dec_nw_ttl {
61         description " Decrement IP TTL. ";
62         base oft:action;
63     }
64     identity set_field {
65         description " Set a header field using OXM TLV format. ";
66         base oft:action;
67     }
68     identity push_pbb {
69         description " Push a new PBB service tag (I-TAG) ";
70         base oft:action;
71     }
72     identity pop_pbb {
73         description " Pop the outer PBB service tag (I-TAG) ";
74         base oft:action;
75     }
76     identity experimenter {
77         description "";
78         base oft:action;
79     }
80     */
81     grouping output {
82         description 
83             "Action structure for OFPAT_OUTPUT, which sends packets out 'port'.
84             When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max
85             number of bytes to send. A 'max_len' of zero means no bytes of the
86             packet should be sent. A 'max_len' of OFPCML_NO_BUFFER means that
87             the packet is not buffered and the complete packet is to be sent to
88             the controller.";
89         leaf port {
90             type oft:any-port-number;
91         }
92         leaf max-length {
93             description "Maximum packet length to be send to controller.";
94             type union {
95                 type uint16 {
96                     range "0..65294"; // 0..0xff0e
97                 }
98                 type enumeration {
99                     enum no-buffer {
100                         description 
101                             "indicates that no buffering should be
102                              applied and the whole packet is to be
103                              sent to the controller";
104                         value 65535; //0xffff
105                     }
106                 }
107             }
108         }
109     }
110
111     grouping group {
112         leaf group {
113             type oft:group-id; // define action group-id type;
114         }
115     }
116
117     grouping set-queue {
118         leaf queue {
119             type oft:queue-id;
120         }
121     }
122
123     grouping set-mpls-ttl {
124         leaf mpls_ttl {
125             type uint8;
126         }
127     }
128
129     grouping set-nw-ttl {
130         leaf nw_ttl {
131             type uint8;
132         }
133     }
134
135     grouping push-pbb {
136
137     }
138
139     grouping push-mpls {
140
141     }
142
143     grouping push-vlan {
144
145     }
146
147     grouping pop-mpls {
148         leaf ethertype {
149             type uint16; // TODO: define ethertype type
150         }
151     }
152
153     grouping set-field {
154         container field {
155             // TODO: figure definition
156         }
157     }
158     
159     
160     grouping action-header {
161         leaf type {
162             type action-type;
163         }
164     }
165     
166     typedef action-type {
167         /* ofp_action_type */
168         type enumeration {
169             enum OUTPUT {
170                 description "Output to switch port.";
171             }
172             enum SET_VLAN_VID {
173                 description "Set the 802.1q VLAN id.";
174             }
175             enum SET_VLAN_PCP {
176                 description "Set the 802.1q priority.";
177             }
178             enum STRIP_VLAN {
179                 description "Strip the 802.1q header.";
180             }
181             enum SET_DL_SRC {
182                 description "Ethernet source address.";
183             }
184             enum SET_DL_DST {
185                 description "Ethernet destination address.";
186             }
187             enum SET_NW_SRC {
188                 description "IP source address.";
189             }
190             enum SET_NW_DST {
191                 description "IP destination address.";
192             }
193             enum SET_TP_SRC {
194                 description "TCP/UDP source port.";
195             }
196             enum SET_TP_DST {
197                 description "TCP/UDP destination port.";
198             }
199             enum OFPAT_VENDOR {
200                 value 65535; // 0xffff
201             }
202         }
203     }
204 }