blob: ab32abe8a250f0d876a5a0acb0d2d3892c2839a2 [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 4
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
38 OFP_TCP_PORT = 6633,
39 OFP_SSL_PORT = 6633,
40
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 OFPQ_MAX_RATE_UNCFG = 0xffff,
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59};
60
61enum ofp_port_no {
62 OFPP_ANY = 0xffffffff,
63};
64
65enum ofp_port {
66 OFPP_MAX = 0xffffff00,
67 OFPP_IN_PORT = 0xfffffff8,
68 OFPP_TABLE = 0xfffffff9,
69 OFPP_NORMAL = 0xfffffffa,
70 OFPP_FLOOD = 0xfffffffb,
71 OFPP_ALL = 0xfffffffc,
72 OFPP_CONTROLLER = 0xfffffffd,
73 OFPP_LOCAL = 0xfffffffe,
74};
75
76enum ofp_type {
77 OFPT_HELLO = 0,
78 OFPT_ERROR = 1,
79 OFPT_ECHO_REQUEST = 2,
80 OFPT_ECHO_REPLY = 3,
81 OFPT_EXPERIMENTER = 4,
82 OFPT_FEATURES_REQUEST = 5,
83 OFPT_FEATURES_REPLY = 6,
84 OFPT_GET_CONFIG_REQUEST = 7,
85 OFPT_GET_CONFIG_REPLY = 8,
86 OFPT_SET_CONFIG = 9,
87 OFPT_PACKET_IN = 10,
88 OFPT_FLOW_REMOVED = 11,
89 OFPT_PORT_STATUS = 12,
90 OFPT_PACKET_OUT = 13,
91 OFPT_FLOW_MOD = 14,
92 OFPT_GROUP_MOD = 15,
93 OFPT_PORT_MOD = 16,
94 OFPT_TABLE_MOD = 17,
95 OFPT_MULTIPART_REQUEST = 18,
96 OFPT_MULTIPART_REPLY = 19,
97 OFPT_BARRIER_REQUEST = 20,
98 OFPT_BARRIER_REPLY = 21,
99 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
100 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
101 OFPT_ROLE_REQUEST = 24,
102 OFPT_ROLE_REPLY = 25,
103 OFPT_GET_ASYNC_REQUEST = 26,
104 OFPT_GET_ASYNC_REPLY = 27,
105 OFPT_SET_ASYNC = 28,
106 OFPT_METER_MOD = 29,
107};
108
109enum ofp_config_flags {
110 OFPC_FRAG_NORMAL = 0,
111 OFPC_FRAG_DROP = 1,
112 OFPC_FRAG_REASM = 2,
113 OFPC_FRAG_MASK = 3,
114};
115
116enum ofp_table_config {
117 OFPTC_DEPRECATED_MASK = 0x3,
118};
119
120enum ofp_table {
121 OFPTT_MAX = 0xfe,
122 OFPTT_ALL = 0xff,
123};
124
125enum ofp_capabilities {
126 OFPC_FLOW_STATS = 0x1,
127 OFPC_TABLE_STATS = 0x2,
128 OFPC_PORT_STATS = 0x4,
129 OFPC_GROUP_STATS = 0x8,
130 OFPC_IP_REASM = 0x20,
131 OFPC_QUEUE_STATS = 0x40,
132 OFPC_PORT_BLOCKED = 0x100,
133};
134
135enum ofp_port_config {
136 OFPPC_PORT_DOWN = 0x1,
137 OFPPC_NO_RECV = 0x4,
138 OFPPC_NO_FWD = 0x20,
139 OFPPC_NO_PACKET_IN = 0x40,
140};
141
142enum ofp_port_state {
143 OFPPS_LINK_DOWN = 0x1,
144 OFPPS_BLOCKED = 0x2,
145 OFPPS_LIVE = 0x4,
146};
147
148enum ofp_port_features {
149 OFPPF_10MB_HD = 0x1,
150 OFPPF_10MB_FD = 0x2,
151 OFPPF_100MB_HD = 0x4,
152 OFPPF_100MB_FD = 0x8,
153 OFPPF_1GB_HD = 0x10,
154 OFPPF_1GB_FD = 0x20,
155 OFPPF_10GB_FD = 0x40,
156 OFPPF_40GB_FD = 0x80,
157 OFPPF_100GB_FD = 0x100,
158 OFPPF_1TB_FD = 0x200,
159 OFPPF_OTHER = 0x400,
160 OFPPF_COPPER = 0x800,
161 OFPPF_FIBER = 0x1000,
162 OFPPF_AUTONEG = 0x2000,
163 OFPPF_PAUSE = 0x4000,
164 OFPPF_PAUSE_ASYM = 0x8000,
165};
166
167enum ofp_port_reason {
168 OFPPR_ADD = 0,
169 OFPPR_DELETE = 1,
170 OFPPR_MODIFY = 2,
171};
172
173enum ofp_match_type {
174 OFPMT_STANDARD = 0,
175 OFPMT_OXM = 1,
176};
177
178enum ofp_oxm_class {
179 OFPXMC_NXM_0 = 0,
180 OFPXMC_NXM_1 = 1,
181 OFPXMC_OPENFLOW_BASIC = 0x8000,
182 OFPXMC_EXPERIMENTER = 0xffff,
183};
184
185enum ofp_vlan_id {
186 OFPVID_NONE = 0,
187 OFPVID_PRESENT = 0x1000,
188};
189
190enum ofp_ipv6exthdr_flags {
191 OFPIEH_NONEXT = 0x1,
192 OFPIEH_ESP = 0x2,
193 OFPIEH_AUTH = 0x4,
194 OFPIEH_DEST = 0x8,
195 OFPIEH_FRAG = 0x10,
196 OFPIEH_ROUTER = 0x20,
197 OFPIEH_HOP = 0x40,
198 OFPIEH_UNREP = 0x80,
199 OFPIEH_UNSEQ = 0x100,
200};
201
202enum ofp_action_type {
203 OFPAT_OUTPUT = 0,
204 OFPAT_COPY_TTL_OUT = 0xb,
205 OFPAT_COPY_TTL_IN = 0xc,
206 OFPAT_SET_MPLS_TTL = 0xf,
207 OFPAT_DEC_MPLS_TTL = 0x10,
208 OFPAT_PUSH_VLAN = 0x11,
209 OFPAT_POP_VLAN = 0x12,
210 OFPAT_PUSH_MPLS = 0x13,
211 OFPAT_POP_MPLS = 0x14,
212 OFPAT_SET_QUEUE = 0x15,
213 OFPAT_GROUP = 0x16,
214 OFPAT_SET_NW_TTL = 0x17,
215 OFPAT_DEC_NW_TTL = 0x18,
216 OFPAT_SET_FIELD = 0x19,
217 OFPAT_PUSH_PBB = 0x1a,
218 OFPAT_POP_PBB = 0x1b,
219 OFPAT_EXPERIMENTER = 0xffff,
220};
221
222enum ofp_controller_max_len {
223 OFPCML_MAX = 0xffe5,
224 OFPCML_NO_BUFFER = 0xffff,
225};
226
227enum ofp_instruction_type {
228 OFPIT_GOTO_TABLE = 0x1,
229 OFPIT_WRITE_METADATA = 0x2,
230 OFPIT_WRITE_ACTIONS = 0x3,
231 OFPIT_APPLY_ACTIONS = 0x4,
232 OFPIT_CLEAR_ACTIONS = 0x5,
233 OFPIT_METER = 0x6,
234 OFPIT_EXPERIMENTER = 0xffff,
235};
236
237enum ofp_flow_mod_command {
238 OFPFC_ADD = 0,
239 OFPFC_MODIFY = 1,
240 OFPFC_MODIFY_STRICT = 2,
241 OFPFC_DELETE = 3,
242 OFPFC_DELETE_STRICT = 4,
243};
244
245enum ofp_flow_mod_flags {
246 OFPFF_SEND_FLOW_REM = 0x1,
247 OFPFF_CHECK_OVERLAP = 0x2,
248 OFPFF_RESET_COUNTS = 0x4,
249 OFPFF_NO_PKT_COUNTS = 0x8,
250 OFPFF_NO_BYT_COUNTS = 0x10,
251};
252
253enum ofp_group {
254 OFPG_MAX = 0xffffff00,
255 OFPG_ALL = 0xfffffffc,
256 OFPG_ANY = 0xffffffff,
257};
258
259enum ofp_group_mod_command {
260 OFPGC_ADD = 0,
261 OFPGC_MODIFY = 1,
262 OFPGC_DELETE = 2,
263};
264
265enum ofp_group_type {
266 OFPGT_ALL = 0,
267 OFPGT_SELECT = 1,
268 OFPGT_INDIRECT = 2,
269 OFPGT_FF = 3,
270};
271
272enum ofp_packet_in_reason {
273 OFPR_NO_MATCH = 0,
274 OFPR_ACTION = 1,
275 OFPR_INVALID_TTL = 2,
276};
277
278enum ofp_flow_removed_reason {
279 OFPRR_IDLE_TIMEOUT = 0,
280 OFPRR_HARD_TIMEOUT = 1,
281 OFPRR_DELETE = 2,
282 OFPRR_GROUP_DELETE = 3,
283};
284
285enum ofp_meter {
286 OFPM_MAX = 0xffff0000,
287 OFPM_SLOWPATH = 0xfffffffd,
288 OFPM_CONTROLLER = 0xfffffffe,
289 OFPM_ALL = 0xffffffff,
290};
291
292enum ofp_meter_band_type {
293 OFPMBT_DROP = 0x1,
294 OFPMBT_DSCP_REMARK = 0x2,
295 OFPMBT_EXPERIMENTER = 0xffff,
296};
297
298enum ofp_meter_mod_command {
299 OFPMC_ADD = 0,
300 OFPMC_MODIFY = 1,
301 OFPMC_DELETE = 2,
302};
303
304enum ofp_meter_flags {
305 OFPMF_KBPS = 0x1,
306 OFPMF_PKTPS = 0x2,
307 OFPMF_BURST = 0x4,
308 OFPMF_STATS = 0x8,
309};
310
311enum ofp_error_type {
312 OFPET_HELLO_FAILED = 0,
313 OFPET_BAD_REQUEST = 1,
314 OFPET_BAD_ACTION = 2,
315 OFPET_BAD_INSTRUCTION = 3,
316 OFPET_BAD_MATCH = 4,
317 OFPET_FLOW_MOD_FAILED = 5,
318 OFPET_GROUP_MOD_FAILED = 6,
319 OFPET_PORT_MOD_FAILED = 7,
320 OFPET_TABLE_MOD_FAILED = 8,
321 OFPET_QUEUE_OP_FAILED = 9,
322 OFPET_SWITCH_CONFIG_FAILED = 10,
323 OFPET_ROLE_REQUEST_FAILED = 11,
324 OFPET_METER_MOD_FAILED = 12,
325 OFPET_TABLE_FEATURES_FAILED = 13,
326 OFPET_EXPERIMENTER = 0xffff,
327};
328
329enum ofp_hello_failed_code {
330 OFPHFC_INCOMPATIBLE = 0,
331 OFPHFC_EPERM = 1,
332};
333
334enum ofp_bad_request_code {
335 OFPBRC_BAD_VERSION = 0,
336 OFPBRC_BAD_TYPE = 1,
337 OFPBRC_BAD_MULTIPART = 2,
338 OFPBRC_BAD_EXPERIMENTER = 3,
339 OFPBRC_BAD_EXP_TYPE = 4,
340 OFPBRC_EPERM = 5,
341 OFPBRC_BAD_LEN = 6,
342 OFPBRC_BUFFER_EMPTY = 7,
343 OFPBRC_BUFFER_UNKNOWN = 8,
344 OFPBRC_BAD_TABLE_ID = 9,
345 OFPBRC_IS_SLAVE = 10,
346 OFPBRC_BAD_PORT = 11,
347 OFPBRC_BAD_PACKET = 12,
348 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
349};
350
351enum ofp_bad_action_code {
352 OFPBAC_BAD_TYPE = 0,
353 OFPBAC_BAD_LEN = 1,
354 OFPBAC_BAD_EXPERIMENTER = 2,
355 OFPBAC_BAD_EXP_TYPE = 3,
356 OFPBAC_BAD_OUT_PORT = 4,
357 OFPBAC_BAD_ARGUMENT = 5,
358 OFPBAC_EPERM = 6,
359 OFPBAC_TOO_MANY = 7,
360 OFPBAC_BAD_QUEUE = 8,
361 OFPBAC_BAD_OUT_GROUP = 9,
362 OFPBAC_MATCH_INCONSISTENT = 10,
363 OFPBAC_UNSUPPORTED_ORDER = 11,
364 OFPBAC_BAD_TAG = 12,
365 OFPBAC_BAD_SET_TYPE = 13,
366 OFPBAC_BAD_SET_LEN = 14,
367 OFPBAC_BAD_SET_ARGUMENT = 15,
368};
369
370enum ofp_bad_instruction_code {
371 OFPBIC_UNKNOWN_INST = 0,
372 OFPBIC_UNSUP_INST = 1,
373 OFPBIC_BAD_TABLE_ID = 2,
374 OFPBIC_UNSUP_METADATA = 3,
375 OFPBIC_UNSUP_METADATA_MASK = 4,
376 OFPBIC_BAD_EXPERIMENTER = 5,
377 OFPBIC_BAD_EXP_TYPE = 6,
378 OFPBIC_BAD_LEN = 7,
379 OFPBIC_EPERM = 8,
380};
381
382enum ofp_bad_match_code {
383 OFPBMC_BAD_TYPE = 0,
384 OFPBMC_BAD_LEN = 1,
385 OFPBMC_BAD_TAG = 2,
386 OFPBMC_BAD_DL_ADDR_MASK = 3,
387 OFPBMC_BAD_NW_ADDR_MASK = 4,
388 OFPBMC_BAD_WILDCARDS = 5,
389 OFPBMC_BAD_FIELD = 6,
390 OFPBMC_BAD_VALUE = 7,
391 OFPBMC_BAD_MASK = 8,
392 OFPBMC_BAD_PREREQ = 9,
393 OFPBMC_DUP_FIELD = 10,
394 OFPBMC_EPERM = 11,
395};
396
397enum ofp_flow_mod_failed_code {
398 OFPFMFC_UNKNOWN = 0,
399 OFPFMFC_TABLE_FULL = 1,
400 OFPFMFC_BAD_TABLE_ID = 2,
401 OFPFMFC_OVERLAP = 3,
402 OFPFMFC_EPERM = 4,
403 OFPFMFC_BAD_TIMEOUT = 5,
404 OFPFMFC_BAD_COMMAND = 6,
405 OFPFMFC_BAD_FLAGS = 7,
406};
407
408enum ofp_group_mod_failed_code {
409 OFPGMFC_GROUP_EXISTS = 0,
410 OFPGMFC_INVALID_GROUP = 1,
411 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
412 OFPGMFC_OUT_OF_GROUPS = 3,
413 OFPGMFC_OUT_OF_BUCKETS = 4,
414 OFPGMFC_CHAINING_UNSUPPORTED = 5,
415 OFPGMFC_WATCH_UNSUPPORTED = 6,
416 OFPGMFC_LOOP = 7,
417 OFPGMFC_UNKNOWN_GROUP = 8,
418 OFPGMFC_CHAINED_GROUP = 9,
419 OFPGMFC_BAD_TYPE = 10,
420 OFPGMFC_BAD_COMMAND = 11,
421 OFPGMFC_BAD_BUCKET = 12,
422 OFPGMFC_BAD_WATCH = 13,
423 OFPGMFC_EPERM = 14,
424};
425
426enum ofp_port_mod_failed_code {
427 OFPPMFC_BAD_PORT = 0,
428 OFPPMFC_BAD_HW_ADDR = 1,
429 OFPPMFC_BAD_CONFIG = 2,
430 OFPPMFC_BAD_ADVERTISE = 3,
431 OFPPMFC_EPERM = 4,
432};
433
434enum ofp_table_mod_failed_code {
435 OFPTMFC_BAD_TABLE = 0,
436 OFPTMFC_BAD_CONFIG = 1,
437 OFPTMFC_EPERM = 2,
438};
439
440enum ofp_queue_op_failed_code {
441 OFPQOFC_BAD_PORT = 0,
442 OFPQOFC_BAD_QUEUE = 1,
443 OFPQOFC_EPERM = 2,
444};
445
446enum ofp_switch_config_failed_code {
447 OFPSCFC_BAD_FLAGS = 0,
448 OFPSCFC_BAD_LEN = 1,
449 OFPSCFC_EPERM = 2,
450};
451
452enum ofp_role_request_failed_code {
453 OFPRRFC_STALE = 0,
454 OFPRRFC_UNSUP = 1,
455 OFPRRFC_BAD_ROLE = 2,
456};
457
458enum ofp_meter_mod_failed_code {
459 OFPMMFC_UNKNOWN = 0,
460 OFPMMFC_METER_EXISTS = 1,
461 OFPMMFC_INVALID_METER = 2,
462 OFPMMFC_UNKNOWN_METER = 3,
463 OFPMMFC_BAD_COMMAND = 4,
464 OFPMMFC_BAD_FLAGS = 5,
465 OFPMMFC_BAD_RATE = 6,
466 OFPMMFC_BAD_BURST = 7,
467 OFPMMFC_BAD_BAND = 8,
468 OFPMMFC_BAD_BAND_VALUE = 9,
469 OFPMMFC_OUT_OF_METERS = 10,
470 OFPMMFC_OUT_OF_BANDS = 11,
471};
472
473enum ofp_table_features_failed_code {
474 OFPTFFC_BAD_TABLE = 0,
475 OFPTFFC_BAD_METADATA = 1,
476 OFPTFFC_BAD_TYPE = 2,
477 OFPTFFC_BAD_LEN = 3,
478 OFPTFFC_BAD_ARGUMENT = 4,
479 OFPTFFC_EPERM = 5,
480};
481
482enum ofp_multipart_types {
483 OFPMP_DESC = 0,
484 OFPMP_FLOW = 1,
485 OFPMP_AGGREGATE = 2,
486 OFPMP_TABLE = 3,
487 OFPMP_PORT_STATS = 4,
488 OFPMP_QUEUE = 5,
489 OFPMP_GROUP = 6,
490 OFPMP_GROUP_DESC = 7,
491 OFPMP_GROUP_FEATURES = 8,
492 OFPMP_METER = 9,
493 OFPMP_METER_CONFIG = 10,
494 OFPMP_METER_FEATURES = 11,
495 OFPMP_TABLE_FEATURES = 12,
496 OFPMP_PORT_DESC = 13,
497 OFPMP_EXPERIMENTER = 0xffff,
498};
499
500enum ofp_multipart_request_flags {
501 OFPMPF_REQ_MORE = 0x1,
502};
503
504enum ofp_multipart_reply_flags {
505 OFPMPF_REPLY_MORE = 0x1,
506};
507
508enum ofp_table_feature_prop_type {
509 OFPTFPT_INSTRUCTIONS = 0,
510 OFPTFPT_INSTRUCTIONS_MISS = 1,
511 OFPTFPT_NEXT_TABLES = 2,
512 OFPTFPT_NEXT_TABLES_MISS = 3,
513 OFPTFPT_WRITE_ACTIONS = 4,
514 OFPTFPT_WRITE_ACTIONS_MISS = 5,
515 OFPTFPT_APPLY_ACTIONS = 6,
516 OFPTFPT_APPLY_ACTIONS_MISS = 7,
517 OFPTFPT_MATCH = 8,
518 OFPTFPT_WILDCARDS = 0xa,
519 OFPTFPT_WRITE_SETFIELD = 0xc,
520 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
521 OFPTFPT_APPLY_SETFIELD = 0xe,
522 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
523 OFPTFPT_EXPERIMENTER = 0xfffe,
524 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
525};
526
527enum ofp_group_capabilities {
528 OFPGFC_SELECT_WEIGHT = 0x1,
529 OFPGFC_SELECT_LIVENESS = 0x2,
530 OFPGFC_CHAINING = 0x4,
531 OFPGFC_CHAINING_CHECKS = 0x8,
532};
533
534enum ofp_queue_properties {
535 OFPQT_MIN_RATE = 0x1,
536 OFPQT_MAX_RATE = 0x2,
537 OFPQT_EXPERIMENTER = 0xffff,
538};
539
540enum ofp_controller_role {
541 OFPCR_ROLE_NOCHANGE = 0,
542 OFPCR_ROLE_EQUAL = 1,
543 OFPCR_ROLE_MASTER = 2,
544 OFPCR_ROLE_SLAVE = 3,
545};
546
Rich Lane0733cd62013-04-18 21:14:42 -0700547enum ofp_hello_elem_type {
548 OFPHET_VERSIONBITMAP = 1,
549};
550
Rich Lanee9c37db2013-06-21 18:30:24 -0700551/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700552struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700553 uint8_t version;
554 uint8_t type;
555 uint16_t length;
556 uint32_t xid;
557};
558
559// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700560struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700561 uint32_t value;
562};
563
564// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700565struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700566 uint8_t value;
567};
568
Rich Lane68ae4d72013-05-09 10:55:19 -0700569struct of_hello_elem {
Rich Lanea06d0c32013-03-25 08:52:03 -0700570 uint16_t type;
571 uint16_t length;
572};
573
Rich Lanee9c37db2013-06-21 18:30:24 -0700574struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700575 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700576 uint16_t length;
577 list(of_uint32_t) bitmaps;
578};
579
Rich Lanee9c37db2013-06-21 18:30:24 -0700580struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700581 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700582 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700583 uint16_t length;
584 uint32_t xid;
585 list(of_hello_elem_t) elements;
586};
587
Rich Lanee9c37db2013-06-21 18:30:24 -0700588struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700589 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700590 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700591 uint16_t length;
592 uint32_t xid;
593 of_octets_t data;
594};
595
Rich Lanee9c37db2013-06-21 18:30:24 -0700596struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700598 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700599 uint16_t length;
600 uint32_t xid;
601 of_octets_t data;
602};
603
Rich Lanee9c37db2013-06-21 18:30:24 -0700604struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700605 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700606 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700607 uint16_t length;
608 uint32_t xid;
609 uint32_t experimenter;
610 uint32_t subtype;
611 of_octets_t data;
612};
613
Rich Lanee9c37db2013-06-21 18:30:24 -0700614struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700615 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700616 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700617 uint16_t length;
618 uint32_t xid;
619};
620
Rich Lanee9c37db2013-06-21 18:30:24 -0700621struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700622 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700623 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700624 uint16_t length;
625 uint32_t xid;
626};
627
Rich Lanee9c37db2013-06-21 18:30:24 -0700628struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700629 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700630 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint16_t length;
632 uint32_t xid;
633};
634
Rich Lanee9c37db2013-06-21 18:30:24 -0700635struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700636 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700637 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700638 uint16_t length;
639 uint32_t xid;
640 uint16_t flags;
641 uint16_t miss_send_len;
642};
643
Rich Lanee9c37db2013-06-21 18:30:24 -0700644struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700645 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700646 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700647 uint16_t length;
648 uint32_t xid;
649 uint16_t flags;
650 uint16_t miss_send_len;
651};
652
Rich Lanee9c37db2013-06-21 18:30:24 -0700653struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700654 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700655 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700656 uint16_t length;
657 uint32_t xid;
658 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700659 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700660 uint32_t config;
661};
662
Rich Lane68ae4d72013-05-09 10:55:19 -0700663struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700664 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700665 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700666 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700667 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700668 of_port_name_t name;
669 uint32_t config;
670 uint32_t state;
671 uint32_t curr;
672 uint32_t advertised;
673 uint32_t supported;
674 uint32_t peer;
675 uint32_t curr_speed;
676 uint32_t max_speed;
677};
678
Rich Lanee9c37db2013-06-21 18:30:24 -0700679struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700680 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700681 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 uint16_t length;
683 uint32_t xid;
684};
685
Rich Lanee9c37db2013-06-21 18:30:24 -0700686struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700687 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700688 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700689 uint16_t length;
690 uint32_t xid;
691 uint64_t datapath_id;
692 uint32_t n_buffers;
693 uint8_t n_tables;
694 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700695 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint32_t capabilities;
697 uint32_t reserved;
698};
699
Rich Lanee9c37db2013-06-21 18:30:24 -0700700struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700701 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700702 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700703 uint16_t length;
704 uint32_t xid;
705 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700706 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700707 of_port_desc_t desc;
708};
709
Rich Lanee9c37db2013-06-21 18:30:24 -0700710struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700711 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700712 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700713 uint16_t length;
714 uint32_t xid;
715 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700716 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700717 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700718 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700719 uint32_t config;
720 uint32_t mask;
721 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700722 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700723};
724
725// FIXME Does this need to be v4?
Rich Lane68ae4d72013-05-09 10:55:19 -0700726struct of_match_v3 {
Rich Lane31b87142013-05-09 22:05:42 -0700727 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700728 uint16_t length;
729 list(of_oxm_t) oxm_list;
730};
731
Rich Lanea06d0c32013-03-25 08:52:03 -0700732// This looks like an action header, but is standalone. See
733// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700734struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700735 uint16_t type;
736 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700737 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700738};
739
Rich Lanee9c37db2013-06-21 18:30:24 -0700740struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700741 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700742 uint16_t len;
743 of_port_no_t port;
744 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700745 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700746};
747
Rich Lanee9c37db2013-06-21 18:30:24 -0700748struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700749 uint16_t type == 11;
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_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700755 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700756 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700757 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700758};
759
Rich Lanee9c37db2013-06-21 18:30:24 -0700760struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700761 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700762 uint16_t len;
763 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700764 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700765};
766
Rich Lanee9c37db2013-06-21 18:30:24 -0700767struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700768 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700769 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700770 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700771};
772
Rich Lanee9c37db2013-06-21 18:30:24 -0700773struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700774 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700775 uint16_t len;
776 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700777 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700778};
779
Rich Lanee9c37db2013-06-21 18:30:24 -0700780struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700781 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700782 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700783 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700784};
785
Rich Lanee9c37db2013-06-21 18:30:24 -0700786struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700787 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700788 uint16_t len;
789 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700790 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700791};
792
Rich Lanee9c37db2013-06-21 18:30:24 -0700793struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700794 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700795 uint16_t len;
796 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700797 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700798};
799
Rich Lanee9c37db2013-06-21 18:30:24 -0700800struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700801 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700802 uint16_t len;
803 uint32_t queue_id;
804};
805
Rich Lanee9c37db2013-06-21 18:30:24 -0700806struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700807 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700808 uint16_t len;
809 uint32_t group_id;
810};
811
Rich Lanee9c37db2013-06-21 18:30:24 -0700812struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700813 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700814 uint16_t len;
815 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700816 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700817};
818
Rich Lanee9c37db2013-06-21 18:30:24 -0700819struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700820 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700821 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700822 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700823};
824
Rich Lanee9c37db2013-06-21 18:30:24 -0700825struct of_action_set_field : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700826 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700827 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700828 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700829};
830
Rich Lanee9c37db2013-06-21 18:30:24 -0700831struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700832 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700833 uint16_t len;
834 uint32_t experimenter;
835 of_octets_t data;
836};
837
Rich Lanee9c37db2013-06-21 18:30:24 -0700838struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700839 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700840 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700841 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700842};
843
Rich Lanee9c37db2013-06-21 18:30:24 -0700844struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700845 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700846 uint16_t len;
847 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700848 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700849};
850
Rich Lane68ae4d72013-05-09 10:55:19 -0700851struct of_action {
Rich Lanea06d0c32013-03-25 08:52:03 -0700852 uint16_t type;
853 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700854 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700855};
856
Rich Lane68ae4d72013-05-09 10:55:19 -0700857struct of_instruction {
Rich Lanea06d0c32013-03-25 08:52:03 -0700858 uint16_t type;
859 uint16_t len;
860};
861
Rich Lanee9c37db2013-06-21 18:30:24 -0700862struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700863 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700864 uint16_t len;
865 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700866 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700867};
868
Rich Lanee9c37db2013-06-21 18:30:24 -0700869struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700870 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700871 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700872 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700873 uint64_t metadata;
874 uint64_t metadata_mask;
875};
876
Rich Lanee9c37db2013-06-21 18:30:24 -0700877struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700878 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700879 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700880 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700881 list(of_action_t) actions;
882};
883
Rich Lanee9c37db2013-06-21 18:30:24 -0700884struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700885 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700886 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700887 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 list(of_action_t) actions;
889};
890
Rich Lanee9c37db2013-06-21 18:30:24 -0700891struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700892 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700893 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700894 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700895};
896
Rich Lanee9c37db2013-06-21 18:30:24 -0700897struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700898 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700899 uint16_t len;
900 uint32_t meter_id;
901};
902
Rich Lanee9c37db2013-06-21 18:30:24 -0700903struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700904 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700905 uint16_t len;
906 uint32_t experimenter;
907 of_octets_t data;
908};
909
Rich Lanee9c37db2013-06-21 18:30:24 -0700910struct of_flow_mod : of_header {
911 uint8_t version;
912 uint8_t type == 14;
913 uint16_t length;
914 uint32_t xid;
915 uint64_t cookie;
916 uint64_t cookie_mask;
917 uint8_t table_id;
918 of_fm_cmd_t _command;
919 uint16_t idle_timeout;
920 uint16_t hard_timeout;
921 uint16_t priority;
922 uint32_t buffer_id;
923 of_port_no_t out_port;
924 uint32_t out_group;
925 uint16_t flags;
926 pad(2);
927 of_match_t match;
928 list(of_instruction_t) instructions;
929};
930
931struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700932 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700933 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700934 uint16_t length;
935 uint32_t xid;
936 uint64_t cookie;
937 uint64_t cookie_mask;
938 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700939 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700940 uint16_t idle_timeout;
941 uint16_t hard_timeout;
942 uint16_t priority;
943 uint32_t buffer_id;
944 of_port_no_t out_port;
945 uint32_t out_group;
946 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700947 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700948 of_match_t match;
949 list(of_instruction_t) instructions;
950};
951
Rich Lanee9c37db2013-06-21 18:30:24 -0700952struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700953 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700954 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700955 uint16_t length;
956 uint32_t xid;
957 uint64_t cookie;
958 uint64_t cookie_mask;
959 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700960 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700961 uint16_t idle_timeout;
962 uint16_t hard_timeout;
963 uint16_t priority;
964 uint32_t buffer_id;
965 of_port_no_t out_port;
966 uint32_t out_group;
967 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700968 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700969 of_match_t match;
970 list(of_instruction_t) instructions;
971};
972
Rich Lanee9c37db2013-06-21 18:30:24 -0700973struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700974 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700975 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700976 uint16_t length;
977 uint32_t xid;
978 uint64_t cookie;
979 uint64_t cookie_mask;
980 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700981 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700982 uint16_t idle_timeout;
983 uint16_t hard_timeout;
984 uint16_t priority;
985 uint32_t buffer_id;
986 of_port_no_t out_port;
987 uint32_t out_group;
988 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700989 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700990 of_match_t match;
991 list(of_instruction_t) instructions;
992};
993
Rich Lanee9c37db2013-06-21 18:30:24 -0700994struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700995 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700996 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700997 uint16_t length;
998 uint32_t xid;
999 uint64_t cookie;
1000 uint64_t cookie_mask;
1001 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001002 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001003 uint16_t idle_timeout;
1004 uint16_t hard_timeout;
1005 uint16_t priority;
1006 uint32_t buffer_id;
1007 of_port_no_t out_port;
1008 uint32_t out_group;
1009 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001010 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001011 of_match_t match;
1012 list(of_instruction_t) instructions;
1013};
1014
Rich Lanee9c37db2013-06-21 18:30:24 -07001015struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001016 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001017 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001018 uint16_t length;
1019 uint32_t xid;
1020 uint64_t cookie;
1021 uint64_t cookie_mask;
1022 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001023 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001024 uint16_t idle_timeout;
1025 uint16_t hard_timeout;
1026 uint16_t priority;
1027 uint32_t buffer_id;
1028 of_port_no_t out_port;
1029 uint32_t out_group;
1030 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001031 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001032 of_match_t match;
1033 list(of_instruction_t) instructions;
1034};
1035
Rich Lane68ae4d72013-05-09 10:55:19 -07001036struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001037 uint16_t len;
1038 uint16_t weight;
1039 of_port_no_t watch_port;
1040 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001041 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001042 list(of_action_t) actions;
1043};
1044
Rich Lanee9c37db2013-06-21 18:30:24 -07001045struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001046 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001047 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001048 uint16_t length;
1049 uint32_t xid;
1050 uint16_t command;
1051 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001052 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001053 uint32_t group_id;
1054 list(of_bucket_t) buckets;
1055};
1056
Rich Lanee9c37db2013-06-21 18:30:24 -07001057struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001058 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001059 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001060 uint16_t length;
1061 uint32_t xid;
1062 uint32_t buffer_id;
1063 of_port_no_t in_port;
1064 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001065 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001066 list(of_action_t) actions;
1067 of_octets_t data;
1068};
1069
Rich Lanee9c37db2013-06-21 18:30:24 -07001070struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001071 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001072 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001073 uint16_t length;
1074 uint32_t xid;
1075 uint32_t buffer_id;
1076 uint16_t total_len;
1077 uint8_t reason;
1078 uint8_t table_id;
1079 uint64_t cookie;
1080 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001081 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001082 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1083};
1084
Rich Lanee9c37db2013-06-21 18:30:24 -07001085struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001086 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001087 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001088 uint16_t length;
1089 uint32_t xid;
1090 uint64_t cookie;
1091 uint16_t priority;
1092 uint8_t reason;
1093 uint8_t table_id;
1094 uint32_t duration_sec;
1095 uint32_t duration_nsec;
1096 uint16_t idle_timeout;
1097 uint16_t hard_timeout;
1098 uint64_t packet_count;
1099 uint64_t byte_count;
1100 of_match_t match;
1101};
1102
Rich Lane68ae4d72013-05-09 10:55:19 -07001103struct of_meter_band {
Rich Lanea06d0c32013-03-25 08:52:03 -07001104 uint16_t type;
1105 uint16_t len;
1106// uint32_t rate; // These are excluded b/c this is the header
1107// uint32_t burst_size; // These are excluded b/c this is the header
1108};
1109
Rich Lanee9c37db2013-06-21 18:30:24 -07001110struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001111 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001112 uint16_t len;
1113 uint32_t rate;
1114 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001115 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001116};
1117
Rich Lanee9c37db2013-06-21 18:30:24 -07001118struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001119 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001120 uint16_t len;
1121 uint32_t rate;
1122 uint32_t burst_size;
1123 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001124 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001125};
1126
Rich Lanee9c37db2013-06-21 18:30:24 -07001127struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001128 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001129 uint16_t len;
1130 uint32_t rate;
1131 uint32_t burst_size;
1132 uint32_t experimenter;
1133};
1134
Rich Lanee9c37db2013-06-21 18:30:24 -07001135struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001136 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001137 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001138 uint16_t length;
1139 uint32_t xid;
1140 uint16_t command;
1141 uint16_t flags;
1142 uint32_t meter_id;
1143 list(of_meter_band_t) meters;
1144};
1145
Rich Lanee9c37db2013-06-21 18:30:24 -07001146struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001147 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001148 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001149 uint16_t length;
1150 uint32_t xid;
1151 uint16_t err_type;
1152 uint16_t code;
1153 of_octets_t data;
1154};
1155
Rich Lane68ae4d72013-05-09 10:55:19 -07001156//struct of_error_experimenter_msg {
Rich Lanea06d0c32013-03-25 08:52:03 -07001157// uint8_t version;
1158// uint8_t type;
1159// uint16_t length;
1160// uint32_t xid;
1161// uint16_t err_type;
1162// uint16_t subtype;
1163// uint32_t experimenter;
1164// of_octets_t data;
1165//};
1166
1167// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1168
Rich Lane68ae4d72013-05-09 10:55:19 -07001169struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001170 uint16_t length;
1171 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001172 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001173 uint32_t duration_sec;
1174 uint32_t duration_nsec;
1175 uint16_t priority;
1176 uint16_t idle_timeout;
1177 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001178 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001179 uint64_t cookie;
1180 uint64_t packet_count;
1181 uint64_t byte_count;
1182 of_match_t match;
1183 list(of_instruction_t) instructions;
1184};
1185
1186
Rich Lane68ae4d72013-05-09 10:55:19 -07001187struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001188 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001189 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001190 uint32_t active_count;
1191 uint64_t lookup_count;
1192 uint64_t matched_count;
1193};
1194
Rich Lane68ae4d72013-05-09 10:55:19 -07001195struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001196 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001197 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001198 uint64_t rx_packets;
1199 uint64_t tx_packets;
1200 uint64_t rx_bytes;
1201 uint64_t tx_bytes;
1202 uint64_t rx_dropped;
1203 uint64_t tx_dropped;
1204 uint64_t rx_errors;
1205 uint64_t tx_errors;
1206 uint64_t rx_frame_err;
1207 uint64_t rx_over_err;
1208 uint64_t rx_crc_err;
1209 uint64_t collisions;
1210 uint32_t duration_sec;
1211 uint32_t duration_nsec;
1212};
1213
Rich Lane68ae4d72013-05-09 10:55:19 -07001214struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001215 of_port_no_t port_no;
1216 uint32_t queue_id;
1217 uint64_t tx_bytes;
1218 uint64_t tx_packets;
1219 uint64_t tx_errors;
1220 uint32_t duration_sec;
1221 uint32_t duration_nsec;
1222};
1223
Rich Lane68ae4d72013-05-09 10:55:19 -07001224struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001225 uint64_t packet_count;
1226 uint64_t byte_count;
1227};
1228
Rich Lane68ae4d72013-05-09 10:55:19 -07001229struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001230 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001231 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001232 uint32_t group_id;
1233 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001234 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001235 uint64_t packet_count;
1236 uint64_t byte_count;
1237 uint32_t duration_sec;
1238 uint32_t duration_nsec;
1239 list(of_bucket_counter_t) bucket_stats;
1240};
1241
Rich Lane68ae4d72013-05-09 10:55:19 -07001242struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001243 uint16_t length;
1244 uint8_t type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001245 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001246 uint32_t group_id;
1247 list(of_bucket_t) buckets;
1248};
1249
1250// STATS:
1251// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1252
Rich Lanee9c37db2013-06-21 18:30:24 -07001253struct of_stats_request : of_header {
1254 uint8_t version;
1255 uint8_t type == 18;
1256 uint16_t length;
1257 uint32_t xid;
1258 uint16_t stats_type;
1259 uint16_t flags;
1260 pad(4);
1261};
1262
1263struct of_stats_reply : of_header {
1264 uint8_t version;
1265 uint8_t type == 19;
1266 uint16_t length;
1267 uint32_t xid;
1268 uint16_t stats_type;
1269 uint16_t flags;
1270 pad(4);
1271};
1272
1273struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001274 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001275 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001276 uint16_t length;
1277 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001278 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001279 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001280 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001281};
1282
Rich Lanee9c37db2013-06-21 18:30:24 -07001283struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001284 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001285 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001286 uint16_t length;
1287 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001288 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001289 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001290 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001291 of_desc_str_t mfr_desc;
1292 of_desc_str_t hw_desc;
1293 of_desc_str_t sw_desc;
1294 of_serial_num_t serial_num;
1295 of_desc_str_t dp_desc;
1296};
1297
Rich Lanee9c37db2013-06-21 18:30:24 -07001298struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001299 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001300 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001301 uint16_t length;
1302 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001303 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001304 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001305 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001306 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001307 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001308 of_port_no_t out_port;
1309 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001310 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001311 uint64_t cookie;
1312 uint64_t cookie_mask;
1313 of_match_t match;
1314};
1315
Rich Lanee9c37db2013-06-21 18:30:24 -07001316struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001317 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001318 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001319 uint16_t length;
1320 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001321 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001322 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001323 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001324 list(of_flow_stats_entry_t) entries;
1325};
1326
Rich Lanee9c37db2013-06-21 18:30:24 -07001327struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001328 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001329 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001330 uint16_t length;
1331 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001332 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001333 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001334 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001335 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001336 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001337 of_port_no_t out_port;
1338 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001339 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001340 uint64_t cookie;
1341 uint64_t cookie_mask;
1342 of_match_t match;
1343};
1344
Rich Lanee9c37db2013-06-21 18:30:24 -07001345struct of_aggregate_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 == 2;
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 uint64_t packet_count;
1354 uint64_t byte_count;
1355 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001356 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001357};
1358
Rich Lanee9c37db2013-06-21 18:30:24 -07001359struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001360 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001361 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001362 uint16_t length;
1363 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001364 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001365 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001366 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001367};
1368
Rich Lanee9c37db2013-06-21 18:30:24 -07001369struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001370 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001371 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001372 uint16_t length;
1373 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001374 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001375 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001376 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001377 list(of_table_stats_entry_t) entries;
1378};
1379
Rich Lanea06d0c32013-03-25 08:52:03 -07001380// FIXME: These are padded to 8 byte align beyond the length indicated
1381
Rich Lane68ae4d72013-05-09 10:55:19 -07001382struct of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001383 uint16_t type;
1384 uint16_t length;
1385};
1386
Rich Lanee9c37db2013-06-21 18:30:24 -07001387struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001388 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 uint16_t length;
1390 // FIXME Check if instruction_t is right for ids here
1391 list(of_instruction_t) instruction_ids;
1392};
1393
Rich Lanee9c37db2013-06-21 18:30:24 -07001394struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001395 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001396 uint16_t length;
1397 list(of_instruction_t) instruction_ids;
1398};
1399
Rich Lanee9c37db2013-06-21 18:30:24 -07001400struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001401 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001402 uint16_t length;
1403 list(of_uint8_t) next_table_ids;
1404};
1405
Rich Lanee9c37db2013-06-21 18:30:24 -07001406struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001407 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001408 uint16_t length;
1409 list(of_uint8_t) next_table_ids;
1410};
1411
Rich Lanee9c37db2013-06-21 18:30:24 -07001412struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001413 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001414 uint16_t length;
1415 list(of_action_id_t) action_ids;
1416};
1417
Rich Lanee9c37db2013-06-21 18:30:24 -07001418struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001419 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001420 uint16_t length;
1421 list(of_action_id_t) action_ids;
1422};
1423
Rich Lanee9c37db2013-06-21 18:30:24 -07001424struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001425 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001426 uint16_t length;
1427 list(of_action_id_t) action_ids;
1428};
1429
Rich Lanee9c37db2013-06-21 18:30:24 -07001430struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001431 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001432 uint16_t length;
1433 list(of_action_id_t) action_ids;
1434};
1435
Rich Lanee9c37db2013-06-21 18:30:24 -07001436struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001437 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001438 uint16_t length;
1439 list(of_uint32_t) oxm_ids;
1440};
1441
Rich Lanee9c37db2013-06-21 18:30:24 -07001442struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001443 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001444 uint16_t length;
1445 list(of_uint32_t) oxm_ids;
1446};
1447
Rich Lanee9c37db2013-06-21 18:30:24 -07001448struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001449 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 uint16_t length;
1451 list(of_uint32_t) oxm_ids;
1452};
1453
Rich Lanee9c37db2013-06-21 18:30:24 -07001454struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001455 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001456 uint16_t length;
1457 list(of_uint32_t) oxm_ids;
1458};
1459
Rich Lanee9c37db2013-06-21 18:30:24 -07001460struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001461 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001462 uint16_t length;
1463 list(of_uint32_t) oxm_ids;
1464};
1465
Rich Lanee9c37db2013-06-21 18:30:24 -07001466struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001467 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001468 uint16_t length;
1469 list(of_uint32_t) oxm_ids;
1470};
1471
Rich Lanee9c37db2013-06-21 18:30:24 -07001472struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001473 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001474 uint16_t length;
1475 uint32_t experimenter;
1476 uint32_t subtype;
1477 of_octets_t experimenter_data;
1478};
1479
1480// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001481// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001482// uint16_t type;
1483// uint16_t length;
1484// uint32_t experimenter;
1485// uint32_t subtype;
1486// of_octets_t experimenter_data;
1487// };
1488
Rich Lane68ae4d72013-05-09 10:55:19 -07001489struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 uint16_t length;
1491 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001492 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001493 of_table_name_t name;
1494 uint64_t metadata_match;
1495 uint64_t metadata_write;
1496 uint32_t config;
1497 uint32_t max_entries;
1498 list(of_table_feature_prop_t) properties;
1499};
1500
Rich Lane68ae4d72013-05-09 10:55:19 -07001501struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001502 uint32_t max_meter;
1503 uint32_t band_types;
1504 uint32_t capabilities;
1505 uint8_t max_bands;
1506 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001507 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001508};
1509
Rich Lanee9c37db2013-06-21 18:30:24 -07001510struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001511 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001512 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001513 uint16_t length;
1514 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001515 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001516 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001517 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001518 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001519 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001520};
1521
Rich Lanee9c37db2013-06-21 18:30:24 -07001522struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001523 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001524 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001525 uint16_t length;
1526 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001527 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001528 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001529 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001530 list(of_port_stats_entry_t) entries;
1531};
1532
Rich Lanee9c37db2013-06-21 18:30:24 -07001533struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001534 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001535 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001536 uint16_t length;
1537 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001538 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001539 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001540 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001541 of_port_no_t port_no;
1542 uint32_t queue_id;
1543};
1544
Rich Lanee9c37db2013-06-21 18:30:24 -07001545struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001546 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001547 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001548 uint16_t length;
1549 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001550 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001551 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001552 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001553 list(of_queue_stats_entry_t) entries;
1554};
1555
Rich Lanee9c37db2013-06-21 18:30:24 -07001556struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001557 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001558 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001559 uint16_t length;
1560 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001561 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001562 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001563 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001564 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001565 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001566};
1567
Rich Lanee9c37db2013-06-21 18:30:24 -07001568struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001569 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001570 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001571 uint16_t length;
1572 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001573 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001574 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001575 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001576 list(of_group_stats_entry_t) entries;
1577};
1578
Rich Lanee9c37db2013-06-21 18:30:24 -07001579struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001580 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001581 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001582 uint16_t length;
1583 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001584 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001585 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001586 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001587};
1588
Rich Lanee9c37db2013-06-21 18:30:24 -07001589struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001590 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001591 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001592 uint16_t length;
1593 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001594 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001595 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001596 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001597 list(of_group_desc_stats_entry_t) entries;
1598};
1599
Rich Lanee9c37db2013-06-21 18:30:24 -07001600struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001601 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001602 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001603 uint16_t length;
1604 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001605 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001606 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001607 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001608};
1609
Rich Lanee9c37db2013-06-21 18:30:24 -07001610struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001611 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001612 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001613 uint16_t length;
1614 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001615 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001616 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001617 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001618 uint32_t types;
1619 uint32_t capabilities;
1620 uint32_t max_groups_all;
1621 uint32_t max_groups_select;
1622 uint32_t max_groups_indirect;
1623 uint32_t max_groups_ff;
1624 uint32_t actions_all;
1625 uint32_t actions_select;
1626 uint32_t actions_indirect;
1627 uint32_t actions_ff;
1628};
1629
Rich Lanee9c37db2013-06-21 18:30:24 -07001630struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001631 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001632 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001633 uint16_t length;
1634 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001635 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001636 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001637 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001638 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001639 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001640};
1641
Rich Lanee9c37db2013-06-21 18:30:24 -07001642struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001643 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001644 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001645 uint16_t length;
1646 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001647 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001648 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001649 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001650 list(of_meter_stats_t) entries;
1651};
1652
Rich Lanee9c37db2013-06-21 18:30:24 -07001653struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001654 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001655 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001656 uint16_t length;
1657 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001658 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001659 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001660 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001661 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001662 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001663};
1664
Rich Lanee9c37db2013-06-21 18:30:24 -07001665struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001666 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001667 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001668 uint16_t length;
1669 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001670 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001671 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001672 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001673 list(of_meter_band_t) entries;
1674};
1675
1676// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001677struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001678 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001679 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001680 uint16_t length;
1681 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001682 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001683 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001684 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001685};
1686
1687// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001688struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001689 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001690 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001691 uint16_t length;
1692 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001693 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001694 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001695 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001696 of_meter_features_t features;
1697};
1698
1699// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001700struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001701 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001702 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001703 uint16_t length;
1704 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001705 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001706 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001707 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001708 list(of_table_features_t) entries;
1709};
1710
1711// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001712struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001713 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001714 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001715 uint16_t length;
1716 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001717 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001718 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001719 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001720 list(of_table_features_t) entries;
1721};
1722
1723// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001724struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001725 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001726 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001727 uint16_t length;
1728 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001729 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001730 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001731 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001732};
1733
1734// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001735struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001736 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001737 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001738 uint16_t length;
1739 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001740 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001741 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001742 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001743 list(of_port_desc_t) entries;
1744};
1745
Rich Lane68ae4d72013-05-09 10:55:19 -07001746struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001747 uint64_t packet_band_count;
1748 uint64_t byte_band_count;
1749};
1750
Rich Lane68ae4d72013-05-09 10:55:19 -07001751struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001752 uint32_t meter_id;
1753 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001754 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001755 uint32_t flow_count;
1756 uint64_t packet_in_count;
1757 uint64_t byte_in_count;
1758 uint32_t duration_sec;
1759 uint32_t duration_nsec;
1760 list(of_meter_band_stats_t) band_stats;
1761};
1762
Rich Lane68ae4d72013-05-09 10:55:19 -07001763struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001764 uint16_t length;
1765 uint16_t flags;
1766 uint32_t meter_id;
1767 list(of_meter_band_t) entries;
1768};
1769
Rich Lane68ae4d72013-05-09 10:55:19 -07001770struct of_experimenter_multipart_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001771 uint32_t experimenter;
1772 uint32_t subtype;
1773};
1774
1775// END OF STATS OBJECTS
1776
Rich Lane68ae4d72013-05-09 10:55:19 -07001777struct of_queue_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001778 uint16_t type;
1779 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001780 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001781};
1782
Rich Lanee9c37db2013-06-21 18:30:24 -07001783struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001784 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001785 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001786 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001787 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001788 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001789};
1790
Rich Lanee9c37db2013-06-21 18:30:24 -07001791struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001792 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001793 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001794 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001795 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001796 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001797};
1798
Rich Lanee9c37db2013-06-21 18:30:24 -07001799struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001800 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001801 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001802 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001803 uint32_t experimenter;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001804 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001805 of_octets_t data;
1806};
1807
Rich Lane68ae4d72013-05-09 10:55:19 -07001808struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001809 uint32_t queue_id;
1810 of_port_no_t port;
1811 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001812 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001813 list(of_queue_prop_t) properties;
1814};
1815
Rich Lanee9c37db2013-06-21 18:30:24 -07001816struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001817 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001818 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001819 uint16_t length;
1820 uint32_t xid;
1821 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001822 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001823};
1824
Rich Lanee9c37db2013-06-21 18:30:24 -07001825struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001826 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001827 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001828 uint16_t length;
1829 uint32_t xid;
1830 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001831 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001832 list(of_packet_queue_t) queues;
1833};
1834
Rich Lanee9c37db2013-06-21 18:30:24 -07001835struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001836 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001837 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001838 uint16_t length;
1839 uint32_t xid;
1840 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001841 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001842 uint64_t generation_id;
1843};
1844
Rich Lanee9c37db2013-06-21 18:30:24 -07001845struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001846 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001847 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001848 uint16_t length;
1849 uint32_t xid;
1850 of_octets_t data;
1851};
1852
1853////////////////////////////////////////////////////////////////
1854// FIXME understand async; where do bitmasks live?
1855// Determine bitmap type for masks below.
1856// DOCUMENT masks where uint32_t[0] is interest for equal/master
1857// while uint32_t[1] is interest for slave
1858////////////////////////////////////////////////////////////////
1859
Rich Lanee9c37db2013-06-21 18:30:24 -07001860struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001861 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001862 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07001863 uint16_t length;
1864 uint32_t xid;
1865 uint32_t packet_in_mask_equal_master;
1866 uint32_t packet_in_mask_slave;
1867 uint32_t port_status_mask_equal_master;
1868 uint32_t port_status_mask_slave;
1869 uint32_t flow_removed_mask_equal_master;
1870 uint32_t flow_removed_mask_slave;
1871};
1872
Rich Lanee9c37db2013-06-21 18:30:24 -07001873struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001874 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001875 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07001876 uint16_t length;
1877 uint32_t xid;
1878 uint32_t packet_in_mask_equal_master;
1879 uint32_t packet_in_mask_slave;
1880 uint32_t port_status_mask_equal_master;
1881 uint32_t port_status_mask_slave;
1882 uint32_t flow_removed_mask_equal_master;
1883 uint32_t flow_removed_mask_slave;
1884};
1885
Rich Lanee9c37db2013-06-21 18:30:24 -07001886struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001887 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001888 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07001889 uint16_t length;
1890 uint32_t xid;
1891 uint32_t packet_in_mask_equal_master;
1892 uint32_t packet_in_mask_slave;
1893 uint32_t port_status_mask_equal_master;
1894 uint32_t port_status_mask_slave;
1895 uint32_t flow_removed_mask_equal_master;
1896 uint32_t flow_removed_mask_slave;
1897};