blob: bfa9a64d80e65d9dac7c27d51a1c331edf2f7614 [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
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
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,
295 OFPBRC_BAD_EXP_TYPE = 4,
296 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,
310 OFPBAC_BAD_EXP_TYPE = 3,
311 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,
332 OFPBIC_BAD_EXP_TYPE = 6,
333 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
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700413enum ofp_stats_types(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;
546 uint32_t config;
547 uint32_t state;
548 uint32_t curr;
549 uint32_t advertised;
550 uint32_t supported;
551 uint32_t peer;
552 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);
Rich Lanea06d0c32013-03-25 08:52:03 -0700572 uint32_t capabilities;
573 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;
582 uint8_t 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;
775 uint16_t flags;
776 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;
796 uint16_t 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;
817 uint16_t 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;
838 uint16_t 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;
859 uint16_t 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;
880 uint16_t 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;
957 uint16_t err_type;
958 uint16_t code;
959 of_octets_t data;
960};
961
Rich Lane68ae4d72013-05-09 10:55:19 -0700962// struct of_error_experimenter_msg {
Rich Lanea06d0c32013-03-25 08:52:03 -0700963// uint8_t version;
964// uint8_t type;
965// uint16_t length;
966// uint32_t xid;
967// uint16_t err_type;
968// uint16_t subtype;
969// uint32_t experimenter;
970// of_octets_t data;
971//};
972
973// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
974// FIXME: Verify disambiguation w/ length in object and entry
975
Rich Lane68ae4d72013-05-09 10:55:19 -0700976struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint16_t length;
978 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700979 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700980 uint32_t duration_sec;
981 uint32_t duration_nsec;
982 uint16_t priority;
983 uint16_t idle_timeout;
984 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700985 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700986 uint64_t cookie;
987 uint64_t packet_count;
988 uint64_t byte_count;
989 of_match_t match;
990 list(of_instruction_t) instructions;
991};
992
Rich Lane68ae4d72013-05-09 10:55:19 -0700993struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700994 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700995 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700996 of_table_name_t name;
997 of_match_bmap_t match;
998 of_wc_bmap_t wildcards;
999 uint32_t write_actions;
1000 uint32_t apply_actions;
1001 uint64_t write_setfields;
1002 uint64_t apply_setfields;
1003 uint64_t metadata_match;
1004 uint64_t metadata_write;
1005 uint32_t instructions;
1006 uint32_t config;
1007 uint32_t max_entries;
1008 uint32_t active_count;
1009 uint64_t lookup_count;
1010 uint64_t matched_count;
1011};
1012
Rich Lane68ae4d72013-05-09 10:55:19 -07001013struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001014 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001015 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001016 uint64_t rx_packets;
1017 uint64_t tx_packets;
1018 uint64_t rx_bytes;
1019 uint64_t tx_bytes;
1020 uint64_t rx_dropped;
1021 uint64_t tx_dropped;
1022 uint64_t rx_errors;
1023 uint64_t tx_errors;
1024 uint64_t rx_frame_err;
1025 uint64_t rx_over_err;
1026 uint64_t rx_crc_err;
1027 uint64_t collisions;
1028};
1029
Rich Lane68ae4d72013-05-09 10:55:19 -07001030struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001031 of_port_no_t port_no;
1032 uint32_t queue_id;
1033 uint64_t tx_bytes;
1034 uint64_t tx_packets;
1035 uint64_t tx_errors;
1036};
1037
Rich Lane68ae4d72013-05-09 10:55:19 -07001038struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001039 uint64_t packet_count;
1040 uint64_t byte_count;
1041};
1042
Rich Lane68ae4d72013-05-09 10:55:19 -07001043struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001044 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001045 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001046 uint32_t group_id;
1047 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001048 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001049 uint64_t packet_count;
1050 uint64_t byte_count;
1051 list(of_bucket_counter_t) bucket_stats;
1052};
1053
Rich Lane68ae4d72013-05-09 10:55:19 -07001054struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001055 uint16_t length;
1056 uint8_t type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001057 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001058 uint32_t group_id;
1059 list(of_bucket_t) buckets;
1060};
1061
1062// STATS:
1063// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1064
Rich Lanee9c37db2013-06-21 18:30:24 -07001065struct of_stats_request : of_header {
1066 uint8_t version;
1067 uint8_t type == 18;
1068 uint16_t length;
1069 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001070 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001071 uint16_t flags;
1072 pad(4);
1073};
1074
1075struct of_stats_reply : of_header {
1076 uint8_t version;
1077 uint8_t type == 19;
1078 uint16_t length;
1079 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001080 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001081 uint16_t flags;
1082 pad(4);
1083};
1084
1085struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001086 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001087 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001088 uint16_t length;
1089 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001090 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001091 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001092 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001093};
1094
Rich Lanee9c37db2013-06-21 18:30:24 -07001095struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001096 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001097 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001098 uint16_t length;
1099 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001100 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001101 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001102 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001103 of_desc_str_t mfr_desc;
1104 of_desc_str_t hw_desc;
1105 of_desc_str_t sw_desc;
1106 of_serial_num_t serial_num;
1107 of_desc_str_t dp_desc;
1108};
1109
Rich Lanee9c37db2013-06-21 18:30:24 -07001110struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001111 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001112 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001113 uint16_t length;
1114 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001115 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001116 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001117 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001118 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001119 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001120 of_port_no_t out_port;
1121 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001122 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001123 uint64_t cookie;
1124 uint64_t cookie_mask;
1125 of_match_t match;
1126};
1127
Rich Lanee9c37db2013-06-21 18:30:24 -07001128struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001129 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001130 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001131 uint16_t length;
1132 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001133 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001134 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001135 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001136 list(of_flow_stats_entry_t) entries;
1137};
1138
Rich Lanee9c37db2013-06-21 18:30:24 -07001139struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001140 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001141 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001142 uint16_t length;
1143 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001144 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001145 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001146 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001147 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001148 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001149 of_port_no_t out_port;
1150 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001151 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001152 uint64_t cookie;
1153 uint64_t cookie_mask;
1154 of_match_t match;
1155};
1156
Rich Lanee9c37db2013-06-21 18:30:24 -07001157struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001158 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001159 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001160 uint16_t length;
1161 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001162 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001163 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001164 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001165 uint64_t packet_count;
1166 uint64_t byte_count;
1167 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001168 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001169};
1170
Rich Lanee9c37db2013-06-21 18:30:24 -07001171struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001172 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001173 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001174 uint16_t length;
1175 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001176 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001177 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001178 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001179};
1180
Rich Lanee9c37db2013-06-21 18:30:24 -07001181struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001182 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001183 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001184 uint16_t length;
1185 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001186 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001187 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001188 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001189 list(of_table_stats_entry_t) entries;
1190};
1191
Rich Lanee9c37db2013-06-21 18:30:24 -07001192struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001193 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001194 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001195 uint16_t length;
1196 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001197 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001198 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001199 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001200 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001201 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001202};
1203
Rich Lanee9c37db2013-06-21 18:30:24 -07001204struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001205 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001206 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001207 uint16_t length;
1208 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001209 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001210 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001211 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001212 list(of_port_stats_entry_t) entries;
1213};
1214
Rich Lanee9c37db2013-06-21 18:30:24 -07001215struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001216 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001217 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001218 uint16_t length;
1219 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001220 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001221 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001222 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001223 of_port_no_t port_no;
1224 uint32_t queue_id;
1225};
1226
Rich Lanee9c37db2013-06-21 18:30:24 -07001227struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001228 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001229 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001230 uint16_t length;
1231 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001232 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001233 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001234 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001235 list(of_queue_stats_entry_t) entries;
1236};
1237
Rich Lanee9c37db2013-06-21 18:30:24 -07001238struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001239 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001240 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001241 uint16_t length;
1242 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001243 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001244 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001245 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001246 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001247 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001248};
1249
Rich Lanee9c37db2013-06-21 18:30:24 -07001250struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001251 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001252 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001253 uint16_t length;
1254 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001255 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001256 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001257 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001258 list(of_group_stats_entry_t) entries;
1259};
1260
Rich Lanee9c37db2013-06-21 18:30:24 -07001261struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001262 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001263 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001264 uint16_t length;
1265 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001266 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001267 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001268 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001269};
1270
Rich Lanee9c37db2013-06-21 18:30:24 -07001271struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001272 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001273 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001274 uint16_t length;
1275 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001276 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001277 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001278 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001279 list(of_group_desc_stats_entry_t) entries;
1280};
1281
Rich Lanee9c37db2013-06-21 18:30:24 -07001282struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001283 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001284 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001285 uint16_t length;
1286 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001287 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001288 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001289 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001290};
1291
Rich Lanee9c37db2013-06-21 18:30:24 -07001292struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001293 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001294 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001295 uint16_t length;
1296 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001297 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001298 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001299 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001300 uint32_t types;
1301 uint32_t capabilities;
1302 uint32_t max_groups_all;
1303 uint32_t max_groups_select;
1304 uint32_t max_groups_indirect;
1305 uint32_t max_groups_ff;
1306 uint32_t actions_all;
1307 uint32_t actions_select;
1308 uint32_t actions_indirect;
1309 uint32_t actions_ff;
1310};
1311
Rich Lanee9c37db2013-06-21 18:30:24 -07001312struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001313 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001314 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001315 uint16_t length;
1316 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001317 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001318 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001319 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001320 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001321 uint32_t subtype;
1322 of_octets_t data;
1323};
1324
Rich Lanee9c37db2013-06-21 18:30:24 -07001325struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001326 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001327 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001328 uint16_t length;
1329 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001330 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001331 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001332 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001333 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001334 uint32_t subtype;
1335 of_octets_t data;
1336};
1337
1338// END OF STATS OBJECTS
1339
Rich Lane68ae4d72013-05-09 10:55:19 -07001340struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001341 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001342 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001343 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001344};
1345
Rich Lanee9c37db2013-06-21 18:30:24 -07001346struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001347 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001348 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001349 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001350 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001351 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001352};
1353
Rich Lanee9c37db2013-06-21 18:30:24 -07001354struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001355 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001356 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001357 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001358 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001359 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001360};
1361
Rich Lanee9c37db2013-06-21 18:30:24 -07001362struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001363 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001364 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001365 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001366 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001367 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001368 of_octets_t data;
1369};
1370
Rich Lane68ae4d72013-05-09 10:55:19 -07001371struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001372 uint32_t queue_id;
1373 of_port_no_t port;
1374 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001375 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001376 list(of_queue_prop_t) properties;
1377};
1378
Rich Lanee9c37db2013-06-21 18:30:24 -07001379struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001380 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001381 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001382 uint16_t length;
1383 uint32_t xid;
1384 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001385 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001386};
1387
Rich Lanee9c37db2013-06-21 18:30:24 -07001388struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001390 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001391 uint16_t length;
1392 uint32_t xid;
1393 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001394 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001395 list(of_packet_queue_t) queues;
1396};
1397
Rich Lanee9c37db2013-06-21 18:30:24 -07001398struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001399 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001400 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 uint16_t length;
1402 uint32_t xid;
1403 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001404 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001405 uint64_t generation_id;
1406};
1407
Rich Lanee9c37db2013-06-21 18:30:24 -07001408struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001409 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001410 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001411 uint16_t length;
1412 uint32_t xid;
1413 of_octets_t data;
1414};