blob: 9937c6da1aedfb295124f9c75a1d5ddbee59e8a7 [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,
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,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -0700138 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700139};
140
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700141enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700142 OFPPS_LINK_DOWN = 0x1,
143 OFPPS_BLOCKED = 0x2,
144 OFPPS_LIVE = 0x4,
145};
146
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700147enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700148 OFPPF_10MB_HD = 0x1,
149 OFPPF_10MB_FD = 0x2,
150 OFPPF_100MB_HD = 0x4,
151 OFPPF_100MB_FD = 0x8,
152 OFPPF_1GB_HD = 0x10,
153 OFPPF_1GB_FD = 0x20,
154 OFPPF_10GB_FD = 0x40,
155 OFPPF_40GB_FD = 0x80,
156 OFPPF_100GB_FD = 0x100,
157 OFPPF_1TB_FD = 0x200,
158 OFPPF_OTHER = 0x400,
159 OFPPF_COPPER = 0x800,
160 OFPPF_FIBER = 0x1000,
161 OFPPF_AUTONEG = 0x2000,
162 OFPPF_PAUSE = 0x4000,
163 OFPPF_PAUSE_ASYM = 0x8000,
164};
165
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700166enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700167 OFPPR_ADD = 0,
168 OFPPR_DELETE = 1,
169 OFPPR_MODIFY = 2,
170};
171
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700172enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700173 OFPR_NO_MATCH = 0,
174 OFPR_ACTION = 1,
175};
176
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700177enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700178 OFPAT_OUTPUT = 0,
179 OFPAT_SET_VLAN_VID = 1,
180 OFPAT_SET_VLAN_PCP = 2,
181 OFPAT_SET_DL_SRC = 3,
182 OFPAT_SET_DL_DST = 4,
183 OFPAT_SET_NW_SRC = 5,
184 OFPAT_SET_NW_DST = 6,
185 OFPAT_SET_NW_TOS = 7,
186 OFPAT_SET_NW_ECN = 8,
187 OFPAT_SET_TP_SRC = 9,
188 OFPAT_SET_TP_DST = 10,
189 OFPAT_COPY_TTL_OUT = 11,
190 OFPAT_COPY_TTL_IN = 12,
191 OFPAT_SET_MPLS_LABEL = 13,
192 OFPAT_SET_MPLS_TC = 14,
193 OFPAT_SET_MPLS_TTL = 15,
194 OFPAT_DEC_MPLS_TTL = 16,
195 OFPAT_PUSH_VLAN = 17,
196 OFPAT_POP_VLAN = 18,
197 OFPAT_PUSH_MPLS = 19,
198 OFPAT_POP_MPLS = 20,
199 OFPAT_SET_QUEUE = 21,
200 OFPAT_GROUP = 22,
201 OFPAT_SET_NW_TTL = 23,
202 OFPAT_DEC_NW_TTL = 24,
203 OFPAT_EXPERIMENTER = 0xffff,
204};
205
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700206enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700207 OFPFC_ADD = 0,
208 OFPFC_MODIFY = 1,
209 OFPFC_MODIFY_STRICT = 2,
210 OFPFC_DELETE = 3,
211 OFPFC_DELETE_STRICT = 4,
212};
213
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700214enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700215 OFPGC_ADD = 0,
216 OFPGC_MODIFY = 1,
217 OFPGC_DELETE = 2,
218};
219
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700220enum ofp_flow_wildcards(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700221 OFPFW_IN_PORT = 0x1,
222 OFPFW_DL_VLAN = 0x2,
223 OFPFW_DL_VLAN_PCP = 0x4,
224 OFPFW_DL_TYPE = 0x8,
225 OFPFW_NW_TOS = 0x10,
226 OFPFW_NW_PROTO = 0x20,
227 OFPFW_TP_SRC = 0x40,
228 OFPFW_TP_DST = 0x80,
229 OFPFW_MPLS_LABEL = 0x100,
230 OFPFW_MPLS_TC = 0x200,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700231 OFPFW_ALL(virtual=True) = 0x3ff,
Rich Lane5d33a622013-04-08 17:33:11 -0700232};
233
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700234enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700235 OFPVID_ANY = 0xfffe,
236 OFPVID_NONE = 0xffff,
237};
238
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700239enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700240 OFPMT_STANDARD = 0,
241};
242
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700243enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700244 OFPIT_GOTO_TABLE = 0x1,
245 OFPIT_WRITE_METADATA = 0x2,
246 OFPIT_WRITE_ACTIONS = 0x3,
247 OFPIT_APPLY_ACTIONS = 0x4,
248 OFPIT_CLEAR_ACTIONS = 0x5,
249 OFPIT_EXPERIMENTER = 0xffff,
250};
251
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700252enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700253 OFPFF_SEND_FLOW_REM = 0x1,
254 OFPFF_CHECK_OVERLAP = 0x2,
255};
256
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700257enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700258 OFPG_MAX = 0xffffff00,
259 OFPG_ALL = 0xfffffffc,
260 OFPG_ANY = 0xffffffff,
261};
262
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700263enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700264 OFPGT_ALL = 0,
265 OFPGT_SELECT = 1,
266 OFPGT_INDIRECT = 2,
267 OFPGT_FF = 3,
268};
269
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700270enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700271 OFPRR_IDLE_TIMEOUT = 0,
272 OFPRR_HARD_TIMEOUT = 1,
273 OFPRR_DELETE = 2,
274 OFPRR_GROUP_DELETE = 3,
275};
276
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700277enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700278 OFPET_HELLO_FAILED = 0,
279 OFPET_BAD_REQUEST = 1,
280 OFPET_BAD_ACTION = 2,
281 OFPET_BAD_INSTRUCTION = 3,
282 OFPET_BAD_MATCH = 4,
283 OFPET_FLOW_MOD_FAILED = 5,
284 OFPET_GROUP_MOD_FAILED = 6,
285 OFPET_PORT_MOD_FAILED = 7,
286 OFPET_TABLE_MOD_FAILED = 8,
287 OFPET_QUEUE_OP_FAILED = 9,
288 OFPET_SWITCH_CONFIG_FAILED = 10,
289};
290
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700291enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700292 OFPHFC_INCOMPATIBLE = 0,
293 OFPHFC_EPERM = 1,
294};
295
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700296enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700297 OFPBRC_BAD_VERSION = 0,
298 OFPBRC_BAD_TYPE = 1,
299 OFPBRC_BAD_STAT = 2,
300 OFPBRC_BAD_EXPERIMENTER = 3,
301 OFPBRC_BAD_SUBTYPE = 4,
302 OFPBRC_EPERM = 5,
303 OFPBRC_BAD_LEN = 6,
304 OFPBRC_BUFFER_EMPTY = 7,
305 OFPBRC_BUFFER_UNKNOWN = 8,
306 OFPBRC_BAD_TABLE_ID = 9,
307};
308
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700309enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700310 OFPBAC_BAD_TYPE = 0,
311 OFPBAC_BAD_LEN = 1,
312 OFPBAC_BAD_EXPERIMENTER = 2,
313 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
314 OFPBAC_BAD_OUT_PORT = 4,
315 OFPBAC_BAD_ARGUMENT = 5,
316 OFPBAC_EPERM = 6,
317 OFPBAC_TOO_MANY = 7,
318 OFPBAC_BAD_QUEUE = 8,
319 OFPBAC_BAD_OUT_GROUP = 9,
320 OFPBAC_MATCH_INCONSISTENT = 10,
321 OFPBAC_UNSUPPORTED_ORDER = 11,
322 OFPBAC_BAD_TAG = 12,
323};
324
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700325enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700326 OFPBIC_UNKNOWN_INST = 0,
327 OFPBIC_UNSUP_INST = 1,
328 OFPBIC_BAD_TABLE_ID = 2,
329 OFPBIC_UNSUP_METADATA = 3,
330 OFPBIC_UNSUP_METADATA_MASK = 4,
331 OFPBIC_UNSUP_EXP_INST = 5,
332};
333
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700334enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700335 OFPBMC_BAD_TYPE = 0,
336 OFPBMC_BAD_LEN = 1,
337 OFPBMC_BAD_TAG = 2,
338 OFPBMC_BAD_DL_ADDR_MASK = 3,
339 OFPBMC_BAD_NW_ADDR_MASK = 4,
340 OFPBMC_BAD_WILDCARDS = 5,
341 OFPBMC_BAD_FIELD = 6,
342 OFPBMC_BAD_VALUE = 7,
343};
344
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700345enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700346 OFPFMFC_UNKNOWN = 0,
347 OFPFMFC_TABLE_FULL = 1,
348 OFPFMFC_BAD_TABLE_ID = 2,
349 OFPFMFC_OVERLAP = 3,
350 OFPFMFC_EPERM = 4,
351 OFPFMFC_BAD_TIMEOUT = 5,
352 OFPFMFC_BAD_COMMAND = 6,
353};
354
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700355enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700356 OFPGMFC_GROUP_EXISTS = 0,
357 OFPGMFC_INVALID_GROUP = 1,
358 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
359 OFPGMFC_OUT_OF_GROUPS = 3,
360 OFPGMFC_OUT_OF_BUCKETS = 4,
361 OFPGMFC_CHAINING_UNSUPPORTED = 5,
362 OFPGMFC_WATCH_UNSUPPORTED = 6,
363 OFPGMFC_LOOP = 7,
364 OFPGMFC_UNKNOWN_GROUP = 8,
365};
366
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700367enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700368 OFPPMFC_BAD_PORT = 0,
369 OFPPMFC_BAD_HW_ADDR = 1,
370 OFPPMFC_BAD_CONFIG = 2,
371 OFPPMFC_BAD_ADVERTISE = 3,
372};
373
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700374enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700375 OFPTMFC_BAD_TABLE = 0,
376 OFPTMFC_BAD_CONFIG = 1,
377};
378
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700379enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700380 OFPQOFC_BAD_PORT = 0,
381 OFPQOFC_BAD_QUEUE = 1,
382 OFPQOFC_EPERM = 2,
383};
384
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700385enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700386 OFPSCFC_BAD_FLAGS = 0,
387 OFPSCFC_BAD_LEN = 1,
388};
389
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700390enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700391 OFPST_DESC = 0,
392 OFPST_FLOW = 1,
393 OFPST_AGGREGATE = 2,
394 OFPST_TABLE = 3,
395 OFPST_PORT = 4,
396 OFPST_QUEUE = 5,
397 OFPST_GROUP = 6,
398 OFPST_GROUP_DESC = 7,
399 OFPST_EXPERIMENTER = 0xffff,
400};
401
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700402enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700403 OFPSF_REPLY_MORE = 0x1,
404};
405
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700406enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700407 OFPQT_NONE = 0,
408 OFPQT_MIN_RATE = 1,
409};
410
Rich Lanee9c37db2013-06-21 18:30:24 -0700411/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700412struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700413 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700414 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700415 uint16_t length;
416 uint32_t xid;
417};
418
Rich Lanee9c37db2013-06-21 18:30:24 -0700419struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700420 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700421 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700422 uint16_t length;
423 uint32_t xid;
424};
425
Rich Lanee9c37db2013-06-21 18:30:24 -0700426struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700427 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700428 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700429 uint16_t length;
430 uint32_t xid;
431 of_octets_t data;
432};
433
Rich Lanee9c37db2013-06-21 18:30:24 -0700434struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700435 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700436 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700437 uint16_t length;
438 uint32_t xid;
439 of_octets_t data;
440};
441
Rich Lanee9c37db2013-06-21 18:30:24 -0700442struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700443 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700444 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700445 uint16_t length;
446 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700447 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700448 uint32_t subtype;
449 of_octets_t data;
450};
451
Rich Lanee9c37db2013-06-21 18:30:24 -0700452struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700453 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700454 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700455 uint16_t length;
456 uint32_t xid;
457};
458
Rich Lanee9c37db2013-06-21 18:30:24 -0700459struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700460 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700461 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700462 uint16_t length;
463 uint32_t xid;
464};
465
Rich Lanee9c37db2013-06-21 18:30:24 -0700466struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700467 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700468 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700469 uint16_t length;
470 uint32_t xid;
471};
472
Rich Lanee9c37db2013-06-21 18:30:24 -0700473struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700474 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700475 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700476 uint16_t length;
477 uint32_t xid;
478 uint16_t flags;
479 uint16_t miss_send_len;
480};
481
Rich Lanee9c37db2013-06-21 18:30:24 -0700482struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700483 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700484 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700485 uint16_t length;
486 uint32_t xid;
487 uint16_t flags;
488 uint16_t miss_send_len;
489};
490
Rich Lanee9c37db2013-06-21 18:30:24 -0700491struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700492 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700493 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700494 uint16_t length;
495 uint32_t xid;
496 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700497 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700498 uint32_t config;
499};
500
Rich Lane68ae4d72013-05-09 10:55:19 -0700501struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700502 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700503 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700504 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700505 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700506 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700507 enum ofp_port_config config;
508 enum ofp_port_state state;
509 enum ofp_port_features curr;
510 enum ofp_port_features advertised;
511 enum ofp_port_features supported;
512 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700513 uint32_t curr_speed;
514 uint32_t max_speed;
515};
516
Rich Lanee9c37db2013-06-21 18:30:24 -0700517struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700518 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700519 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700520 uint16_t length;
521 uint32_t xid;
522};
523
Rich Lanee9c37db2013-06-21 18:30:24 -0700524struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700525 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700526 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700527 uint16_t length;
528 uint32_t xid;
529 uint64_t datapath_id;
530 uint32_t n_buffers;
531 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700532 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700533 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700534 uint32_t reserved;
535 list(of_port_desc_t) ports;
536};
537
Rich Lanee9c37db2013-06-21 18:30:24 -0700538struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700539 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700540 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700541 uint16_t length;
542 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700543 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700544 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700545 of_port_desc_t desc;
546};
547
Rich Lanee9c37db2013-06-21 18:30:24 -0700548struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700549 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700550 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700551 uint16_t length;
552 uint32_t xid;
553 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700554 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700555 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700556 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700557 uint32_t config;
558 uint32_t mask;
559 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700560 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700561};
562
Rich Lanee9c37db2013-06-21 18:30:24 -0700563struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700564 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700565 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700566 uint16_t length;
567 uint32_t xid;
568 uint32_t buffer_id;
569 of_port_no_t in_port;
570 of_port_no_t in_phy_port;
571 uint16_t total_len;
572 uint8_t reason;
573 uint8_t table_id;
574 of_octets_t data;
575};
576
Rich Lanee9c37db2013-06-21 18:30:24 -0700577struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700578 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700579 uint16_t len;
580 of_port_no_t port;
581 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700582 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700583};
584
Rich Lanee9c37db2013-06-21 18:30:24 -0700585struct of_action_set_vlan_vid : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700586 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700587 uint16_t len;
588 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700589 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700590};
591
Rich Lanee9c37db2013-06-21 18:30:24 -0700592struct of_action_set_vlan_pcp : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700593 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700594 uint16_t len;
595 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700596 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700597};
598
Rich Lanee9c37db2013-06-21 18:30:24 -0700599struct of_action_set_dl_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700600 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700601 uint16_t len;
602 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700603 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700604};
605
Rich Lanee9c37db2013-06-21 18:30:24 -0700606struct of_action_set_dl_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700607 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700608 uint16_t len;
609 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700610 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700611};
612
Rich Lanee9c37db2013-06-21 18:30:24 -0700613struct of_action_set_nw_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700614 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700615 uint16_t len;
616 uint32_t nw_addr;
617};
618
Rich Lanee9c37db2013-06-21 18:30:24 -0700619struct of_action_set_nw_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700620 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700621 uint16_t len;
622 uint32_t nw_addr;
623};
624
Rich Lanee9c37db2013-06-21 18:30:24 -0700625struct of_action_set_nw_tos : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700626 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700627 uint16_t len;
628 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700629 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700630};
631
Rich Lanee9c37db2013-06-21 18:30:24 -0700632struct of_action_set_nw_ecn : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700633 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700634 uint16_t len;
635 uint8_t nw_ecn;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700636 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700637};
638
Rich Lanee9c37db2013-06-21 18:30:24 -0700639struct of_action_set_tp_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700640 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700641 uint16_t len;
642 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700643 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700644};
645
Rich Lanee9c37db2013-06-21 18:30:24 -0700646struct of_action_set_tp_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700647 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700648 uint16_t len;
649 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700650 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700651};
652
Rich Lanee9c37db2013-06-21 18:30:24 -0700653struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700654 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700655 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700656 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700657};
658
Rich Lanee9c37db2013-06-21 18:30:24 -0700659struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700660 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700661 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700662 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700663};
664
Rich Lanee9c37db2013-06-21 18:30:24 -0700665struct of_action_set_mpls_label : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700666 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700667 uint16_t len;
668 uint32_t mpls_label;
669};
670
Rich Lanee9c37db2013-06-21 18:30:24 -0700671struct of_action_set_mpls_tc : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700672 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700673 uint16_t len;
674 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700675 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700676};
677
Rich Lanee9c37db2013-06-21 18:30:24 -0700678struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700679 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700680 uint16_t len;
681 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700682 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700683};
684
Rich Lanee9c37db2013-06-21 18:30:24 -0700685struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700686 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700687 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700688 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700689};
690
Rich Lanee9c37db2013-06-21 18:30:24 -0700691struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700692 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700693 uint16_t len;
694 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700695 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700696};
697
Rich Lanee9c37db2013-06-21 18:30:24 -0700698struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700699 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700700 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700701 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700702};
703
Rich Lanee9c37db2013-06-21 18:30:24 -0700704struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700705 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700706 uint16_t len;
707 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700708 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700709};
710
Rich Lanee9c37db2013-06-21 18:30:24 -0700711struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700712 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700713 uint16_t len;
714 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700715 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700716};
717
Rich Lanee9c37db2013-06-21 18:30:24 -0700718struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700719 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700720 uint16_t len;
721 uint32_t queue_id;
722};
723
Rich Lanee9c37db2013-06-21 18:30:24 -0700724struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700725 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700726 uint16_t len;
727 uint32_t group_id;
728};
729
Rich Lanee9c37db2013-06-21 18:30:24 -0700730struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700731 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700732 uint16_t len;
733 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700734 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700735};
736
Rich Lanee9c37db2013-06-21 18:30:24 -0700737struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700738 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700739 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700740 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700741};
742
Rich Lanee9c37db2013-06-21 18:30:24 -0700743struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700744 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700745 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700746 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700747 of_octets_t data;
748};
749
Rich Lane68ae4d72013-05-09 10:55:19 -0700750struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700751 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700752 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700753 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700754};
755
Rich Lanee9c37db2013-06-21 18:30:24 -0700756struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700757 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700758 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700759 uint16_t length;
760 uint32_t xid;
761 uint32_t buffer_id;
762 of_port_no_t in_port;
763 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700764 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700765 list(of_action_t) actions;
766 of_octets_t data;
767};
768
Rich Lane68ae4d72013-05-09 10:55:19 -0700769struct of_match_v2 {
Rich Lane31b87142013-05-09 22:05:42 -0700770 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700771 uint16_t length;
772 of_port_no_t in_port;
773 of_wc_bmap_t wildcards;
774 of_mac_addr_t eth_src;
775 of_mac_addr_t eth_src_mask;
776 of_mac_addr_t eth_dst;
777 of_mac_addr_t eth_dst_mask;
778 uint16_t vlan_vid;
779 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700780 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700781 uint16_t eth_type;
782 uint8_t ip_dscp;
783 uint8_t ip_proto;
Andreas Wundsamb566a162013-07-18 19:30:23 -0700784 of_ipv4_t ipv4_src;
785 of_ipv4_t ipv4_src_mask;
786 of_ipv4_t ipv4_dst;
787 of_ipv4_t ipv4_dst_mask;
Rich Lanea06d0c32013-03-25 08:52:03 -0700788 uint16_t tcp_src;
789 uint16_t tcp_dst;
790 uint32_t mpls_label;
791 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700792 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700793 uint64_t metadata;
794 uint64_t metadata_mask;
795};
796
Rich Lane68ae4d72013-05-09 10:55:19 -0700797struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700798 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700799 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700800 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700801};
802
Rich Lanee9c37db2013-06-21 18:30:24 -0700803struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700804 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700805 uint16_t len;
806 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700807 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700808};
809
Rich Lanee9c37db2013-06-21 18:30:24 -0700810struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700811 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700812 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700813 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700814 uint64_t metadata;
815 uint64_t metadata_mask;
816};
817
Rich Lanee9c37db2013-06-21 18:30:24 -0700818struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700819 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700820 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700821 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700822 list(of_action_t) actions;
823};
824
Rich Lanee9c37db2013-06-21 18:30:24 -0700825struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700826 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700827 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700828 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700829 list(of_action_t) actions;
830};
831
Rich Lanee9c37db2013-06-21 18:30:24 -0700832struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700833 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700834 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700835 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700836};
837
Rich Lanee9c37db2013-06-21 18:30:24 -0700838struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700839 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700840 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700841 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700842 of_octets_t data;
843};
844
Rich Lanee9c37db2013-06-21 18:30:24 -0700845struct of_flow_mod : of_header {
846 uint8_t version;
847 uint8_t type == 14;
848 uint16_t length;
849 uint32_t xid;
850 uint64_t cookie;
851 uint64_t cookie_mask;
852 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700853 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700854 uint16_t idle_timeout;
855 uint16_t hard_timeout;
856 uint16_t priority;
857 uint32_t buffer_id;
858 of_port_no_t out_port;
859 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700860 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700861 pad(2);
862 of_match_t match;
863 list(of_instruction_t) instructions;
864};
865
866struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700867 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700868 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700869 uint16_t length;
870 uint32_t xid;
871 uint64_t cookie;
872 uint64_t cookie_mask;
873 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700874 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700875 uint16_t idle_timeout;
876 uint16_t hard_timeout;
877 uint16_t priority;
878 uint32_t buffer_id;
879 of_port_no_t out_port;
880 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700881 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700882 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700883 of_match_t match;
884 list(of_instruction_t) instructions;
885};
886
Rich Lanee9c37db2013-06-21 18:30:24 -0700887struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700889 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700890 uint16_t length;
891 uint32_t xid;
892 uint64_t cookie;
893 uint64_t cookie_mask;
894 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700895 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700896 uint16_t idle_timeout;
897 uint16_t hard_timeout;
898 uint16_t priority;
899 uint32_t buffer_id;
900 of_port_no_t out_port;
901 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700902 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700903 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700904 of_match_t match;
905 list(of_instruction_t) instructions;
906};
907
Rich Lanee9c37db2013-06-21 18:30:24 -0700908struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700910 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700911 uint16_t length;
912 uint32_t xid;
913 uint64_t cookie;
914 uint64_t cookie_mask;
915 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700916 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700917 uint16_t idle_timeout;
918 uint16_t hard_timeout;
919 uint16_t priority;
920 uint32_t buffer_id;
921 of_port_no_t out_port;
922 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700923 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700924 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700925 of_match_t match;
926 list(of_instruction_t) instructions;
927};
928
Rich Lanee9c37db2013-06-21 18:30:24 -0700929struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700930 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700931 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700932 uint16_t length;
933 uint32_t xid;
934 uint64_t cookie;
935 uint64_t cookie_mask;
936 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700937 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700938 uint16_t idle_timeout;
939 uint16_t hard_timeout;
940 uint16_t priority;
941 uint32_t buffer_id;
942 of_port_no_t out_port;
943 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700944 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700945 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700946 of_match_t match;
947 list(of_instruction_t) instructions;
948};
949
Rich Lanee9c37db2013-06-21 18:30:24 -0700950struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700951 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700952 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700953 uint16_t length;
954 uint32_t xid;
955 uint64_t cookie;
956 uint64_t cookie_mask;
957 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700958 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700959 uint16_t idle_timeout;
960 uint16_t hard_timeout;
961 uint16_t priority;
962 uint32_t buffer_id;
963 of_port_no_t out_port;
964 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700965 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700966 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700967 of_match_t match;
968 list(of_instruction_t) instructions;
969};
970
Rich Lane68ae4d72013-05-09 10:55:19 -0700971struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700972 uint16_t len;
973 uint16_t weight;
974 of_port_no_t watch_port;
975 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700976 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 list(of_action_t) actions;
978};
979
Rich Lanee9c37db2013-06-21 18:30:24 -0700980struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700981 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700982 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700983 uint16_t length;
984 uint32_t xid;
985 uint16_t command;
986 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700987 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700988 uint32_t group_id;
989 list(of_bucket_t) buckets;
990};
991
Rich Lanee9c37db2013-06-21 18:30:24 -0700992struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700993 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700994 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700995 uint16_t length;
996 uint32_t xid;
997 uint64_t cookie;
998 uint16_t priority;
999 uint8_t reason;
1000 uint8_t table_id;
1001 uint32_t duration_sec;
1002 uint32_t duration_nsec;
1003 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001004 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001005 uint64_t packet_count;
1006 uint64_t byte_count;
1007 of_match_t match;
1008};
1009
Rich Lanee9c37db2013-06-21 18:30:24 -07001010struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001011 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001012 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001013 uint16_t length;
1014 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001015 uint16_t err_type == ?;
1016};
1017
1018struct of_hello_failed_error_msg : of_error_msg {
1019 uint8_t version;
1020 uint8_t type == 1;
1021 uint16_t length;
1022 uint32_t xid;
1023 uint16_t err_type == 0;
1024 enum ofp_hello_failed_code code;
1025 of_octets_t data;
1026};
1027
1028struct of_bad_request_error_msg : of_error_msg {
1029 uint8_t version;
1030 uint8_t type == 1;
1031 uint16_t length;
1032 uint32_t xid;
1033 uint16_t err_type == 1;
1034 enum ofp_bad_request_code code;
1035 of_octets_t data;
1036};
1037
1038struct of_bad_action_error_msg : of_error_msg {
1039 uint8_t version;
1040 uint8_t type == 1;
1041 uint16_t length;
1042 uint32_t xid;
1043 uint16_t err_type == 2;
1044 enum ofp_bad_action_code code;
1045 of_octets_t data;
1046};
1047
1048struct of_bad_instruction_error_msg : of_error_msg {
1049 uint8_t version;
1050 uint8_t type == 1;
1051 uint16_t length;
1052 uint32_t xid;
1053 uint16_t err_type == 3;
1054 enum ofp_bad_instruction_code code;
1055 of_octets_t data;
1056};
1057
1058struct of_bad_match_error_msg : of_error_msg {
1059 uint8_t version;
1060 uint8_t type == 1;
1061 uint16_t length;
1062 uint32_t xid;
1063 uint16_t err_type == 4;
1064 enum ofp_bad_match_code code;
1065 of_octets_t data;
1066};
1067
1068struct of_flow_mod_failed_error_msg : of_error_msg {
1069 uint8_t version;
1070 uint8_t type == 1;
1071 uint16_t length;
1072 uint32_t xid;
1073 uint16_t err_type == 5;
1074 enum ofp_flow_mod_failed_code code;
1075 of_octets_t data;
1076};
1077
1078struct of_group_mod_failed_error_msg : of_error_msg {
1079 uint8_t version;
1080 uint8_t type == 1;
1081 uint16_t length;
1082 uint32_t xid;
1083 uint16_t err_type == 6;
1084 enum ofp_group_mod_failed_code code;
1085 of_octets_t data;
1086};
1087
1088struct of_port_mod_failed_error_msg : of_error_msg {
1089 uint8_t version;
1090 uint8_t type == 1;
1091 uint16_t length;
1092 uint32_t xid;
1093 uint16_t err_type == 7;
1094 enum ofp_port_mod_failed_code code;
1095 of_octets_t data;
1096};
1097
1098struct of_table_mod_failed_error_msg : of_error_msg {
1099 uint8_t version;
1100 uint8_t type == 1;
1101 uint16_t length;
1102 uint32_t xid;
1103 uint16_t err_type == 8;
1104 enum ofp_table_mod_failed_code code;
1105 of_octets_t data;
1106};
1107
1108struct of_queue_op_failed_error_msg : of_error_msg {
1109 uint8_t version;
1110 uint8_t type == 1;
1111 uint16_t length;
1112 uint32_t xid;
1113 uint16_t err_type == 9;
1114 enum ofp_queue_op_failed_code code;
1115 of_octets_t data;
1116};
1117
1118struct of_switch_config_failed_error_msg : of_error_msg {
1119 uint8_t version;
1120 uint8_t type == 1;
1121 uint16_t length;
1122 uint32_t xid;
1123 uint16_t err_type == 10;
1124 enum ofp_switch_config_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001125 of_octets_t data;
1126};
1127
1128// STATS ENTRIES: flow, table, port, group, group_desc
1129
Rich Lane68ae4d72013-05-09 10:55:19 -07001130struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001131 uint16_t length;
1132 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001133 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001134 uint32_t duration_sec;
1135 uint32_t duration_nsec;
1136 uint16_t priority;
1137 uint16_t idle_timeout;
1138 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001139 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001140 uint64_t cookie;
1141 uint64_t packet_count;
1142 uint64_t byte_count;
1143 of_match_t match;
1144 list(of_instruction_t) instructions;
1145};
1146
Rich Lane68ae4d72013-05-09 10:55:19 -07001147struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001148 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001149 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001150 of_table_name_t name;
1151 of_wc_bmap_t wildcards;
1152 of_match_bmap_t match;
1153 uint32_t instructions;
1154 uint32_t write_actions;
1155 uint32_t apply_actions;
1156 uint32_t config;
1157 uint32_t max_entries;
1158 uint32_t active_count;
1159 uint64_t lookup_count;
1160 uint64_t matched_count;
1161};
1162
Rich Lane68ae4d72013-05-09 10:55:19 -07001163struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001164 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001165 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001166 uint64_t rx_packets;
1167 uint64_t tx_packets;
1168 uint64_t rx_bytes;
1169 uint64_t tx_bytes;
1170 uint64_t rx_dropped;
1171 uint64_t tx_dropped;
1172 uint64_t rx_errors;
1173 uint64_t tx_errors;
1174 uint64_t rx_frame_err;
1175 uint64_t rx_over_err;
1176 uint64_t rx_crc_err;
1177 uint64_t collisions;
1178};
1179
Rich Lane68ae4d72013-05-09 10:55:19 -07001180struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001181 of_port_no_t port_no;
1182 uint32_t queue_id;
1183 uint64_t tx_bytes;
1184 uint64_t tx_packets;
1185 uint64_t tx_errors;
1186};
1187
Rich Lane68ae4d72013-05-09 10:55:19 -07001188struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001189 uint64_t packet_count;
1190 uint64_t byte_count;
1191};
1192
Rich Lane68ae4d72013-05-09 10:55:19 -07001193struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001194 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001195 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001196 uint32_t group_id;
1197 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001198 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001199 uint64_t packet_count;
1200 uint64_t byte_count;
1201 list(of_bucket_counter_t) bucket_stats;
1202};
1203
Rich Lane68ae4d72013-05-09 10:55:19 -07001204struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001205 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001206 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001207 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001208 uint32_t group_id;
1209 list(of_bucket_t) buckets;
1210};
1211
1212// STATS: Desc, flow, agg, table, port, queue, group, group_desc, experi
1213
Rich Lanee9c37db2013-06-21 18:30:24 -07001214struct of_stats_request : of_header {
1215 uint8_t version;
1216 uint8_t type == 18;
1217 uint16_t length;
1218 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001219 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001220 uint16_t flags;
1221 pad(4);
1222};
1223
1224struct of_stats_reply : of_header {
1225 uint8_t version;
1226 uint8_t type == 19;
1227 uint16_t length;
1228 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001229 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001230 uint16_t flags;
1231 pad(4);
1232};
1233
1234struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001235 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001236 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001237 uint16_t length;
1238 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001239 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001240 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001241 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001242};
1243
Rich Lanee9c37db2013-06-21 18:30:24 -07001244struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001245 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001246 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001247 uint16_t length;
1248 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001249 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001250 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001251 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001252 of_desc_str_t mfr_desc;
1253 of_desc_str_t hw_desc;
1254 of_desc_str_t sw_desc;
1255 of_serial_num_t serial_num;
1256 of_desc_str_t dp_desc;
1257};
1258
Rich Lanee9c37db2013-06-21 18:30:24 -07001259struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001260 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001261 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001262 uint16_t length;
1263 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001264 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001265 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001266 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001267 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001268 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001269 of_port_no_t out_port;
1270 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001271 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001272 uint64_t cookie;
1273 uint64_t cookie_mask;
1274 of_match_t match;
1275};
1276
Rich Lanee9c37db2013-06-21 18:30:24 -07001277struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001278 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001279 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001280 uint16_t length;
1281 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001282 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001283 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001284 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001285 list(of_flow_stats_entry_t) entries;
1286};
1287
Rich Lanee9c37db2013-06-21 18:30:24 -07001288struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001289 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001290 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001291 uint16_t length;
1292 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001293 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001294 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001295 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001296 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001297 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001298 of_port_no_t out_port;
1299 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001300 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001301 uint64_t cookie;
1302 uint64_t cookie_mask;
1303 of_match_t match;
1304};
1305
Rich Lanee9c37db2013-06-21 18:30:24 -07001306struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001307 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001308 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001309 uint16_t length;
1310 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001311 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001312 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001313 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001314 uint64_t packet_count;
1315 uint64_t byte_count;
1316 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001317 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001318};
1319
Rich Lanee9c37db2013-06-21 18:30:24 -07001320struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001321 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001322 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001323 uint16_t length;
1324 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001325 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001326 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001327 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001328};
1329
Rich Lanee9c37db2013-06-21 18:30:24 -07001330struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001331 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001332 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001333 uint16_t length;
1334 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001335 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001336 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001337 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001338 list(of_table_stats_entry_t) entries;
1339};
1340
Rich Lanee9c37db2013-06-21 18:30:24 -07001341struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001342 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001343 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001344 uint16_t length;
1345 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001346 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001347 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001348 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001349 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001350 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001351};
1352
Rich Lanee9c37db2013-06-21 18:30:24 -07001353struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001354 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001355 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001356 uint16_t length;
1357 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001358 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001359 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001360 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001361 list(of_port_stats_entry_t) entries;
1362};
1363
Rich Lanee9c37db2013-06-21 18:30:24 -07001364struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001365 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001366 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001367 uint16_t length;
1368 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001369 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001370 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001371 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001372 of_port_no_t port_no;
1373 uint32_t queue_id;
1374};
1375
Rich Lanee9c37db2013-06-21 18:30:24 -07001376struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001377 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001378 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001379 uint16_t length;
1380 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001381 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001382 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001383 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 list(of_queue_stats_entry_t) entries;
1385};
1386
Rich Lanee9c37db2013-06-21 18:30:24 -07001387struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001388 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001389 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001390 uint16_t length;
1391 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001392 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001393 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001394 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001395 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001396 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001397};
1398
Rich Lanee9c37db2013-06-21 18:30:24 -07001399struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001400 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001401 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001402 uint16_t length;
1403 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001404 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001405 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001406 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001407 list(of_group_stats_entry_t) entries;
1408};
1409
Rich Lanee9c37db2013-06-21 18:30:24 -07001410struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001411 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001412 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001413 uint16_t length;
1414 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001415 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001416 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001417 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001418};
1419
Rich Lanee9c37db2013-06-21 18:30:24 -07001420struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001421 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001422 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001423 uint16_t length;
1424 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001425 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001426 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001427 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001428 list(of_group_desc_stats_entry_t) entries;
1429};
1430
Rich Lanee9c37db2013-06-21 18:30:24 -07001431struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001432 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001433 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001434 uint16_t length;
1435 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001436 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001438 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001439 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001440 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001441 of_octets_t data;
1442};
1443
Rich Lanee9c37db2013-06-21 18:30:24 -07001444struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001445 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001446 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001447 uint16_t length;
1448 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001449 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001451 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001452 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001453 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001454 of_octets_t data;
1455};
1456
1457// END OF STATS OBJECTS
1458
Rich Lane68ae4d72013-05-09 10:55:19 -07001459struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001460 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001461 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001462 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001463};
1464
Rich Lanee9c37db2013-06-21 18:30:24 -07001465struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001466 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001467 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001468 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001469 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001470 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001471};
1472
Rich Lane68ae4d72013-05-09 10:55:19 -07001473struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001474 uint32_t queue_id;
1475 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001476 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001477 list(of_queue_prop_t) properties;
1478};
1479
Rich Lanee9c37db2013-06-21 18:30:24 -07001480struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001481 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001482 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001483 uint16_t length;
1484 uint32_t xid;
1485 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001486 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001487};
1488
Rich Lanee9c37db2013-06-21 18:30:24 -07001489struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001491 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001492 uint16_t length;
1493 uint32_t xid;
1494 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001495 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001496 list(of_packet_queue_t) queues;
1497};