blob: 0b58b2d591763837c749e22ba0e78c884499f804 [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 2
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 OFPFW_ICMP_TYPE = 0x40,
46 OFPFW_ICMP_CODE = 0x80,
47
48 OFP_DL_TYPE_ETH2_CUTOFF = 0x600,
49 OFP_DL_TYPE_NOT_ETH_TYPE = 0x5ff,
50
51 OFP_VLAN_NONE = 0,
52
53 OFPMT_STANDARD_LENGTH = 88,
54
55 OFP_FLOW_PERMANENT = 0,
56
57 OFP_DEFAULT_PRIORITY = 0x8000,
58
59 DESC_STR_LEN = 256,
60 SERIAL_NUM_LEN = 32,
61
62 OFPQ_ALL = 0xffffffff,
63 OFPQ_MIN_RATE_UNCFG = 0xffff,
64};
65
Andreas Wundsam4ee51462013-07-30 11:00:37 -070066enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070067 OFPP_MAX = 0xffffff00,
68 OFPP_IN_PORT = 0xfffffff8,
69 OFPP_TABLE = 0xfffffff9,
70 OFPP_NORMAL = 0xfffffffa,
71 OFPP_FLOOD = 0xfffffffb,
72 OFPP_ALL = 0xfffffffc,
73 OFPP_CONTROLLER = 0xfffffffd,
74 OFPP_LOCAL = 0xfffffffe,
75};
76
Andreas Wundsam7933beb2013-08-02 22:36:42 -070077enum ofp_port_no(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -070078 OFPP_ANY = 0xffffffff,
79};
80
Andreas Wundsam4ee51462013-07-30 11:00:37 -070081enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070082 OFPT_HELLO = 0,
83 OFPT_ERROR = 1,
84 OFPT_ECHO_REQUEST = 2,
85 OFPT_ECHO_REPLY = 3,
86 OFPT_EXPERIMENTER = 4,
87 OFPT_FEATURES_REQUEST = 5,
88 OFPT_FEATURES_REPLY = 6,
89 OFPT_GET_CONFIG_REQUEST = 7,
90 OFPT_GET_CONFIG_REPLY = 8,
91 OFPT_SET_CONFIG = 9,
92 OFPT_PACKET_IN = 10,
93 OFPT_FLOW_REMOVED = 11,
94 OFPT_PORT_STATUS = 12,
95 OFPT_PACKET_OUT = 13,
96 OFPT_FLOW_MOD = 14,
97 OFPT_GROUP_MOD = 15,
98 OFPT_PORT_MOD = 16,
99 OFPT_TABLE_MOD = 17,
100 OFPT_STATS_REQUEST = 18,
101 OFPT_STATS_REPLY = 19,
102 OFPT_BARRIER_REQUEST = 20,
103 OFPT_BARRIER_REPLY = 21,
104 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
105 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
106};
107
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700108enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700109 OFPC_FRAG_NORMAL = 0,
110 OFPC_FRAG_DROP = 1,
111 OFPC_FRAG_REASM = 2,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700112 OFPC_FRAG_MASK(virtual=True) = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700113 OFPC_INVALID_TTL_TO_CONTROLLER = 4,
114};
115
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700116enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700117 OFPTC_TABLE_MISS_CONTROLLER = 0,
118 OFPTC_TABLE_MISS_CONTINUE = 1,
119 OFPTC_TABLE_MISS_DROP = 2,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700120 OFPTC_TABLE_MISS_MASK(virtual=True) = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700121};
122
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700123enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700124 OFPC_FLOW_STATS = 0x1,
125 OFPC_TABLE_STATS = 0x2,
126 OFPC_PORT_STATS = 0x4,
127 OFPC_GROUP_STATS = 0x8,
128 OFPC_IP_REASM = 0x20,
129 OFPC_QUEUE_STATS = 0x40,
130 OFPC_ARP_MATCH_IP = 0x80,
131};
132
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700133enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700134 OFPPC_PORT_DOWN = 0x1,
135 OFPPC_NO_RECV = 0x4,
136 OFPPC_NO_FWD = 0x20,
137 OFPPC_NO_PACKET_IN = 0x40,
138};
139
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700140enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700141 OFPPS_LINK_DOWN = 0x1,
142 OFPPS_BLOCKED = 0x2,
143 OFPPS_LIVE = 0x4,
144};
145
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700146enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700147 OFPPF_10MB_HD = 0x1,
148 OFPPF_10MB_FD = 0x2,
149 OFPPF_100MB_HD = 0x4,
150 OFPPF_100MB_FD = 0x8,
151 OFPPF_1GB_HD = 0x10,
152 OFPPF_1GB_FD = 0x20,
153 OFPPF_10GB_FD = 0x40,
154 OFPPF_40GB_FD = 0x80,
155 OFPPF_100GB_FD = 0x100,
156 OFPPF_1TB_FD = 0x200,
157 OFPPF_OTHER = 0x400,
158 OFPPF_COPPER = 0x800,
159 OFPPF_FIBER = 0x1000,
160 OFPPF_AUTONEG = 0x2000,
161 OFPPF_PAUSE = 0x4000,
162 OFPPF_PAUSE_ASYM = 0x8000,
163};
164
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700165enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700166 OFPPR_ADD = 0,
167 OFPPR_DELETE = 1,
168 OFPPR_MODIFY = 2,
169};
170
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700171enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700172 OFPR_NO_MATCH = 0,
173 OFPR_ACTION = 1,
174};
175
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700176enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700177 OFPAT_OUTPUT = 0,
178 OFPAT_SET_VLAN_VID = 1,
179 OFPAT_SET_VLAN_PCP = 2,
180 OFPAT_SET_DL_SRC = 3,
181 OFPAT_SET_DL_DST = 4,
182 OFPAT_SET_NW_SRC = 5,
183 OFPAT_SET_NW_DST = 6,
184 OFPAT_SET_NW_TOS = 7,
185 OFPAT_SET_NW_ECN = 8,
186 OFPAT_SET_TP_SRC = 9,
187 OFPAT_SET_TP_DST = 10,
188 OFPAT_COPY_TTL_OUT = 11,
189 OFPAT_COPY_TTL_IN = 12,
190 OFPAT_SET_MPLS_LABEL = 13,
191 OFPAT_SET_MPLS_TC = 14,
192 OFPAT_SET_MPLS_TTL = 15,
193 OFPAT_DEC_MPLS_TTL = 16,
194 OFPAT_PUSH_VLAN = 17,
195 OFPAT_POP_VLAN = 18,
196 OFPAT_PUSH_MPLS = 19,
197 OFPAT_POP_MPLS = 20,
198 OFPAT_SET_QUEUE = 21,
199 OFPAT_GROUP = 22,
200 OFPAT_SET_NW_TTL = 23,
201 OFPAT_DEC_NW_TTL = 24,
202 OFPAT_EXPERIMENTER = 0xffff,
203};
204
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700205enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700206 OFPFC_ADD = 0,
207 OFPFC_MODIFY = 1,
208 OFPFC_MODIFY_STRICT = 2,
209 OFPFC_DELETE = 3,
210 OFPFC_DELETE_STRICT = 4,
211};
212
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700213enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700214 OFPGC_ADD = 0,
215 OFPGC_MODIFY = 1,
216 OFPGC_DELETE = 2,
217};
218
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700219enum ofp_flow_wildcards(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700220 OFPFW_IN_PORT = 0x1,
221 OFPFW_DL_VLAN = 0x2,
222 OFPFW_DL_VLAN_PCP = 0x4,
223 OFPFW_DL_TYPE = 0x8,
224 OFPFW_NW_TOS = 0x10,
225 OFPFW_NW_PROTO = 0x20,
226 OFPFW_TP_SRC = 0x40,
227 OFPFW_TP_DST = 0x80,
228 OFPFW_MPLS_LABEL = 0x100,
229 OFPFW_MPLS_TC = 0x200,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700230 OFPFW_ALL(virtual=True) = 0x3ff,
Rich Lane5d33a622013-04-08 17:33:11 -0700231};
232
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700233enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700234 OFPVID_ANY = 0xfffe,
235 OFPVID_NONE = 0xffff,
236};
237
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700238enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700239 OFPMT_STANDARD = 0,
240};
241
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700242enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700243 OFPIT_GOTO_TABLE = 0x1,
244 OFPIT_WRITE_METADATA = 0x2,
245 OFPIT_WRITE_ACTIONS = 0x3,
246 OFPIT_APPLY_ACTIONS = 0x4,
247 OFPIT_CLEAR_ACTIONS = 0x5,
248 OFPIT_EXPERIMENTER = 0xffff,
249};
250
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700251enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700252 OFPFF_SEND_FLOW_REM = 0x1,
253 OFPFF_CHECK_OVERLAP = 0x2,
254};
255
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700256enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700257 OFPG_MAX = 0xffffff00,
258 OFPG_ALL = 0xfffffffc,
259 OFPG_ANY = 0xffffffff,
260};
261
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700262enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700263 OFPGT_ALL = 0,
264 OFPGT_SELECT = 1,
265 OFPGT_INDIRECT = 2,
266 OFPGT_FF = 3,
267};
268
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700269enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700270 OFPRR_IDLE_TIMEOUT = 0,
271 OFPRR_HARD_TIMEOUT = 1,
272 OFPRR_DELETE = 2,
273 OFPRR_GROUP_DELETE = 3,
274};
275
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700276enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700277 OFPET_HELLO_FAILED = 0,
278 OFPET_BAD_REQUEST = 1,
279 OFPET_BAD_ACTION = 2,
280 OFPET_BAD_INSTRUCTION = 3,
281 OFPET_BAD_MATCH = 4,
282 OFPET_FLOW_MOD_FAILED = 5,
283 OFPET_GROUP_MOD_FAILED = 6,
284 OFPET_PORT_MOD_FAILED = 7,
285 OFPET_TABLE_MOD_FAILED = 8,
286 OFPET_QUEUE_OP_FAILED = 9,
287 OFPET_SWITCH_CONFIG_FAILED = 10,
288};
289
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700290enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700291 OFPHFC_INCOMPATIBLE = 0,
292 OFPHFC_EPERM = 1,
293};
294
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700295enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700296 OFPBRC_BAD_VERSION = 0,
297 OFPBRC_BAD_TYPE = 1,
298 OFPBRC_BAD_STAT = 2,
299 OFPBRC_BAD_EXPERIMENTER = 3,
300 OFPBRC_BAD_SUBTYPE = 4,
301 OFPBRC_EPERM = 5,
302 OFPBRC_BAD_LEN = 6,
303 OFPBRC_BUFFER_EMPTY = 7,
304 OFPBRC_BUFFER_UNKNOWN = 8,
305 OFPBRC_BAD_TABLE_ID = 9,
306};
307
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700308enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700309 OFPBAC_BAD_TYPE = 0,
310 OFPBAC_BAD_LEN = 1,
311 OFPBAC_BAD_EXPERIMENTER = 2,
312 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
313 OFPBAC_BAD_OUT_PORT = 4,
314 OFPBAC_BAD_ARGUMENT = 5,
315 OFPBAC_EPERM = 6,
316 OFPBAC_TOO_MANY = 7,
317 OFPBAC_BAD_QUEUE = 8,
318 OFPBAC_BAD_OUT_GROUP = 9,
319 OFPBAC_MATCH_INCONSISTENT = 10,
320 OFPBAC_UNSUPPORTED_ORDER = 11,
321 OFPBAC_BAD_TAG = 12,
322};
323
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700324enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700325 OFPBIC_UNKNOWN_INST = 0,
326 OFPBIC_UNSUP_INST = 1,
327 OFPBIC_BAD_TABLE_ID = 2,
328 OFPBIC_UNSUP_METADATA = 3,
329 OFPBIC_UNSUP_METADATA_MASK = 4,
330 OFPBIC_UNSUP_EXP_INST = 5,
331};
332
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700333enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700334 OFPBMC_BAD_TYPE = 0,
335 OFPBMC_BAD_LEN = 1,
336 OFPBMC_BAD_TAG = 2,
337 OFPBMC_BAD_DL_ADDR_MASK = 3,
338 OFPBMC_BAD_NW_ADDR_MASK = 4,
339 OFPBMC_BAD_WILDCARDS = 5,
340 OFPBMC_BAD_FIELD = 6,
341 OFPBMC_BAD_VALUE = 7,
342};
343
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700344enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700345 OFPFMFC_UNKNOWN = 0,
346 OFPFMFC_TABLE_FULL = 1,
347 OFPFMFC_BAD_TABLE_ID = 2,
348 OFPFMFC_OVERLAP = 3,
349 OFPFMFC_EPERM = 4,
350 OFPFMFC_BAD_TIMEOUT = 5,
351 OFPFMFC_BAD_COMMAND = 6,
352};
353
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700354enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700355 OFPGMFC_GROUP_EXISTS = 0,
356 OFPGMFC_INVALID_GROUP = 1,
357 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
358 OFPGMFC_OUT_OF_GROUPS = 3,
359 OFPGMFC_OUT_OF_BUCKETS = 4,
360 OFPGMFC_CHAINING_UNSUPPORTED = 5,
361 OFPGMFC_WATCH_UNSUPPORTED = 6,
362 OFPGMFC_LOOP = 7,
363 OFPGMFC_UNKNOWN_GROUP = 8,
364};
365
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700366enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700367 OFPPMFC_BAD_PORT = 0,
368 OFPPMFC_BAD_HW_ADDR = 1,
369 OFPPMFC_BAD_CONFIG = 2,
370 OFPPMFC_BAD_ADVERTISE = 3,
371};
372
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700373enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700374 OFPTMFC_BAD_TABLE = 0,
375 OFPTMFC_BAD_CONFIG = 1,
376};
377
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700378enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700379 OFPQOFC_BAD_PORT = 0,
380 OFPQOFC_BAD_QUEUE = 1,
381 OFPQOFC_EPERM = 2,
382};
383
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700384enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700385 OFPSCFC_BAD_FLAGS = 0,
386 OFPSCFC_BAD_LEN = 1,
387};
388
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700389enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700390 OFPST_DESC = 0,
391 OFPST_FLOW = 1,
392 OFPST_AGGREGATE = 2,
393 OFPST_TABLE = 3,
394 OFPST_PORT = 4,
395 OFPST_QUEUE = 5,
396 OFPST_GROUP = 6,
397 OFPST_GROUP_DESC = 7,
398 OFPST_EXPERIMENTER = 0xffff,
399};
400
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700401enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700402 OFPSF_REPLY_MORE = 0x1,
403};
404
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700405enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700406 OFPQT_NONE = 0,
407 OFPQT_MIN_RATE = 1,
408};
409
Rich Lanee9c37db2013-06-21 18:30:24 -0700410/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700411struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700412 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700413 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700414 uint16_t length;
415 uint32_t xid;
416};
417
Rich Lanee9c37db2013-06-21 18:30:24 -0700418struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700419 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700420 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700421 uint16_t length;
422 uint32_t xid;
423};
424
Rich Lanee9c37db2013-06-21 18:30:24 -0700425struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700426 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700427 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700428 uint16_t length;
429 uint32_t xid;
430 of_octets_t data;
431};
432
Rich Lanee9c37db2013-06-21 18:30:24 -0700433struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700434 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700435 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700436 uint16_t length;
437 uint32_t xid;
438 of_octets_t data;
439};
440
Rich Lanee9c37db2013-06-21 18:30:24 -0700441struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700442 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700443 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700444 uint16_t length;
445 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700446 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700447 uint32_t subtype;
448 of_octets_t data;
449};
450
Rich Lanee9c37db2013-06-21 18:30:24 -0700451struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700452 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700453 uint8_t type == 20;
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_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700459 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700460 uint8_t type == 21;
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_get_config_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 == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700468 uint16_t length;
469 uint32_t xid;
470};
471
Rich Lanee9c37db2013-06-21 18:30:24 -0700472struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700473 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700474 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700475 uint16_t length;
476 uint32_t xid;
477 uint16_t flags;
478 uint16_t miss_send_len;
479};
480
Rich Lanee9c37db2013-06-21 18:30:24 -0700481struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700482 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700483 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700484 uint16_t length;
485 uint32_t xid;
486 uint16_t flags;
487 uint16_t miss_send_len;
488};
489
Rich Lanee9c37db2013-06-21 18:30:24 -0700490struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700491 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700492 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700493 uint16_t length;
494 uint32_t xid;
495 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700496 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700497 uint32_t config;
498};
499
Rich Lane68ae4d72013-05-09 10:55:19 -0700500struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700501 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700502 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700503 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700504 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700505 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700506 enum ofp_port_config config;
507 enum ofp_port_state state;
508 enum ofp_port_features curr;
509 enum ofp_port_features advertised;
510 enum ofp_port_features supported;
511 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700512 uint32_t curr_speed;
513 uint32_t max_speed;
514};
515
Rich Lanee9c37db2013-06-21 18:30:24 -0700516struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700517 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700518 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700519 uint16_t length;
520 uint32_t xid;
521};
522
Rich Lanee9c37db2013-06-21 18:30:24 -0700523struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700524 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700525 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700526 uint16_t length;
527 uint32_t xid;
528 uint64_t datapath_id;
529 uint32_t n_buffers;
530 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700531 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700532 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700533 uint32_t reserved;
534 list(of_port_desc_t) ports;
535};
536
Rich Lanee9c37db2013-06-21 18:30:24 -0700537struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700538 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700539 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700540 uint16_t length;
541 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700542 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700543 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700544 of_port_desc_t desc;
545};
546
Rich Lanee9c37db2013-06-21 18:30:24 -0700547struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700548 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700549 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700550 uint16_t length;
551 uint32_t xid;
552 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700553 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700554 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700555 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700556 uint32_t config;
557 uint32_t mask;
558 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700559 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700560};
561
Rich Lanee9c37db2013-06-21 18:30:24 -0700562struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700563 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700564 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700565 uint16_t length;
566 uint32_t xid;
567 uint32_t buffer_id;
568 of_port_no_t in_port;
569 of_port_no_t in_phy_port;
570 uint16_t total_len;
571 uint8_t reason;
572 uint8_t table_id;
573 of_octets_t data;
574};
575
Rich Lanee9c37db2013-06-21 18:30:24 -0700576struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700577 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700578 uint16_t len;
579 of_port_no_t port;
580 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700581 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700582};
583
Rich Lanee9c37db2013-06-21 18:30:24 -0700584struct of_action_set_vlan_vid : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700585 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700586 uint16_t len;
587 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700588 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700589};
590
Rich Lanee9c37db2013-06-21 18:30:24 -0700591struct of_action_set_vlan_pcp : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700592 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700593 uint16_t len;
594 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700595 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700596};
597
Rich Lanee9c37db2013-06-21 18:30:24 -0700598struct of_action_set_dl_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700599 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700600 uint16_t len;
601 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700602 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700603};
604
Rich Lanee9c37db2013-06-21 18:30:24 -0700605struct of_action_set_dl_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700606 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700607 uint16_t len;
608 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700609 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700610};
611
Rich Lanee9c37db2013-06-21 18:30:24 -0700612struct of_action_set_nw_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700613 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700614 uint16_t len;
615 uint32_t nw_addr;
616};
617
Rich Lanee9c37db2013-06-21 18:30:24 -0700618struct of_action_set_nw_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700619 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700620 uint16_t len;
621 uint32_t nw_addr;
622};
623
Rich Lanee9c37db2013-06-21 18:30:24 -0700624struct of_action_set_nw_tos : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700625 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700626 uint16_t len;
627 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700628 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700629};
630
Rich Lanee9c37db2013-06-21 18:30:24 -0700631struct of_action_set_nw_ecn : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700632 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700633 uint16_t len;
634 uint8_t nw_ecn;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700635 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700636};
637
Rich Lanee9c37db2013-06-21 18:30:24 -0700638struct of_action_set_tp_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700639 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700640 uint16_t len;
641 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700642 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700643};
644
Rich Lanee9c37db2013-06-21 18:30:24 -0700645struct of_action_set_tp_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700646 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700647 uint16_t len;
648 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700649 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700650};
651
Rich Lanee9c37db2013-06-21 18:30:24 -0700652struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700653 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700654 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700655 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700656};
657
Rich Lanee9c37db2013-06-21 18:30:24 -0700658struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700659 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700660 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700661 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700662};
663
Rich Lanee9c37db2013-06-21 18:30:24 -0700664struct of_action_set_mpls_label : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700665 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700666 uint16_t len;
667 uint32_t mpls_label;
668};
669
Rich Lanee9c37db2013-06-21 18:30:24 -0700670struct of_action_set_mpls_tc : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700671 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700672 uint16_t len;
673 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700674 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700675};
676
Rich Lanee9c37db2013-06-21 18:30:24 -0700677struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700678 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700679 uint16_t len;
680 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700681 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700682};
683
Rich Lanee9c37db2013-06-21 18:30:24 -0700684struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700685 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700686 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700687 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700688};
689
Rich Lanee9c37db2013-06-21 18:30:24 -0700690struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700691 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700692 uint16_t len;
693 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700694 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700695};
696
Rich Lanee9c37db2013-06-21 18:30:24 -0700697struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700698 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700699 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700700 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700701};
702
Rich Lanee9c37db2013-06-21 18:30:24 -0700703struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700704 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700705 uint16_t len;
706 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700707 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700708};
709
Rich Lanee9c37db2013-06-21 18:30:24 -0700710struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700711 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700712 uint16_t len;
713 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700714 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700715};
716
Rich Lanee9c37db2013-06-21 18:30:24 -0700717struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700718 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700719 uint16_t len;
720 uint32_t queue_id;
721};
722
Rich Lanee9c37db2013-06-21 18:30:24 -0700723struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700724 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700725 uint16_t len;
726 uint32_t group_id;
727};
728
Rich Lanee9c37db2013-06-21 18:30:24 -0700729struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700730 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700731 uint16_t len;
732 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700733 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700734};
735
Rich Lanee9c37db2013-06-21 18:30:24 -0700736struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700737 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700738 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700739 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700740};
741
Rich Lanee9c37db2013-06-21 18:30:24 -0700742struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700743 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700744 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700745 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700746 of_octets_t data;
747};
748
Rich Lane68ae4d72013-05-09 10:55:19 -0700749struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700750 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700751 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700752 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700753};
754
Rich Lanee9c37db2013-06-21 18:30:24 -0700755struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700756 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700757 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700758 uint16_t length;
759 uint32_t xid;
760 uint32_t buffer_id;
761 of_port_no_t in_port;
762 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700763 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700764 list(of_action_t) actions;
765 of_octets_t data;
766};
767
Rich Lane68ae4d72013-05-09 10:55:19 -0700768struct of_match_v2 {
Rich Lane31b87142013-05-09 22:05:42 -0700769 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700770 uint16_t length;
771 of_port_no_t in_port;
772 of_wc_bmap_t wildcards;
773 of_mac_addr_t eth_src;
774 of_mac_addr_t eth_src_mask;
775 of_mac_addr_t eth_dst;
776 of_mac_addr_t eth_dst_mask;
777 uint16_t vlan_vid;
778 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700779 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700780 uint16_t eth_type;
781 uint8_t ip_dscp;
782 uint8_t ip_proto;
Andreas Wundsamb566a162013-07-18 19:30:23 -0700783 of_ipv4_t ipv4_src;
784 of_ipv4_t ipv4_src_mask;
785 of_ipv4_t ipv4_dst;
786 of_ipv4_t ipv4_dst_mask;
Rich Lanea06d0c32013-03-25 08:52:03 -0700787 uint16_t tcp_src;
788 uint16_t tcp_dst;
789 uint32_t mpls_label;
790 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700791 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700792 uint64_t metadata;
793 uint64_t metadata_mask;
794};
795
Rich Lane68ae4d72013-05-09 10:55:19 -0700796struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700797 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700798 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700799 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700800};
801
Rich Lanee9c37db2013-06-21 18:30:24 -0700802struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700803 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700804 uint16_t len;
805 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700806 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700807};
808
Rich Lanee9c37db2013-06-21 18:30:24 -0700809struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700810 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700811 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700812 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700813 uint64_t metadata;
814 uint64_t metadata_mask;
815};
816
Rich Lanee9c37db2013-06-21 18:30:24 -0700817struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700818 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700819 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700820 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700821 list(of_action_t) actions;
822};
823
Rich Lanee9c37db2013-06-21 18:30:24 -0700824struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700825 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700826 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700827 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700828 list(of_action_t) actions;
829};
830
Rich Lanee9c37db2013-06-21 18:30:24 -0700831struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700832 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700833 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700834 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700835};
836
Rich Lanee9c37db2013-06-21 18:30:24 -0700837struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700838 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700839 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700840 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700841 of_octets_t data;
842};
843
Rich Lanee9c37db2013-06-21 18:30:24 -0700844struct of_flow_mod : of_header {
845 uint8_t version;
846 uint8_t type == 14;
847 uint16_t length;
848 uint32_t xid;
849 uint64_t cookie;
850 uint64_t cookie_mask;
851 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700852 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700853 uint16_t idle_timeout;
854 uint16_t hard_timeout;
855 uint16_t priority;
856 uint32_t buffer_id;
857 of_port_no_t out_port;
858 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700859 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700860 pad(2);
861 of_match_t match;
862 list(of_instruction_t) instructions;
863};
864
865struct of_flow_add : 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 == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700874 uint16_t idle_timeout;
875 uint16_t hard_timeout;
876 uint16_t priority;
877 uint32_t buffer_id;
878 of_port_no_t out_port;
879 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700880 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700881 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700882 of_match_t match;
883 list(of_instruction_t) instructions;
884};
885
Rich Lanee9c37db2013-06-21 18:30:24 -0700886struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700887 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700888 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700889 uint16_t length;
890 uint32_t xid;
891 uint64_t cookie;
892 uint64_t cookie_mask;
893 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700894 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 uint16_t idle_timeout;
896 uint16_t hard_timeout;
897 uint16_t priority;
898 uint32_t buffer_id;
899 of_port_no_t out_port;
900 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700901 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700902 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700903 of_match_t match;
904 list(of_instruction_t) instructions;
905};
906
Rich Lanee9c37db2013-06-21 18:30:24 -0700907struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700908 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700909 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700910 uint16_t length;
911 uint32_t xid;
912 uint64_t cookie;
913 uint64_t cookie_mask;
914 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700915 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700916 uint16_t idle_timeout;
917 uint16_t hard_timeout;
918 uint16_t priority;
919 uint32_t buffer_id;
920 of_port_no_t out_port;
921 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700922 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700923 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700924 of_match_t match;
925 list(of_instruction_t) instructions;
926};
927
Rich Lanee9c37db2013-06-21 18:30:24 -0700928struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700929 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700930 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700931 uint16_t length;
932 uint32_t xid;
933 uint64_t cookie;
934 uint64_t cookie_mask;
935 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700936 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700937 uint16_t idle_timeout;
938 uint16_t hard_timeout;
939 uint16_t priority;
940 uint32_t buffer_id;
941 of_port_no_t out_port;
942 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700943 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700944 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700945 of_match_t match;
946 list(of_instruction_t) instructions;
947};
948
Rich Lanee9c37db2013-06-21 18:30:24 -0700949struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700950 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700951 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700952 uint16_t length;
953 uint32_t xid;
954 uint64_t cookie;
955 uint64_t cookie_mask;
956 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700957 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700958 uint16_t idle_timeout;
959 uint16_t hard_timeout;
960 uint16_t priority;
961 uint32_t buffer_id;
962 of_port_no_t out_port;
963 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700964 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700965 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700966 of_match_t match;
967 list(of_instruction_t) instructions;
968};
969
Rich Lane68ae4d72013-05-09 10:55:19 -0700970struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700971 uint16_t len;
972 uint16_t weight;
973 of_port_no_t watch_port;
974 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700975 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700976 list(of_action_t) actions;
977};
978
Rich Lanee9c37db2013-06-21 18:30:24 -0700979struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700980 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700981 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700982 uint16_t length;
983 uint32_t xid;
984 uint16_t command;
985 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700986 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700987 uint32_t group_id;
988 list(of_bucket_t) buckets;
989};
990
Rich Lanee9c37db2013-06-21 18:30:24 -0700991struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700992 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700993 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700994 uint16_t length;
995 uint32_t xid;
996 uint64_t cookie;
997 uint16_t priority;
998 uint8_t reason;
999 uint8_t table_id;
1000 uint32_t duration_sec;
1001 uint32_t duration_nsec;
1002 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001003 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001004 uint64_t packet_count;
1005 uint64_t byte_count;
1006 of_match_t match;
1007};
1008
Rich Lanee9c37db2013-06-21 18:30:24 -07001009struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001010 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001011 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001012 uint16_t length;
1013 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001014 uint16_t err_type == ?;
1015};
1016
1017struct of_hello_failed_error_msg : of_error_msg {
1018 uint8_t version;
1019 uint8_t type == 1;
1020 uint16_t length;
1021 uint32_t xid;
1022 uint16_t err_type == 0;
1023 enum ofp_hello_failed_code code;
1024 of_octets_t data;
1025};
1026
1027struct of_bad_request_error_msg : of_error_msg {
1028 uint8_t version;
1029 uint8_t type == 1;
1030 uint16_t length;
1031 uint32_t xid;
1032 uint16_t err_type == 1;
1033 enum ofp_bad_request_code code;
1034 of_octets_t data;
1035};
1036
1037struct of_bad_action_error_msg : of_error_msg {
1038 uint8_t version;
1039 uint8_t type == 1;
1040 uint16_t length;
1041 uint32_t xid;
1042 uint16_t err_type == 2;
1043 enum ofp_bad_action_code code;
1044 of_octets_t data;
1045};
1046
1047struct of_bad_instruction_error_msg : of_error_msg {
1048 uint8_t version;
1049 uint8_t type == 1;
1050 uint16_t length;
1051 uint32_t xid;
1052 uint16_t err_type == 3;
1053 enum ofp_bad_instruction_code code;
1054 of_octets_t data;
1055};
1056
1057struct of_bad_match_error_msg : of_error_msg {
1058 uint8_t version;
1059 uint8_t type == 1;
1060 uint16_t length;
1061 uint32_t xid;
1062 uint16_t err_type == 4;
1063 enum ofp_bad_match_code code;
1064 of_octets_t data;
1065};
1066
1067struct of_flow_mod_failed_error_msg : of_error_msg {
1068 uint8_t version;
1069 uint8_t type == 1;
1070 uint16_t length;
1071 uint32_t xid;
1072 uint16_t err_type == 5;
1073 enum ofp_flow_mod_failed_code code;
1074 of_octets_t data;
1075};
1076
1077struct of_group_mod_failed_error_msg : of_error_msg {
1078 uint8_t version;
1079 uint8_t type == 1;
1080 uint16_t length;
1081 uint32_t xid;
1082 uint16_t err_type == 6;
1083 enum ofp_group_mod_failed_code code;
1084 of_octets_t data;
1085};
1086
1087struct of_port_mod_failed_error_msg : of_error_msg {
1088 uint8_t version;
1089 uint8_t type == 1;
1090 uint16_t length;
1091 uint32_t xid;
1092 uint16_t err_type == 7;
1093 enum ofp_port_mod_failed_code code;
1094 of_octets_t data;
1095};
1096
1097struct of_table_mod_failed_error_msg : of_error_msg {
1098 uint8_t version;
1099 uint8_t type == 1;
1100 uint16_t length;
1101 uint32_t xid;
1102 uint16_t err_type == 8;
1103 enum ofp_table_mod_failed_code code;
1104 of_octets_t data;
1105};
1106
1107struct of_queue_op_failed_error_msg : of_error_msg {
1108 uint8_t version;
1109 uint8_t type == 1;
1110 uint16_t length;
1111 uint32_t xid;
1112 uint16_t err_type == 9;
1113 enum ofp_queue_op_failed_code code;
1114 of_octets_t data;
1115};
1116
1117struct of_switch_config_failed_error_msg : of_error_msg {
1118 uint8_t version;
1119 uint8_t type == 1;
1120 uint16_t length;
1121 uint32_t xid;
1122 uint16_t err_type == 10;
1123 enum ofp_switch_config_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001124 of_octets_t data;
1125};
1126
1127// STATS ENTRIES: flow, table, port, group, group_desc
1128
Rich Lane68ae4d72013-05-09 10:55:19 -07001129struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001130 uint16_t length;
1131 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001132 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001133 uint32_t duration_sec;
1134 uint32_t duration_nsec;
1135 uint16_t priority;
1136 uint16_t idle_timeout;
1137 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001138 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001139 uint64_t cookie;
1140 uint64_t packet_count;
1141 uint64_t byte_count;
1142 of_match_t match;
1143 list(of_instruction_t) instructions;
1144};
1145
Rich Lane68ae4d72013-05-09 10:55:19 -07001146struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001147 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001148 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001149 of_table_name_t name;
1150 of_wc_bmap_t wildcards;
1151 of_match_bmap_t match;
1152 uint32_t instructions;
1153 uint32_t write_actions;
1154 uint32_t apply_actions;
1155 uint32_t config;
1156 uint32_t max_entries;
1157 uint32_t active_count;
1158 uint64_t lookup_count;
1159 uint64_t matched_count;
1160};
1161
Rich Lane68ae4d72013-05-09 10:55:19 -07001162struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001163 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001164 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001165 uint64_t rx_packets;
1166 uint64_t tx_packets;
1167 uint64_t rx_bytes;
1168 uint64_t tx_bytes;
1169 uint64_t rx_dropped;
1170 uint64_t tx_dropped;
1171 uint64_t rx_errors;
1172 uint64_t tx_errors;
1173 uint64_t rx_frame_err;
1174 uint64_t rx_over_err;
1175 uint64_t rx_crc_err;
1176 uint64_t collisions;
1177};
1178
Rich Lane68ae4d72013-05-09 10:55:19 -07001179struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001180 of_port_no_t port_no;
1181 uint32_t queue_id;
1182 uint64_t tx_bytes;
1183 uint64_t tx_packets;
1184 uint64_t tx_errors;
1185};
1186
Rich Lane68ae4d72013-05-09 10:55:19 -07001187struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001188 uint64_t packet_count;
1189 uint64_t byte_count;
1190};
1191
Rich Lane68ae4d72013-05-09 10:55:19 -07001192struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001193 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001194 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001195 uint32_t group_id;
1196 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001197 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001198 uint64_t packet_count;
1199 uint64_t byte_count;
1200 list(of_bucket_counter_t) bucket_stats;
1201};
1202
Rich Lane68ae4d72013-05-09 10:55:19 -07001203struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001204 uint16_t length;
1205 uint8_t type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001206 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001207 uint32_t group_id;
1208 list(of_bucket_t) buckets;
1209};
1210
1211// STATS: Desc, flow, agg, table, port, queue, group, group_desc, experi
1212
Rich Lanee9c37db2013-06-21 18:30:24 -07001213struct of_stats_request : of_header {
1214 uint8_t version;
1215 uint8_t type == 18;
1216 uint16_t length;
1217 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001218 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001219 uint16_t flags;
1220 pad(4);
1221};
1222
1223struct of_stats_reply : of_header {
1224 uint8_t version;
1225 uint8_t type == 19;
1226 uint16_t length;
1227 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001228 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001229 uint16_t flags;
1230 pad(4);
1231};
1232
1233struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001234 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001235 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001236 uint16_t length;
1237 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001238 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001239 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001240 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001241};
1242
Rich Lanee9c37db2013-06-21 18:30:24 -07001243struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001244 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001245 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001246 uint16_t length;
1247 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001248 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001249 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001250 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001251 of_desc_str_t mfr_desc;
1252 of_desc_str_t hw_desc;
1253 of_desc_str_t sw_desc;
1254 of_serial_num_t serial_num;
1255 of_desc_str_t dp_desc;
1256};
1257
Rich Lanee9c37db2013-06-21 18:30:24 -07001258struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001259 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001260 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001261 uint16_t length;
1262 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001263 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001264 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001265 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001266 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001267 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001268 of_port_no_t out_port;
1269 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001270 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001271 uint64_t cookie;
1272 uint64_t cookie_mask;
1273 of_match_t match;
1274};
1275
Rich Lanee9c37db2013-06-21 18:30:24 -07001276struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001277 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001278 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001279 uint16_t length;
1280 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001281 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001282 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001283 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001284 list(of_flow_stats_entry_t) entries;
1285};
1286
Rich Lanee9c37db2013-06-21 18:30:24 -07001287struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001288 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001289 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001290 uint16_t length;
1291 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001292 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001293 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001294 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001295 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001296 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001297 of_port_no_t out_port;
1298 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001299 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001300 uint64_t cookie;
1301 uint64_t cookie_mask;
1302 of_match_t match;
1303};
1304
Rich Lanee9c37db2013-06-21 18:30:24 -07001305struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001306 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001307 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001308 uint16_t length;
1309 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001310 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001311 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001312 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001313 uint64_t packet_count;
1314 uint64_t byte_count;
1315 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001316 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001317};
1318
Rich Lanee9c37db2013-06-21 18:30:24 -07001319struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001320 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001321 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001322 uint16_t length;
1323 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001324 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001325 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001326 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001327};
1328
Rich Lanee9c37db2013-06-21 18:30:24 -07001329struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001330 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001331 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001332 uint16_t length;
1333 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001334 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001335 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001336 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001337 list(of_table_stats_entry_t) entries;
1338};
1339
Rich Lanee9c37db2013-06-21 18:30:24 -07001340struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001341 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001342 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001343 uint16_t length;
1344 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001345 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001346 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001347 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001348 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001349 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001350};
1351
Rich Lanee9c37db2013-06-21 18:30:24 -07001352struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001353 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001354 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001355 uint16_t length;
1356 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001357 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001358 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001359 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001360 list(of_port_stats_entry_t) entries;
1361};
1362
Rich Lanee9c37db2013-06-21 18:30:24 -07001363struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001364 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001365 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001366 uint16_t length;
1367 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001368 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001369 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001370 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001371 of_port_no_t port_no;
1372 uint32_t queue_id;
1373};
1374
Rich Lanee9c37db2013-06-21 18:30:24 -07001375struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001376 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001377 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001378 uint16_t length;
1379 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001380 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001381 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001382 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001383 list(of_queue_stats_entry_t) entries;
1384};
1385
Rich Lanee9c37db2013-06-21 18:30:24 -07001386struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001387 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001388 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 uint16_t length;
1390 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001391 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001392 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001393 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001394 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001395 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001396};
1397
Rich Lanee9c37db2013-06-21 18:30:24 -07001398struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001399 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001400 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 uint16_t length;
1402 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001403 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001404 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001405 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001406 list(of_group_stats_entry_t) entries;
1407};
1408
Rich Lanee9c37db2013-06-21 18:30:24 -07001409struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001410 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001411 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001412 uint16_t length;
1413 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001414 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001415 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001416 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001417};
1418
Rich Lanee9c37db2013-06-21 18:30:24 -07001419struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001420 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001421 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001422 uint16_t length;
1423 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001424 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001425 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001426 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001427 list(of_group_desc_stats_entry_t) entries;
1428};
1429
Rich Lanee9c37db2013-06-21 18:30:24 -07001430struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001431 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001432 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001433 uint16_t length;
1434 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001435 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001436 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001437 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001438 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001439 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001440 of_octets_t data;
1441};
1442
Rich Lanee9c37db2013-06-21 18:30:24 -07001443struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001444 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001445 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001446 uint16_t length;
1447 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001448 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001449 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001450 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001451 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001452 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001453 of_octets_t data;
1454};
1455
1456// END OF STATS OBJECTS
1457
Rich Lane68ae4d72013-05-09 10:55:19 -07001458struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001459 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001460 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001461 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001462};
1463
Rich Lanee9c37db2013-06-21 18:30:24 -07001464struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001465 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001466 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001467 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001468 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001469 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001470};
1471
Rich Lane68ae4d72013-05-09 10:55:19 -07001472struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001473 uint32_t queue_id;
1474 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001475 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001476 list(of_queue_prop_t) properties;
1477};
1478
Rich Lanee9c37db2013-06-21 18:30:24 -07001479struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001480 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001481 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001482 uint16_t length;
1483 uint32_t xid;
1484 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001485 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001486};
1487
Rich Lanee9c37db2013-06-21 18:30:24 -07001488struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001489 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001490 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001491 uint16_t length;
1492 uint32_t xid;
1493 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001494 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001495 list(of_packet_queue_t) queues;
1496};