blob: e4776e99dfe6d677f80ef82eb6b96996fbca1806 [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
Wilson Ngd72013d2013-09-29 10:21:48 -070038 OFP_TCP_PORT = 6653,
39 OFP_SSL_PORT = 6653,
Rich Lane5d33a622013-04-08 17:33:11 -070040
41 OFP_ETH_ALEN = 6,
42
43 OFP_DEFAULT_MISS_SEND_LEN = 128,
44
45 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,
Rich Lane5d33a622013-04-08 17:33:11 -070075 OFPP_ANY = 0xffffffff,
76};
77
Andreas Wundsam4ee51462013-07-30 11:00:37 -070078enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070079 OFPT_HELLO = 0,
80 OFPT_ERROR = 1,
81 OFPT_ECHO_REQUEST = 2,
82 OFPT_ECHO_REPLY = 3,
83 OFPT_EXPERIMENTER = 4,
84 OFPT_FEATURES_REQUEST = 5,
85 OFPT_FEATURES_REPLY = 6,
86 OFPT_GET_CONFIG_REQUEST = 7,
87 OFPT_GET_CONFIG_REPLY = 8,
88 OFPT_SET_CONFIG = 9,
89 OFPT_PACKET_IN = 10,
90 OFPT_FLOW_REMOVED = 11,
91 OFPT_PORT_STATUS = 12,
92 OFPT_PACKET_OUT = 13,
93 OFPT_FLOW_MOD = 14,
94 OFPT_GROUP_MOD = 15,
95 OFPT_PORT_MOD = 16,
96 OFPT_TABLE_MOD = 17,
97 OFPT_STATS_REQUEST = 18,
98 OFPT_STATS_REPLY = 19,
99 OFPT_BARRIER_REQUEST = 20,
100 OFPT_BARRIER_REPLY = 21,
101 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
102 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
103};
104
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700105enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700106 OFPC_FRAG_NORMAL = 0,
107 OFPC_FRAG_DROP = 1,
108 OFPC_FRAG_REASM = 2,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700109 OFPC_FRAG_MASK(virtual=True) = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700110 OFPC_INVALID_TTL_TO_CONTROLLER = 4,
111};
112
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700113enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700114 OFPTC_TABLE_MISS_CONTROLLER = 0,
115 OFPTC_TABLE_MISS_CONTINUE = 1,
116 OFPTC_TABLE_MISS_DROP = 2,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700117 OFPTC_TABLE_MISS_MASK(virtual=True) = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700118};
119
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700120enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700121 OFPC_FLOW_STATS = 0x1,
122 OFPC_TABLE_STATS = 0x2,
123 OFPC_PORT_STATS = 0x4,
124 OFPC_GROUP_STATS = 0x8,
125 OFPC_IP_REASM = 0x20,
126 OFPC_QUEUE_STATS = 0x40,
127 OFPC_ARP_MATCH_IP = 0x80,
128};
129
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700130enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700131 OFPPC_PORT_DOWN = 0x1,
132 OFPPC_NO_RECV = 0x4,
133 OFPPC_NO_FWD = 0x20,
134 OFPPC_NO_PACKET_IN = 0x40,
135};
136
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700137enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700138 OFPPS_LINK_DOWN = 0x1,
139 OFPPS_BLOCKED = 0x2,
140 OFPPS_LIVE = 0x4,
141};
142
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700143enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700144 OFPPF_10MB_HD = 0x1,
145 OFPPF_10MB_FD = 0x2,
146 OFPPF_100MB_HD = 0x4,
147 OFPPF_100MB_FD = 0x8,
148 OFPPF_1GB_HD = 0x10,
149 OFPPF_1GB_FD = 0x20,
150 OFPPF_10GB_FD = 0x40,
151 OFPPF_40GB_FD = 0x80,
152 OFPPF_100GB_FD = 0x100,
153 OFPPF_1TB_FD = 0x200,
154 OFPPF_OTHER = 0x400,
155 OFPPF_COPPER = 0x800,
156 OFPPF_FIBER = 0x1000,
157 OFPPF_AUTONEG = 0x2000,
158 OFPPF_PAUSE = 0x4000,
159 OFPPF_PAUSE_ASYM = 0x8000,
160};
161
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700162enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700163 OFPPR_ADD = 0,
164 OFPPR_DELETE = 1,
165 OFPPR_MODIFY = 2,
166};
167
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700168enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700169 OFPR_NO_MATCH = 0,
170 OFPR_ACTION = 1,
171};
172
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700173enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700174 OFPAT_OUTPUT = 0,
175 OFPAT_SET_VLAN_VID = 1,
176 OFPAT_SET_VLAN_PCP = 2,
177 OFPAT_SET_DL_SRC = 3,
178 OFPAT_SET_DL_DST = 4,
179 OFPAT_SET_NW_SRC = 5,
180 OFPAT_SET_NW_DST = 6,
181 OFPAT_SET_NW_TOS = 7,
182 OFPAT_SET_NW_ECN = 8,
183 OFPAT_SET_TP_SRC = 9,
184 OFPAT_SET_TP_DST = 10,
185 OFPAT_COPY_TTL_OUT = 11,
186 OFPAT_COPY_TTL_IN = 12,
187 OFPAT_SET_MPLS_LABEL = 13,
188 OFPAT_SET_MPLS_TC = 14,
189 OFPAT_SET_MPLS_TTL = 15,
190 OFPAT_DEC_MPLS_TTL = 16,
191 OFPAT_PUSH_VLAN = 17,
192 OFPAT_POP_VLAN = 18,
193 OFPAT_PUSH_MPLS = 19,
194 OFPAT_POP_MPLS = 20,
195 OFPAT_SET_QUEUE = 21,
196 OFPAT_GROUP = 22,
197 OFPAT_SET_NW_TTL = 23,
198 OFPAT_DEC_NW_TTL = 24,
199 OFPAT_EXPERIMENTER = 0xffff,
200};
201
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700202enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700203 OFPFC_ADD = 0,
204 OFPFC_MODIFY = 1,
205 OFPFC_MODIFY_STRICT = 2,
206 OFPFC_DELETE = 3,
207 OFPFC_DELETE_STRICT = 4,
208};
209
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700210enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700211 OFPGC_ADD = 0,
212 OFPGC_MODIFY = 1,
213 OFPGC_DELETE = 2,
214};
215
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700216enum ofp_flow_wildcards(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700217 OFPFW_IN_PORT = 0x1,
218 OFPFW_DL_VLAN = 0x2,
219 OFPFW_DL_VLAN_PCP = 0x4,
220 OFPFW_DL_TYPE = 0x8,
221 OFPFW_NW_TOS = 0x10,
222 OFPFW_NW_PROTO = 0x20,
223 OFPFW_TP_SRC = 0x40,
224 OFPFW_TP_DST = 0x80,
225 OFPFW_MPLS_LABEL = 0x100,
226 OFPFW_MPLS_TC = 0x200,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700227 OFPFW_ALL(virtual=True) = 0x3ff,
Rich Lane5d33a622013-04-08 17:33:11 -0700228};
229
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700230enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700231 OFPVID_ANY = 0xfffe,
232 OFPVID_NONE = 0xffff,
233};
234
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700235enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700236 OFPMT_STANDARD = 0,
237};
238
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700239enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700240 OFPIT_GOTO_TABLE = 0x1,
241 OFPIT_WRITE_METADATA = 0x2,
242 OFPIT_WRITE_ACTIONS = 0x3,
243 OFPIT_APPLY_ACTIONS = 0x4,
244 OFPIT_CLEAR_ACTIONS = 0x5,
245 OFPIT_EXPERIMENTER = 0xffff,
246};
247
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700248enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700249 OFPFF_SEND_FLOW_REM = 0x1,
250 OFPFF_CHECK_OVERLAP = 0x2,
251};
252
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700253enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700254 OFPG_MAX = 0xffffff00,
255 OFPG_ALL = 0xfffffffc,
256 OFPG_ANY = 0xffffffff,
257};
258
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700259enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700260 OFPGT_ALL = 0,
261 OFPGT_SELECT = 1,
262 OFPGT_INDIRECT = 2,
263 OFPGT_FF = 3,
264};
265
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700266enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700267 OFPRR_IDLE_TIMEOUT = 0,
268 OFPRR_HARD_TIMEOUT = 1,
269 OFPRR_DELETE = 2,
270 OFPRR_GROUP_DELETE = 3,
271};
272
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700273enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700274 OFPET_HELLO_FAILED = 0,
275 OFPET_BAD_REQUEST = 1,
276 OFPET_BAD_ACTION = 2,
277 OFPET_BAD_INSTRUCTION = 3,
278 OFPET_BAD_MATCH = 4,
279 OFPET_FLOW_MOD_FAILED = 5,
280 OFPET_GROUP_MOD_FAILED = 6,
281 OFPET_PORT_MOD_FAILED = 7,
282 OFPET_TABLE_MOD_FAILED = 8,
283 OFPET_QUEUE_OP_FAILED = 9,
284 OFPET_SWITCH_CONFIG_FAILED = 10,
285};
286
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700287enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700288 OFPHFC_INCOMPATIBLE = 0,
289 OFPHFC_EPERM = 1,
290};
291
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700292enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700293 OFPBRC_BAD_VERSION = 0,
294 OFPBRC_BAD_TYPE = 1,
295 OFPBRC_BAD_STAT = 2,
296 OFPBRC_BAD_EXPERIMENTER = 3,
297 OFPBRC_BAD_SUBTYPE = 4,
298 OFPBRC_EPERM = 5,
299 OFPBRC_BAD_LEN = 6,
300 OFPBRC_BUFFER_EMPTY = 7,
301 OFPBRC_BUFFER_UNKNOWN = 8,
302 OFPBRC_BAD_TABLE_ID = 9,
303};
304
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700305enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700306 OFPBAC_BAD_TYPE = 0,
307 OFPBAC_BAD_LEN = 1,
308 OFPBAC_BAD_EXPERIMENTER = 2,
309 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
310 OFPBAC_BAD_OUT_PORT = 4,
311 OFPBAC_BAD_ARGUMENT = 5,
312 OFPBAC_EPERM = 6,
313 OFPBAC_TOO_MANY = 7,
314 OFPBAC_BAD_QUEUE = 8,
315 OFPBAC_BAD_OUT_GROUP = 9,
316 OFPBAC_MATCH_INCONSISTENT = 10,
317 OFPBAC_UNSUPPORTED_ORDER = 11,
318 OFPBAC_BAD_TAG = 12,
319};
320
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700321enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700322 OFPBIC_UNKNOWN_INST = 0,
323 OFPBIC_UNSUP_INST = 1,
324 OFPBIC_BAD_TABLE_ID = 2,
325 OFPBIC_UNSUP_METADATA = 3,
326 OFPBIC_UNSUP_METADATA_MASK = 4,
327 OFPBIC_UNSUP_EXP_INST = 5,
328};
329
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700330enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700331 OFPBMC_BAD_TYPE = 0,
332 OFPBMC_BAD_LEN = 1,
333 OFPBMC_BAD_TAG = 2,
334 OFPBMC_BAD_DL_ADDR_MASK = 3,
335 OFPBMC_BAD_NW_ADDR_MASK = 4,
336 OFPBMC_BAD_WILDCARDS = 5,
337 OFPBMC_BAD_FIELD = 6,
338 OFPBMC_BAD_VALUE = 7,
339};
340
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700341enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700342 OFPFMFC_UNKNOWN = 0,
343 OFPFMFC_TABLE_FULL = 1,
344 OFPFMFC_BAD_TABLE_ID = 2,
345 OFPFMFC_OVERLAP = 3,
346 OFPFMFC_EPERM = 4,
347 OFPFMFC_BAD_TIMEOUT = 5,
348 OFPFMFC_BAD_COMMAND = 6,
349};
350
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700351enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700352 OFPGMFC_GROUP_EXISTS = 0,
353 OFPGMFC_INVALID_GROUP = 1,
354 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
355 OFPGMFC_OUT_OF_GROUPS = 3,
356 OFPGMFC_OUT_OF_BUCKETS = 4,
357 OFPGMFC_CHAINING_UNSUPPORTED = 5,
358 OFPGMFC_WATCH_UNSUPPORTED = 6,
359 OFPGMFC_LOOP = 7,
360 OFPGMFC_UNKNOWN_GROUP = 8,
361};
362
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700363enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700364 OFPPMFC_BAD_PORT = 0,
365 OFPPMFC_BAD_HW_ADDR = 1,
366 OFPPMFC_BAD_CONFIG = 2,
367 OFPPMFC_BAD_ADVERTISE = 3,
368};
369
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700370enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700371 OFPTMFC_BAD_TABLE = 0,
372 OFPTMFC_BAD_CONFIG = 1,
373};
374
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700375enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700376 OFPQOFC_BAD_PORT = 0,
377 OFPQOFC_BAD_QUEUE = 1,
378 OFPQOFC_EPERM = 2,
379};
380
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700381enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700382 OFPSCFC_BAD_FLAGS = 0,
383 OFPSCFC_BAD_LEN = 1,
384};
385
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700386enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700387 OFPST_DESC = 0,
388 OFPST_FLOW = 1,
389 OFPST_AGGREGATE = 2,
390 OFPST_TABLE = 3,
391 OFPST_PORT = 4,
392 OFPST_QUEUE = 5,
393 OFPST_GROUP = 6,
394 OFPST_GROUP_DESC = 7,
395 OFPST_EXPERIMENTER = 0xffff,
396};
397
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700398enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700399 OFPSF_REPLY_MORE = 0x1,
400};
401
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700402enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700403 OFPQT_NONE = 0,
404 OFPQT_MIN_RATE = 1,
405};
406
Rich Lanee9c37db2013-06-21 18:30:24 -0700407/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700408struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700409 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700410 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700411 uint16_t length;
412 uint32_t xid;
413};
414
Rich Lanee9c37db2013-06-21 18:30:24 -0700415struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700416 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700417 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700418 uint16_t length;
419 uint32_t xid;
420};
421
Rich Lanee9c37db2013-06-21 18:30:24 -0700422struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700423 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700424 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700425 uint16_t length;
426 uint32_t xid;
427 of_octets_t data;
428};
429
Rich Lanee9c37db2013-06-21 18:30:24 -0700430struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700431 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700432 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700433 uint16_t length;
434 uint32_t xid;
435 of_octets_t data;
436};
437
Rich Lanee9c37db2013-06-21 18:30:24 -0700438struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700439 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700440 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700441 uint16_t length;
442 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700443 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700444 uint32_t subtype;
445 of_octets_t data;
446};
447
Rich Lanee9c37db2013-06-21 18:30:24 -0700448struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700449 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700450 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700451 uint16_t length;
452 uint32_t xid;
453};
454
Rich Lanee9c37db2013-06-21 18:30:24 -0700455struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700456 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700457 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700458 uint16_t length;
459 uint32_t xid;
460};
461
Rich Lanee9c37db2013-06-21 18:30:24 -0700462struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700463 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700464 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700465 uint16_t length;
466 uint32_t xid;
467};
468
Rich Lanee9c37db2013-06-21 18:30:24 -0700469struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700470 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700471 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700472 uint16_t length;
473 uint32_t xid;
474 uint16_t flags;
475 uint16_t miss_send_len;
476};
477
Rich Lanee9c37db2013-06-21 18:30:24 -0700478struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700479 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700480 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700481 uint16_t length;
482 uint32_t xid;
483 uint16_t flags;
484 uint16_t miss_send_len;
485};
486
Rich Lanee9c37db2013-06-21 18:30:24 -0700487struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700488 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700489 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700490 uint16_t length;
491 uint32_t xid;
492 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700493 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700494 uint32_t config;
495};
496
Rich Lane68ae4d72013-05-09 10:55:19 -0700497struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700498 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700499 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700500 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700501 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700502 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700503 enum ofp_port_config config;
504 enum ofp_port_state state;
505 enum ofp_port_features curr;
506 enum ofp_port_features advertised;
507 enum ofp_port_features supported;
508 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700509 uint32_t curr_speed;
510 uint32_t max_speed;
511};
512
Rich Lanee9c37db2013-06-21 18:30:24 -0700513struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700514 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700515 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700516 uint16_t length;
517 uint32_t xid;
518};
519
Rich Lanee9c37db2013-06-21 18:30:24 -0700520struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700521 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700522 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700523 uint16_t length;
524 uint32_t xid;
525 uint64_t datapath_id;
526 uint32_t n_buffers;
527 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700528 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700529 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700530 uint32_t reserved;
531 list(of_port_desc_t) ports;
532};
533
Rich Lanee9c37db2013-06-21 18:30:24 -0700534struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700535 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700536 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700537 uint16_t length;
538 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700539 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700540 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700541 of_port_desc_t desc;
542};
543
Rich Lanee9c37db2013-06-21 18:30:24 -0700544struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700545 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700546 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700547 uint16_t length;
548 uint32_t xid;
549 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700550 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700551 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700552 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700553 uint32_t config;
554 uint32_t mask;
555 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700556 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700557};
558
Rich Lanee9c37db2013-06-21 18:30:24 -0700559struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700560 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700561 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700562 uint16_t length;
563 uint32_t xid;
564 uint32_t buffer_id;
565 of_port_no_t in_port;
566 of_port_no_t in_phy_port;
567 uint16_t total_len;
568 uint8_t reason;
569 uint8_t table_id;
570 of_octets_t data;
571};
572
Rich Lanee9c37db2013-06-21 18:30:24 -0700573struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700574 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700575 uint16_t len;
576 of_port_no_t port;
577 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700578 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700579};
580
Rich Lanee9c37db2013-06-21 18:30:24 -0700581struct of_action_set_vlan_vid : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700582 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700583 uint16_t len;
584 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700585 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700586};
587
Rich Lanee9c37db2013-06-21 18:30:24 -0700588struct of_action_set_vlan_pcp : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700589 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700590 uint16_t len;
591 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700592 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700593};
594
Rich Lanee9c37db2013-06-21 18:30:24 -0700595struct of_action_set_dl_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700596 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint16_t len;
598 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700599 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700600};
601
Rich Lanee9c37db2013-06-21 18:30:24 -0700602struct of_action_set_dl_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700603 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700604 uint16_t len;
605 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700606 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700607};
608
Rich Lanee9c37db2013-06-21 18:30:24 -0700609struct of_action_set_nw_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700610 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700611 uint16_t len;
612 uint32_t nw_addr;
613};
614
Rich Lanee9c37db2013-06-21 18:30:24 -0700615struct of_action_set_nw_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700616 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700617 uint16_t len;
618 uint32_t nw_addr;
619};
620
Rich Lanee9c37db2013-06-21 18:30:24 -0700621struct of_action_set_nw_tos : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700622 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700623 uint16_t len;
624 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700625 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700626};
627
Rich Lanee9c37db2013-06-21 18:30:24 -0700628struct of_action_set_nw_ecn : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700629 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700630 uint16_t len;
631 uint8_t nw_ecn;
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_set_tp_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700636 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700637 uint16_t len;
638 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700639 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700640};
641
Rich Lanee9c37db2013-06-21 18:30:24 -0700642struct of_action_set_tp_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700643 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700644 uint16_t len;
645 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700646 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700647};
648
Rich Lanee9c37db2013-06-21 18:30:24 -0700649struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700650 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700651 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700652 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700653};
654
Rich Lanee9c37db2013-06-21 18:30:24 -0700655struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700656 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700657 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700658 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700659};
660
Rich Lanee9c37db2013-06-21 18:30:24 -0700661struct of_action_set_mpls_label : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700662 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint16_t len;
664 uint32_t mpls_label;
665};
666
Rich Lanee9c37db2013-06-21 18:30:24 -0700667struct of_action_set_mpls_tc : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700668 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700669 uint16_t len;
670 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700671 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700672};
673
Rich Lanee9c37db2013-06-21 18:30:24 -0700674struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700675 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700676 uint16_t len;
677 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700678 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700679};
680
Rich Lanee9c37db2013-06-21 18:30:24 -0700681struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700682 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700683 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700684 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700685};
686
Rich Lanee9c37db2013-06-21 18:30:24 -0700687struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700688 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700689 uint16_t len;
690 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700691 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700692};
693
Rich Lanee9c37db2013-06-21 18:30:24 -0700694struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700695 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700697 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700698};
699
Rich Lanee9c37db2013-06-21 18:30:24 -0700700struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700701 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700702 uint16_t len;
703 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700704 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700705};
706
Rich Lanee9c37db2013-06-21 18:30:24 -0700707struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700708 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700709 uint16_t len;
710 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700711 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700712};
713
Rich Lanee9c37db2013-06-21 18:30:24 -0700714struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700715 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700716 uint16_t len;
717 uint32_t queue_id;
718};
719
Rich Lanee9c37db2013-06-21 18:30:24 -0700720struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700721 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700722 uint16_t len;
723 uint32_t group_id;
724};
725
Rich Lanee9c37db2013-06-21 18:30:24 -0700726struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700727 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700728 uint16_t len;
729 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700730 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700731};
732
Rich Lanee9c37db2013-06-21 18:30:24 -0700733struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700734 uint16_t type == 24;
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};
738
Rich Lanee9c37db2013-06-21 18:30:24 -0700739struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700740 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700741 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700742 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700743 of_octets_t data;
744};
745
Rich Lane68ae4d72013-05-09 10:55:19 -0700746struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700747 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700748 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700749 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700750};
751
Rich Lanee9c37db2013-06-21 18:30:24 -0700752struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700753 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700754 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700755 uint16_t length;
756 uint32_t xid;
757 uint32_t buffer_id;
758 of_port_no_t in_port;
759 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700760 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700761 list(of_action_t) actions;
762 of_octets_t data;
763};
764
Rich Lane68ae4d72013-05-09 10:55:19 -0700765struct of_match_v2 {
Rich Lane31b87142013-05-09 22:05:42 -0700766 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700767 uint16_t length;
768 of_port_no_t in_port;
769 of_wc_bmap_t wildcards;
770 of_mac_addr_t eth_src;
771 of_mac_addr_t eth_src_mask;
772 of_mac_addr_t eth_dst;
773 of_mac_addr_t eth_dst_mask;
774 uint16_t vlan_vid;
775 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700776 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700777 uint16_t eth_type;
778 uint8_t ip_dscp;
779 uint8_t ip_proto;
Andreas Wundsamb566a162013-07-18 19:30:23 -0700780 of_ipv4_t ipv4_src;
781 of_ipv4_t ipv4_src_mask;
782 of_ipv4_t ipv4_dst;
783 of_ipv4_t ipv4_dst_mask;
Rich Lanea06d0c32013-03-25 08:52:03 -0700784 uint16_t tcp_src;
785 uint16_t tcp_dst;
786 uint32_t mpls_label;
787 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700788 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700789 uint64_t metadata;
790 uint64_t metadata_mask;
791};
792
Rich Lane68ae4d72013-05-09 10:55:19 -0700793struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700794 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700795 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700796 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700797};
798
Rich Lanee9c37db2013-06-21 18:30:24 -0700799struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700800 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700801 uint16_t len;
802 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700803 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700804};
805
Rich Lanee9c37db2013-06-21 18:30:24 -0700806struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700807 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700808 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700809 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700810 uint64_t metadata;
811 uint64_t metadata_mask;
812};
813
Rich Lanee9c37db2013-06-21 18:30:24 -0700814struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700815 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700816 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700817 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700818 list(of_action_t) actions;
819};
820
Rich Lanee9c37db2013-06-21 18:30:24 -0700821struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700822 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700823 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700824 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700825 list(of_action_t) actions;
826};
827
Rich Lanee9c37db2013-06-21 18:30:24 -0700828struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700829 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700830 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700831 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700832};
833
Rich Lanee9c37db2013-06-21 18:30:24 -0700834struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700835 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700836 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700837 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700838 of_octets_t data;
839};
840
Rich Lanee9c37db2013-06-21 18:30:24 -0700841struct of_flow_mod : of_header {
842 uint8_t version;
843 uint8_t type == 14;
844 uint16_t length;
845 uint32_t xid;
846 uint64_t cookie;
847 uint64_t cookie_mask;
848 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700849 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700850 uint16_t idle_timeout;
851 uint16_t hard_timeout;
852 uint16_t priority;
853 uint32_t buffer_id;
854 of_port_no_t out_port;
855 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700856 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700857 pad(2);
858 of_match_t match;
859 list(of_instruction_t) instructions;
860};
861
862struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700863 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700864 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700865 uint16_t length;
866 uint32_t xid;
867 uint64_t cookie;
868 uint64_t cookie_mask;
869 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700870 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700871 uint16_t idle_timeout;
872 uint16_t hard_timeout;
873 uint16_t priority;
874 uint32_t buffer_id;
875 of_port_no_t out_port;
876 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700877 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700878 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700879 of_match_t match;
880 list(of_instruction_t) instructions;
881};
882
Rich Lanee9c37db2013-06-21 18:30:24 -0700883struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700884 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700885 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700886 uint16_t length;
887 uint32_t xid;
888 uint64_t cookie;
889 uint64_t cookie_mask;
890 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700891 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700892 uint16_t idle_timeout;
893 uint16_t hard_timeout;
894 uint16_t priority;
895 uint32_t buffer_id;
896 of_port_no_t out_port;
897 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700898 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700899 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700900 of_match_t match;
901 list(of_instruction_t) instructions;
902};
903
Rich Lanee9c37db2013-06-21 18:30:24 -0700904struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700905 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700906 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700907 uint16_t length;
908 uint32_t xid;
909 uint64_t cookie;
910 uint64_t cookie_mask;
911 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700912 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700913 uint16_t idle_timeout;
914 uint16_t hard_timeout;
915 uint16_t priority;
916 uint32_t buffer_id;
917 of_port_no_t out_port;
918 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700919 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700920 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700921 of_match_t match;
922 list(of_instruction_t) instructions;
923};
924
Rich Lanee9c37db2013-06-21 18:30:24 -0700925struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700926 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700927 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700928 uint16_t length;
929 uint32_t xid;
930 uint64_t cookie;
931 uint64_t cookie_mask;
932 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700933 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700934 uint16_t idle_timeout;
935 uint16_t hard_timeout;
936 uint16_t priority;
937 uint32_t buffer_id;
938 of_port_no_t out_port;
939 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700940 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700941 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700942 of_match_t match;
943 list(of_instruction_t) instructions;
944};
945
Rich Lanee9c37db2013-06-21 18:30:24 -0700946struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700947 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700948 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700949 uint16_t length;
950 uint32_t xid;
951 uint64_t cookie;
952 uint64_t cookie_mask;
953 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700954 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700955 uint16_t idle_timeout;
956 uint16_t hard_timeout;
957 uint16_t priority;
958 uint32_t buffer_id;
959 of_port_no_t out_port;
960 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700961 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700962 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700963 of_match_t match;
964 list(of_instruction_t) instructions;
965};
966
Rich Lane68ae4d72013-05-09 10:55:19 -0700967struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700968 uint16_t len;
969 uint16_t weight;
970 of_port_no_t watch_port;
971 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700972 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700973 list(of_action_t) actions;
974};
975
Rich Lanee9c37db2013-06-21 18:30:24 -0700976struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700978 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700979 uint16_t length;
980 uint32_t xid;
981 uint16_t command;
982 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700983 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700984 uint32_t group_id;
985 list(of_bucket_t) buckets;
986};
987
Rich Lanee9c37db2013-06-21 18:30:24 -0700988struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700989 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700990 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700991 uint16_t length;
992 uint32_t xid;
993 uint64_t cookie;
994 uint16_t priority;
995 uint8_t reason;
996 uint8_t table_id;
997 uint32_t duration_sec;
998 uint32_t duration_nsec;
999 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001000 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001001 uint64_t packet_count;
1002 uint64_t byte_count;
1003 of_match_t match;
1004};
1005
Rich Lanee9c37db2013-06-21 18:30:24 -07001006struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001007 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001008 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001009 uint16_t length;
1010 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001011 uint16_t err_type == ?;
1012};
1013
1014struct of_hello_failed_error_msg : of_error_msg {
1015 uint8_t version;
1016 uint8_t type == 1;
1017 uint16_t length;
1018 uint32_t xid;
1019 uint16_t err_type == 0;
1020 enum ofp_hello_failed_code code;
1021 of_octets_t data;
1022};
1023
1024struct of_bad_request_error_msg : of_error_msg {
1025 uint8_t version;
1026 uint8_t type == 1;
1027 uint16_t length;
1028 uint32_t xid;
1029 uint16_t err_type == 1;
1030 enum ofp_bad_request_code code;
1031 of_octets_t data;
1032};
1033
1034struct of_bad_action_error_msg : of_error_msg {
1035 uint8_t version;
1036 uint8_t type == 1;
1037 uint16_t length;
1038 uint32_t xid;
1039 uint16_t err_type == 2;
1040 enum ofp_bad_action_code code;
1041 of_octets_t data;
1042};
1043
1044struct of_bad_instruction_error_msg : of_error_msg {
1045 uint8_t version;
1046 uint8_t type == 1;
1047 uint16_t length;
1048 uint32_t xid;
1049 uint16_t err_type == 3;
1050 enum ofp_bad_instruction_code code;
1051 of_octets_t data;
1052};
1053
1054struct of_bad_match_error_msg : of_error_msg {
1055 uint8_t version;
1056 uint8_t type == 1;
1057 uint16_t length;
1058 uint32_t xid;
1059 uint16_t err_type == 4;
1060 enum ofp_bad_match_code code;
1061 of_octets_t data;
1062};
1063
1064struct of_flow_mod_failed_error_msg : of_error_msg {
1065 uint8_t version;
1066 uint8_t type == 1;
1067 uint16_t length;
1068 uint32_t xid;
1069 uint16_t err_type == 5;
1070 enum ofp_flow_mod_failed_code code;
1071 of_octets_t data;
1072};
1073
1074struct of_group_mod_failed_error_msg : of_error_msg {
1075 uint8_t version;
1076 uint8_t type == 1;
1077 uint16_t length;
1078 uint32_t xid;
1079 uint16_t err_type == 6;
1080 enum ofp_group_mod_failed_code code;
1081 of_octets_t data;
1082};
1083
1084struct of_port_mod_failed_error_msg : of_error_msg {
1085 uint8_t version;
1086 uint8_t type == 1;
1087 uint16_t length;
1088 uint32_t xid;
1089 uint16_t err_type == 7;
1090 enum ofp_port_mod_failed_code code;
1091 of_octets_t data;
1092};
1093
1094struct of_table_mod_failed_error_msg : of_error_msg {
1095 uint8_t version;
1096 uint8_t type == 1;
1097 uint16_t length;
1098 uint32_t xid;
1099 uint16_t err_type == 8;
1100 enum ofp_table_mod_failed_code code;
1101 of_octets_t data;
1102};
1103
1104struct of_queue_op_failed_error_msg : of_error_msg {
1105 uint8_t version;
1106 uint8_t type == 1;
1107 uint16_t length;
1108 uint32_t xid;
1109 uint16_t err_type == 9;
1110 enum ofp_queue_op_failed_code code;
1111 of_octets_t data;
1112};
1113
1114struct of_switch_config_failed_error_msg : of_error_msg {
1115 uint8_t version;
1116 uint8_t type == 1;
1117 uint16_t length;
1118 uint32_t xid;
1119 uint16_t err_type == 10;
1120 enum ofp_switch_config_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001121 of_octets_t data;
1122};
1123
1124// STATS ENTRIES: flow, table, port, group, group_desc
1125
Rich Lane68ae4d72013-05-09 10:55:19 -07001126struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001127 uint16_t length;
1128 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001129 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001130 uint32_t duration_sec;
1131 uint32_t duration_nsec;
1132 uint16_t priority;
1133 uint16_t idle_timeout;
1134 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001135 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001136 uint64_t cookie;
1137 uint64_t packet_count;
1138 uint64_t byte_count;
1139 of_match_t match;
1140 list(of_instruction_t) instructions;
1141};
1142
Rich Lane68ae4d72013-05-09 10:55:19 -07001143struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001144 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001145 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001146 of_table_name_t name;
1147 of_wc_bmap_t wildcards;
1148 of_match_bmap_t match;
1149 uint32_t instructions;
1150 uint32_t write_actions;
1151 uint32_t apply_actions;
1152 uint32_t config;
1153 uint32_t max_entries;
1154 uint32_t active_count;
1155 uint64_t lookup_count;
1156 uint64_t matched_count;
1157};
1158
Rich Lane68ae4d72013-05-09 10:55:19 -07001159struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001160 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001161 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001162 uint64_t rx_packets;
1163 uint64_t tx_packets;
1164 uint64_t rx_bytes;
1165 uint64_t tx_bytes;
1166 uint64_t rx_dropped;
1167 uint64_t tx_dropped;
1168 uint64_t rx_errors;
1169 uint64_t tx_errors;
1170 uint64_t rx_frame_err;
1171 uint64_t rx_over_err;
1172 uint64_t rx_crc_err;
1173 uint64_t collisions;
1174};
1175
Rich Lane68ae4d72013-05-09 10:55:19 -07001176struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001177 of_port_no_t port_no;
1178 uint32_t queue_id;
1179 uint64_t tx_bytes;
1180 uint64_t tx_packets;
1181 uint64_t tx_errors;
1182};
1183
Rich Lane68ae4d72013-05-09 10:55:19 -07001184struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001185 uint64_t packet_count;
1186 uint64_t byte_count;
1187};
1188
Rich Lane68ae4d72013-05-09 10:55:19 -07001189struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001190 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001191 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001192 uint32_t group_id;
1193 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001194 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001195 uint64_t packet_count;
1196 uint64_t byte_count;
1197 list(of_bucket_counter_t) bucket_stats;
1198};
1199
Rich Lane68ae4d72013-05-09 10:55:19 -07001200struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001201 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001202 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001203 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001204 uint32_t group_id;
1205 list(of_bucket_t) buckets;
1206};
1207
1208// STATS: Desc, flow, agg, table, port, queue, group, group_desc, experi
1209
Rich Lanee9c37db2013-06-21 18:30:24 -07001210struct of_stats_request : of_header {
1211 uint8_t version;
1212 uint8_t type == 18;
1213 uint16_t length;
1214 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001215 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001216 uint16_t flags;
1217 pad(4);
1218};
1219
1220struct of_stats_reply : of_header {
1221 uint8_t version;
1222 uint8_t type == 19;
1223 uint16_t length;
1224 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001225 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001226 uint16_t flags;
1227 pad(4);
1228};
1229
1230struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001231 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001232 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001233 uint16_t length;
1234 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001235 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001236 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001237 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001238};
1239
Rich Lanee9c37db2013-06-21 18:30:24 -07001240struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001241 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001242 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001243 uint16_t length;
1244 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001245 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001246 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001247 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001248 of_desc_str_t mfr_desc;
1249 of_desc_str_t hw_desc;
1250 of_desc_str_t sw_desc;
1251 of_serial_num_t serial_num;
1252 of_desc_str_t dp_desc;
1253};
1254
Rich Lanee9c37db2013-06-21 18:30:24 -07001255struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001256 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001257 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001258 uint16_t length;
1259 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001260 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001261 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001262 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001263 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001264 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001265 of_port_no_t out_port;
1266 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001267 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001268 uint64_t cookie;
1269 uint64_t cookie_mask;
1270 of_match_t match;
1271};
1272
Rich Lanee9c37db2013-06-21 18:30:24 -07001273struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001274 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001275 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001276 uint16_t length;
1277 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001278 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001279 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001280 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001281 list(of_flow_stats_entry_t) entries;
1282};
1283
Rich Lanee9c37db2013-06-21 18:30:24 -07001284struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001285 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001286 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001287 uint16_t length;
1288 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001289 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001290 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001291 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001292 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001293 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001294 of_port_no_t out_port;
1295 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001296 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001297 uint64_t cookie;
1298 uint64_t cookie_mask;
1299 of_match_t match;
1300};
1301
Rich Lanee9c37db2013-06-21 18:30:24 -07001302struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001303 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001304 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001305 uint16_t length;
1306 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001307 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001308 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001309 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001310 uint64_t packet_count;
1311 uint64_t byte_count;
1312 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001313 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001314};
1315
Rich Lanee9c37db2013-06-21 18:30:24 -07001316struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001317 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001318 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001319 uint16_t length;
1320 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001321 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001322 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001323 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001324};
1325
Rich Lanee9c37db2013-06-21 18:30:24 -07001326struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001327 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001328 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001329 uint16_t length;
1330 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001331 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001332 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001333 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001334 list(of_table_stats_entry_t) entries;
1335};
1336
Rich Lanee9c37db2013-06-21 18:30:24 -07001337struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001338 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001339 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001340 uint16_t length;
1341 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001342 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001343 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001344 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001345 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001346 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001347};
1348
Rich Lanee9c37db2013-06-21 18:30:24 -07001349struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001350 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001351 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001352 uint16_t length;
1353 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001354 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001355 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001356 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001357 list(of_port_stats_entry_t) entries;
1358};
1359
Rich Lanee9c37db2013-06-21 18:30:24 -07001360struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001361 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001362 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001363 uint16_t length;
1364 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001365 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001366 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001367 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001368 of_port_no_t port_no;
1369 uint32_t queue_id;
1370};
1371
Rich Lanee9c37db2013-06-21 18:30:24 -07001372struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001373 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001374 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001375 uint16_t length;
1376 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001377 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001378 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001379 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001380 list(of_queue_stats_entry_t) entries;
1381};
1382
Rich Lanee9c37db2013-06-21 18:30:24 -07001383struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001385 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001386 uint16_t length;
1387 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001388 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001390 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001391 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001392 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001393};
1394
Rich Lanee9c37db2013-06-21 18:30:24 -07001395struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001396 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001397 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001398 uint16_t length;
1399 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001400 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001402 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001403 list(of_group_stats_entry_t) entries;
1404};
1405
Rich Lanee9c37db2013-06-21 18:30:24 -07001406struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001407 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001408 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001409 uint16_t length;
1410 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001411 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001412 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001413 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001414};
1415
Rich Lanee9c37db2013-06-21 18:30:24 -07001416struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001417 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001418 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001419 uint16_t length;
1420 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001421 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001422 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001423 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001424 list(of_group_desc_stats_entry_t) entries;
1425};
1426
Rich Lanee9c37db2013-06-21 18:30:24 -07001427struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001428 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001429 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001430 uint16_t length;
1431 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001432 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001433 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001434 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001435 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001436 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 of_octets_t data;
1438};
1439
Rich Lanee9c37db2013-06-21 18:30:24 -07001440struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001441 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001442 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001443 uint16_t length;
1444 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001445 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001446 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001447 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001448 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001449 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 of_octets_t data;
1451};
1452
1453// END OF STATS OBJECTS
1454
Rich Lane68ae4d72013-05-09 10:55:19 -07001455struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001456 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001457 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001458 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001459};
1460
Rich Lanee9c37db2013-06-21 18:30:24 -07001461struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001462 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001463 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001464 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001465 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001466 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001467};
1468
Rich Lane68ae4d72013-05-09 10:55:19 -07001469struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001470 uint32_t queue_id;
1471 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001472 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001473 list(of_queue_prop_t) properties;
1474};
1475
Rich Lanee9c37db2013-06-21 18:30:24 -07001476struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001477 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001478 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001479 uint16_t length;
1480 uint32_t xid;
1481 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001482 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001483};
1484
Rich Lanee9c37db2013-06-21 18:30:24 -07001485struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001486 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001487 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001488 uint16_t length;
1489 uint32_t xid;
1490 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001491 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001492 list(of_packet_queue_t) queues;
1493};