blob: 9032458d058d251ab0f4534cea92da8cb4396212 [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,
141};
142
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700143enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700144 OFPPS_LINK_DOWN = 0x1,
145 OFPPS_BLOCKED = 0x2,
146 OFPPS_LIVE = 0x4,
147};
148
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700149enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700150 OFPPF_10MB_HD = 0x1,
151 OFPPF_10MB_FD = 0x2,
152 OFPPF_100MB_HD = 0x4,
153 OFPPF_100MB_FD = 0x8,
154 OFPPF_1GB_HD = 0x10,
155 OFPPF_1GB_FD = 0x20,
156 OFPPF_10GB_FD = 0x40,
157 OFPPF_40GB_FD = 0x80,
158 OFPPF_100GB_FD = 0x100,
159 OFPPF_1TB_FD = 0x200,
160 OFPPF_OTHER = 0x400,
161 OFPPF_COPPER = 0x800,
162 OFPPF_FIBER = 0x1000,
163 OFPPF_AUTONEG = 0x2000,
164 OFPPF_PAUSE = 0x4000,
165 OFPPF_PAUSE_ASYM = 0x8000,
166};
167
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700168enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700169 OFPPR_ADD = 0,
170 OFPPR_DELETE = 1,
171 OFPPR_MODIFY = 2,
172};
173
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700174enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700175 OFPMT_STANDARD = 0,
176 OFPMT_OXM = 1,
177};
178
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700179enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700180 OFPXMC_NXM_0 = 0,
181 OFPXMC_NXM_1 = 1,
182 OFPXMC_OPENFLOW_BASIC = 0x8000,
183 OFPXMC_EXPERIMENTER = 0xffff,
184};
185
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700186enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700187 OFPVID_NONE = 0,
188 OFPVID_PRESENT = 0x1000,
189};
190
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700191enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700192 OFPAT_OUTPUT = 0,
193 OFPAT_COPY_TTL_OUT = 0xb,
194 OFPAT_COPY_TTL_IN = 0xc,
195 OFPAT_SET_MPLS_TTL = 0xf,
196 OFPAT_DEC_MPLS_TTL = 0x10,
197 OFPAT_PUSH_VLAN = 0x11,
198 OFPAT_POP_VLAN = 0x12,
199 OFPAT_PUSH_MPLS = 0x13,
200 OFPAT_POP_MPLS = 0x14,
201 OFPAT_SET_QUEUE = 0x15,
202 OFPAT_GROUP = 0x16,
203 OFPAT_SET_NW_TTL = 0x17,
204 OFPAT_DEC_NW_TTL = 0x18,
205 OFPAT_SET_FIELD = 0x19,
206 OFPAT_EXPERIMENTER = 0xffff,
207};
208
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700209enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700210 OFPCML_MAX = 0xffe5,
211 OFPCML_NO_BUFFER = 0xffff,
212};
213
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700214enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700215 OFPIT_GOTO_TABLE = 0x1,
216 OFPIT_WRITE_METADATA = 0x2,
217 OFPIT_WRITE_ACTIONS = 0x3,
218 OFPIT_APPLY_ACTIONS = 0x4,
219 OFPIT_CLEAR_ACTIONS = 0x5,
220 OFPIT_EXPERIMENTER = 0xffff,
221};
222
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700223enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700224 OFPFC_ADD = 0,
225 OFPFC_MODIFY = 1,
226 OFPFC_MODIFY_STRICT = 2,
227 OFPFC_DELETE = 3,
228 OFPFC_DELETE_STRICT = 4,
229};
230
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700231enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700232 OFPFF_SEND_FLOW_REM = 0x1,
233 OFPFF_CHECK_OVERLAP = 0x2,
234 OFPFF_RESET_COUNTS = 0x4,
235};
236
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700237enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700238 OFPG_MAX = 0xffffff00,
239 OFPG_ALL = 0xfffffffc,
240 OFPG_ANY = 0xffffffff,
241};
242
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700243enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700244 OFPGC_ADD = 0,
245 OFPGC_MODIFY = 1,
246 OFPGC_DELETE = 2,
247};
248
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700249enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700250 OFPGT_ALL = 0,
251 OFPGT_SELECT = 1,
252 OFPGT_INDIRECT = 2,
253 OFPGT_FF = 3,
254};
255
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700256enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700257 OFPR_NO_MATCH = 0,
258 OFPR_ACTION = 1,
259 OFPR_INVALID_TTL = 2,
260};
261
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700262enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700263 OFPRR_IDLE_TIMEOUT = 0,
264 OFPRR_HARD_TIMEOUT = 1,
265 OFPRR_DELETE = 2,
266 OFPRR_GROUP_DELETE = 3,
267};
268
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700269enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700270 OFPET_HELLO_FAILED = 0,
271 OFPET_BAD_REQUEST = 1,
272 OFPET_BAD_ACTION = 2,
273 OFPET_BAD_INSTRUCTION = 3,
274 OFPET_BAD_MATCH = 4,
275 OFPET_FLOW_MOD_FAILED = 5,
276 OFPET_GROUP_MOD_FAILED = 6,
277 OFPET_PORT_MOD_FAILED = 7,
278 OFPET_TABLE_MOD_FAILED = 8,
279 OFPET_QUEUE_OP_FAILED = 9,
280 OFPET_SWITCH_CONFIG_FAILED = 10,
281 OFPET_ROLE_REQUEST_FAILED = 11,
282 OFPET_EXPERIMENTER = 0xffff,
283};
284
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700285enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700286 OFPHFC_INCOMPATIBLE = 0,
287 OFPHFC_EPERM = 1,
288};
289
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700290enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700291 OFPBRC_BAD_VERSION = 0,
292 OFPBRC_BAD_TYPE = 1,
293 OFPBRC_BAD_STAT = 2,
294 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700295 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700296 OFPBRC_EPERM = 5,
297 OFPBRC_BAD_LEN = 6,
298 OFPBRC_BUFFER_EMPTY = 7,
299 OFPBRC_BUFFER_UNKNOWN = 8,
300 OFPBRC_BAD_TABLE_ID = 9,
301 OFPBRC_IS_SLAVE = 10,
302 OFPBRC_BAD_PORT = 11,
303 OFPBRC_BAD_PACKET = 12,
304};
305
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700306enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700307 OFPBAC_BAD_TYPE = 0,
308 OFPBAC_BAD_LEN = 1,
309 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700310 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700311 OFPBAC_BAD_OUT_PORT = 4,
312 OFPBAC_BAD_ARGUMENT = 5,
313 OFPBAC_EPERM = 6,
314 OFPBAC_TOO_MANY = 7,
315 OFPBAC_BAD_QUEUE = 8,
316 OFPBAC_BAD_OUT_GROUP = 9,
317 OFPBAC_MATCH_INCONSISTENT = 10,
318 OFPBAC_UNSUPPORTED_ORDER = 11,
319 OFPBAC_BAD_TAG = 12,
320 OFPBAC_BAD_SET_TYPE = 13,
321 OFPBAC_BAD_SET_LEN = 14,
322 OFPBAC_BAD_SET_ARGUMENT = 15,
323};
324
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700325enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700326 OFPBIC_UNKNOWN_INST = 0,
327 OFPBIC_UNSUP_INST = 1,
328 OFPBIC_BAD_TABLE_ID = 2,
329 OFPBIC_UNSUP_METADATA = 3,
330 OFPBIC_UNSUP_METADATA_MASK = 4,
331 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700332 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700333 OFPBIC_BAD_LEN = 7,
334 OFPBIC_EPERM = 8,
335};
336
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700337enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700338 OFPBMC_BAD_TYPE = 0,
339 OFPBMC_BAD_LEN = 1,
340 OFPBMC_BAD_TAG = 2,
341 OFPBMC_BAD_DL_ADDR_MASK = 3,
342 OFPBMC_BAD_NW_ADDR_MASK = 4,
343 OFPBMC_BAD_WILDCARDS = 5,
344 OFPBMC_BAD_FIELD = 6,
345 OFPBMC_BAD_VALUE = 7,
346 OFPBMC_BAD_MASK = 8,
347 OFPBMC_BAD_PREREQ = 9,
348 OFPBMC_DUP_FIELD = 10,
349 OFPBMC_EPERM = 11,
350};
351
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700352enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700353 OFPFMFC_UNKNOWN = 0,
354 OFPFMFC_TABLE_FULL = 1,
355 OFPFMFC_BAD_TABLE_ID = 2,
356 OFPFMFC_OVERLAP = 3,
357 OFPFMFC_EPERM = 4,
358 OFPFMFC_BAD_TIMEOUT = 5,
359 OFPFMFC_BAD_COMMAND = 6,
360 OFPFMFC_BAD_FLAGS = 7,
361};
362
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700363enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700364 OFPGMFC_GROUP_EXISTS = 0,
365 OFPGMFC_INVALID_GROUP = 1,
366 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
367 OFPGMFC_OUT_OF_GROUPS = 3,
368 OFPGMFC_OUT_OF_BUCKETS = 4,
369 OFPGMFC_CHAINING_UNSUPPORTED = 5,
370 OFPGMFC_WATCH_UNSUPPORTED = 6,
371 OFPGMFC_LOOP = 7,
372 OFPGMFC_UNKNOWN_GROUP = 8,
373 OFPGMFC_CHAINED_GROUP = 9,
374 OFPGMFC_BAD_TYPE = 10,
375 OFPGMFC_BAD_COMMAND = 11,
376 OFPGMFC_BAD_BUCKET = 12,
377 OFPGMFC_BAD_WATCH = 13,
378 OFPGMFC_EPERM = 14,
379};
380
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700381enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700382 OFPPMFC_BAD_PORT = 0,
383 OFPPMFC_BAD_HW_ADDR = 1,
384 OFPPMFC_BAD_CONFIG = 2,
385 OFPPMFC_BAD_ADVERTISE = 3,
386 OFPPMFC_EPERM = 4,
387};
388
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700389enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700390 OFPTMFC_BAD_TABLE = 0,
391 OFPTMFC_BAD_CONFIG = 1,
392 OFPTMFC_EPERM = 2,
393};
394
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700395enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700396 OFPQOFC_BAD_PORT = 0,
397 OFPQOFC_BAD_QUEUE = 1,
398 OFPQOFC_EPERM = 2,
399};
400
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700401enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700402 OFPSCFC_BAD_FLAGS = 0,
403 OFPSCFC_BAD_LEN = 1,
404 OFPSCFC_EPERM = 2,
405};
406
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700407enum ofp_role_request_failed_code (wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700408 OFPRRFC_STALE = 0,
409 OFPRRFC_UNSUP = 1,
410 OFPRRFC_BAD_ROLE = 2,
411};
412
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700413enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700414 OFPST_DESC = 0,
415 OFPST_FLOW = 1,
416 OFPST_AGGREGATE = 2,
417 OFPST_TABLE = 3,
418 OFPST_PORT = 4,
419 OFPST_QUEUE = 5,
420 OFPST_GROUP = 6,
421 OFPST_GROUP_DESC = 7,
422 OFPST_GROUP_FEATURES = 8,
423 OFPST_EXPERIMENTER = 0xffff,
424};
425
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700426enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700427 OFPSF_REPLY_MORE = 0x1,
428};
429
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700430enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700431 OFPGFC_SELECT_WEIGHT = 0x1,
432 OFPGFC_SELECT_LIVENESS = 0x2,
433 OFPGFC_CHAINING = 0x4,
434 OFPGFC_CHAINING_CHECKS = 0x8,
435};
436
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700437enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700438 OFPQT_MIN_RATE = 0x1,
439 OFPQT_MAX_RATE = 0x2,
440 OFPQT_EXPERIMENTER = 0xffff,
441};
442
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700443enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700444 OFPCR_ROLE_NOCHANGE = 0,
445 OFPCR_ROLE_EQUAL = 1,
446 OFPCR_ROLE_MASTER = 2,
447 OFPCR_ROLE_SLAVE = 3,
448};
449
Rich Lanee9c37db2013-06-21 18:30:24 -0700450/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700451struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700452 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700453 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700454 uint16_t length;
455 uint32_t xid;
456};
457
Rich Lanee9c37db2013-06-21 18:30:24 -0700458struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700459 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700460 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700461 uint16_t length;
462 uint32_t xid;
463};
464
Rich Lanee9c37db2013-06-21 18:30:24 -0700465struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700466 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700467 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700468 uint16_t length;
469 uint32_t xid;
470 of_octets_t data;
471};
472
Rich Lanee9c37db2013-06-21 18:30:24 -0700473struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700474 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700475 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700476 uint16_t length;
477 uint32_t xid;
478 of_octets_t data;
479};
480
Rich Lanee9c37db2013-06-21 18:30:24 -0700481struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700482 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700483 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700484 uint16_t length;
485 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700486 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700487 uint32_t subtype;
488 of_octets_t data;
489};
490
Rich Lanee9c37db2013-06-21 18:30:24 -0700491struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700492 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700493 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700494 uint16_t length;
495 uint32_t xid;
496};
497
Rich Lanee9c37db2013-06-21 18:30:24 -0700498struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700499 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700500 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700501 uint16_t length;
502 uint32_t xid;
503};
504
Rich Lanee9c37db2013-06-21 18:30:24 -0700505struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700506 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700507 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700508 uint16_t length;
509 uint32_t xid;
510};
511
Rich Lanee9c37db2013-06-21 18:30:24 -0700512struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700513 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700514 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700515 uint16_t length;
516 uint32_t xid;
517 uint16_t flags;
518 uint16_t miss_send_len;
519};
520
Rich Lanee9c37db2013-06-21 18:30:24 -0700521struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700522 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700523 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700524 uint16_t length;
525 uint32_t xid;
526 uint16_t flags;
527 uint16_t miss_send_len;
528};
529
Rich Lanee9c37db2013-06-21 18:30:24 -0700530struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700531 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700532 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700533 uint16_t length;
534 uint32_t xid;
535 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700536 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700537 uint32_t config;
538};
539
Rich Lane68ae4d72013-05-09 10:55:19 -0700540struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700541 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700542 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700543 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700544 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700545 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700546 enum ofp_port_config config;
547 enum ofp_port_state state;
548 enum ofp_port_features curr;
549 enum ofp_port_features advertised;
550 enum ofp_port_features supported;
551 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700552 uint32_t curr_speed;
553 uint32_t max_speed;
554};
555
Rich Lanee9c37db2013-06-21 18:30:24 -0700556struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700557 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700558 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700559 uint16_t length;
560 uint32_t xid;
561};
562
Rich Lanee9c37db2013-06-21 18:30:24 -0700563struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700564 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700565 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700566 uint16_t length;
567 uint32_t xid;
568 uint64_t datapath_id;
569 uint32_t n_buffers;
570 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700571 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700572 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700573 uint32_t reserved;
574 list(of_port_desc_t) ports;
575};
576
Rich Lanee9c37db2013-06-21 18:30:24 -0700577struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700578 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700579 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700580 uint16_t length;
581 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700582 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700583 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700584 of_port_desc_t desc;
585};
586
Rich Lanee9c37db2013-06-21 18:30:24 -0700587struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700588 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700589 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700590 uint16_t length;
591 uint32_t xid;
592 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700593 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700594 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700595 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700596 uint32_t config;
597 uint32_t mask;
598 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700599 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700600};
601
Andreas Wundsamfef7d5f2013-08-01 22:15:44 -0700602struct of_match_v3(align=8) {
Rich Lane31b87142013-05-09 22:05:42 -0700603 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700604 uint16_t length;
605 list(of_oxm_t) oxm_list;
606};
607
Rich Lanee9c37db2013-06-21 18:30:24 -0700608struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700609 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700610 uint16_t len;
611 of_port_no_t port;
612 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700613 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700614};
615
Rich Lanee9c37db2013-06-21 18:30:24 -0700616struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700617 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700618 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700619 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700620};
621
Rich Lanee9c37db2013-06-21 18:30:24 -0700622struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700623 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700624 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700625 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700626};
627
Rich Lanee9c37db2013-06-21 18:30:24 -0700628struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700629 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700630 uint16_t len;
631 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700632 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700633};
634
Rich Lanee9c37db2013-06-21 18:30:24 -0700635struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700636 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700637 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700638 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700639};
640
Rich Lanee9c37db2013-06-21 18:30:24 -0700641struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700642 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700643 uint16_t len;
644 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700645 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700646};
647
Rich Lanee9c37db2013-06-21 18:30:24 -0700648struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700649 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700650 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700651 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700652};
653
Rich Lanee9c37db2013-06-21 18:30:24 -0700654struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700655 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700656 uint16_t len;
657 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700658 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700659};
660
Rich Lanee9c37db2013-06-21 18:30:24 -0700661struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700662 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint16_t len;
664 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700665 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700666};
667
Rich Lanee9c37db2013-06-21 18:30:24 -0700668struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700669 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700670 uint16_t len;
671 uint32_t queue_id;
672};
673
Rich Lanee9c37db2013-06-21 18:30:24 -0700674struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700675 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700676 uint16_t len;
677 uint32_t group_id;
678};
679
Rich Lanee9c37db2013-06-21 18:30:24 -0700680struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700681 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 uint16_t len;
683 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700684 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700685};
686
Rich Lanee9c37db2013-06-21 18:30:24 -0700687struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700688 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700689 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700690 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700691};
692
Rich Lanee9c37db2013-06-21 18:30:24 -0700693struct of_action_set_field : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700694 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700695 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700696 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700697};
698
Rich Lanee9c37db2013-06-21 18:30:24 -0700699struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700700 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700701 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700702 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700703 of_octets_t data;
704};
705
Rich Lane68ae4d72013-05-09 10:55:19 -0700706struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700707 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700708 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700709 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700710};
711
Rich Lane68ae4d72013-05-09 10:55:19 -0700712struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700713 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700714 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700715 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700716};
717
Rich Lanee9c37db2013-06-21 18:30:24 -0700718struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700719 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700720 uint16_t len;
721 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700722 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700723};
724
Rich Lanee9c37db2013-06-21 18:30:24 -0700725struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700726 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700727 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700728 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700729 uint64_t metadata;
730 uint64_t metadata_mask;
731};
732
Rich Lanee9c37db2013-06-21 18:30:24 -0700733struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700734 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700735 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700736 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700737 list(of_action_t) actions;
738};
739
Rich Lanee9c37db2013-06-21 18:30:24 -0700740struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700741 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700742 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700743 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700744 list(of_action_t) actions;
745};
746
Rich Lanee9c37db2013-06-21 18:30:24 -0700747struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700748 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700749 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700750 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700751};
752
Rich Lanee9c37db2013-06-21 18:30:24 -0700753struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700754 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700755 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700756 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700757 of_octets_t data;
758};
759
Rich Lanee9c37db2013-06-21 18:30:24 -0700760struct of_flow_mod : of_header {
761 uint8_t version;
762 uint8_t type == 14;
763 uint16_t length;
764 uint32_t xid;
765 uint64_t cookie;
766 uint64_t cookie_mask;
767 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700768 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700769 uint16_t idle_timeout;
770 uint16_t hard_timeout;
771 uint16_t priority;
772 uint32_t buffer_id;
773 of_port_no_t out_port;
774 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700775 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700776 pad(2);
777 of_match_t match;
778 list(of_instruction_t) instructions;
779};
780
781struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700782 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700783 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700784 uint16_t length;
785 uint32_t xid;
786 uint64_t cookie;
787 uint64_t cookie_mask;
788 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700789 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700790 uint16_t idle_timeout;
791 uint16_t hard_timeout;
792 uint16_t priority;
793 uint32_t buffer_id;
794 of_port_no_t out_port;
795 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700796 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700797 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700798 of_match_t match;
799 list(of_instruction_t) instructions;
800};
801
Rich Lanee9c37db2013-06-21 18:30:24 -0700802struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700803 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700804 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700805 uint16_t length;
806 uint32_t xid;
807 uint64_t cookie;
808 uint64_t cookie_mask;
809 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700810 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700811 uint16_t idle_timeout;
812 uint16_t hard_timeout;
813 uint16_t priority;
814 uint32_t buffer_id;
815 of_port_no_t out_port;
816 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700817 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700818 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700819 of_match_t match;
820 list(of_instruction_t) instructions;
821};
822
Rich Lanee9c37db2013-06-21 18:30:24 -0700823struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700824 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700825 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700826 uint16_t length;
827 uint32_t xid;
828 uint64_t cookie;
829 uint64_t cookie_mask;
830 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700831 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700832 uint16_t idle_timeout;
833 uint16_t hard_timeout;
834 uint16_t priority;
835 uint32_t buffer_id;
836 of_port_no_t out_port;
837 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700838 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700839 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700840 of_match_t match;
841 list(of_instruction_t) instructions;
842};
843
Rich Lanee9c37db2013-06-21 18:30:24 -0700844struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700845 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700846 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700847 uint16_t length;
848 uint32_t xid;
849 uint64_t cookie;
850 uint64_t cookie_mask;
851 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700852 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700853 uint16_t idle_timeout;
854 uint16_t hard_timeout;
855 uint16_t priority;
856 uint32_t buffer_id;
857 of_port_no_t out_port;
858 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700859 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700860 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700861 of_match_t match;
862 list(of_instruction_t) instructions;
863};
864
Rich Lanee9c37db2013-06-21 18:30:24 -0700865struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700866 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700867 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700868 uint16_t length;
869 uint32_t xid;
870 uint64_t cookie;
871 uint64_t cookie_mask;
872 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700873 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700874 uint16_t idle_timeout;
875 uint16_t hard_timeout;
876 uint16_t priority;
877 uint32_t buffer_id;
878 of_port_no_t out_port;
879 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700880 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700881 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700882 of_match_t match;
883 list(of_instruction_t) instructions;
884};
885
Rich Lane68ae4d72013-05-09 10:55:19 -0700886struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700887 uint16_t len;
888 uint16_t weight;
889 of_port_no_t watch_port;
890 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700891 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700892 list(of_action_t) actions;
893};
894
Rich Lanee9c37db2013-06-21 18:30:24 -0700895struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700896 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700897 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700898 uint16_t length;
899 uint32_t xid;
900 uint16_t command;
901 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700902 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700903 uint32_t group_id;
904 list(of_bucket_t) buckets;
905};
906
Rich Lanee9c37db2013-06-21 18:30:24 -0700907struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700908 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700909 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700910 uint16_t length;
911 uint32_t xid;
912 uint32_t buffer_id;
913 of_port_no_t in_port;
914 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700915 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700916 list(of_action_t) actions;
917 of_octets_t data;
918};
919
Rich Lanee9c37db2013-06-21 18:30:24 -0700920struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700921 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700922 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700923 uint16_t length;
924 uint32_t xid;
925 uint32_t buffer_id;
926 uint16_t total_len;
927 uint8_t reason;
928 uint8_t table_id;
929 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700930 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700931 of_octets_t data; /* FIXME: Ensure total_len gets updated */
932};
933
Rich Lanee9c37db2013-06-21 18:30:24 -0700934struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700935 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700936 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700937 uint16_t length;
938 uint32_t xid;
939 uint64_t cookie;
940 uint16_t priority;
941 uint8_t reason;
942 uint8_t table_id;
943 uint32_t duration_sec;
944 uint32_t duration_nsec;
945 uint16_t idle_timeout;
946 uint16_t hard_timeout;
947 uint64_t packet_count;
948 uint64_t byte_count;
949 of_match_t match;
950};
951
Rich Lanee9c37db2013-06-21 18:30:24 -0700952struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700953 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700954 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700955 uint16_t length;
956 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700957 uint16_t err_type == ?;
958};
959
960struct of_hello_failed_error_msg : of_error_msg {
961 uint8_t version;
962 uint8_t type == 1;
963 uint16_t length;
964 uint32_t xid;
965 uint16_t err_type == 0;
966 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -0700967 of_octets_t data;
968};
969
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700970struct of_bad_request_error_msg : of_error_msg {
971 uint8_t version;
972 uint8_t type == 1;
973 uint16_t length;
974 uint32_t xid;
975 uint16_t err_type == 1;
976 enum ofp_bad_request_code code;
977 of_octets_t data;
978};
979
980struct of_bad_action_error_msg : of_error_msg {
981 uint8_t version;
982 uint8_t type == 1;
983 uint16_t length;
984 uint32_t xid;
985 uint16_t err_type == 2;
986 enum ofp_bad_action_code code;
987 of_octets_t data;
988};
989
990struct of_bad_instruction_error_msg : of_error_msg {
991 uint8_t version;
992 uint8_t type == 1;
993 uint16_t length;
994 uint32_t xid;
995 uint16_t err_type == 3;
996 enum ofp_bad_instruction_code code;
997 of_octets_t data;
998};
999
1000struct of_bad_match_error_msg : of_error_msg {
1001 uint8_t version;
1002 uint8_t type == 1;
1003 uint16_t length;
1004 uint32_t xid;
1005 uint16_t err_type == 4;
1006 enum ofp_bad_match_code code;
1007 of_octets_t data;
1008};
1009
1010struct of_flow_mod_failed_error_msg : of_error_msg {
1011 uint8_t version;
1012 uint8_t type == 1;
1013 uint16_t length;
1014 uint32_t xid;
1015 uint16_t err_type == 5;
1016 enum ofp_flow_mod_failed_code code;
1017 of_octets_t data;
1018};
1019
1020struct of_group_mod_failed_error_msg : of_error_msg {
1021 uint8_t version;
1022 uint8_t type == 1;
1023 uint16_t length;
1024 uint32_t xid;
1025 uint16_t err_type == 6;
1026 enum ofp_group_mod_failed_code code;
1027 of_octets_t data;
1028};
1029
1030struct of_port_mod_failed_error_msg : of_error_msg {
1031 uint8_t version;
1032 uint8_t type == 1;
1033 uint16_t length;
1034 uint32_t xid;
1035 uint16_t err_type == 7;
1036 enum ofp_port_mod_failed_code code;
1037 of_octets_t data;
1038};
1039
1040struct of_table_mod_failed_error_msg : of_error_msg {
1041 uint8_t version;
1042 uint8_t type == 1;
1043 uint16_t length;
1044 uint32_t xid;
1045 uint16_t err_type == 8;
1046 enum ofp_table_mod_failed_code code;
1047 of_octets_t data;
1048};
1049
1050struct of_queue_op_failed_error_msg : of_error_msg {
1051 uint8_t version;
1052 uint8_t type == 1;
1053 uint16_t length;
1054 uint32_t xid;
1055 uint16_t err_type == 9;
1056 enum ofp_queue_op_failed_code code;
1057 of_octets_t data;
1058};
1059
1060struct of_switch_config_failed_error_msg : of_error_msg {
1061 uint8_t version;
1062 uint8_t type == 1;
1063 uint16_t length;
1064 uint32_t xid;
1065 uint16_t err_type == 10;
1066 enum ofp_switch_config_failed_code code;
1067 of_octets_t data;
1068};
1069
1070struct of_role_request_failed_error_msg : of_error_msg {
1071 uint8_t version;
1072 uint8_t type == 1;
1073 uint16_t length;
1074 uint32_t xid;
1075 uint16_t err_type == 11;
1076 enum ofp_role_request_failed_code code;
1077 of_octets_t data;
1078};
1079
1080struct of_experimenter_error_msg {
1081 uint8_t version;
1082 uint8_t type == 1;
1083 uint16_t length;
1084 uint32_t xid;
1085 uint16_t err_type == 0xffff;
1086 uint16_t subtype;
1087 uint32_t experimenter;
1088 of_octets_t data;
1089};
Rich Lanea06d0c32013-03-25 08:52:03 -07001090
1091// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1092// FIXME: Verify disambiguation w/ length in object and entry
1093
Rich Lane68ae4d72013-05-09 10:55:19 -07001094struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001095 uint16_t length;
1096 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001097 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001098 uint32_t duration_sec;
1099 uint32_t duration_nsec;
1100 uint16_t priority;
1101 uint16_t idle_timeout;
1102 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001103 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001104 uint64_t cookie;
1105 uint64_t packet_count;
1106 uint64_t byte_count;
1107 of_match_t match;
1108 list(of_instruction_t) instructions;
1109};
1110
Rich Lane68ae4d72013-05-09 10:55:19 -07001111struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001112 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001113 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001114 of_table_name_t name;
1115 of_match_bmap_t match;
1116 of_wc_bmap_t wildcards;
1117 uint32_t write_actions;
1118 uint32_t apply_actions;
1119 uint64_t write_setfields;
1120 uint64_t apply_setfields;
1121 uint64_t metadata_match;
1122 uint64_t metadata_write;
1123 uint32_t instructions;
1124 uint32_t config;
1125 uint32_t max_entries;
1126 uint32_t active_count;
1127 uint64_t lookup_count;
1128 uint64_t matched_count;
1129};
1130
Rich Lane68ae4d72013-05-09 10:55:19 -07001131struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001132 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001133 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001134 uint64_t rx_packets;
1135 uint64_t tx_packets;
1136 uint64_t rx_bytes;
1137 uint64_t tx_bytes;
1138 uint64_t rx_dropped;
1139 uint64_t tx_dropped;
1140 uint64_t rx_errors;
1141 uint64_t tx_errors;
1142 uint64_t rx_frame_err;
1143 uint64_t rx_over_err;
1144 uint64_t rx_crc_err;
1145 uint64_t collisions;
1146};
1147
Rich Lane68ae4d72013-05-09 10:55:19 -07001148struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001149 of_port_no_t port_no;
1150 uint32_t queue_id;
1151 uint64_t tx_bytes;
1152 uint64_t tx_packets;
1153 uint64_t tx_errors;
1154};
1155
Rich Lane68ae4d72013-05-09 10:55:19 -07001156struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001157 uint64_t packet_count;
1158 uint64_t byte_count;
1159};
1160
Rich Lane68ae4d72013-05-09 10:55:19 -07001161struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001162 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001163 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001164 uint32_t group_id;
1165 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001166 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001167 uint64_t packet_count;
1168 uint64_t byte_count;
1169 list(of_bucket_counter_t) bucket_stats;
1170};
1171
Rich Lane68ae4d72013-05-09 10:55:19 -07001172struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001173 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001174 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001175 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001176 uint32_t group_id;
1177 list(of_bucket_t) buckets;
1178};
1179
1180// STATS:
1181// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1182
Rich Lanee9c37db2013-06-21 18:30:24 -07001183struct of_stats_request : of_header {
1184 uint8_t version;
1185 uint8_t type == 18;
1186 uint16_t length;
1187 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001188 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001189 uint16_t flags;
1190 pad(4);
1191};
1192
1193struct of_stats_reply : of_header {
1194 uint8_t version;
1195 uint8_t type == 19;
1196 uint16_t length;
1197 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001198 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001199 uint16_t flags;
1200 pad(4);
1201};
1202
1203struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001204 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001205 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001206 uint16_t length;
1207 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001208 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001209 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001210 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001211};
1212
Rich Lanee9c37db2013-06-21 18:30:24 -07001213struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001214 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001215 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001216 uint16_t length;
1217 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001218 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001219 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001220 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001221 of_desc_str_t mfr_desc;
1222 of_desc_str_t hw_desc;
1223 of_desc_str_t sw_desc;
1224 of_serial_num_t serial_num;
1225 of_desc_str_t dp_desc;
1226};
1227
Rich Lanee9c37db2013-06-21 18:30:24 -07001228struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001229 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001230 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001231 uint16_t length;
1232 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001233 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001234 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001235 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001236 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001237 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001238 of_port_no_t out_port;
1239 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001240 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001241 uint64_t cookie;
1242 uint64_t cookie_mask;
1243 of_match_t match;
1244};
1245
Rich Lanee9c37db2013-06-21 18:30:24 -07001246struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001247 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001248 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001249 uint16_t length;
1250 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001251 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001252 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001253 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001254 list(of_flow_stats_entry_t) entries;
1255};
1256
Rich Lanee9c37db2013-06-21 18:30:24 -07001257struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001258 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001259 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001260 uint16_t length;
1261 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001262 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001263 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001264 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001265 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001266 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001267 of_port_no_t out_port;
1268 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001269 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001270 uint64_t cookie;
1271 uint64_t cookie_mask;
1272 of_match_t match;
1273};
1274
Rich Lanee9c37db2013-06-21 18:30:24 -07001275struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001276 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001277 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001278 uint16_t length;
1279 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001280 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001281 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001282 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001283 uint64_t packet_count;
1284 uint64_t byte_count;
1285 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001286 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001287};
1288
Rich Lanee9c37db2013-06-21 18:30:24 -07001289struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001290 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001291 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001292 uint16_t length;
1293 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001294 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001295 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001296 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001297};
1298
Rich Lanee9c37db2013-06-21 18:30:24 -07001299struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001300 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001301 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001302 uint16_t length;
1303 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001304 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001305 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001306 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001307 list(of_table_stats_entry_t) entries;
1308};
1309
Rich Lanee9c37db2013-06-21 18:30:24 -07001310struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001311 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001312 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001313 uint16_t length;
1314 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001315 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001316 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001317 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001318 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001319 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001320};
1321
Rich Lanee9c37db2013-06-21 18:30:24 -07001322struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001323 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001324 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001325 uint16_t length;
1326 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001327 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001328 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001329 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001330 list(of_port_stats_entry_t) entries;
1331};
1332
Rich Lanee9c37db2013-06-21 18:30:24 -07001333struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001334 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001335 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001336 uint16_t length;
1337 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001338 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001339 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001340 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001341 of_port_no_t port_no;
1342 uint32_t queue_id;
1343};
1344
Rich Lanee9c37db2013-06-21 18:30:24 -07001345struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001346 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001347 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001348 uint16_t length;
1349 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001350 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001351 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001352 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001353 list(of_queue_stats_entry_t) entries;
1354};
1355
Rich Lanee9c37db2013-06-21 18:30:24 -07001356struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001357 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001358 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001359 uint16_t length;
1360 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001361 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001362 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001363 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001364 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001365 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001366};
1367
Rich Lanee9c37db2013-06-21 18:30:24 -07001368struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001369 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001370 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001371 uint16_t length;
1372 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001373 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001374 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001375 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001376 list(of_group_stats_entry_t) entries;
1377};
1378
Rich Lanee9c37db2013-06-21 18:30:24 -07001379struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001380 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001381 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001382 uint16_t length;
1383 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001384 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001385 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001386 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001387};
1388
Rich Lanee9c37db2013-06-21 18:30:24 -07001389struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001390 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001391 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001392 uint16_t length;
1393 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001394 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001395 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001396 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001397 list(of_group_desc_stats_entry_t) entries;
1398};
1399
Rich Lanee9c37db2013-06-21 18:30:24 -07001400struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001402 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001403 uint16_t length;
1404 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001405 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001406 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001407 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001408};
1409
Rich Lanee9c37db2013-06-21 18:30:24 -07001410struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001411 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001412 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001413 uint16_t length;
1414 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001415 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001416 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001417 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001418 uint32_t types;
1419 uint32_t capabilities;
1420 uint32_t max_groups_all;
1421 uint32_t max_groups_select;
1422 uint32_t max_groups_indirect;
1423 uint32_t max_groups_ff;
1424 uint32_t actions_all;
1425 uint32_t actions_select;
1426 uint32_t actions_indirect;
1427 uint32_t actions_ff;
1428};
1429
Rich Lanee9c37db2013-06-21 18:30:24 -07001430struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001431 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001432 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001433 uint16_t length;
1434 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001435 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001436 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001437 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001438 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001439 uint32_t subtype;
1440 of_octets_t data;
1441};
1442
Rich Lanee9c37db2013-06-21 18:30:24 -07001443struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001444 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001445 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001446 uint16_t length;
1447 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001448 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001449 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001450 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001451 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001452 uint32_t subtype;
1453 of_octets_t data;
1454};
1455
1456// END OF STATS OBJECTS
1457
Rich Lane68ae4d72013-05-09 10:55:19 -07001458struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001459 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001460 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001461 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001462};
1463
Rich Lanee9c37db2013-06-21 18:30:24 -07001464struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001465 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001466 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001467 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001468 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001469 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001470};
1471
Rich Lanee9c37db2013-06-21 18:30:24 -07001472struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001473 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001474 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001475 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001476 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001477 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001478};
1479
Rich Lanee9c37db2013-06-21 18:30:24 -07001480struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001481 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001482 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001483 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001484 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001485 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001486 of_octets_t data;
1487};
1488
Rich Lane68ae4d72013-05-09 10:55:19 -07001489struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 uint32_t queue_id;
1491 of_port_no_t port;
1492 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001493 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001494 list(of_queue_prop_t) properties;
1495};
1496
Rich Lanee9c37db2013-06-21 18:30:24 -07001497struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001498 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001499 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001500 uint16_t length;
1501 uint32_t xid;
1502 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001503 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001504};
1505
Rich Lanee9c37db2013-06-21 18:30:24 -07001506struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001507 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001508 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001509 uint16_t length;
1510 uint32_t xid;
1511 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001512 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001513 list(of_packet_queue_t) queues;
1514};
1515
Rich Lanee9c37db2013-06-21 18:30:24 -07001516struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001517 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001518 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001519 uint16_t length;
1520 uint32_t xid;
1521 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001522 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001523 uint64_t generation_id;
1524};
1525
Rich Lanee9c37db2013-06-21 18:30:24 -07001526struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001527 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001528 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001529 uint16_t length;
1530 uint32_t xid;
1531 of_octets_t data;
1532};