blob: a6f511f0b5e262a7ad78aa7e75ade1b5ba6797f3 [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 Wundsamb47d7e82013-10-18 17:43:00 -0700402// none defined
403enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
404};
405
406
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700407enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700408 OFPSF_REPLY_MORE = 0x1,
409};
410
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700411enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700412 OFPQT_NONE = 0,
413 OFPQT_MIN_RATE = 1,
414};
415
Rich Lanee9c37db2013-06-21 18:30:24 -0700416/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700417struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700418 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700419 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700420 uint16_t length;
421 uint32_t xid;
422};
423
Rich Lanee9c37db2013-06-21 18:30:24 -0700424struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700425 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700426 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700427 uint16_t length;
428 uint32_t xid;
429};
430
Rich Lanee9c37db2013-06-21 18:30:24 -0700431struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700432 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700433 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700434 uint16_t length;
435 uint32_t xid;
436 of_octets_t data;
437};
438
Rich Lanee9c37db2013-06-21 18:30:24 -0700439struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700440 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700441 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700442 uint16_t length;
443 uint32_t xid;
444 of_octets_t data;
445};
446
Rich Lanee9c37db2013-06-21 18:30:24 -0700447struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700448 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700449 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700450 uint16_t length;
451 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700452 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700453 uint32_t subtype;
454 of_octets_t data;
455};
456
Rich Lanee9c37db2013-06-21 18:30:24 -0700457struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700458 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700459 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700460 uint16_t length;
461 uint32_t xid;
462};
463
Rich Lanee9c37db2013-06-21 18:30:24 -0700464struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700465 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700466 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700467 uint16_t length;
468 uint32_t xid;
469};
470
Rich Lanee9c37db2013-06-21 18:30:24 -0700471struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700472 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700473 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700474 uint16_t length;
475 uint32_t xid;
476};
477
Rich Lanee9c37db2013-06-21 18:30:24 -0700478struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700479 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700480 uint8_t type == 8;
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_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700488 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700489 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700490 uint16_t length;
491 uint32_t xid;
492 uint16_t flags;
493 uint16_t miss_send_len;
494};
495
Rich Lanee9c37db2013-06-21 18:30:24 -0700496struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700497 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700498 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700499 uint16_t length;
500 uint32_t xid;
501 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700502 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700503 uint32_t config;
504};
505
Rich Lane68ae4d72013-05-09 10:55:19 -0700506struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700507 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700508 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700509 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700510 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700511 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700512 enum ofp_port_config config;
513 enum ofp_port_state state;
514 enum ofp_port_features curr;
515 enum ofp_port_features advertised;
516 enum ofp_port_features supported;
517 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700518 uint32_t curr_speed;
519 uint32_t max_speed;
520};
521
Rich Lanee9c37db2013-06-21 18:30:24 -0700522struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700523 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700524 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700525 uint16_t length;
526 uint32_t xid;
527};
528
Rich Lanee9c37db2013-06-21 18:30:24 -0700529struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700530 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700531 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700532 uint16_t length;
533 uint32_t xid;
534 uint64_t datapath_id;
535 uint32_t n_buffers;
536 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700537 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700538 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700539 uint32_t reserved;
540 list(of_port_desc_t) ports;
541};
542
Rich Lanee9c37db2013-06-21 18:30:24 -0700543struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700544 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700545 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700546 uint16_t length;
547 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700548 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700549 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700550 of_port_desc_t desc;
551};
552
Rich Lanee9c37db2013-06-21 18:30:24 -0700553struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700554 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700555 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700556 uint16_t length;
557 uint32_t xid;
558 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700559 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700560 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700561 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700562 uint32_t config;
563 uint32_t mask;
564 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700565 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700566};
567
Rich Lanee9c37db2013-06-21 18:30:24 -0700568struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700569 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700570 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700571 uint16_t length;
572 uint32_t xid;
573 uint32_t buffer_id;
574 of_port_no_t in_port;
575 of_port_no_t in_phy_port;
576 uint16_t total_len;
577 uint8_t reason;
578 uint8_t table_id;
579 of_octets_t data;
580};
581
Rich Lanee9c37db2013-06-21 18:30:24 -0700582struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700583 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700584 uint16_t len;
585 of_port_no_t port;
586 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700587 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700588};
589
Rich Lanee9c37db2013-06-21 18:30:24 -0700590struct of_action_set_vlan_vid : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700591 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700592 uint16_t len;
593 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700594 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700595};
596
Rich Lanee9c37db2013-06-21 18:30:24 -0700597struct of_action_set_vlan_pcp : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700598 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700599 uint16_t len;
600 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700601 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700602};
603
Rich Lanee9c37db2013-06-21 18:30:24 -0700604struct of_action_set_dl_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700605 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700606 uint16_t len;
607 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700608 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700609};
610
Rich Lanee9c37db2013-06-21 18:30:24 -0700611struct of_action_set_dl_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700612 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700613 uint16_t len;
614 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700615 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700616};
617
Rich Lanee9c37db2013-06-21 18:30:24 -0700618struct of_action_set_nw_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700619 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700620 uint16_t len;
621 uint32_t nw_addr;
622};
623
Rich Lanee9c37db2013-06-21 18:30:24 -0700624struct of_action_set_nw_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700625 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700626 uint16_t len;
627 uint32_t nw_addr;
628};
629
Rich Lanee9c37db2013-06-21 18:30:24 -0700630struct of_action_set_nw_tos : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700631 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700632 uint16_t len;
633 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700634 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700635};
636
Rich Lanee9c37db2013-06-21 18:30:24 -0700637struct of_action_set_nw_ecn : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700638 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700639 uint16_t len;
640 uint8_t nw_ecn;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700641 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700642};
643
Rich Lanee9c37db2013-06-21 18:30:24 -0700644struct of_action_set_tp_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700645 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700646 uint16_t len;
647 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700648 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700649};
650
Rich Lanee9c37db2013-06-21 18:30:24 -0700651struct of_action_set_tp_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700652 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700653 uint16_t len;
654 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700655 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700656};
657
Rich Lanee9c37db2013-06-21 18:30:24 -0700658struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700659 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700660 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700661 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700662};
663
Rich Lanee9c37db2013-06-21 18:30:24 -0700664struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700665 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700666 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700667 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700668};
669
Rich Lanee9c37db2013-06-21 18:30:24 -0700670struct of_action_set_mpls_label : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700671 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700672 uint16_t len;
673 uint32_t mpls_label;
674};
675
Rich Lanee9c37db2013-06-21 18:30:24 -0700676struct of_action_set_mpls_tc : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700677 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700678 uint16_t len;
679 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700680 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700681};
682
Rich Lanee9c37db2013-06-21 18:30:24 -0700683struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700684 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700685 uint16_t len;
686 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700687 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700688};
689
Rich Lanee9c37db2013-06-21 18:30:24 -0700690struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700691 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700692 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700693 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700694};
695
Rich Lanee9c37db2013-06-21 18:30:24 -0700696struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700697 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700698 uint16_t len;
699 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700700 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700701};
702
Rich Lanee9c37db2013-06-21 18:30:24 -0700703struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700704 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700705 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700706 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700707};
708
Rich Lanee9c37db2013-06-21 18:30:24 -0700709struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700710 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700711 uint16_t len;
712 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700713 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700714};
715
Rich Lanee9c37db2013-06-21 18:30:24 -0700716struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700717 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700718 uint16_t len;
719 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700720 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700721};
722
Rich Lanee9c37db2013-06-21 18:30:24 -0700723struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700724 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700725 uint16_t len;
726 uint32_t queue_id;
727};
728
Rich Lanee9c37db2013-06-21 18:30:24 -0700729struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700730 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700731 uint16_t len;
732 uint32_t group_id;
733};
734
Rich Lanee9c37db2013-06-21 18:30:24 -0700735struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700736 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700737 uint16_t len;
738 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700739 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700740};
741
Rich Lanee9c37db2013-06-21 18:30:24 -0700742struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700743 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700744 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700745 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700746};
747
Rich Lanee9c37db2013-06-21 18:30:24 -0700748struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700749 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700750 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700751 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700752 of_octets_t data;
753};
754
Rich Lane68ae4d72013-05-09 10:55:19 -0700755struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700756 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700757 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700758 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700759};
760
Rich Lanee9c37db2013-06-21 18:30:24 -0700761struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700762 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700763 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700764 uint16_t length;
765 uint32_t xid;
766 uint32_t buffer_id;
767 of_port_no_t in_port;
768 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700769 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700770 list(of_action_t) actions;
771 of_octets_t data;
772};
773
Rich Lane68ae4d72013-05-09 10:55:19 -0700774struct of_match_v2 {
Rich Lane31b87142013-05-09 22:05:42 -0700775 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700776 uint16_t length;
777 of_port_no_t in_port;
778 of_wc_bmap_t wildcards;
779 of_mac_addr_t eth_src;
780 of_mac_addr_t eth_src_mask;
781 of_mac_addr_t eth_dst;
782 of_mac_addr_t eth_dst_mask;
783 uint16_t vlan_vid;
784 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700785 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700786 uint16_t eth_type;
787 uint8_t ip_dscp;
788 uint8_t ip_proto;
Andreas Wundsamb566a162013-07-18 19:30:23 -0700789 of_ipv4_t ipv4_src;
790 of_ipv4_t ipv4_src_mask;
791 of_ipv4_t ipv4_dst;
792 of_ipv4_t ipv4_dst_mask;
Rich Lanea06d0c32013-03-25 08:52:03 -0700793 uint16_t tcp_src;
794 uint16_t tcp_dst;
795 uint32_t mpls_label;
796 uint8_t mpls_tc;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700797 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700798 uint64_t metadata;
799 uint64_t metadata_mask;
800};
801
Rich Lane68ae4d72013-05-09 10:55:19 -0700802struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700803 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700804 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700805 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700806};
807
Rich Lanee9c37db2013-06-21 18:30:24 -0700808struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700809 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700810 uint16_t len;
811 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700812 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700813};
814
Rich Lanee9c37db2013-06-21 18:30:24 -0700815struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700816 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700817 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700818 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700819 uint64_t metadata;
820 uint64_t metadata_mask;
821};
822
Rich Lanee9c37db2013-06-21 18:30:24 -0700823struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700824 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700825 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700826 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700827 list(of_action_t) actions;
828};
829
Rich Lanee9c37db2013-06-21 18:30:24 -0700830struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700831 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700832 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700833 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700834 list(of_action_t) actions;
835};
836
Rich Lanee9c37db2013-06-21 18:30:24 -0700837struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700838 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700839 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700840 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700841};
842
Rich Lanee9c37db2013-06-21 18:30:24 -0700843struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700844 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700845 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700846 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700847 of_octets_t data;
848};
849
Rich Lanee9c37db2013-06-21 18:30:24 -0700850struct of_flow_mod : of_header {
851 uint8_t version;
852 uint8_t type == 14;
853 uint16_t length;
854 uint32_t xid;
855 uint64_t cookie;
856 uint64_t cookie_mask;
857 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700858 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700859 uint16_t idle_timeout;
860 uint16_t hard_timeout;
861 uint16_t priority;
862 uint32_t buffer_id;
863 of_port_no_t out_port;
864 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700865 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700866 pad(2);
867 of_match_t match;
868 list(of_instruction_t) instructions;
869};
870
871struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700872 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700873 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700874 uint16_t length;
875 uint32_t xid;
876 uint64_t cookie;
877 uint64_t cookie_mask;
878 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700879 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700880 uint16_t idle_timeout;
881 uint16_t hard_timeout;
882 uint16_t priority;
883 uint32_t buffer_id;
884 of_port_no_t out_port;
885 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700886 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700887 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 of_match_t match;
889 list(of_instruction_t) instructions;
890};
891
Rich Lanee9c37db2013-06-21 18:30:24 -0700892struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700893 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700894 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 uint16_t length;
896 uint32_t xid;
897 uint64_t cookie;
898 uint64_t cookie_mask;
899 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700900 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700901 uint16_t idle_timeout;
902 uint16_t hard_timeout;
903 uint16_t priority;
904 uint32_t buffer_id;
905 of_port_no_t out_port;
906 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700907 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700908 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 of_match_t match;
910 list(of_instruction_t) instructions;
911};
912
Rich Lanee9c37db2013-06-21 18:30:24 -0700913struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700914 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700915 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700916 uint16_t length;
917 uint32_t xid;
918 uint64_t cookie;
919 uint64_t cookie_mask;
920 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700921 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700922 uint16_t idle_timeout;
923 uint16_t hard_timeout;
924 uint16_t priority;
925 uint32_t buffer_id;
926 of_port_no_t out_port;
927 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700928 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700929 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700930 of_match_t match;
931 list(of_instruction_t) instructions;
932};
933
Rich Lanee9c37db2013-06-21 18:30:24 -0700934struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700935 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700936 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700937 uint16_t length;
938 uint32_t xid;
939 uint64_t cookie;
940 uint64_t cookie_mask;
941 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700942 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700943 uint16_t idle_timeout;
944 uint16_t hard_timeout;
945 uint16_t priority;
946 uint32_t buffer_id;
947 of_port_no_t out_port;
948 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700949 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700950 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700951 of_match_t match;
952 list(of_instruction_t) instructions;
953};
954
Rich Lanee9c37db2013-06-21 18:30:24 -0700955struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700956 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700957 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700958 uint16_t length;
959 uint32_t xid;
960 uint64_t cookie;
961 uint64_t cookie_mask;
962 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700963 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700964 uint16_t idle_timeout;
965 uint16_t hard_timeout;
966 uint16_t priority;
967 uint32_t buffer_id;
968 of_port_no_t out_port;
969 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700970 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700971 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700972 of_match_t match;
973 list(of_instruction_t) instructions;
974};
975
Rich Lane68ae4d72013-05-09 10:55:19 -0700976struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint16_t len;
978 uint16_t weight;
979 of_port_no_t watch_port;
980 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700981 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700982 list(of_action_t) actions;
983};
984
Rich Lanee9c37db2013-06-21 18:30:24 -0700985struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700986 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700987 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700988 uint16_t length;
989 uint32_t xid;
990 uint16_t command;
991 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700992 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700993 uint32_t group_id;
994 list(of_bucket_t) buckets;
995};
996
Rich Lanee9c37db2013-06-21 18:30:24 -0700997struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700998 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700999 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001000 uint16_t length;
1001 uint32_t xid;
1002 uint64_t cookie;
1003 uint16_t priority;
1004 uint8_t reason;
1005 uint8_t table_id;
1006 uint32_t duration_sec;
1007 uint32_t duration_nsec;
1008 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001009 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001010 uint64_t packet_count;
1011 uint64_t byte_count;
1012 of_match_t match;
1013};
1014
Rich Lanee9c37db2013-06-21 18:30:24 -07001015struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001016 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001017 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001018 uint16_t length;
1019 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001020 uint16_t err_type == ?;
1021};
1022
1023struct of_hello_failed_error_msg : of_error_msg {
1024 uint8_t version;
1025 uint8_t type == 1;
1026 uint16_t length;
1027 uint32_t xid;
1028 uint16_t err_type == 0;
1029 enum ofp_hello_failed_code code;
1030 of_octets_t data;
1031};
1032
1033struct of_bad_request_error_msg : of_error_msg {
1034 uint8_t version;
1035 uint8_t type == 1;
1036 uint16_t length;
1037 uint32_t xid;
1038 uint16_t err_type == 1;
1039 enum ofp_bad_request_code code;
1040 of_octets_t data;
1041};
1042
1043struct of_bad_action_error_msg : of_error_msg {
1044 uint8_t version;
1045 uint8_t type == 1;
1046 uint16_t length;
1047 uint32_t xid;
1048 uint16_t err_type == 2;
1049 enum ofp_bad_action_code code;
1050 of_octets_t data;
1051};
1052
1053struct of_bad_instruction_error_msg : of_error_msg {
1054 uint8_t version;
1055 uint8_t type == 1;
1056 uint16_t length;
1057 uint32_t xid;
1058 uint16_t err_type == 3;
1059 enum ofp_bad_instruction_code code;
1060 of_octets_t data;
1061};
1062
1063struct of_bad_match_error_msg : of_error_msg {
1064 uint8_t version;
1065 uint8_t type == 1;
1066 uint16_t length;
1067 uint32_t xid;
1068 uint16_t err_type == 4;
1069 enum ofp_bad_match_code code;
1070 of_octets_t data;
1071};
1072
1073struct of_flow_mod_failed_error_msg : of_error_msg {
1074 uint8_t version;
1075 uint8_t type == 1;
1076 uint16_t length;
1077 uint32_t xid;
1078 uint16_t err_type == 5;
1079 enum ofp_flow_mod_failed_code code;
1080 of_octets_t data;
1081};
1082
1083struct of_group_mod_failed_error_msg : of_error_msg {
1084 uint8_t version;
1085 uint8_t type == 1;
1086 uint16_t length;
1087 uint32_t xid;
1088 uint16_t err_type == 6;
1089 enum ofp_group_mod_failed_code code;
1090 of_octets_t data;
1091};
1092
1093struct of_port_mod_failed_error_msg : of_error_msg {
1094 uint8_t version;
1095 uint8_t type == 1;
1096 uint16_t length;
1097 uint32_t xid;
1098 uint16_t err_type == 7;
1099 enum ofp_port_mod_failed_code code;
1100 of_octets_t data;
1101};
1102
1103struct of_table_mod_failed_error_msg : of_error_msg {
1104 uint8_t version;
1105 uint8_t type == 1;
1106 uint16_t length;
1107 uint32_t xid;
1108 uint16_t err_type == 8;
1109 enum ofp_table_mod_failed_code code;
1110 of_octets_t data;
1111};
1112
1113struct of_queue_op_failed_error_msg : of_error_msg {
1114 uint8_t version;
1115 uint8_t type == 1;
1116 uint16_t length;
1117 uint32_t xid;
1118 uint16_t err_type == 9;
1119 enum ofp_queue_op_failed_code code;
1120 of_octets_t data;
1121};
1122
1123struct of_switch_config_failed_error_msg : of_error_msg {
1124 uint8_t version;
1125 uint8_t type == 1;
1126 uint16_t length;
1127 uint32_t xid;
1128 uint16_t err_type == 10;
1129 enum ofp_switch_config_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001130 of_octets_t data;
1131};
1132
1133// STATS ENTRIES: flow, table, port, group, group_desc
1134
Rich Lane68ae4d72013-05-09 10:55:19 -07001135struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001136 uint16_t length;
1137 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001138 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001139 uint32_t duration_sec;
1140 uint32_t duration_nsec;
1141 uint16_t priority;
1142 uint16_t idle_timeout;
1143 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001144 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001145 uint64_t cookie;
1146 uint64_t packet_count;
1147 uint64_t byte_count;
1148 of_match_t match;
1149 list(of_instruction_t) instructions;
1150};
1151
Rich Lane68ae4d72013-05-09 10:55:19 -07001152struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001153 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001154 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001155 of_table_name_t name;
1156 of_wc_bmap_t wildcards;
1157 of_match_bmap_t match;
1158 uint32_t instructions;
1159 uint32_t write_actions;
1160 uint32_t apply_actions;
1161 uint32_t config;
1162 uint32_t max_entries;
1163 uint32_t active_count;
1164 uint64_t lookup_count;
1165 uint64_t matched_count;
1166};
1167
Rich Lane68ae4d72013-05-09 10:55:19 -07001168struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001169 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001170 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001171 uint64_t rx_packets;
1172 uint64_t tx_packets;
1173 uint64_t rx_bytes;
1174 uint64_t tx_bytes;
1175 uint64_t rx_dropped;
1176 uint64_t tx_dropped;
1177 uint64_t rx_errors;
1178 uint64_t tx_errors;
1179 uint64_t rx_frame_err;
1180 uint64_t rx_over_err;
1181 uint64_t rx_crc_err;
1182 uint64_t collisions;
1183};
1184
Rich Lane68ae4d72013-05-09 10:55:19 -07001185struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001186 of_port_no_t port_no;
1187 uint32_t queue_id;
1188 uint64_t tx_bytes;
1189 uint64_t tx_packets;
1190 uint64_t tx_errors;
1191};
1192
Rich Lane68ae4d72013-05-09 10:55:19 -07001193struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001194 uint64_t packet_count;
1195 uint64_t byte_count;
1196};
1197
Rich Lane68ae4d72013-05-09 10:55:19 -07001198struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001199 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001200 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001201 uint32_t group_id;
1202 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001203 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001204 uint64_t packet_count;
1205 uint64_t byte_count;
1206 list(of_bucket_counter_t) bucket_stats;
1207};
1208
Rich Lane68ae4d72013-05-09 10:55:19 -07001209struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001210 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001211 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001212 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001213 uint32_t group_id;
1214 list(of_bucket_t) buckets;
1215};
1216
1217// STATS: Desc, flow, agg, table, port, queue, group, group_desc, experi
1218
Rich Lanee9c37db2013-06-21 18:30:24 -07001219struct of_stats_request : of_header {
1220 uint8_t version;
1221 uint8_t type == 18;
1222 uint16_t length;
1223 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001224 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001225 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001226 pad(4);
1227};
1228
1229struct of_stats_reply : of_header {
1230 uint8_t version;
1231 uint8_t type == 19;
1232 uint16_t length;
1233 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001234 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001235 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001236 pad(4);
1237};
1238
1239struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001240 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001241 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001242 uint16_t length;
1243 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001244 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001245 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001246 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001247};
1248
Rich Lanee9c37db2013-06-21 18:30:24 -07001249struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001250 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001251 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001252 uint16_t length;
1253 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001254 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001255 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001256 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001257 of_desc_str_t mfr_desc;
1258 of_desc_str_t hw_desc;
1259 of_desc_str_t sw_desc;
1260 of_serial_num_t serial_num;
1261 of_desc_str_t dp_desc;
1262};
1263
Rich Lanee9c37db2013-06-21 18:30:24 -07001264struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001265 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001266 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001267 uint16_t length;
1268 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001269 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001270 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001271 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001272 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001273 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001274 of_port_no_t out_port;
1275 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001276 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001277 uint64_t cookie;
1278 uint64_t cookie_mask;
1279 of_match_t match;
1280};
1281
Rich Lanee9c37db2013-06-21 18:30:24 -07001282struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001283 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001284 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001285 uint16_t length;
1286 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001287 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001288 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001289 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001290 list(of_flow_stats_entry_t) entries;
1291};
1292
Rich Lanee9c37db2013-06-21 18:30:24 -07001293struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001294 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001295 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001296 uint16_t length;
1297 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001298 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001299 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001300 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001301 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001302 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001303 of_port_no_t out_port;
1304 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001305 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001306 uint64_t cookie;
1307 uint64_t cookie_mask;
1308 of_match_t match;
1309};
1310
Rich Lanee9c37db2013-06-21 18:30:24 -07001311struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001312 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001313 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001314 uint16_t length;
1315 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001316 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001317 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001318 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001319 uint64_t packet_count;
1320 uint64_t byte_count;
1321 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001322 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001323};
1324
Rich Lanee9c37db2013-06-21 18:30:24 -07001325struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001326 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001327 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001328 uint16_t length;
1329 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001330 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001331 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001332 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001333};
1334
Rich Lanee9c37db2013-06-21 18:30:24 -07001335struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001336 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001337 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001338 uint16_t length;
1339 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001340 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001341 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001342 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001343 list(of_table_stats_entry_t) entries;
1344};
1345
Rich Lanee9c37db2013-06-21 18:30:24 -07001346struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001347 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001348 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001349 uint16_t length;
1350 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001351 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001352 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001353 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001354 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001355 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001356};
1357
Rich Lanee9c37db2013-06-21 18:30:24 -07001358struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001359 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001360 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001361 uint16_t length;
1362 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001363 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001364 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001365 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001366 list(of_port_stats_entry_t) entries;
1367};
1368
Rich Lanee9c37db2013-06-21 18:30:24 -07001369struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001370 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001371 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001372 uint16_t length;
1373 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001374 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001375 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001376 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001377 of_port_no_t port_no;
1378 uint32_t queue_id;
1379};
1380
Rich Lanee9c37db2013-06-21 18:30:24 -07001381struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001382 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001383 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 uint16_t length;
1385 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001386 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001387 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001388 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 list(of_queue_stats_entry_t) entries;
1390};
1391
Rich Lanee9c37db2013-06-21 18:30:24 -07001392struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001393 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001394 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001395 uint16_t length;
1396 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001397 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001398 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001399 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001400 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001401 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001402};
1403
Rich Lanee9c37db2013-06-21 18:30:24 -07001404struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001405 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001406 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001407 uint16_t length;
1408 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001409 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001410 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001411 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001412 list(of_group_stats_entry_t) entries;
1413};
1414
Rich Lanee9c37db2013-06-21 18:30:24 -07001415struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001416 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001417 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001418 uint16_t length;
1419 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001420 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001421 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001422 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001423};
1424
Rich Lanee9c37db2013-06-21 18:30:24 -07001425struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001426 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001427 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001428 uint16_t length;
1429 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001430 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001431 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001432 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001433 list(of_group_desc_stats_entry_t) entries;
1434};
1435
Rich Lanee9c37db2013-06-21 18:30:24 -07001436struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001438 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001439 uint16_t length;
1440 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001441 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001442 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001443 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001444 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001445 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001446 of_octets_t data;
1447};
1448
Rich Lanee9c37db2013-06-21 18:30:24 -07001449struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001451 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001452 uint16_t length;
1453 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001454 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001455 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001456 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001457 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001458 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001459 of_octets_t data;
1460};
1461
1462// END OF STATS OBJECTS
1463
Rich Lane68ae4d72013-05-09 10:55:19 -07001464struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001465 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001466 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001467 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001468};
1469
Rich Lanee9c37db2013-06-21 18:30:24 -07001470struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001471 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001472 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001473 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001474 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001475 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001476};
1477
Rich Lane68ae4d72013-05-09 10:55:19 -07001478struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001479 uint32_t queue_id;
1480 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001481 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001482 list(of_queue_prop_t) properties;
1483};
1484
Rich Lanee9c37db2013-06-21 18:30:24 -07001485struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001486 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001487 uint8_t type == 22;
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};
1493
Rich Lanee9c37db2013-06-21 18:30:24 -07001494struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001495 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001496 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001497 uint16_t length;
1498 uint32_t xid;
1499 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001500 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001501 list(of_packet_queue_t) queues;
1502};