blob: cf146e00af5d4c178f006f8690be2518533ca265 [file] [log] [blame]
Rich Lanea06d0c32013-03-25 08:52:03 -07001// Copyright 2013, Big Switch Networks, Inc.
2//
3// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
4// the following special exception:
5//
6// LOXI Exception
7//
8// As a special exception to the terms of the EPL, you may distribute libraries
9// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
10// that copyright and licensing notices generated by LoxiGen are not altered or removed
11// from the LoxiGen Libraries and the notice provided below is (i) included in
12// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
13// documentation for the LoxiGen Libraries, if distributed in binary form.
14//
15// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
16//
17// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
18// a copy of the EPL at:
19//
20// http://www.eclipse.org/legal/epl-v10.html
21//
22// Unless required by applicable law or agreed to in writing, software
23// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
25// EPL for the specific language governing permissions and limitations
26// under the EPL.
Rich Lane5d33a622013-04-08 17:33:11 -070027//
28// Also derived from the OpenFlow header files which have these copyrights:
29// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
30// Copyright (c) 2011, 2012 Open Networking Foundation
Rich Lanea06d0c32013-03-25 08:52:03 -070031
32#version 3
33
Rich Lane5d33a622013-04-08 17:33:11 -070034enum macro_definitions {
35 OFP_MAX_TABLE_NAME_LEN = 32,
36 OFP_MAX_PORT_NAME_LEN = 16,
37
Wilson Ngd72013d2013-09-29 10:21:48 -070038 OFP_TCP_PORT = 6653,
39 OFP_SSL_PORT = 6653,
Rich Lane5d33a622013-04-08 17:33:11 -070040
41 OFP_ETH_ALEN = 6,
42
43 OFP_DEFAULT_MISS_SEND_LEN = 128,
44
45 OFP_VLAN_NONE = 0,
46
47 OFP_FLOW_PERMANENT = 0,
48
49 OFP_DEFAULT_PRIORITY = 0x8000,
50
51 OFP_NO_BUFFER = 0xffffffff,
52
53 DESC_STR_LEN = 256,
54 SERIAL_NUM_LEN = 32,
55
56 OFPQ_ALL = 0xffffffff,
57
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59 OFPQ_MAX_RATE_UNCFG = 0xffff,
60};
61
Andreas Wundsam4ee51462013-07-30 11:00:37 -070062enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070063 OFPP_MAX = 0xffffff00,
64 OFPP_IN_PORT = 0xfffffff8,
65 OFPP_TABLE = 0xfffffff9,
66 OFPP_NORMAL = 0xfffffffa,
67 OFPP_FLOOD = 0xfffffffb,
68 OFPP_ALL = 0xfffffffc,
69 OFPP_CONTROLLER = 0xfffffffd,
70 OFPP_LOCAL = 0xfffffffe,
71};
72
Andreas Wundsam7933beb2013-08-02 22:36:42 -070073enum ofp_port_no(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -070074 OFPP_ANY = 0xffffffff,
75};
76
Andreas Wundsam4ee51462013-07-30 11:00:37 -070077enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070078 OFPT_HELLO = 0,
79 OFPT_ERROR = 1,
80 OFPT_ECHO_REQUEST = 2,
81 OFPT_ECHO_REPLY = 3,
82 OFPT_EXPERIMENTER = 4,
83 OFPT_FEATURES_REQUEST = 5,
84 OFPT_FEATURES_REPLY = 6,
85 OFPT_GET_CONFIG_REQUEST = 7,
86 OFPT_GET_CONFIG_REPLY = 8,
87 OFPT_SET_CONFIG = 9,
88 OFPT_PACKET_IN = 10,
89 OFPT_FLOW_REMOVED = 11,
90 OFPT_PORT_STATUS = 12,
91 OFPT_PACKET_OUT = 13,
92 OFPT_FLOW_MOD = 14,
93 OFPT_GROUP_MOD = 15,
94 OFPT_PORT_MOD = 16,
95 OFPT_TABLE_MOD = 17,
96 OFPT_STATS_REQUEST = 18,
97 OFPT_STATS_REPLY = 19,
98 OFPT_BARRIER_REQUEST = 20,
99 OFPT_BARRIER_REPLY = 21,
100 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
101 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
102 OFPT_ROLE_REQUEST = 24,
103 OFPT_ROLE_REPLY = 25,
104};
105
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700106enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700107 OFPC_FRAG_NORMAL = 0,
108 OFPC_FRAG_DROP = 1,
109 OFPC_FRAG_REASM = 2,
110 OFPC_FRAG_MASK = 3,
111 OFPC_INVALID_TTL_TO_CONTROLLER = 4,
112};
113
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700114enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700115 OFPTC_TABLE_MISS_CONTROLLER = 0,
116 OFPTC_TABLE_MISS_CONTINUE = 1,
117 OFPTC_TABLE_MISS_DROP = 2,
118 OFPTC_TABLE_MISS_MASK = 3,
119};
120
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700121enum ofp_table(wire_type=uint8_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700122 OFPTT_MAX = 0xfe,
123 OFPTT_ALL = 0xff,
124};
125
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700126enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700127 OFPC_FLOW_STATS = 0x1,
128 OFPC_TABLE_STATS = 0x2,
129 OFPC_PORT_STATS = 0x4,
130 OFPC_GROUP_STATS = 0x8,
131 OFPC_IP_REASM = 0x20,
132 OFPC_QUEUE_STATS = 0x40,
133 OFPC_PORT_BLOCKED = 0x100,
134};
135
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700136enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700137 OFPPC_PORT_DOWN = 0x1,
138 OFPPC_NO_RECV = 0x4,
139 OFPPC_NO_FWD = 0x20,
140 OFPPC_NO_PACKET_IN = 0x40,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -0700141 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700142};
143
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700144enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700145 OFPPS_LINK_DOWN = 0x1,
146 OFPPS_BLOCKED = 0x2,
147 OFPPS_LIVE = 0x4,
148};
149
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700150enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700151 OFPPF_10MB_HD = 0x1,
152 OFPPF_10MB_FD = 0x2,
153 OFPPF_100MB_HD = 0x4,
154 OFPPF_100MB_FD = 0x8,
155 OFPPF_1GB_HD = 0x10,
156 OFPPF_1GB_FD = 0x20,
157 OFPPF_10GB_FD = 0x40,
158 OFPPF_40GB_FD = 0x80,
159 OFPPF_100GB_FD = 0x100,
160 OFPPF_1TB_FD = 0x200,
161 OFPPF_OTHER = 0x400,
162 OFPPF_COPPER = 0x800,
163 OFPPF_FIBER = 0x1000,
164 OFPPF_AUTONEG = 0x2000,
165 OFPPF_PAUSE = 0x4000,
166 OFPPF_PAUSE_ASYM = 0x8000,
167};
168
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700169enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700170 OFPPR_ADD = 0,
171 OFPPR_DELETE = 1,
172 OFPPR_MODIFY = 2,
173};
174
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700175enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700176 OFPMT_STANDARD = 0,
177 OFPMT_OXM = 1,
178};
179
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700180enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700181 OFPXMC_NXM_0 = 0,
182 OFPXMC_NXM_1 = 1,
183 OFPXMC_OPENFLOW_BASIC = 0x8000,
184 OFPXMC_EXPERIMENTER = 0xffff,
185};
186
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700187enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700188 OFPVID_NONE = 0,
189 OFPVID_PRESENT = 0x1000,
190};
191
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700192enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700193 OFPAT_OUTPUT = 0,
194 OFPAT_COPY_TTL_OUT = 0xb,
195 OFPAT_COPY_TTL_IN = 0xc,
196 OFPAT_SET_MPLS_TTL = 0xf,
197 OFPAT_DEC_MPLS_TTL = 0x10,
198 OFPAT_PUSH_VLAN = 0x11,
199 OFPAT_POP_VLAN = 0x12,
200 OFPAT_PUSH_MPLS = 0x13,
201 OFPAT_POP_MPLS = 0x14,
202 OFPAT_SET_QUEUE = 0x15,
203 OFPAT_GROUP = 0x16,
204 OFPAT_SET_NW_TTL = 0x17,
205 OFPAT_DEC_NW_TTL = 0x18,
206 OFPAT_SET_FIELD = 0x19,
207 OFPAT_EXPERIMENTER = 0xffff,
208};
209
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700210enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700211 OFPCML_MAX = 0xffe5,
212 OFPCML_NO_BUFFER = 0xffff,
213};
214
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700215enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700216 OFPIT_GOTO_TABLE = 0x1,
217 OFPIT_WRITE_METADATA = 0x2,
218 OFPIT_WRITE_ACTIONS = 0x3,
219 OFPIT_APPLY_ACTIONS = 0x4,
220 OFPIT_CLEAR_ACTIONS = 0x5,
221 OFPIT_EXPERIMENTER = 0xffff,
222};
223
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700224enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700225 OFPFC_ADD = 0,
226 OFPFC_MODIFY = 1,
227 OFPFC_MODIFY_STRICT = 2,
228 OFPFC_DELETE = 3,
229 OFPFC_DELETE_STRICT = 4,
230};
231
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700232enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700233 OFPFF_SEND_FLOW_REM = 0x1,
234 OFPFF_CHECK_OVERLAP = 0x2,
235 OFPFF_RESET_COUNTS = 0x4,
236};
237
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700238enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700239 OFPG_MAX = 0xffffff00,
240 OFPG_ALL = 0xfffffffc,
241 OFPG_ANY = 0xffffffff,
242};
243
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700244enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700245 OFPGC_ADD = 0,
246 OFPGC_MODIFY = 1,
247 OFPGC_DELETE = 2,
248};
249
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700250enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700251 OFPGT_ALL = 0,
252 OFPGT_SELECT = 1,
253 OFPGT_INDIRECT = 2,
254 OFPGT_FF = 3,
255};
256
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700257enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700258 OFPR_NO_MATCH = 0,
259 OFPR_ACTION = 1,
260 OFPR_INVALID_TTL = 2,
261};
262
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700263enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700264 OFPRR_IDLE_TIMEOUT = 0,
265 OFPRR_HARD_TIMEOUT = 1,
266 OFPRR_DELETE = 2,
267 OFPRR_GROUP_DELETE = 3,
268};
269
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700270enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700271 OFPET_HELLO_FAILED = 0,
272 OFPET_BAD_REQUEST = 1,
273 OFPET_BAD_ACTION = 2,
274 OFPET_BAD_INSTRUCTION = 3,
275 OFPET_BAD_MATCH = 4,
276 OFPET_FLOW_MOD_FAILED = 5,
277 OFPET_GROUP_MOD_FAILED = 6,
278 OFPET_PORT_MOD_FAILED = 7,
279 OFPET_TABLE_MOD_FAILED = 8,
280 OFPET_QUEUE_OP_FAILED = 9,
281 OFPET_SWITCH_CONFIG_FAILED = 10,
282 OFPET_ROLE_REQUEST_FAILED = 11,
283 OFPET_EXPERIMENTER = 0xffff,
284};
285
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700286enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700287 OFPHFC_INCOMPATIBLE = 0,
288 OFPHFC_EPERM = 1,
289};
290
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700291enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700292 OFPBRC_BAD_VERSION = 0,
293 OFPBRC_BAD_TYPE = 1,
294 OFPBRC_BAD_STAT = 2,
295 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700296 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700297 OFPBRC_EPERM = 5,
298 OFPBRC_BAD_LEN = 6,
299 OFPBRC_BUFFER_EMPTY = 7,
300 OFPBRC_BUFFER_UNKNOWN = 8,
301 OFPBRC_BAD_TABLE_ID = 9,
302 OFPBRC_IS_SLAVE = 10,
303 OFPBRC_BAD_PORT = 11,
304 OFPBRC_BAD_PACKET = 12,
305};
306
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700307enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700308 OFPBAC_BAD_TYPE = 0,
309 OFPBAC_BAD_LEN = 1,
310 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700311 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700312 OFPBAC_BAD_OUT_PORT = 4,
313 OFPBAC_BAD_ARGUMENT = 5,
314 OFPBAC_EPERM = 6,
315 OFPBAC_TOO_MANY = 7,
316 OFPBAC_BAD_QUEUE = 8,
317 OFPBAC_BAD_OUT_GROUP = 9,
318 OFPBAC_MATCH_INCONSISTENT = 10,
319 OFPBAC_UNSUPPORTED_ORDER = 11,
320 OFPBAC_BAD_TAG = 12,
321 OFPBAC_BAD_SET_TYPE = 13,
322 OFPBAC_BAD_SET_LEN = 14,
323 OFPBAC_BAD_SET_ARGUMENT = 15,
324};
325
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700326enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700327 OFPBIC_UNKNOWN_INST = 0,
328 OFPBIC_UNSUP_INST = 1,
329 OFPBIC_BAD_TABLE_ID = 2,
330 OFPBIC_UNSUP_METADATA = 3,
331 OFPBIC_UNSUP_METADATA_MASK = 4,
332 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700333 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700334 OFPBIC_BAD_LEN = 7,
335 OFPBIC_EPERM = 8,
336};
337
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700338enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700339 OFPBMC_BAD_TYPE = 0,
340 OFPBMC_BAD_LEN = 1,
341 OFPBMC_BAD_TAG = 2,
342 OFPBMC_BAD_DL_ADDR_MASK = 3,
343 OFPBMC_BAD_NW_ADDR_MASK = 4,
344 OFPBMC_BAD_WILDCARDS = 5,
345 OFPBMC_BAD_FIELD = 6,
346 OFPBMC_BAD_VALUE = 7,
347 OFPBMC_BAD_MASK = 8,
348 OFPBMC_BAD_PREREQ = 9,
349 OFPBMC_DUP_FIELD = 10,
350 OFPBMC_EPERM = 11,
351};
352
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700353enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700354 OFPFMFC_UNKNOWN = 0,
355 OFPFMFC_TABLE_FULL = 1,
356 OFPFMFC_BAD_TABLE_ID = 2,
357 OFPFMFC_OVERLAP = 3,
358 OFPFMFC_EPERM = 4,
359 OFPFMFC_BAD_TIMEOUT = 5,
360 OFPFMFC_BAD_COMMAND = 6,
361 OFPFMFC_BAD_FLAGS = 7,
362};
363
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700364enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700365 OFPGMFC_GROUP_EXISTS = 0,
366 OFPGMFC_INVALID_GROUP = 1,
367 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
368 OFPGMFC_OUT_OF_GROUPS = 3,
369 OFPGMFC_OUT_OF_BUCKETS = 4,
370 OFPGMFC_CHAINING_UNSUPPORTED = 5,
371 OFPGMFC_WATCH_UNSUPPORTED = 6,
372 OFPGMFC_LOOP = 7,
373 OFPGMFC_UNKNOWN_GROUP = 8,
374 OFPGMFC_CHAINED_GROUP = 9,
375 OFPGMFC_BAD_TYPE = 10,
376 OFPGMFC_BAD_COMMAND = 11,
377 OFPGMFC_BAD_BUCKET = 12,
378 OFPGMFC_BAD_WATCH = 13,
379 OFPGMFC_EPERM = 14,
380};
381
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700382enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700383 OFPPMFC_BAD_PORT = 0,
384 OFPPMFC_BAD_HW_ADDR = 1,
385 OFPPMFC_BAD_CONFIG = 2,
386 OFPPMFC_BAD_ADVERTISE = 3,
387 OFPPMFC_EPERM = 4,
388};
389
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700390enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700391 OFPTMFC_BAD_TABLE = 0,
392 OFPTMFC_BAD_CONFIG = 1,
393 OFPTMFC_EPERM = 2,
394};
395
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700396enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700397 OFPQOFC_BAD_PORT = 0,
398 OFPQOFC_BAD_QUEUE = 1,
399 OFPQOFC_EPERM = 2,
400};
401
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700402enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700403 OFPSCFC_BAD_FLAGS = 0,
404 OFPSCFC_BAD_LEN = 1,
405 OFPSCFC_EPERM = 2,
406};
407
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700408enum ofp_role_request_failed_code (wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700409 OFPRRFC_STALE = 0,
410 OFPRRFC_UNSUP = 1,
411 OFPRRFC_BAD_ROLE = 2,
412};
413
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700414enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700415 OFPST_DESC = 0,
416 OFPST_FLOW = 1,
417 OFPST_AGGREGATE = 2,
418 OFPST_TABLE = 3,
419 OFPST_PORT = 4,
420 OFPST_QUEUE = 5,
421 OFPST_GROUP = 6,
422 OFPST_GROUP_DESC = 7,
423 OFPST_GROUP_FEATURES = 8,
424 OFPST_EXPERIMENTER = 0xffff,
425};
426
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700427enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
428};
429
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700430enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700431 OFPSF_REPLY_MORE = 0x1,
432};
433
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700434enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700435 OFPGFC_SELECT_WEIGHT = 0x1,
436 OFPGFC_SELECT_LIVENESS = 0x2,
437 OFPGFC_CHAINING = 0x4,
438 OFPGFC_CHAINING_CHECKS = 0x8,
439};
440
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700441enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700442 OFPQT_MIN_RATE = 0x1,
443 OFPQT_MAX_RATE = 0x2,
444 OFPQT_EXPERIMENTER = 0xffff,
445};
446
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700447enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700448 OFPCR_ROLE_NOCHANGE = 0,
449 OFPCR_ROLE_EQUAL = 1,
450 OFPCR_ROLE_MASTER = 2,
451 OFPCR_ROLE_SLAVE = 3,
452};
453
Rich Lanee9c37db2013-06-21 18:30:24 -0700454/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700455struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700456 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700457 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700458 uint16_t length;
459 uint32_t xid;
460};
461
Rich Lanee9c37db2013-06-21 18:30:24 -0700462struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700463 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700464 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700465 uint16_t length;
466 uint32_t xid;
467};
468
Rich Lanee9c37db2013-06-21 18:30:24 -0700469struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700470 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700471 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700472 uint16_t length;
473 uint32_t xid;
474 of_octets_t data;
475};
476
Rich Lanee9c37db2013-06-21 18:30:24 -0700477struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700478 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700479 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700480 uint16_t length;
481 uint32_t xid;
482 of_octets_t data;
483};
484
Rich Lanee9c37db2013-06-21 18:30:24 -0700485struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700486 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700487 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700488 uint16_t length;
489 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700490 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700491 uint32_t subtype;
492 of_octets_t data;
493};
494
Rich Lanee9c37db2013-06-21 18:30:24 -0700495struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700496 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700497 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700498 uint16_t length;
499 uint32_t xid;
500};
501
Rich Lanee9c37db2013-06-21 18:30:24 -0700502struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700503 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700504 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700505 uint16_t length;
506 uint32_t xid;
507};
508
Rich Lanee9c37db2013-06-21 18:30:24 -0700509struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700510 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700511 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700512 uint16_t length;
513 uint32_t xid;
514};
515
Rich Lanee9c37db2013-06-21 18:30:24 -0700516struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700517 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700518 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700519 uint16_t length;
520 uint32_t xid;
521 uint16_t flags;
522 uint16_t miss_send_len;
523};
524
Rich Lanee9c37db2013-06-21 18:30:24 -0700525struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700526 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700527 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700528 uint16_t length;
529 uint32_t xid;
530 uint16_t flags;
531 uint16_t miss_send_len;
532};
533
Rich Lanee9c37db2013-06-21 18:30:24 -0700534struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700535 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700536 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700537 uint16_t length;
538 uint32_t xid;
539 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700540 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700541 uint32_t config;
542};
543
Rich Lane68ae4d72013-05-09 10:55:19 -0700544struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700545 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700546 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700547 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700548 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700549 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700550 enum ofp_port_config config;
551 enum ofp_port_state state;
552 enum ofp_port_features curr;
553 enum ofp_port_features advertised;
554 enum ofp_port_features supported;
555 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700556 uint32_t curr_speed;
557 uint32_t max_speed;
558};
559
Rich Lanee9c37db2013-06-21 18:30:24 -0700560struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700561 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700562 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700563 uint16_t length;
564 uint32_t xid;
565};
566
Rich Lanee9c37db2013-06-21 18:30:24 -0700567struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700568 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700569 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700570 uint16_t length;
571 uint32_t xid;
572 uint64_t datapath_id;
573 uint32_t n_buffers;
574 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700575 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700576 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700577 uint32_t reserved;
578 list(of_port_desc_t) ports;
579};
580
Rich Lanee9c37db2013-06-21 18:30:24 -0700581struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700582 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700583 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700584 uint16_t length;
585 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700586 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700587 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700588 of_port_desc_t desc;
589};
590
Rich Lanee9c37db2013-06-21 18:30:24 -0700591struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700592 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700593 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700594 uint16_t length;
595 uint32_t xid;
596 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700597 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700598 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700599 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700600 uint32_t config;
601 uint32_t mask;
602 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700603 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700604};
605
Andreas Wundsam5da68512013-10-22 22:18:00 -0700606struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700607 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700608 uint16_t length;
609 list(of_oxm_t) oxm_list;
610};
611
Rich Lanee9c37db2013-06-21 18:30:24 -0700612struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700613 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700614 uint16_t len;
615 of_port_no_t port;
616 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700617 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700618};
619
Rich Lanee9c37db2013-06-21 18:30:24 -0700620struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700621 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700622 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700623 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700624};
625
Rich Lanee9c37db2013-06-21 18:30:24 -0700626struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700627 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700628 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700629 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700630};
631
Rich Lanee9c37db2013-06-21 18:30:24 -0700632struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700633 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700634 uint16_t len;
635 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700636 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700637};
638
Rich Lanee9c37db2013-06-21 18:30:24 -0700639struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700640 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700641 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700642 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700643};
644
Rich Lanee9c37db2013-06-21 18:30:24 -0700645struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700646 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700647 uint16_t len;
648 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700649 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700650};
651
Rich Lanee9c37db2013-06-21 18:30:24 -0700652struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700653 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700654 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700655 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700656};
657
Rich Lanee9c37db2013-06-21 18:30:24 -0700658struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700659 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700660 uint16_t len;
661 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700662 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700663};
664
Rich Lanee9c37db2013-06-21 18:30:24 -0700665struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700666 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700667 uint16_t len;
668 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700669 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700670};
671
Rich Lanee9c37db2013-06-21 18:30:24 -0700672struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700673 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700674 uint16_t len;
675 uint32_t queue_id;
676};
677
Rich Lanee9c37db2013-06-21 18:30:24 -0700678struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700679 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700680 uint16_t len;
681 uint32_t group_id;
682};
683
Rich Lanee9c37db2013-06-21 18:30:24 -0700684struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700685 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700686 uint16_t len;
687 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700688 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700689};
690
Rich Lanee9c37db2013-06-21 18:30:24 -0700691struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700692 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700693 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700694 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700695};
696
Andreas Wundsam5da68512013-10-22 22:18:00 -0700697struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700698 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700699 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700700 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700701};
702
Andreas Wundsam5da68512013-10-22 22:18:00 -0700703struct of_action_experimenter(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700704 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700705 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700706 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700707 of_octets_t data;
708};
709
Rich Lane68ae4d72013-05-09 10:55:19 -0700710struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700711 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700712 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700713 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700714};
715
Rich Lane68ae4d72013-05-09 10:55:19 -0700716struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700717 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700718 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700719 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700720};
721
Rich Lanee9c37db2013-06-21 18:30:24 -0700722struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700723 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700724 uint16_t len;
725 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700726 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700727};
728
Rich Lanee9c37db2013-06-21 18:30:24 -0700729struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700730 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700731 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700732 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700733 uint64_t metadata;
734 uint64_t metadata_mask;
735};
736
Rich Lanee9c37db2013-06-21 18:30:24 -0700737struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700738 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700739 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700740 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700741 list(of_action_t) actions;
742};
743
Rich Lanee9c37db2013-06-21 18:30:24 -0700744struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700745 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700746 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700747 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700748 list(of_action_t) actions;
749};
750
Rich Lanee9c37db2013-06-21 18:30:24 -0700751struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700752 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700753 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700754 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700755};
756
Rich Lanee9c37db2013-06-21 18:30:24 -0700757struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700758 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700759 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700760 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700761 of_octets_t data;
762};
763
Rich Lanee9c37db2013-06-21 18:30:24 -0700764struct of_flow_mod : of_header {
765 uint8_t version;
766 uint8_t type == 14;
767 uint16_t length;
768 uint32_t xid;
769 uint64_t cookie;
770 uint64_t cookie_mask;
771 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700772 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700773 uint16_t idle_timeout;
774 uint16_t hard_timeout;
775 uint16_t priority;
776 uint32_t buffer_id;
777 of_port_no_t out_port;
778 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700779 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700780 pad(2);
781 of_match_t match;
782 list(of_instruction_t) instructions;
783};
784
785struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700786 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700787 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700788 uint16_t length;
789 uint32_t xid;
790 uint64_t cookie;
791 uint64_t cookie_mask;
792 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700793 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700794 uint16_t idle_timeout;
795 uint16_t hard_timeout;
796 uint16_t priority;
797 uint32_t buffer_id;
798 of_port_no_t out_port;
799 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700800 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700801 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700802 of_match_t match;
803 list(of_instruction_t) instructions;
804};
805
Rich Lanee9c37db2013-06-21 18:30:24 -0700806struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700807 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700808 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700809 uint16_t length;
810 uint32_t xid;
811 uint64_t cookie;
812 uint64_t cookie_mask;
813 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700814 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700815 uint16_t idle_timeout;
816 uint16_t hard_timeout;
817 uint16_t priority;
818 uint32_t buffer_id;
819 of_port_no_t out_port;
820 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700821 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700822 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700823 of_match_t match;
824 list(of_instruction_t) instructions;
825};
826
Rich Lanee9c37db2013-06-21 18:30:24 -0700827struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700828 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700829 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700830 uint16_t length;
831 uint32_t xid;
832 uint64_t cookie;
833 uint64_t cookie_mask;
834 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700835 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700836 uint16_t idle_timeout;
837 uint16_t hard_timeout;
838 uint16_t priority;
839 uint32_t buffer_id;
840 of_port_no_t out_port;
841 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700842 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700843 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700844 of_match_t match;
845 list(of_instruction_t) instructions;
846};
847
Rich Lanee9c37db2013-06-21 18:30:24 -0700848struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700849 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700850 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700851 uint16_t length;
852 uint32_t xid;
853 uint64_t cookie;
854 uint64_t cookie_mask;
855 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700856 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700857 uint16_t idle_timeout;
858 uint16_t hard_timeout;
859 uint16_t priority;
860 uint32_t buffer_id;
861 of_port_no_t out_port;
862 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700863 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700864 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700865 of_match_t match;
866 list(of_instruction_t) instructions;
867};
868
Rich Lanee9c37db2013-06-21 18:30:24 -0700869struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700870 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700871 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700872 uint16_t length;
873 uint32_t xid;
874 uint64_t cookie;
875 uint64_t cookie_mask;
876 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700877 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700878 uint16_t idle_timeout;
879 uint16_t hard_timeout;
880 uint16_t priority;
881 uint32_t buffer_id;
882 of_port_no_t out_port;
883 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700884 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700885 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700886 of_match_t match;
887 list(of_instruction_t) instructions;
888};
889
Rich Lane68ae4d72013-05-09 10:55:19 -0700890struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700891 uint16_t len;
892 uint16_t weight;
893 of_port_no_t watch_port;
894 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700895 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700896 list(of_action_t) actions;
897};
898
Rich Lanee9c37db2013-06-21 18:30:24 -0700899struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700900 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700901 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700902 uint16_t length;
903 uint32_t xid;
904 uint16_t command;
905 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700906 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700907 uint32_t group_id;
908 list(of_bucket_t) buckets;
909};
910
Rich Lanee9c37db2013-06-21 18:30:24 -0700911struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700912 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700913 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700914 uint16_t length;
915 uint32_t xid;
916 uint32_t buffer_id;
917 of_port_no_t in_port;
918 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700919 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700920 list(of_action_t) actions;
921 of_octets_t data;
922};
923
Rich Lanee9c37db2013-06-21 18:30:24 -0700924struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700925 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700926 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700927 uint16_t length;
928 uint32_t xid;
929 uint32_t buffer_id;
930 uint16_t total_len;
931 uint8_t reason;
932 uint8_t table_id;
933 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700934 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700935 of_octets_t data; /* FIXME: Ensure total_len gets updated */
936};
937
Rich Lanee9c37db2013-06-21 18:30:24 -0700938struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700939 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700940 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700941 uint16_t length;
942 uint32_t xid;
943 uint64_t cookie;
944 uint16_t priority;
945 uint8_t reason;
946 uint8_t table_id;
947 uint32_t duration_sec;
948 uint32_t duration_nsec;
949 uint16_t idle_timeout;
950 uint16_t hard_timeout;
951 uint64_t packet_count;
952 uint64_t byte_count;
953 of_match_t match;
954};
955
Rich Lanee9c37db2013-06-21 18:30:24 -0700956struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700957 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700958 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700959 uint16_t length;
960 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700961 uint16_t err_type == ?;
962};
963
964struct of_hello_failed_error_msg : of_error_msg {
965 uint8_t version;
966 uint8_t type == 1;
967 uint16_t length;
968 uint32_t xid;
969 uint16_t err_type == 0;
970 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -0700971 of_octets_t data;
972};
973
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700974struct of_bad_request_error_msg : of_error_msg {
975 uint8_t version;
976 uint8_t type == 1;
977 uint16_t length;
978 uint32_t xid;
979 uint16_t err_type == 1;
980 enum ofp_bad_request_code code;
981 of_octets_t data;
982};
983
984struct of_bad_action_error_msg : of_error_msg {
985 uint8_t version;
986 uint8_t type == 1;
987 uint16_t length;
988 uint32_t xid;
989 uint16_t err_type == 2;
990 enum ofp_bad_action_code code;
991 of_octets_t data;
992};
993
994struct of_bad_instruction_error_msg : of_error_msg {
995 uint8_t version;
996 uint8_t type == 1;
997 uint16_t length;
998 uint32_t xid;
999 uint16_t err_type == 3;
1000 enum ofp_bad_instruction_code code;
1001 of_octets_t data;
1002};
1003
1004struct of_bad_match_error_msg : of_error_msg {
1005 uint8_t version;
1006 uint8_t type == 1;
1007 uint16_t length;
1008 uint32_t xid;
1009 uint16_t err_type == 4;
1010 enum ofp_bad_match_code code;
1011 of_octets_t data;
1012};
1013
1014struct of_flow_mod_failed_error_msg : of_error_msg {
1015 uint8_t version;
1016 uint8_t type == 1;
1017 uint16_t length;
1018 uint32_t xid;
1019 uint16_t err_type == 5;
1020 enum ofp_flow_mod_failed_code code;
1021 of_octets_t data;
1022};
1023
1024struct of_group_mod_failed_error_msg : of_error_msg {
1025 uint8_t version;
1026 uint8_t type == 1;
1027 uint16_t length;
1028 uint32_t xid;
1029 uint16_t err_type == 6;
1030 enum ofp_group_mod_failed_code code;
1031 of_octets_t data;
1032};
1033
1034struct of_port_mod_failed_error_msg : of_error_msg {
1035 uint8_t version;
1036 uint8_t type == 1;
1037 uint16_t length;
1038 uint32_t xid;
1039 uint16_t err_type == 7;
1040 enum ofp_port_mod_failed_code code;
1041 of_octets_t data;
1042};
1043
1044struct of_table_mod_failed_error_msg : of_error_msg {
1045 uint8_t version;
1046 uint8_t type == 1;
1047 uint16_t length;
1048 uint32_t xid;
1049 uint16_t err_type == 8;
1050 enum ofp_table_mod_failed_code code;
1051 of_octets_t data;
1052};
1053
1054struct of_queue_op_failed_error_msg : of_error_msg {
1055 uint8_t version;
1056 uint8_t type == 1;
1057 uint16_t length;
1058 uint32_t xid;
1059 uint16_t err_type == 9;
1060 enum ofp_queue_op_failed_code code;
1061 of_octets_t data;
1062};
1063
1064struct of_switch_config_failed_error_msg : of_error_msg {
1065 uint8_t version;
1066 uint8_t type == 1;
1067 uint16_t length;
1068 uint32_t xid;
1069 uint16_t err_type == 10;
1070 enum ofp_switch_config_failed_code code;
1071 of_octets_t data;
1072};
1073
1074struct of_role_request_failed_error_msg : of_error_msg {
1075 uint8_t version;
1076 uint8_t type == 1;
1077 uint16_t length;
1078 uint32_t xid;
1079 uint16_t err_type == 11;
1080 enum ofp_role_request_failed_code code;
1081 of_octets_t data;
1082};
1083
1084struct of_experimenter_error_msg {
1085 uint8_t version;
1086 uint8_t type == 1;
1087 uint16_t length;
1088 uint32_t xid;
1089 uint16_t err_type == 0xffff;
1090 uint16_t subtype;
1091 uint32_t experimenter;
1092 of_octets_t data;
1093};
Rich Lanea06d0c32013-03-25 08:52:03 -07001094
1095// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1096// FIXME: Verify disambiguation w/ length in object and entry
1097
Rich Lane68ae4d72013-05-09 10:55:19 -07001098struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001099 uint16_t length;
1100 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001101 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001102 uint32_t duration_sec;
1103 uint32_t duration_nsec;
1104 uint16_t priority;
1105 uint16_t idle_timeout;
1106 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001107 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001108 uint64_t cookie;
1109 uint64_t packet_count;
1110 uint64_t byte_count;
1111 of_match_t match;
1112 list(of_instruction_t) instructions;
1113};
1114
Rich Lane68ae4d72013-05-09 10:55:19 -07001115struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001116 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001117 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001118 of_table_name_t name;
1119 of_match_bmap_t match;
1120 of_wc_bmap_t wildcards;
1121 uint32_t write_actions;
1122 uint32_t apply_actions;
1123 uint64_t write_setfields;
1124 uint64_t apply_setfields;
1125 uint64_t metadata_match;
1126 uint64_t metadata_write;
1127 uint32_t instructions;
1128 uint32_t config;
1129 uint32_t max_entries;
1130 uint32_t active_count;
1131 uint64_t lookup_count;
1132 uint64_t matched_count;
1133};
1134
Rich Lane68ae4d72013-05-09 10:55:19 -07001135struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001136 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001137 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001138 uint64_t rx_packets;
1139 uint64_t tx_packets;
1140 uint64_t rx_bytes;
1141 uint64_t tx_bytes;
1142 uint64_t rx_dropped;
1143 uint64_t tx_dropped;
1144 uint64_t rx_errors;
1145 uint64_t tx_errors;
1146 uint64_t rx_frame_err;
1147 uint64_t rx_over_err;
1148 uint64_t rx_crc_err;
1149 uint64_t collisions;
1150};
1151
Rich Lane68ae4d72013-05-09 10:55:19 -07001152struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001153 of_port_no_t port_no;
1154 uint32_t queue_id;
1155 uint64_t tx_bytes;
1156 uint64_t tx_packets;
1157 uint64_t tx_errors;
1158};
1159
Rich Lane68ae4d72013-05-09 10:55:19 -07001160struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001161 uint64_t packet_count;
1162 uint64_t byte_count;
1163};
1164
Rich Lane68ae4d72013-05-09 10:55:19 -07001165struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001166 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001167 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001168 uint32_t group_id;
1169 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001170 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001171 uint64_t packet_count;
1172 uint64_t byte_count;
1173 list(of_bucket_counter_t) bucket_stats;
1174};
1175
Rich Lane68ae4d72013-05-09 10:55:19 -07001176struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001177 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001178 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001179 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001180 uint32_t group_id;
1181 list(of_bucket_t) buckets;
1182};
1183
1184// STATS:
1185// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1186
Rich Lanee9c37db2013-06-21 18:30:24 -07001187struct of_stats_request : of_header {
1188 uint8_t version;
1189 uint8_t type == 18;
1190 uint16_t length;
1191 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001192 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001193 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001194 pad(4);
1195};
1196
1197struct of_stats_reply : of_header {
1198 uint8_t version;
1199 uint8_t type == 19;
1200 uint16_t length;
1201 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001202 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001203 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001204 pad(4);
1205};
1206
1207struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001208 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001209 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001210 uint16_t length;
1211 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001212 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001213 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001214 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001215};
1216
Rich Lanee9c37db2013-06-21 18:30:24 -07001217struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001218 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001219 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001220 uint16_t length;
1221 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001222 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001223 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001224 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001225 of_desc_str_t mfr_desc;
1226 of_desc_str_t hw_desc;
1227 of_desc_str_t sw_desc;
1228 of_serial_num_t serial_num;
1229 of_desc_str_t dp_desc;
1230};
1231
Rich Lanee9c37db2013-06-21 18:30:24 -07001232struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001233 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001234 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001235 uint16_t length;
1236 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001237 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001238 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001239 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001240 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001241 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001242 of_port_no_t out_port;
1243 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001244 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001245 uint64_t cookie;
1246 uint64_t cookie_mask;
1247 of_match_t match;
1248};
1249
Rich Lanee9c37db2013-06-21 18:30:24 -07001250struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001251 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001252 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001253 uint16_t length;
1254 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001255 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001256 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001257 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001258 list(of_flow_stats_entry_t) entries;
1259};
1260
Rich Lanee9c37db2013-06-21 18:30:24 -07001261struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001262 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001263 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001264 uint16_t length;
1265 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001266 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001267 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001268 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001269 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001270 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001271 of_port_no_t out_port;
1272 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001273 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001274 uint64_t cookie;
1275 uint64_t cookie_mask;
1276 of_match_t match;
1277};
1278
Rich Lanee9c37db2013-06-21 18:30:24 -07001279struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001280 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001281 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001282 uint16_t length;
1283 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001284 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001285 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001286 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001287 uint64_t packet_count;
1288 uint64_t byte_count;
1289 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001290 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001291};
1292
Rich Lanee9c37db2013-06-21 18:30:24 -07001293struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001294 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001295 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001296 uint16_t length;
1297 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001298 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001299 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001300 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001301};
1302
Rich Lanee9c37db2013-06-21 18:30:24 -07001303struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001304 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001305 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001306 uint16_t length;
1307 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001308 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001309 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001310 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001311 list(of_table_stats_entry_t) entries;
1312};
1313
Rich Lanee9c37db2013-06-21 18:30:24 -07001314struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001315 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001316 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001317 uint16_t length;
1318 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001319 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001320 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001321 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001322 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001323 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001324};
1325
Rich Lanee9c37db2013-06-21 18:30:24 -07001326struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001327 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001328 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001329 uint16_t length;
1330 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001331 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001332 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001333 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001334 list(of_port_stats_entry_t) entries;
1335};
1336
Rich Lanee9c37db2013-06-21 18:30:24 -07001337struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001338 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001339 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001340 uint16_t length;
1341 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001342 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001343 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001344 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001345 of_port_no_t port_no;
1346 uint32_t queue_id;
1347};
1348
Rich Lanee9c37db2013-06-21 18:30:24 -07001349struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001350 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001351 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001352 uint16_t length;
1353 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001354 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001355 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001356 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001357 list(of_queue_stats_entry_t) entries;
1358};
1359
Rich Lanee9c37db2013-06-21 18:30:24 -07001360struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001361 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001362 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001363 uint16_t length;
1364 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001365 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001366 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001367 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001368 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001369 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001370};
1371
Rich Lanee9c37db2013-06-21 18:30:24 -07001372struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001373 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001374 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001375 uint16_t length;
1376 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001377 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001378 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001379 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001380 list(of_group_stats_entry_t) entries;
1381};
1382
Rich Lanee9c37db2013-06-21 18:30:24 -07001383struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001385 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001386 uint16_t length;
1387 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001388 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001389 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001390 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001391};
1392
Rich Lanee9c37db2013-06-21 18:30:24 -07001393struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001394 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001395 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001396 uint16_t length;
1397 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001398 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001399 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001400 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 list(of_group_desc_stats_entry_t) entries;
1402};
1403
Rich Lanee9c37db2013-06-21 18:30:24 -07001404struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001405 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001406 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001407 uint16_t length;
1408 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001409 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001410 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001411 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001412};
1413
Rich Lanee9c37db2013-06-21 18:30:24 -07001414struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001415 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001416 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001417 uint16_t length;
1418 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001419 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001420 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001421 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001422 uint32_t types;
1423 uint32_t capabilities;
1424 uint32_t max_groups_all;
1425 uint32_t max_groups_select;
1426 uint32_t max_groups_indirect;
1427 uint32_t max_groups_ff;
1428 uint32_t actions_all;
1429 uint32_t actions_select;
1430 uint32_t actions_indirect;
1431 uint32_t actions_ff;
1432};
1433
Rich Lanee9c37db2013-06-21 18:30:24 -07001434struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001435 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001436 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 uint16_t length;
1438 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001439 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001440 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001441 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001442 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001443 uint32_t subtype;
1444 of_octets_t data;
1445};
1446
Rich Lanee9c37db2013-06-21 18:30:24 -07001447struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001448 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001449 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 uint16_t length;
1451 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001452 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001453 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001454 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001455 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001456 uint32_t subtype;
1457 of_octets_t data;
1458};
1459
1460// END OF STATS OBJECTS
1461
Rich Lane68ae4d72013-05-09 10:55:19 -07001462struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001463 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001464 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001465 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001466};
1467
Rich Lanee9c37db2013-06-21 18:30:24 -07001468struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001469 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001470 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001471 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001472 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001473 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001474};
1475
Rich Lanee9c37db2013-06-21 18:30:24 -07001476struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001477 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001478 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001479 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001480 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001481 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001482};
1483
Rich Lanee9c37db2013-06-21 18:30:24 -07001484struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001485 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001486 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001487 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001488 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001489 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 of_octets_t data;
1491};
1492
Rich Lane68ae4d72013-05-09 10:55:19 -07001493struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001494 uint32_t queue_id;
1495 of_port_no_t port;
1496 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001497 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001498 list(of_queue_prop_t) properties;
1499};
1500
Rich Lanee9c37db2013-06-21 18:30:24 -07001501struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001502 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001503 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001504 uint16_t length;
1505 uint32_t xid;
1506 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001507 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001508};
1509
Rich Lanee9c37db2013-06-21 18:30:24 -07001510struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001511 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001512 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001513 uint16_t length;
1514 uint32_t xid;
1515 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001516 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001517 list(of_packet_queue_t) queues;
1518};
1519
Rich Lanee9c37db2013-06-21 18:30:24 -07001520struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001521 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001522 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001523 uint16_t length;
1524 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07001525 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001526 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001527 uint64_t generation_id;
1528};
1529
Rich Lanee9c37db2013-06-21 18:30:24 -07001530struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001531 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001532 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001533 uint16_t length;
1534 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07001535 enum ofp_controller_role role;
1536 pad(4);
1537 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07001538};