blob: 182794e9edaf4096b5701b7244981065b1c8c798 [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 Wundsam4ee51462013-07-30 11:00:37 -0700427enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700428 OFPSF_REPLY_MORE = 0x1,
429};
430
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700431enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700432 OFPGFC_SELECT_WEIGHT = 0x1,
433 OFPGFC_SELECT_LIVENESS = 0x2,
434 OFPGFC_CHAINING = 0x4,
435 OFPGFC_CHAINING_CHECKS = 0x8,
436};
437
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700438enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700439 OFPQT_MIN_RATE = 0x1,
440 OFPQT_MAX_RATE = 0x2,
441 OFPQT_EXPERIMENTER = 0xffff,
442};
443
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700444enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700445 OFPCR_ROLE_NOCHANGE = 0,
446 OFPCR_ROLE_EQUAL = 1,
447 OFPCR_ROLE_MASTER = 2,
448 OFPCR_ROLE_SLAVE = 3,
449};
450
Rich Lanee9c37db2013-06-21 18:30:24 -0700451/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700452struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700453 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700454 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700455 uint16_t length;
456 uint32_t xid;
457};
458
Rich Lanee9c37db2013-06-21 18:30:24 -0700459struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700460 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700461 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700462 uint16_t length;
463 uint32_t xid;
464};
465
Rich Lanee9c37db2013-06-21 18:30:24 -0700466struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700467 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700468 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700469 uint16_t length;
470 uint32_t xid;
471 of_octets_t data;
472};
473
Rich Lanee9c37db2013-06-21 18:30:24 -0700474struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700475 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700476 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700477 uint16_t length;
478 uint32_t xid;
479 of_octets_t data;
480};
481
Rich Lanee9c37db2013-06-21 18:30:24 -0700482struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700483 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700484 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700485 uint16_t length;
486 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700487 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700488 uint32_t subtype;
489 of_octets_t data;
490};
491
Rich Lanee9c37db2013-06-21 18:30:24 -0700492struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700493 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700494 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700495 uint16_t length;
496 uint32_t xid;
497};
498
Rich Lanee9c37db2013-06-21 18:30:24 -0700499struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700500 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700501 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700502 uint16_t length;
503 uint32_t xid;
504};
505
Rich Lanee9c37db2013-06-21 18:30:24 -0700506struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700507 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700508 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700509 uint16_t length;
510 uint32_t xid;
511};
512
Rich Lanee9c37db2013-06-21 18:30:24 -0700513struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700514 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700515 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700516 uint16_t length;
517 uint32_t xid;
518 uint16_t flags;
519 uint16_t miss_send_len;
520};
521
Rich Lanee9c37db2013-06-21 18:30:24 -0700522struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700523 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700524 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700525 uint16_t length;
526 uint32_t xid;
527 uint16_t flags;
528 uint16_t miss_send_len;
529};
530
Rich Lanee9c37db2013-06-21 18:30:24 -0700531struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700532 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700533 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700534 uint16_t length;
535 uint32_t xid;
536 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700537 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700538 uint32_t config;
539};
540
Rich Lane68ae4d72013-05-09 10:55:19 -0700541struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700542 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700543 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700544 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700545 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700546 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700547 enum ofp_port_config config;
548 enum ofp_port_state state;
549 enum ofp_port_features curr;
550 enum ofp_port_features advertised;
551 enum ofp_port_features supported;
552 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700553 uint32_t curr_speed;
554 uint32_t max_speed;
555};
556
Rich Lanee9c37db2013-06-21 18:30:24 -0700557struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700558 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700559 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700560 uint16_t length;
561 uint32_t xid;
562};
563
Rich Lanee9c37db2013-06-21 18:30:24 -0700564struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700565 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700566 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700567 uint16_t length;
568 uint32_t xid;
569 uint64_t datapath_id;
570 uint32_t n_buffers;
571 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700572 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700573 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700574 uint32_t reserved;
575 list(of_port_desc_t) ports;
576};
577
Rich Lanee9c37db2013-06-21 18:30:24 -0700578struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700579 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700580 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700581 uint16_t length;
582 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700583 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700584 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700585 of_port_desc_t desc;
586};
587
Rich Lanee9c37db2013-06-21 18:30:24 -0700588struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700589 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700590 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700591 uint16_t length;
592 uint32_t xid;
593 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700594 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700595 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700596 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint32_t config;
598 uint32_t mask;
599 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700600 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700601};
602
Andreas Wundsamfef7d5f2013-08-01 22:15:44 -0700603struct of_match_v3(align=8) {
Rich Lane31b87142013-05-09 22:05:42 -0700604 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700605 uint16_t length;
606 list(of_oxm_t) oxm_list;
607};
608
Rich Lanee9c37db2013-06-21 18:30:24 -0700609struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700610 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700611 uint16_t len;
612 of_port_no_t port;
613 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700614 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700615};
616
Rich Lanee9c37db2013-06-21 18:30:24 -0700617struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700618 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700619 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700620 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700621};
622
Rich Lanee9c37db2013-06-21 18:30:24 -0700623struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700624 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700625 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700626 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700627};
628
Rich Lanee9c37db2013-06-21 18:30:24 -0700629struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700630 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint16_t len;
632 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700633 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700634};
635
Rich Lanee9c37db2013-06-21 18:30:24 -0700636struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700637 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700638 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700639 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700640};
641
Rich Lanee9c37db2013-06-21 18:30:24 -0700642struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700643 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700644 uint16_t len;
645 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700646 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700647};
648
Rich Lanee9c37db2013-06-21 18:30:24 -0700649struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700650 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700651 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700652 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700653};
654
Rich Lanee9c37db2013-06-21 18:30:24 -0700655struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700656 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700657 uint16_t len;
658 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700659 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700660};
661
Rich Lanee9c37db2013-06-21 18:30:24 -0700662struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700663 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700664 uint16_t len;
665 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700666 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700667};
668
Rich Lanee9c37db2013-06-21 18:30:24 -0700669struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700670 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700671 uint16_t len;
672 uint32_t queue_id;
673};
674
Rich Lanee9c37db2013-06-21 18:30:24 -0700675struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700676 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700677 uint16_t len;
678 uint32_t group_id;
679};
680
Rich Lanee9c37db2013-06-21 18:30:24 -0700681struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700682 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700683 uint16_t len;
684 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700685 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700686};
687
Rich Lanee9c37db2013-06-21 18:30:24 -0700688struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700689 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700690 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700691 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700692};
693
Rich Lanee9c37db2013-06-21 18:30:24 -0700694struct of_action_set_field : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700695 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700697 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700698};
699
Rich Lanee9c37db2013-06-21 18:30:24 -0700700struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700701 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700702 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700703 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700704 of_octets_t data;
705};
706
Rich Lane68ae4d72013-05-09 10:55:19 -0700707struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700708 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700709 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700710 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700711};
712
Rich Lane68ae4d72013-05-09 10:55:19 -0700713struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700714 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700715 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700716 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700717};
718
Rich Lanee9c37db2013-06-21 18:30:24 -0700719struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700720 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700721 uint16_t len;
722 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700723 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700724};
725
Rich Lanee9c37db2013-06-21 18:30:24 -0700726struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700727 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700728 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700729 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700730 uint64_t metadata;
731 uint64_t metadata_mask;
732};
733
Rich Lanee9c37db2013-06-21 18:30:24 -0700734struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700735 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700736 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700737 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700738 list(of_action_t) actions;
739};
740
Rich Lanee9c37db2013-06-21 18:30:24 -0700741struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700742 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700743 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700744 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700745 list(of_action_t) actions;
746};
747
Rich Lanee9c37db2013-06-21 18:30:24 -0700748struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700749 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700750 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700751 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700752};
753
Rich Lanee9c37db2013-06-21 18:30:24 -0700754struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700755 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700756 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700757 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700758 of_octets_t data;
759};
760
Rich Lanee9c37db2013-06-21 18:30:24 -0700761struct of_flow_mod : of_header {
762 uint8_t version;
763 uint8_t type == 14;
764 uint16_t length;
765 uint32_t xid;
766 uint64_t cookie;
767 uint64_t cookie_mask;
768 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700769 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700770 uint16_t idle_timeout;
771 uint16_t hard_timeout;
772 uint16_t priority;
773 uint32_t buffer_id;
774 of_port_no_t out_port;
775 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700776 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700777 pad(2);
778 of_match_t match;
779 list(of_instruction_t) instructions;
780};
781
782struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700783 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700784 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700785 uint16_t length;
786 uint32_t xid;
787 uint64_t cookie;
788 uint64_t cookie_mask;
789 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700790 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700791 uint16_t idle_timeout;
792 uint16_t hard_timeout;
793 uint16_t priority;
794 uint32_t buffer_id;
795 of_port_no_t out_port;
796 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700797 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700798 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700799 of_match_t match;
800 list(of_instruction_t) instructions;
801};
802
Rich Lanee9c37db2013-06-21 18:30:24 -0700803struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700804 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700805 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700806 uint16_t length;
807 uint32_t xid;
808 uint64_t cookie;
809 uint64_t cookie_mask;
810 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700811 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700812 uint16_t idle_timeout;
813 uint16_t hard_timeout;
814 uint16_t priority;
815 uint32_t buffer_id;
816 of_port_no_t out_port;
817 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700818 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700819 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700820 of_match_t match;
821 list(of_instruction_t) instructions;
822};
823
Rich Lanee9c37db2013-06-21 18:30:24 -0700824struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700825 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700826 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700827 uint16_t length;
828 uint32_t xid;
829 uint64_t cookie;
830 uint64_t cookie_mask;
831 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700832 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700833 uint16_t idle_timeout;
834 uint16_t hard_timeout;
835 uint16_t priority;
836 uint32_t buffer_id;
837 of_port_no_t out_port;
838 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700839 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700840 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700841 of_match_t match;
842 list(of_instruction_t) instructions;
843};
844
Rich Lanee9c37db2013-06-21 18:30:24 -0700845struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700846 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700847 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700848 uint16_t length;
849 uint32_t xid;
850 uint64_t cookie;
851 uint64_t cookie_mask;
852 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700853 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700854 uint16_t idle_timeout;
855 uint16_t hard_timeout;
856 uint16_t priority;
857 uint32_t buffer_id;
858 of_port_no_t out_port;
859 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700860 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700861 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700862 of_match_t match;
863 list(of_instruction_t) instructions;
864};
865
Rich Lanee9c37db2013-06-21 18:30:24 -0700866struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700867 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700868 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700869 uint16_t length;
870 uint32_t xid;
871 uint64_t cookie;
872 uint64_t cookie_mask;
873 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700874 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700875 uint16_t idle_timeout;
876 uint16_t hard_timeout;
877 uint16_t priority;
878 uint32_t buffer_id;
879 of_port_no_t out_port;
880 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700881 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700882 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700883 of_match_t match;
884 list(of_instruction_t) instructions;
885};
886
Rich Lane68ae4d72013-05-09 10:55:19 -0700887struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 uint16_t len;
889 uint16_t weight;
890 of_port_no_t watch_port;
891 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700892 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700893 list(of_action_t) actions;
894};
895
Rich Lanee9c37db2013-06-21 18:30:24 -0700896struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700897 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700898 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700899 uint16_t length;
900 uint32_t xid;
901 uint16_t command;
902 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700903 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700904 uint32_t group_id;
905 list(of_bucket_t) buckets;
906};
907
Rich Lanee9c37db2013-06-21 18:30:24 -0700908struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700910 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700911 uint16_t length;
912 uint32_t xid;
913 uint32_t buffer_id;
914 of_port_no_t in_port;
915 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700916 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700917 list(of_action_t) actions;
918 of_octets_t data;
919};
920
Rich Lanee9c37db2013-06-21 18:30:24 -0700921struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700922 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700923 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700924 uint16_t length;
925 uint32_t xid;
926 uint32_t buffer_id;
927 uint16_t total_len;
928 uint8_t reason;
929 uint8_t table_id;
930 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700931 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700932 of_octets_t data; /* FIXME: Ensure total_len gets updated */
933};
934
Rich Lanee9c37db2013-06-21 18:30:24 -0700935struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700936 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700937 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700938 uint16_t length;
939 uint32_t xid;
940 uint64_t cookie;
941 uint16_t priority;
942 uint8_t reason;
943 uint8_t table_id;
944 uint32_t duration_sec;
945 uint32_t duration_nsec;
946 uint16_t idle_timeout;
947 uint16_t hard_timeout;
948 uint64_t packet_count;
949 uint64_t byte_count;
950 of_match_t match;
951};
952
Rich Lanee9c37db2013-06-21 18:30:24 -0700953struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700954 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700955 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700956 uint16_t length;
957 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700958 uint16_t err_type == ?;
959};
960
961struct of_hello_failed_error_msg : of_error_msg {
962 uint8_t version;
963 uint8_t type == 1;
964 uint16_t length;
965 uint32_t xid;
966 uint16_t err_type == 0;
967 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -0700968 of_octets_t data;
969};
970
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700971struct of_bad_request_error_msg : of_error_msg {
972 uint8_t version;
973 uint8_t type == 1;
974 uint16_t length;
975 uint32_t xid;
976 uint16_t err_type == 1;
977 enum ofp_bad_request_code code;
978 of_octets_t data;
979};
980
981struct of_bad_action_error_msg : of_error_msg {
982 uint8_t version;
983 uint8_t type == 1;
984 uint16_t length;
985 uint32_t xid;
986 uint16_t err_type == 2;
987 enum ofp_bad_action_code code;
988 of_octets_t data;
989};
990
991struct of_bad_instruction_error_msg : of_error_msg {
992 uint8_t version;
993 uint8_t type == 1;
994 uint16_t length;
995 uint32_t xid;
996 uint16_t err_type == 3;
997 enum ofp_bad_instruction_code code;
998 of_octets_t data;
999};
1000
1001struct of_bad_match_error_msg : of_error_msg {
1002 uint8_t version;
1003 uint8_t type == 1;
1004 uint16_t length;
1005 uint32_t xid;
1006 uint16_t err_type == 4;
1007 enum ofp_bad_match_code code;
1008 of_octets_t data;
1009};
1010
1011struct of_flow_mod_failed_error_msg : of_error_msg {
1012 uint8_t version;
1013 uint8_t type == 1;
1014 uint16_t length;
1015 uint32_t xid;
1016 uint16_t err_type == 5;
1017 enum ofp_flow_mod_failed_code code;
1018 of_octets_t data;
1019};
1020
1021struct of_group_mod_failed_error_msg : of_error_msg {
1022 uint8_t version;
1023 uint8_t type == 1;
1024 uint16_t length;
1025 uint32_t xid;
1026 uint16_t err_type == 6;
1027 enum ofp_group_mod_failed_code code;
1028 of_octets_t data;
1029};
1030
1031struct of_port_mod_failed_error_msg : of_error_msg {
1032 uint8_t version;
1033 uint8_t type == 1;
1034 uint16_t length;
1035 uint32_t xid;
1036 uint16_t err_type == 7;
1037 enum ofp_port_mod_failed_code code;
1038 of_octets_t data;
1039};
1040
1041struct of_table_mod_failed_error_msg : of_error_msg {
1042 uint8_t version;
1043 uint8_t type == 1;
1044 uint16_t length;
1045 uint32_t xid;
1046 uint16_t err_type == 8;
1047 enum ofp_table_mod_failed_code code;
1048 of_octets_t data;
1049};
1050
1051struct of_queue_op_failed_error_msg : of_error_msg {
1052 uint8_t version;
1053 uint8_t type == 1;
1054 uint16_t length;
1055 uint32_t xid;
1056 uint16_t err_type == 9;
1057 enum ofp_queue_op_failed_code code;
1058 of_octets_t data;
1059};
1060
1061struct of_switch_config_failed_error_msg : of_error_msg {
1062 uint8_t version;
1063 uint8_t type == 1;
1064 uint16_t length;
1065 uint32_t xid;
1066 uint16_t err_type == 10;
1067 enum ofp_switch_config_failed_code code;
1068 of_octets_t data;
1069};
1070
1071struct of_role_request_failed_error_msg : of_error_msg {
1072 uint8_t version;
1073 uint8_t type == 1;
1074 uint16_t length;
1075 uint32_t xid;
1076 uint16_t err_type == 11;
1077 enum ofp_role_request_failed_code code;
1078 of_octets_t data;
1079};
1080
1081struct of_experimenter_error_msg {
1082 uint8_t version;
1083 uint8_t type == 1;
1084 uint16_t length;
1085 uint32_t xid;
1086 uint16_t err_type == 0xffff;
1087 uint16_t subtype;
1088 uint32_t experimenter;
1089 of_octets_t data;
1090};
Rich Lanea06d0c32013-03-25 08:52:03 -07001091
1092// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1093// FIXME: Verify disambiguation w/ length in object and entry
1094
Rich Lane68ae4d72013-05-09 10:55:19 -07001095struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001096 uint16_t length;
1097 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001098 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001099 uint32_t duration_sec;
1100 uint32_t duration_nsec;
1101 uint16_t priority;
1102 uint16_t idle_timeout;
1103 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001104 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001105 uint64_t cookie;
1106 uint64_t packet_count;
1107 uint64_t byte_count;
1108 of_match_t match;
1109 list(of_instruction_t) instructions;
1110};
1111
Rich Lane68ae4d72013-05-09 10:55:19 -07001112struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001113 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001114 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001115 of_table_name_t name;
1116 of_match_bmap_t match;
1117 of_wc_bmap_t wildcards;
1118 uint32_t write_actions;
1119 uint32_t apply_actions;
1120 uint64_t write_setfields;
1121 uint64_t apply_setfields;
1122 uint64_t metadata_match;
1123 uint64_t metadata_write;
1124 uint32_t instructions;
1125 uint32_t config;
1126 uint32_t max_entries;
1127 uint32_t active_count;
1128 uint64_t lookup_count;
1129 uint64_t matched_count;
1130};
1131
Rich Lane68ae4d72013-05-09 10:55:19 -07001132struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001133 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001134 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001135 uint64_t rx_packets;
1136 uint64_t tx_packets;
1137 uint64_t rx_bytes;
1138 uint64_t tx_bytes;
1139 uint64_t rx_dropped;
1140 uint64_t tx_dropped;
1141 uint64_t rx_errors;
1142 uint64_t tx_errors;
1143 uint64_t rx_frame_err;
1144 uint64_t rx_over_err;
1145 uint64_t rx_crc_err;
1146 uint64_t collisions;
1147};
1148
Rich Lane68ae4d72013-05-09 10:55:19 -07001149struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001150 of_port_no_t port_no;
1151 uint32_t queue_id;
1152 uint64_t tx_bytes;
1153 uint64_t tx_packets;
1154 uint64_t tx_errors;
1155};
1156
Rich Lane68ae4d72013-05-09 10:55:19 -07001157struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001158 uint64_t packet_count;
1159 uint64_t byte_count;
1160};
1161
Rich Lane68ae4d72013-05-09 10:55:19 -07001162struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001163 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001164 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001165 uint32_t group_id;
1166 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001167 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001168 uint64_t packet_count;
1169 uint64_t byte_count;
1170 list(of_bucket_counter_t) bucket_stats;
1171};
1172
Rich Lane68ae4d72013-05-09 10:55:19 -07001173struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001174 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001175 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001176 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001177 uint32_t group_id;
1178 list(of_bucket_t) buckets;
1179};
1180
1181// STATS:
1182// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1183
Rich Lanee9c37db2013-06-21 18:30:24 -07001184struct of_stats_request : of_header {
1185 uint8_t version;
1186 uint8_t type == 18;
1187 uint16_t length;
1188 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001189 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001190 uint16_t flags;
1191 pad(4);
1192};
1193
1194struct of_stats_reply : of_header {
1195 uint8_t version;
1196 uint8_t type == 19;
1197 uint16_t length;
1198 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001199 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001200 uint16_t flags;
1201 pad(4);
1202};
1203
1204struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001205 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001206 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001207 uint16_t length;
1208 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001209 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001210 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001211 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001212};
1213
Rich Lanee9c37db2013-06-21 18:30:24 -07001214struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001215 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001216 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001217 uint16_t length;
1218 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001219 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001220 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001221 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001222 of_desc_str_t mfr_desc;
1223 of_desc_str_t hw_desc;
1224 of_desc_str_t sw_desc;
1225 of_serial_num_t serial_num;
1226 of_desc_str_t dp_desc;
1227};
1228
Rich Lanee9c37db2013-06-21 18:30:24 -07001229struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001230 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001231 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001232 uint16_t length;
1233 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001234 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001235 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001236 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001237 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001238 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001239 of_port_no_t out_port;
1240 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001241 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001242 uint64_t cookie;
1243 uint64_t cookie_mask;
1244 of_match_t match;
1245};
1246
Rich Lanee9c37db2013-06-21 18:30:24 -07001247struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001248 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001249 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001250 uint16_t length;
1251 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001252 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001253 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001254 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001255 list(of_flow_stats_entry_t) entries;
1256};
1257
Rich Lanee9c37db2013-06-21 18:30:24 -07001258struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001259 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001260 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001261 uint16_t length;
1262 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001263 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001264 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001265 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001266 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001267 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001268 of_port_no_t out_port;
1269 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001270 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001271 uint64_t cookie;
1272 uint64_t cookie_mask;
1273 of_match_t match;
1274};
1275
Rich Lanee9c37db2013-06-21 18:30:24 -07001276struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001277 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001278 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001279 uint16_t length;
1280 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001281 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001282 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001283 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001284 uint64_t packet_count;
1285 uint64_t byte_count;
1286 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001287 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001288};
1289
Rich Lanee9c37db2013-06-21 18:30:24 -07001290struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001291 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001292 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001293 uint16_t length;
1294 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001295 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001296 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001297 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001298};
1299
Rich Lanee9c37db2013-06-21 18:30:24 -07001300struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001301 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001302 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001303 uint16_t length;
1304 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001305 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001306 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001307 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001308 list(of_table_stats_entry_t) entries;
1309};
1310
Rich Lanee9c37db2013-06-21 18:30:24 -07001311struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001312 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001313 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001314 uint16_t length;
1315 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001316 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001317 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001318 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001319 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001320 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001321};
1322
Rich Lanee9c37db2013-06-21 18:30:24 -07001323struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001324 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001325 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001326 uint16_t length;
1327 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001328 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001329 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001330 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001331 list(of_port_stats_entry_t) entries;
1332};
1333
Rich Lanee9c37db2013-06-21 18:30:24 -07001334struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001335 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001336 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001337 uint16_t length;
1338 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001339 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001340 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001341 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001342 of_port_no_t port_no;
1343 uint32_t queue_id;
1344};
1345
Rich Lanee9c37db2013-06-21 18:30:24 -07001346struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001347 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001348 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001349 uint16_t length;
1350 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001351 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001352 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001353 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001354 list(of_queue_stats_entry_t) entries;
1355};
1356
Rich Lanee9c37db2013-06-21 18:30:24 -07001357struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001358 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001359 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001360 uint16_t length;
1361 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001362 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001363 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001364 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001365 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001366 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001367};
1368
Rich Lanee9c37db2013-06-21 18:30:24 -07001369struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001370 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001371 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001372 uint16_t length;
1373 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001374 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001375 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001376 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001377 list(of_group_stats_entry_t) entries;
1378};
1379
Rich Lanee9c37db2013-06-21 18:30:24 -07001380struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001381 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001382 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001383 uint16_t length;
1384 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001385 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001386 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001387 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001388};
1389
Rich Lanee9c37db2013-06-21 18:30:24 -07001390struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001391 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001392 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001393 uint16_t length;
1394 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001395 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001396 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001397 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001398 list(of_group_desc_stats_entry_t) entries;
1399};
1400
Rich Lanee9c37db2013-06-21 18:30:24 -07001401struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001402 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001403 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001404 uint16_t length;
1405 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001406 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001407 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001408 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001409};
1410
Rich Lanee9c37db2013-06-21 18:30:24 -07001411struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001412 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001413 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001414 uint16_t length;
1415 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001416 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001417 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001418 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001419 uint32_t types;
1420 uint32_t capabilities;
1421 uint32_t max_groups_all;
1422 uint32_t max_groups_select;
1423 uint32_t max_groups_indirect;
1424 uint32_t max_groups_ff;
1425 uint32_t actions_all;
1426 uint32_t actions_select;
1427 uint32_t actions_indirect;
1428 uint32_t actions_ff;
1429};
1430
Rich Lanee9c37db2013-06-21 18:30:24 -07001431struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001432 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001433 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001434 uint16_t length;
1435 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001436 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001438 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001439 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001440 uint32_t subtype;
1441 of_octets_t data;
1442};
1443
Rich Lanee9c37db2013-06-21 18:30:24 -07001444struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001445 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001446 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001447 uint16_t length;
1448 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001449 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001451 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001452 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001453 uint32_t subtype;
1454 of_octets_t data;
1455};
1456
1457// END OF STATS OBJECTS
1458
Rich Lane68ae4d72013-05-09 10:55:19 -07001459struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001460 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001461 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001462 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001463};
1464
Rich Lanee9c37db2013-06-21 18:30:24 -07001465struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001466 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001467 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001468 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001469 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001470 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001471};
1472
Rich Lanee9c37db2013-06-21 18:30:24 -07001473struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001474 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001475 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001476 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001477 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001478 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001479};
1480
Rich Lanee9c37db2013-06-21 18:30:24 -07001481struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001482 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001483 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001484 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001485 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001486 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001487 of_octets_t data;
1488};
1489
Rich Lane68ae4d72013-05-09 10:55:19 -07001490struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001491 uint32_t queue_id;
1492 of_port_no_t port;
1493 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001494 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001495 list(of_queue_prop_t) properties;
1496};
1497
Rich Lanee9c37db2013-06-21 18:30:24 -07001498struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001499 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001500 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001501 uint16_t length;
1502 uint32_t xid;
1503 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001504 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001505};
1506
Rich Lanee9c37db2013-06-21 18:30:24 -07001507struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001508 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001509 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001510 uint16_t length;
1511 uint32_t xid;
1512 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001513 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001514 list(of_packet_queue_t) queues;
1515};
1516
Rich Lanee9c37db2013-06-21 18:30:24 -07001517struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001518 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001519 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001520 uint16_t length;
1521 uint32_t xid;
1522 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001523 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001524 uint64_t generation_id;
1525};
1526
Rich Lanee9c37db2013-06-21 18:30:24 -07001527struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001528 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001529 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001530 uint16_t length;
1531 uint32_t xid;
1532 of_octets_t data;
1533};