blob: 3e521dda413b27785be8c8310df5781b3c0a1b80 [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 4
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 OFP_VLAN_NONE = 0,
46
47 OFP_FLOW_PERMANENT = 0,
48
49 OFP_DEFAULT_PRIORITY = 0x8000,
50
51 OFP_NO_BUFFER = 0xffffffff,
52
53 DESC_STR_LEN = 256,
54 SERIAL_NUM_LEN = 32,
55
56 OFPQ_ALL = 0xffffffff,
57 OFPQ_MAX_RATE_UNCFG = 0xffff,
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59};
60
Andreas Wundsam4ee51462013-07-30 11:00:37 -070061enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070062 OFPP_MAX = 0xffffff00,
63 OFPP_IN_PORT = 0xfffffff8,
64 OFPP_TABLE = 0xfffffff9,
65 OFPP_NORMAL = 0xfffffffa,
66 OFPP_FLOOD = 0xfffffffb,
67 OFPP_ALL = 0xfffffffc,
68 OFPP_CONTROLLER = 0xfffffffd,
69 OFPP_LOCAL = 0xfffffffe,
Tomasz949aa522013-10-23 16:12:27 -070070 OFPP_ANY = 0xffffffff,
Rich Lane5d33a622013-04-08 17:33:11 -070071};
72
Andreas Wundsam4ee51462013-07-30 11:00:37 -070073enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070074 OFPT_HELLO = 0,
75 OFPT_ERROR = 1,
76 OFPT_ECHO_REQUEST = 2,
77 OFPT_ECHO_REPLY = 3,
78 OFPT_EXPERIMENTER = 4,
79 OFPT_FEATURES_REQUEST = 5,
80 OFPT_FEATURES_REPLY = 6,
81 OFPT_GET_CONFIG_REQUEST = 7,
82 OFPT_GET_CONFIG_REPLY = 8,
83 OFPT_SET_CONFIG = 9,
84 OFPT_PACKET_IN = 10,
85 OFPT_FLOW_REMOVED = 11,
86 OFPT_PORT_STATUS = 12,
87 OFPT_PACKET_OUT = 13,
88 OFPT_FLOW_MOD = 14,
89 OFPT_GROUP_MOD = 15,
90 OFPT_PORT_MOD = 16,
91 OFPT_TABLE_MOD = 17,
Rob Vaterlausfeee3712013-09-30 11:24:19 -070092 OFPT_STATS_REQUEST = 18,
93 OFPT_STATS_REPLY = 19,
Rich Lane5d33a622013-04-08 17:33:11 -070094 OFPT_BARRIER_REQUEST = 20,
95 OFPT_BARRIER_REPLY = 21,
96 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
97 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
98 OFPT_ROLE_REQUEST = 24,
99 OFPT_ROLE_REPLY = 25,
100 OFPT_GET_ASYNC_REQUEST = 26,
101 OFPT_GET_ASYNC_REPLY = 27,
102 OFPT_SET_ASYNC = 28,
103 OFPT_METER_MOD = 29,
104};
105
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700106enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700107 OFPC_FRAG_NORMAL = 0,
108 OFPC_FRAG_DROP = 1,
109 OFPC_FRAG_REASM = 2,
110 OFPC_FRAG_MASK = 3,
111};
112
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700113enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700114 OFPTC_DEPRECATED_MASK = 0x3,
115};
116
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700117enum ofp_table(wire_type=uint8_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700118 OFPTT_MAX = 0xfe,
119 OFPTT_ALL = 0xff,
120};
121
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700122enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700123 OFPC_FLOW_STATS = 0x1,
124 OFPC_TABLE_STATS = 0x2,
125 OFPC_PORT_STATS = 0x4,
126 OFPC_GROUP_STATS = 0x8,
127 OFPC_IP_REASM = 0x20,
128 OFPC_QUEUE_STATS = 0x40,
129 OFPC_PORT_BLOCKED = 0x100,
130};
131
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700132enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700133 OFPPC_PORT_DOWN = 0x1,
134 OFPPC_NO_RECV = 0x4,
135 OFPPC_NO_FWD = 0x20,
136 OFPPC_NO_PACKET_IN = 0x40,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -0700137 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700138};
139
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700140enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700141 OFPPS_LINK_DOWN = 0x1,
142 OFPPS_BLOCKED = 0x2,
143 OFPPS_LIVE = 0x4,
144};
145
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700146enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700147 OFPPF_10MB_HD = 0x1,
148 OFPPF_10MB_FD = 0x2,
149 OFPPF_100MB_HD = 0x4,
150 OFPPF_100MB_FD = 0x8,
151 OFPPF_1GB_HD = 0x10,
152 OFPPF_1GB_FD = 0x20,
153 OFPPF_10GB_FD = 0x40,
154 OFPPF_40GB_FD = 0x80,
155 OFPPF_100GB_FD = 0x100,
156 OFPPF_1TB_FD = 0x200,
157 OFPPF_OTHER = 0x400,
158 OFPPF_COPPER = 0x800,
159 OFPPF_FIBER = 0x1000,
160 OFPPF_AUTONEG = 0x2000,
161 OFPPF_PAUSE = 0x4000,
162 OFPPF_PAUSE_ASYM = 0x8000,
163};
164
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700165enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700166 OFPPR_ADD = 0,
167 OFPPR_DELETE = 1,
168 OFPPR_MODIFY = 2,
169};
170
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700171enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700172 OFPMT_STANDARD = 0,
173 OFPMT_OXM = 1,
174};
175
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700176enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700177 OFPXMC_NXM_0 = 0,
178 OFPXMC_NXM_1 = 1,
179 OFPXMC_OPENFLOW_BASIC = 0x8000,
180 OFPXMC_EXPERIMENTER = 0xffff,
181};
182
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700183enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700184 OFPVID_NONE = 0,
185 OFPVID_PRESENT = 0x1000,
186};
187
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700188// FIXME: OF spec specified this as '9' bits, implicitly adding
189// to full byte
190enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700191 OFPIEH_NONEXT = 0x1,
192 OFPIEH_ESP = 0x2,
193 OFPIEH_AUTH = 0x4,
194 OFPIEH_DEST = 0x8,
195 OFPIEH_FRAG = 0x10,
196 OFPIEH_ROUTER = 0x20,
197 OFPIEH_HOP = 0x40,
198 OFPIEH_UNREP = 0x80,
199 OFPIEH_UNSEQ = 0x100,
200};
201
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700202enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700203 OFPAT_OUTPUT = 0,
204 OFPAT_COPY_TTL_OUT = 0xb,
205 OFPAT_COPY_TTL_IN = 0xc,
206 OFPAT_SET_MPLS_TTL = 0xf,
207 OFPAT_DEC_MPLS_TTL = 0x10,
208 OFPAT_PUSH_VLAN = 0x11,
209 OFPAT_POP_VLAN = 0x12,
210 OFPAT_PUSH_MPLS = 0x13,
211 OFPAT_POP_MPLS = 0x14,
212 OFPAT_SET_QUEUE = 0x15,
213 OFPAT_GROUP = 0x16,
214 OFPAT_SET_NW_TTL = 0x17,
215 OFPAT_DEC_NW_TTL = 0x18,
216 OFPAT_SET_FIELD = 0x19,
217 OFPAT_PUSH_PBB = 0x1a,
218 OFPAT_POP_PBB = 0x1b,
219 OFPAT_EXPERIMENTER = 0xffff,
220};
221
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700222enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700223 OFPCML_MAX = 0xffe5,
224 OFPCML_NO_BUFFER = 0xffff,
225};
226
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700227enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700228 OFPIT_GOTO_TABLE = 0x1,
229 OFPIT_WRITE_METADATA = 0x2,
230 OFPIT_WRITE_ACTIONS = 0x3,
231 OFPIT_APPLY_ACTIONS = 0x4,
232 OFPIT_CLEAR_ACTIONS = 0x5,
233 OFPIT_METER = 0x6,
234 OFPIT_EXPERIMENTER = 0xffff,
235};
236
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700237enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700238 OFPFC_ADD = 0,
239 OFPFC_MODIFY = 1,
240 OFPFC_MODIFY_STRICT = 2,
241 OFPFC_DELETE = 3,
242 OFPFC_DELETE_STRICT = 4,
243};
244
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700245enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700246 OFPFF_SEND_FLOW_REM = 0x1,
247 OFPFF_CHECK_OVERLAP = 0x2,
248 OFPFF_RESET_COUNTS = 0x4,
249 OFPFF_NO_PKT_COUNTS = 0x8,
250 OFPFF_NO_BYT_COUNTS = 0x10,
Rich Lanef86f39a2013-10-07 18:04:11 -0700251
252 /* Non-standard, enabled by an experimenter message */
253 /* See the bsn_flow_idle input file */
254 OFPFF_BSN_SEND_IDLE = 0x80,
Rich Lane5d33a622013-04-08 17:33:11 -0700255};
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_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700264 OFPGC_ADD = 0,
265 OFPGC_MODIFY = 1,
266 OFPGC_DELETE = 2,
267};
268
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700269enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700270 OFPGT_ALL = 0,
271 OFPGT_SELECT = 1,
272 OFPGT_INDIRECT = 2,
273 OFPGT_FF = 3,
274};
275
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700276enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700277 OFPR_NO_MATCH = 0,
278 OFPR_ACTION = 1,
279 OFPR_INVALID_TTL = 2,
Andreas Wundsam7723c562013-10-23 16:27:40 -0700280
281 // non-standard BSN extensions. OF does not have a standard-conformant
282 // way to extend the set of packet_in reasons
283 OFPR_BSN_NEW_HOST = 128,
284 OFPR_BSN_STATION_MOVE = 129,
285 OFPR_BSN_BAD_VLAN = 130,
286 OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131,
Rich Lanee13d7842013-12-21 14:39:25 -0800287 OFPR_BSN_NO_ROUTE = 132,
Rich Lane5d33a622013-04-08 17:33:11 -0700288};
289
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700290enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700291 OFPRR_IDLE_TIMEOUT = 0,
292 OFPRR_HARD_TIMEOUT = 1,
293 OFPRR_DELETE = 2,
294 OFPRR_GROUP_DELETE = 3,
295};
296
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700297enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700298 OFPM_MAX = 0xffff0000,
299 OFPM_SLOWPATH = 0xfffffffd,
300 OFPM_CONTROLLER = 0xfffffffe,
301 OFPM_ALL = 0xffffffff,
302};
303
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700304enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700305 OFPMBT_DROP = 0x1,
306 OFPMBT_DSCP_REMARK = 0x2,
307 OFPMBT_EXPERIMENTER = 0xffff,
308};
309
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700310enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700311 OFPMC_ADD = 0,
312 OFPMC_MODIFY = 1,
313 OFPMC_DELETE = 2,
314};
315
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700316enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700317 OFPMF_KBPS = 0x1,
318 OFPMF_PKTPS = 0x2,
319 OFPMF_BURST = 0x4,
320 OFPMF_STATS = 0x8,
321};
322
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700323enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700324 OFPET_HELLO_FAILED = 0,
325 OFPET_BAD_REQUEST = 1,
326 OFPET_BAD_ACTION = 2,
327 OFPET_BAD_INSTRUCTION = 3,
328 OFPET_BAD_MATCH = 4,
329 OFPET_FLOW_MOD_FAILED = 5,
330 OFPET_GROUP_MOD_FAILED = 6,
331 OFPET_PORT_MOD_FAILED = 7,
332 OFPET_TABLE_MOD_FAILED = 8,
333 OFPET_QUEUE_OP_FAILED = 9,
334 OFPET_SWITCH_CONFIG_FAILED = 10,
335 OFPET_ROLE_REQUEST_FAILED = 11,
336 OFPET_METER_MOD_FAILED = 12,
337 OFPET_TABLE_FEATURES_FAILED = 13,
338 OFPET_EXPERIMENTER = 0xffff,
339};
340
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700341enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700342 OFPHFC_INCOMPATIBLE = 0,
343 OFPHFC_EPERM = 1,
344};
345
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700346enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700347 OFPBRC_BAD_VERSION = 0,
348 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700349 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700350 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700351 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700352 OFPBRC_EPERM = 5,
353 OFPBRC_BAD_LEN = 6,
354 OFPBRC_BUFFER_EMPTY = 7,
355 OFPBRC_BUFFER_UNKNOWN = 8,
356 OFPBRC_BAD_TABLE_ID = 9,
357 OFPBRC_IS_SLAVE = 10,
358 OFPBRC_BAD_PORT = 11,
359 OFPBRC_BAD_PACKET = 12,
360 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
361};
362
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700363enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700364 OFPBAC_BAD_TYPE = 0,
365 OFPBAC_BAD_LEN = 1,
366 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700367 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700368 OFPBAC_BAD_OUT_PORT = 4,
369 OFPBAC_BAD_ARGUMENT = 5,
370 OFPBAC_EPERM = 6,
371 OFPBAC_TOO_MANY = 7,
372 OFPBAC_BAD_QUEUE = 8,
373 OFPBAC_BAD_OUT_GROUP = 9,
374 OFPBAC_MATCH_INCONSISTENT = 10,
375 OFPBAC_UNSUPPORTED_ORDER = 11,
376 OFPBAC_BAD_TAG = 12,
377 OFPBAC_BAD_SET_TYPE = 13,
378 OFPBAC_BAD_SET_LEN = 14,
379 OFPBAC_BAD_SET_ARGUMENT = 15,
380};
381
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700382enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700383 OFPBIC_UNKNOWN_INST = 0,
384 OFPBIC_UNSUP_INST = 1,
385 OFPBIC_BAD_TABLE_ID = 2,
386 OFPBIC_UNSUP_METADATA = 3,
387 OFPBIC_UNSUP_METADATA_MASK = 4,
388 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700389 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700390 OFPBIC_BAD_LEN = 7,
391 OFPBIC_EPERM = 8,
392};
393
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700394enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700395 OFPBMC_BAD_TYPE = 0,
396 OFPBMC_BAD_LEN = 1,
397 OFPBMC_BAD_TAG = 2,
398 OFPBMC_BAD_DL_ADDR_MASK = 3,
399 OFPBMC_BAD_NW_ADDR_MASK = 4,
400 OFPBMC_BAD_WILDCARDS = 5,
401 OFPBMC_BAD_FIELD = 6,
402 OFPBMC_BAD_VALUE = 7,
403 OFPBMC_BAD_MASK = 8,
404 OFPBMC_BAD_PREREQ = 9,
405 OFPBMC_DUP_FIELD = 10,
406 OFPBMC_EPERM = 11,
407};
408
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700409enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700410 OFPFMFC_UNKNOWN = 0,
411 OFPFMFC_TABLE_FULL = 1,
412 OFPFMFC_BAD_TABLE_ID = 2,
413 OFPFMFC_OVERLAP = 3,
414 OFPFMFC_EPERM = 4,
415 OFPFMFC_BAD_TIMEOUT = 5,
416 OFPFMFC_BAD_COMMAND = 6,
417 OFPFMFC_BAD_FLAGS = 7,
418};
419
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700420enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700421 OFPGMFC_GROUP_EXISTS = 0,
422 OFPGMFC_INVALID_GROUP = 1,
423 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
424 OFPGMFC_OUT_OF_GROUPS = 3,
425 OFPGMFC_OUT_OF_BUCKETS = 4,
426 OFPGMFC_CHAINING_UNSUPPORTED = 5,
427 OFPGMFC_WATCH_UNSUPPORTED = 6,
428 OFPGMFC_LOOP = 7,
429 OFPGMFC_UNKNOWN_GROUP = 8,
430 OFPGMFC_CHAINED_GROUP = 9,
431 OFPGMFC_BAD_TYPE = 10,
432 OFPGMFC_BAD_COMMAND = 11,
433 OFPGMFC_BAD_BUCKET = 12,
434 OFPGMFC_BAD_WATCH = 13,
435 OFPGMFC_EPERM = 14,
436};
437
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700438enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700439 OFPPMFC_BAD_PORT = 0,
440 OFPPMFC_BAD_HW_ADDR = 1,
441 OFPPMFC_BAD_CONFIG = 2,
442 OFPPMFC_BAD_ADVERTISE = 3,
443 OFPPMFC_EPERM = 4,
444};
445
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700446enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700447 OFPTMFC_BAD_TABLE = 0,
448 OFPTMFC_BAD_CONFIG = 1,
449 OFPTMFC_EPERM = 2,
450};
451
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700452enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700453 OFPQOFC_BAD_PORT = 0,
454 OFPQOFC_BAD_QUEUE = 1,
455 OFPQOFC_EPERM = 2,
456};
457
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700458enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700459 OFPSCFC_BAD_FLAGS = 0,
460 OFPSCFC_BAD_LEN = 1,
461 OFPSCFC_EPERM = 2,
462};
463
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700464enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700465 OFPRRFC_STALE = 0,
466 OFPRRFC_UNSUP = 1,
467 OFPRRFC_BAD_ROLE = 2,
468};
469
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700470enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700471 OFPMMFC_UNKNOWN = 0,
472 OFPMMFC_METER_EXISTS = 1,
473 OFPMMFC_INVALID_METER = 2,
474 OFPMMFC_UNKNOWN_METER = 3,
475 OFPMMFC_BAD_COMMAND = 4,
476 OFPMMFC_BAD_FLAGS = 5,
477 OFPMMFC_BAD_RATE = 6,
478 OFPMMFC_BAD_BURST = 7,
479 OFPMMFC_BAD_BAND = 8,
480 OFPMMFC_BAD_BAND_VALUE = 9,
481 OFPMMFC_OUT_OF_METERS = 10,
482 OFPMMFC_OUT_OF_BANDS = 11,
483};
484
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700485enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700486 OFPTFFC_BAD_TABLE = 0,
487 OFPTFFC_BAD_METADATA = 1,
488 OFPTFFC_BAD_TYPE = 2,
489 OFPTFFC_BAD_LEN = 3,
490 OFPTFFC_BAD_ARGUMENT = 4,
491 OFPTFFC_EPERM = 5,
492};
493
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700494enum ofp_stats_type(wire_type=uint16_t) {
495 OFPST_DESC = 0,
496 OFPST_FLOW = 1,
497 OFPST_AGGREGATE = 2,
498 OFPST_TABLE = 3,
499 OFPST_PORT = 4,
500 OFPST_QUEUE = 5,
501 OFPST_GROUP = 6,
502 OFPST_GROUP_DESC = 7,
503 OFPST_GROUP_FEATURES = 8,
504 OFPST_METER = 9,
505 OFPST_METER_CONFIG = 10,
506 OFPST_METER_FEATURES = 11,
507 OFPST_TABLE_FEATURES = 12,
508 OFPST_PORT_DESC = 13,
509 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700510};
511
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700512enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
513 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700514};
515
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700516enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
517 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700518};
519
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700520enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700521 OFPTFPT_INSTRUCTIONS = 0,
522 OFPTFPT_INSTRUCTIONS_MISS = 1,
523 OFPTFPT_NEXT_TABLES = 2,
524 OFPTFPT_NEXT_TABLES_MISS = 3,
525 OFPTFPT_WRITE_ACTIONS = 4,
526 OFPTFPT_WRITE_ACTIONS_MISS = 5,
527 OFPTFPT_APPLY_ACTIONS = 6,
528 OFPTFPT_APPLY_ACTIONS_MISS = 7,
529 OFPTFPT_MATCH = 8,
530 OFPTFPT_WILDCARDS = 0xa,
531 OFPTFPT_WRITE_SETFIELD = 0xc,
532 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
533 OFPTFPT_APPLY_SETFIELD = 0xe,
534 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
535 OFPTFPT_EXPERIMENTER = 0xfffe,
536 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
537};
538
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700539enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700540 OFPGFC_SELECT_WEIGHT = 0x1,
541 OFPGFC_SELECT_LIVENESS = 0x2,
542 OFPGFC_CHAINING = 0x4,
543 OFPGFC_CHAINING_CHECKS = 0x8,
544};
545
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700546enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700547 OFPQT_MIN_RATE = 0x1,
548 OFPQT_MAX_RATE = 0x2,
549 OFPQT_EXPERIMENTER = 0xffff,
550};
551
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700552enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700553 OFPCR_ROLE_NOCHANGE = 0,
554 OFPCR_ROLE_EQUAL = 1,
555 OFPCR_ROLE_MASTER = 2,
556 OFPCR_ROLE_SLAVE = 3,
557};
558
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700559enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700560 OFPHET_VERSIONBITMAP = 1,
561};
562
Rich Lanee9c37db2013-06-21 18:30:24 -0700563/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700564struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700565 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700566 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700567 uint16_t length;
568 uint32_t xid;
569};
570
xinwuf08ef682013-12-05 18:29:20 -0800571struct of_uint64 {
572 uint64_t value;
573};
574
Rich Lanea06d0c32013-03-25 08:52:03 -0700575// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700576struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700577 uint32_t value;
578};
579
580// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700581struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700582 uint8_t value;
583};
584
Rich Lane68ae4d72013-05-09 10:55:19 -0700585struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700586 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700587 uint16_t length;
588};
589
Rich Lanee9c37db2013-06-21 18:30:24 -0700590struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700591 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700592 uint16_t length;
593 list(of_uint32_t) bitmaps;
594};
595
Rich Lanee9c37db2013-06-21 18:30:24 -0700596struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700598 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700599 uint16_t length;
600 uint32_t xid;
601 list(of_hello_elem_t) elements;
602};
603
Rich Lanee9c37db2013-06-21 18:30:24 -0700604struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700605 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700606 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700607 uint16_t length;
608 uint32_t xid;
609 of_octets_t data;
610};
611
Rich Lanee9c37db2013-06-21 18:30:24 -0700612struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700613 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700614 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700615 uint16_t length;
616 uint32_t xid;
617 of_octets_t data;
618};
619
Rich Lanee9c37db2013-06-21 18:30:24 -0700620struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700621 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700622 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700623 uint16_t length;
624 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700625 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700626 uint32_t subtype;
627 of_octets_t data;
628};
629
Rich Lanee9c37db2013-06-21 18:30:24 -0700630struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700632 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700633 uint16_t length;
634 uint32_t xid;
635};
636
Rich Lanee9c37db2013-06-21 18:30:24 -0700637struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700638 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700639 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700640 uint16_t length;
641 uint32_t xid;
642};
643
Rich Lanee9c37db2013-06-21 18:30:24 -0700644struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700645 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700646 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700647 uint16_t length;
648 uint32_t xid;
649};
650
Rich Lanee9c37db2013-06-21 18:30:24 -0700651struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700652 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700653 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700654 uint16_t length;
655 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800656 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700657 uint16_t miss_send_len;
658};
659
Rich Lanee9c37db2013-06-21 18:30:24 -0700660struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700661 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700662 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint16_t length;
664 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800665 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700666 uint16_t miss_send_len;
667};
668
Rich Lanee9c37db2013-06-21 18:30:24 -0700669struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700670 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700671 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700672 uint16_t length;
673 uint32_t xid;
674 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700675 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700676 uint32_t config;
677};
678
Rich Lane68ae4d72013-05-09 10:55:19 -0700679struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700680 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700681 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700683 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700684 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700685 enum ofp_port_config config;
686 enum ofp_port_state state;
687 enum ofp_port_features curr;
688 enum ofp_port_features advertised;
689 enum ofp_port_features supported;
690 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700691 uint32_t curr_speed;
692 uint32_t max_speed;
693};
694
Rich Lanee9c37db2013-06-21 18:30:24 -0700695struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700697 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700698 uint16_t length;
699 uint32_t xid;
700};
701
Rich Lanee9c37db2013-06-21 18:30:24 -0700702struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700703 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700704 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700705 uint16_t length;
706 uint32_t xid;
707 uint64_t datapath_id;
708 uint32_t n_buffers;
709 uint8_t n_tables;
710 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700711 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700712 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700713 uint32_t reserved;
714};
715
Rich Lanee9c37db2013-06-21 18:30:24 -0700716struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700717 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700718 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700719 uint16_t length;
720 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700721 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700722 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700723 of_port_desc_t desc;
724};
725
Rich Lanee9c37db2013-06-21 18:30:24 -0700726struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700727 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700728 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700729 uint16_t length;
730 uint32_t xid;
731 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700732 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700733 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700734 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700735 uint32_t config;
736 uint32_t mask;
737 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700738 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700739};
740
741// FIXME Does this need to be v4?
Andreas Wundsam5da68512013-10-22 22:18:00 -0700742struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700743 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700744 uint16_t length;
745 list(of_oxm_t) oxm_list;
746};
747
Rich Lanea06d0c32013-03-25 08:52:03 -0700748// This looks like an action header, but is standalone. See
749// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700750struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700751 uint16_t type;
752 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_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700757 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700758 uint16_t len;
759 of_port_no_t port;
760 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700761 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700762};
763
Rich Lanee9c37db2013-06-21 18:30:24 -0700764struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700765 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700766 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700767 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700768};
769
Rich Lanee9c37db2013-06-21 18:30:24 -0700770struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700771 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700772 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700773 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700774};
775
Rich Lanee9c37db2013-06-21 18:30:24 -0700776struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700777 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700778 uint16_t len;
779 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700780 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700781};
782
Rich Lanee9c37db2013-06-21 18:30:24 -0700783struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700784 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700785 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700786 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700787};
788
Rich Lanee9c37db2013-06-21 18:30:24 -0700789struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700790 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700791 uint16_t len;
792 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700793 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700794};
795
Rich Lanee9c37db2013-06-21 18:30:24 -0700796struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700797 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700798 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700799 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700800};
801
Rich Lanee9c37db2013-06-21 18:30:24 -0700802struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700803 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700804 uint16_t len;
805 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700806 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700807};
808
Rich Lanee9c37db2013-06-21 18:30:24 -0700809struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700810 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700811 uint16_t len;
812 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700813 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700814};
815
Rich Lanee9c37db2013-06-21 18:30:24 -0700816struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700817 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700818 uint16_t len;
819 uint32_t queue_id;
820};
821
Rich Lanee9c37db2013-06-21 18:30:24 -0700822struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700823 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700824 uint16_t len;
825 uint32_t group_id;
826};
827
Rich Lanee9c37db2013-06-21 18:30:24 -0700828struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700829 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700830 uint16_t len;
831 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700832 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700833};
834
Rich Lanee9c37db2013-06-21 18:30:24 -0700835struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700836 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700837 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700838 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700839};
840
Andreas Wundsam5da68512013-10-22 22:18:00 -0700841struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700842 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700843 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700844 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700845};
846
Andreas Wundsam5da68512013-10-22 22:18:00 -0700847struct of_action_experimenter(align=8, length_includes_align=True): of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700848 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700849 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700850 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700851 of_octets_t data;
852};
853
Rich Lanee9c37db2013-06-21 18:30:24 -0700854struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700855 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700856 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700857 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700858};
859
Rich Lanee9c37db2013-06-21 18:30:24 -0700860struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700861 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700862 uint16_t len;
863 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700864 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700865};
866
Rich Lane68ae4d72013-05-09 10:55:19 -0700867struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700868 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700869 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700870 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700871};
872
Rich Lane68ae4d72013-05-09 10:55:19 -0700873struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700874 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700875 uint16_t len;
876};
877
Rich Lanee9c37db2013-06-21 18:30:24 -0700878struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700879 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700880 uint16_t len;
881 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700882 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700883};
884
Rich Lanee9c37db2013-06-21 18:30:24 -0700885struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700886 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700887 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700888 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700889 uint64_t metadata;
890 uint64_t metadata_mask;
891};
892
Rich Lanee9c37db2013-06-21 18:30:24 -0700893struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700894 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700896 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700897 list(of_action_t) actions;
898};
899
Rich Lanee9c37db2013-06-21 18:30:24 -0700900struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700901 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700902 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700903 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700904 list(of_action_t) actions;
905};
906
Rich Lanee9c37db2013-06-21 18:30:24 -0700907struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700908 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700910 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700911};
912
Rich Lanee9c37db2013-06-21 18:30:24 -0700913struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700914 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700915 uint16_t len;
916 uint32_t meter_id;
917};
918
Rich Lanee9c37db2013-06-21 18:30:24 -0700919struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700920 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700921 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700922 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700923 of_octets_t data;
924};
925
Rich Lanee9c37db2013-06-21 18:30:24 -0700926struct of_flow_mod : of_header {
927 uint8_t version;
928 uint8_t type == 14;
929 uint16_t length;
930 uint32_t xid;
931 uint64_t cookie;
932 uint64_t cookie_mask;
933 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700934 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700935 uint16_t idle_timeout;
936 uint16_t hard_timeout;
937 uint16_t priority;
938 uint32_t buffer_id;
939 of_port_no_t out_port;
940 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700941 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700942 pad(2);
943 of_match_t match;
944 list(of_instruction_t) instructions;
945};
946
947struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700948 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700949 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700950 uint16_t length;
951 uint32_t xid;
952 uint64_t cookie;
953 uint64_t cookie_mask;
954 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700955 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700956 uint16_t idle_timeout;
957 uint16_t hard_timeout;
958 uint16_t priority;
959 uint32_t buffer_id;
960 of_port_no_t out_port;
961 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700962 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700963 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700964 of_match_t match;
965 list(of_instruction_t) instructions;
966};
967
Rich Lanee9c37db2013-06-21 18:30:24 -0700968struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700969 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700970 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700971 uint16_t length;
972 uint32_t xid;
973 uint64_t cookie;
974 uint64_t cookie_mask;
975 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700976 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint16_t idle_timeout;
978 uint16_t hard_timeout;
979 uint16_t priority;
980 uint32_t buffer_id;
981 of_port_no_t out_port;
982 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700983 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700984 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700985 of_match_t match;
986 list(of_instruction_t) instructions;
987};
988
Rich Lanee9c37db2013-06-21 18:30:24 -0700989struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700990 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700991 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700992 uint16_t length;
993 uint32_t xid;
994 uint64_t cookie;
995 uint64_t cookie_mask;
996 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700997 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700998 uint16_t idle_timeout;
999 uint16_t hard_timeout;
1000 uint16_t priority;
1001 uint32_t buffer_id;
1002 of_port_no_t out_port;
1003 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001004 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001005 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001006 of_match_t match;
1007 list(of_instruction_t) instructions;
1008};
1009
Rich Lanee9c37db2013-06-21 18:30:24 -07001010struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001011 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001012 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001013 uint16_t length;
1014 uint32_t xid;
1015 uint64_t cookie;
1016 uint64_t cookie_mask;
1017 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001018 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001019 uint16_t idle_timeout;
1020 uint16_t hard_timeout;
1021 uint16_t priority;
1022 uint32_t buffer_id;
1023 of_port_no_t out_port;
1024 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001025 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001026 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001027 of_match_t match;
1028 list(of_instruction_t) instructions;
1029};
1030
Rich Lanee9c37db2013-06-21 18:30:24 -07001031struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001032 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001033 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001034 uint16_t length;
1035 uint32_t xid;
1036 uint64_t cookie;
1037 uint64_t cookie_mask;
1038 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001039 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001040 uint16_t idle_timeout;
1041 uint16_t hard_timeout;
1042 uint16_t priority;
1043 uint32_t buffer_id;
1044 of_port_no_t out_port;
1045 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001046 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001047 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001048 of_match_t match;
1049 list(of_instruction_t) instructions;
1050};
1051
Rich Lane68ae4d72013-05-09 10:55:19 -07001052struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001053 uint16_t len;
1054 uint16_t weight;
1055 of_port_no_t watch_port;
1056 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001057 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001058 list(of_action_t) actions;
1059};
1060
Rich Lanee9c37db2013-06-21 18:30:24 -07001061struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001062 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001063 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001064 uint16_t length;
1065 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -08001066 enum ofp_group_mod_command command == ?;
1067 enum ofp_group_type group_type;
1068 pad(1);
1069 uint32_t group_id;
1070 list(of_bucket_t) buckets;
1071};
1072
1073struct of_group_add : of_group_mod {
1074 uint8_t version;
1075 uint8_t type == 15;
1076 uint16_t length;
1077 uint32_t xid;
1078 enum ofp_group_mod_command command == 0;
1079 enum ofp_group_type group_type;
1080 pad(1);
1081 uint32_t group_id;
1082 list(of_bucket_t) buckets;
1083};
1084
1085struct of_group_modify : of_group_mod {
1086 uint8_t version;
1087 uint8_t type == 15;
1088 uint16_t length;
1089 uint32_t xid;
1090 enum ofp_group_mod_command command == 1;
1091 enum ofp_group_type group_type;
1092 pad(1);
1093 uint32_t group_id;
1094 list(of_bucket_t) buckets;
1095};
1096
1097struct of_group_delete : of_group_mod {
1098 uint8_t version;
1099 uint8_t type == 15;
1100 uint16_t length;
1101 uint32_t xid;
1102 enum ofp_group_mod_command command == 2;
1103 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001104 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001105 uint32_t group_id;
1106 list(of_bucket_t) buckets;
1107};
1108
Rich Lanee9c37db2013-06-21 18:30:24 -07001109struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001110 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001111 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001112 uint16_t length;
1113 uint32_t xid;
1114 uint32_t buffer_id;
1115 of_port_no_t in_port;
1116 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001117 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001118 list(of_action_t) actions;
1119 of_octets_t data;
1120};
1121
Rich Lanee9c37db2013-06-21 18:30:24 -07001122struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001123 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001124 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001125 uint16_t length;
1126 uint32_t xid;
1127 uint32_t buffer_id;
1128 uint16_t total_len;
1129 uint8_t reason;
1130 uint8_t table_id;
1131 uint64_t cookie;
1132 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001133 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001134 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1135};
1136
Rich Lanee9c37db2013-06-21 18:30:24 -07001137struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001138 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001139 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001140 uint16_t length;
1141 uint32_t xid;
1142 uint64_t cookie;
1143 uint16_t priority;
1144 uint8_t reason;
1145 uint8_t table_id;
1146 uint32_t duration_sec;
1147 uint32_t duration_nsec;
1148 uint16_t idle_timeout;
1149 uint16_t hard_timeout;
1150 uint64_t packet_count;
1151 uint64_t byte_count;
1152 of_match_t match;
1153};
1154
Rich Lane68ae4d72013-05-09 10:55:19 -07001155struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001156 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001157 uint16_t len;
1158// uint32_t rate; // These are excluded b/c this is the header
1159// uint32_t burst_size; // These are excluded b/c this is the header
1160};
1161
Rich Lanee9c37db2013-06-21 18:30:24 -07001162struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001163 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001164 uint16_t len;
1165 uint32_t rate;
1166 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001167 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001168};
1169
Rich Lanee9c37db2013-06-21 18:30:24 -07001170struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001171 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001172 uint16_t len;
1173 uint32_t rate;
1174 uint32_t burst_size;
1175 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001176 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001177};
1178
Rich Lanee9c37db2013-06-21 18:30:24 -07001179struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001180 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001181 uint16_t len;
1182 uint32_t rate;
1183 uint32_t burst_size;
1184 uint32_t experimenter;
1185};
1186
Rich Lanee9c37db2013-06-21 18:30:24 -07001187struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001188 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001189 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001190 uint16_t length;
1191 uint32_t xid;
1192 uint16_t command;
1193 uint16_t flags;
1194 uint32_t meter_id;
1195 list(of_meter_band_t) meters;
1196};
1197
Rich Lanee9c37db2013-06-21 18:30:24 -07001198struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001199 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001200 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001201 uint16_t length;
1202 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001203 uint16_t err_type == ?;
1204};
1205
1206struct of_hello_failed_error_msg : of_error_msg {
1207 uint8_t version;
1208 uint8_t type == 1;
1209 uint16_t length;
1210 uint32_t xid;
1211 uint16_t err_type == 0;
1212 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001213 of_octets_t data;
1214};
1215
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001216struct of_bad_request_error_msg : of_error_msg {
1217 uint8_t version;
1218 uint8_t type == 1;
1219 uint16_t length;
1220 uint32_t xid;
1221 uint16_t err_type == 1;
1222 enum ofp_bad_request_code code;
1223 of_octets_t data;
1224};
1225
1226struct of_bad_action_error_msg : of_error_msg {
1227 uint8_t version;
1228 uint8_t type == 1;
1229 uint16_t length;
1230 uint32_t xid;
1231 uint16_t err_type == 2;
1232 enum ofp_bad_action_code code;
1233 of_octets_t data;
1234};
1235
1236struct of_bad_instruction_error_msg : of_error_msg {
1237 uint8_t version;
1238 uint8_t type == 1;
1239 uint16_t length;
1240 uint32_t xid;
1241 uint16_t err_type == 3;
1242 enum ofp_bad_instruction_code code;
1243 of_octets_t data;
1244};
1245
1246struct of_bad_match_error_msg : of_error_msg {
1247 uint8_t version;
1248 uint8_t type == 1;
1249 uint16_t length;
1250 uint32_t xid;
1251 uint16_t err_type == 4;
1252 enum ofp_bad_match_code code;
1253 of_octets_t data;
1254};
1255
1256struct of_flow_mod_failed_error_msg : of_error_msg {
1257 uint8_t version;
1258 uint8_t type == 1;
1259 uint16_t length;
1260 uint32_t xid;
1261 uint16_t err_type == 5;
1262 enum ofp_flow_mod_failed_code code;
1263 of_octets_t data;
1264};
1265
1266struct of_group_mod_failed_error_msg : of_error_msg {
1267 uint8_t version;
1268 uint8_t type == 1;
1269 uint16_t length;
1270 uint32_t xid;
1271 uint16_t err_type == 6;
1272 enum ofp_group_mod_failed_code code;
1273 of_octets_t data;
1274};
1275
1276struct of_port_mod_failed_error_msg : of_error_msg {
1277 uint8_t version;
1278 uint8_t type == 1;
1279 uint16_t length;
1280 uint32_t xid;
1281 uint16_t err_type == 7;
1282 enum ofp_port_mod_failed_code code;
1283 of_octets_t data;
1284};
1285
1286struct of_table_mod_failed_error_msg : of_error_msg {
1287 uint8_t version;
1288 uint8_t type == 1;
1289 uint16_t length;
1290 uint32_t xid;
1291 uint16_t err_type == 8;
1292 enum ofp_table_mod_failed_code code;
1293 of_octets_t data;
1294};
1295
1296struct of_queue_op_failed_error_msg : of_error_msg {
1297 uint8_t version;
1298 uint8_t type == 1;
1299 uint16_t length;
1300 uint32_t xid;
1301 uint16_t err_type == 9;
1302 enum ofp_queue_op_failed_code code;
1303 of_octets_t data;
1304};
1305
1306struct of_switch_config_failed_error_msg : of_error_msg {
1307 uint8_t version;
1308 uint8_t type == 1;
1309 uint16_t length;
1310 uint32_t xid;
1311 uint16_t err_type == 10;
1312 enum ofp_switch_config_failed_code code;
1313 of_octets_t data;
1314};
1315
1316struct of_role_request_failed_error_msg : of_error_msg {
1317 uint8_t version;
1318 uint8_t type == 1;
1319 uint16_t length;
1320 uint32_t xid;
1321 uint16_t err_type == 11;
1322 enum ofp_role_request_failed_code code;
1323 of_octets_t data;
1324};
1325
1326struct of_meter_mod_failed_error_msg : of_error_msg {
1327 uint8_t version;
1328 uint8_t type == 1;
1329 uint16_t length;
1330 uint32_t xid;
1331 uint16_t err_type == 12;
1332 enum ofp_meter_mod_failed_code code;
1333 of_octets_t data;
1334};
1335
1336struct of_table_features_failed_error_msg : of_error_msg {
1337 uint8_t version;
1338 uint8_t type == 1;
1339 uint16_t length;
1340 uint32_t xid;
1341 uint16_t err_type == 13;
1342 enum ofp_table_features_failed_code code;
1343 of_octets_t data;
1344};
1345
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001346struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001347 uint8_t version;
1348 uint8_t type == 1;
1349 uint16_t length;
1350 uint32_t xid;
1351 uint16_t err_type == 0xffff;
1352 uint16_t subtype;
1353 uint32_t experimenter;
1354 of_octets_t data;
1355};
Rich Lanea06d0c32013-03-25 08:52:03 -07001356
1357// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1358
Rich Lane68ae4d72013-05-09 10:55:19 -07001359struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001360 uint16_t length;
1361 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001362 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001363 uint32_t duration_sec;
1364 uint32_t duration_nsec;
1365 uint16_t priority;
1366 uint16_t idle_timeout;
1367 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001368 uint16_t flags;
1369 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001370 uint64_t cookie;
1371 uint64_t packet_count;
1372 uint64_t byte_count;
1373 of_match_t match;
1374 list(of_instruction_t) instructions;
1375};
1376
1377
Rich Lane68ae4d72013-05-09 10:55:19 -07001378struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001379 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001380 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001381 uint32_t active_count;
1382 uint64_t lookup_count;
1383 uint64_t matched_count;
1384};
1385
Rich Lane68ae4d72013-05-09 10:55:19 -07001386struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001387 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001388 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 uint64_t rx_packets;
1390 uint64_t tx_packets;
1391 uint64_t rx_bytes;
1392 uint64_t tx_bytes;
1393 uint64_t rx_dropped;
1394 uint64_t tx_dropped;
1395 uint64_t rx_errors;
1396 uint64_t tx_errors;
1397 uint64_t rx_frame_err;
1398 uint64_t rx_over_err;
1399 uint64_t rx_crc_err;
1400 uint64_t collisions;
1401 uint32_t duration_sec;
1402 uint32_t duration_nsec;
1403};
1404
Rich Lane68ae4d72013-05-09 10:55:19 -07001405struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001406 of_port_no_t port_no;
1407 uint32_t queue_id;
1408 uint64_t tx_bytes;
1409 uint64_t tx_packets;
1410 uint64_t tx_errors;
1411 uint32_t duration_sec;
1412 uint32_t duration_nsec;
1413};
1414
Rich Lane68ae4d72013-05-09 10:55:19 -07001415struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001416 uint64_t packet_count;
1417 uint64_t byte_count;
1418};
1419
Rich Lane68ae4d72013-05-09 10:55:19 -07001420struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001421 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001422 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001423 uint32_t group_id;
1424 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001425 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001426 uint64_t packet_count;
1427 uint64_t byte_count;
1428 uint32_t duration_sec;
1429 uint32_t duration_nsec;
1430 list(of_bucket_counter_t) bucket_stats;
1431};
1432
Rich Lane68ae4d72013-05-09 10:55:19 -07001433struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001434 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001435 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001436 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 uint32_t group_id;
1438 list(of_bucket_t) buckets;
1439};
1440
1441// STATS:
1442// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1443
Rich Lanee9c37db2013-06-21 18:30:24 -07001444struct of_stats_request : of_header {
1445 uint8_t version;
1446 uint8_t type == 18;
1447 uint16_t length;
1448 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001449 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001450 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001451 pad(4);
1452};
1453
1454struct of_stats_reply : of_header {
1455 uint8_t version;
1456 uint8_t type == 19;
1457 uint16_t length;
1458 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001459 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001460 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001461 pad(4);
1462};
1463
1464struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001465 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001466 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001467 uint16_t length;
1468 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001469 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001470 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001471 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001472};
1473
Rich Lanee9c37db2013-06-21 18:30:24 -07001474struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001475 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001476 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001477 uint16_t length;
1478 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001479 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001480 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001481 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001482 of_desc_str_t mfr_desc;
1483 of_desc_str_t hw_desc;
1484 of_desc_str_t sw_desc;
1485 of_serial_num_t serial_num;
1486 of_desc_str_t dp_desc;
1487};
1488
Rich Lanee9c37db2013-06-21 18:30:24 -07001489struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001491 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001492 uint16_t length;
1493 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001494 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001495 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001496 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001497 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001498 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001499 of_port_no_t out_port;
1500 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001501 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001502 uint64_t cookie;
1503 uint64_t cookie_mask;
1504 of_match_t match;
1505};
1506
Rich Lanee9c37db2013-06-21 18:30:24 -07001507struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001508 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001509 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001510 uint16_t length;
1511 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001512 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001513 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001514 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001515 list(of_flow_stats_entry_t) entries;
1516};
1517
Rich Lanee9c37db2013-06-21 18:30:24 -07001518struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001519 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001520 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001521 uint16_t length;
1522 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001523 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001524 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001525 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001526 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001527 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001528 of_port_no_t out_port;
1529 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001530 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001531 uint64_t cookie;
1532 uint64_t cookie_mask;
1533 of_match_t match;
1534};
1535
Rich Lanee9c37db2013-06-21 18:30:24 -07001536struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001537 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001538 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001539 uint16_t length;
1540 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001541 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001542 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001543 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001544 uint64_t packet_count;
1545 uint64_t byte_count;
1546 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001547 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001548};
1549
Rich Lanee9c37db2013-06-21 18:30:24 -07001550struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001551 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001552 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001553 uint16_t length;
1554 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001555 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001556 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001557 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001558};
1559
Rich Lanee9c37db2013-06-21 18:30:24 -07001560struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001561 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001562 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001563 uint16_t length;
1564 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001565 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001566 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001567 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001568 list(of_table_stats_entry_t) entries;
1569};
1570
Rich Lane6d434332013-11-13 09:23:10 -08001571struct of_experimenter_stats_request : of_stats_request {
1572 uint8_t version;
1573 uint8_t type == 18;
1574 uint16_t length;
1575 uint32_t xid;
1576 uint16_t stats_type == 0xffff;
1577 enum ofp_stats_request_flags flags;
1578 pad(4);
1579 uint32_t experimenter == ?;
1580 uint32_t subtype;
1581};
1582
1583struct of_experimenter_stats_reply : of_stats_reply {
1584 uint8_t version;
1585 uint8_t type == 19;
1586 uint16_t length;
1587 uint32_t xid;
1588 uint16_t stats_type == 0xffff;
1589 enum ofp_stats_reply_flags flags;
1590 pad(4);
1591 uint32_t experimenter == ?;
1592 uint32_t subtype;
1593};
1594
Rich Lanea06d0c32013-03-25 08:52:03 -07001595// FIXME: These are padded to 8 byte align beyond the length indicated
1596
Rich Lane68ae4d72013-05-09 10:55:19 -07001597struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001598 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001599 uint16_t length;
1600};
1601
Rich Lanee9c37db2013-06-21 18:30:24 -07001602struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001603 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001604 uint16_t length;
1605 // FIXME Check if instruction_t is right for ids here
1606 list(of_instruction_t) instruction_ids;
1607};
1608
Rich Lanee9c37db2013-06-21 18:30:24 -07001609struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001610 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001611 uint16_t length;
1612 list(of_instruction_t) instruction_ids;
1613};
1614
Rich Lanee9c37db2013-06-21 18:30:24 -07001615struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001616 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001617 uint16_t length;
1618 list(of_uint8_t) next_table_ids;
1619};
1620
Rich Lanee9c37db2013-06-21 18:30:24 -07001621struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001622 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001623 uint16_t length;
1624 list(of_uint8_t) next_table_ids;
1625};
1626
Rich Lanee9c37db2013-06-21 18:30:24 -07001627struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001628 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001629 uint16_t length;
1630 list(of_action_id_t) action_ids;
1631};
1632
Rich Lanee9c37db2013-06-21 18:30:24 -07001633struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001634 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001635 uint16_t length;
1636 list(of_action_id_t) action_ids;
1637};
1638
Rich Lanee9c37db2013-06-21 18:30:24 -07001639struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001640 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001641 uint16_t length;
1642 list(of_action_id_t) action_ids;
1643};
1644
Rich Lanee9c37db2013-06-21 18:30:24 -07001645struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001646 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001647 uint16_t length;
1648 list(of_action_id_t) action_ids;
1649};
1650
Rich Lanee9c37db2013-06-21 18:30:24 -07001651struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001652 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001653 uint16_t length;
1654 list(of_uint32_t) oxm_ids;
1655};
1656
Rich Lanee9c37db2013-06-21 18:30:24 -07001657struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001658 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001659 uint16_t length;
1660 list(of_uint32_t) oxm_ids;
1661};
1662
Rich Lanee9c37db2013-06-21 18:30:24 -07001663struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001664 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001665 uint16_t length;
1666 list(of_uint32_t) oxm_ids;
1667};
1668
Rich Lanee9c37db2013-06-21 18:30:24 -07001669struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001670 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001671 uint16_t length;
1672 list(of_uint32_t) oxm_ids;
1673};
1674
Rich Lanee9c37db2013-06-21 18:30:24 -07001675struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001676 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001677 uint16_t length;
1678 list(of_uint32_t) oxm_ids;
1679};
1680
Rich Lanee9c37db2013-06-21 18:30:24 -07001681struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001682 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001683 uint16_t length;
1684 list(of_uint32_t) oxm_ids;
1685};
1686
Rich Lanee9c37db2013-06-21 18:30:24 -07001687struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001688 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001689 uint16_t length;
1690 uint32_t experimenter;
1691 uint32_t subtype;
1692 of_octets_t experimenter_data;
1693};
1694
1695// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001696// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001697// uint16_t type;
1698// uint16_t length;
1699// uint32_t experimenter;
1700// uint32_t subtype;
1701// of_octets_t experimenter_data;
1702// };
1703
Rich Lane68ae4d72013-05-09 10:55:19 -07001704struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001705 uint16_t length;
1706 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001707 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001708 of_table_name_t name;
1709 uint64_t metadata_match;
1710 uint64_t metadata_write;
1711 uint32_t config;
1712 uint32_t max_entries;
1713 list(of_table_feature_prop_t) properties;
1714};
1715
Rich Lane68ae4d72013-05-09 10:55:19 -07001716struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001717 uint32_t max_meter;
1718 uint32_t band_types;
1719 uint32_t capabilities;
1720 uint8_t max_bands;
1721 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001722 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001723};
1724
Rich Lanee9c37db2013-06-21 18:30:24 -07001725struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001726 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001727 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001728 uint16_t length;
1729 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001730 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001731 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001732 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001733 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001734 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001735};
1736
Rich Lanee9c37db2013-06-21 18:30:24 -07001737struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001738 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001739 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001740 uint16_t length;
1741 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001742 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001743 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001744 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001745 list(of_port_stats_entry_t) entries;
1746};
1747
Rich Lanee9c37db2013-06-21 18:30:24 -07001748struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001749 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001750 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001751 uint16_t length;
1752 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001753 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001754 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001755 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001756 of_port_no_t port_no;
1757 uint32_t queue_id;
1758};
1759
Rich Lanee9c37db2013-06-21 18:30:24 -07001760struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001761 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001762 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001763 uint16_t length;
1764 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001765 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001766 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001767 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001768 list(of_queue_stats_entry_t) entries;
1769};
1770
Rich Lanee9c37db2013-06-21 18:30:24 -07001771struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001772 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001773 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001774 uint16_t length;
1775 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001776 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001777 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001778 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001779 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001780 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001781};
1782
Rich Lanee9c37db2013-06-21 18:30:24 -07001783struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001784 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001785 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001786 uint16_t length;
1787 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001788 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001789 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001790 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001791 list(of_group_stats_entry_t) entries;
1792};
1793
Rich Lanee9c37db2013-06-21 18:30:24 -07001794struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001795 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001796 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001797 uint16_t length;
1798 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001799 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001800 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001801 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001802};
1803
Rich Lanee9c37db2013-06-21 18:30:24 -07001804struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001805 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001806 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001807 uint16_t length;
1808 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001809 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001810 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001811 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001812 list(of_group_desc_stats_entry_t) entries;
1813};
1814
Rich Lanee9c37db2013-06-21 18:30:24 -07001815struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001816 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001817 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001818 uint16_t length;
1819 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001820 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001821 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001822 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001823};
1824
Rich Lanee9c37db2013-06-21 18:30:24 -07001825struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001826 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001827 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001828 uint16_t length;
1829 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001830 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001831 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001832 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001833 uint32_t types;
1834 uint32_t capabilities;
1835 uint32_t max_groups_all;
1836 uint32_t max_groups_select;
1837 uint32_t max_groups_indirect;
1838 uint32_t max_groups_ff;
1839 uint32_t actions_all;
1840 uint32_t actions_select;
1841 uint32_t actions_indirect;
1842 uint32_t actions_ff;
1843};
1844
Rich Lanee9c37db2013-06-21 18:30:24 -07001845struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001846 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001847 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001848 uint16_t length;
1849 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001850 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001851 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001852 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001853 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001854 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001855};
1856
Rich Lanee9c37db2013-06-21 18:30:24 -07001857struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001858 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001859 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001860 uint16_t length;
1861 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001862 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001863 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001864 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001865 list(of_meter_stats_t) entries;
1866};
1867
Rich Lanee9c37db2013-06-21 18:30:24 -07001868struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001869 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001870 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001871 uint16_t length;
1872 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001873 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001874 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001875 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001876 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001877 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001878};
1879
Rich Lanee9c37db2013-06-21 18:30:24 -07001880struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001881 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001882 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001883 uint16_t length;
1884 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001885 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001886 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001887 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001888 list(of_meter_band_t) entries;
1889};
1890
1891// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001892struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001893 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001894 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001895 uint16_t length;
1896 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001897 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001898 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001899 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001900};
1901
1902// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001903struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001904 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001905 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001906 uint16_t length;
1907 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001908 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001909 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001910 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001911 of_meter_features_t features;
1912};
1913
1914// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001915struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001916 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001917 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001918 uint16_t length;
1919 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001920 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001921 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001922 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001923 list(of_table_features_t) entries;
1924};
1925
1926// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001927struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001928 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001929 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001930 uint16_t length;
1931 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001932 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001933 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001934 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001935 list(of_table_features_t) entries;
1936};
1937
1938// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001939struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001940 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001941 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001942 uint16_t length;
1943 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001944 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001945 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001946 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001947};
1948
1949// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001950struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001951 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001952 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001953 uint16_t length;
1954 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001955 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001956 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001957 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001958 list(of_port_desc_t) entries;
1959};
1960
Rich Lane68ae4d72013-05-09 10:55:19 -07001961struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001962 uint64_t packet_band_count;
1963 uint64_t byte_band_count;
1964};
1965
Rich Lane68ae4d72013-05-09 10:55:19 -07001966struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001967 uint32_t meter_id;
1968 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001969 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001970 uint32_t flow_count;
1971 uint64_t packet_in_count;
1972 uint64_t byte_in_count;
1973 uint32_t duration_sec;
1974 uint32_t duration_nsec;
1975 list(of_meter_band_stats_t) band_stats;
1976};
1977
Rich Lane68ae4d72013-05-09 10:55:19 -07001978struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001979 uint16_t length;
1980 uint16_t flags;
1981 uint32_t meter_id;
1982 list(of_meter_band_t) entries;
1983};
1984
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001985struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001986 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001987 uint32_t subtype;
1988};
1989
1990// END OF STATS OBJECTS
1991
Rich Lane68ae4d72013-05-09 10:55:19 -07001992struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001993 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001994 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001995 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001996};
1997
Rich Lanee9c37db2013-06-21 18:30:24 -07001998struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001999 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07002000 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002001 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002002 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002003 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002004};
2005
Rich Lanee9c37db2013-06-21 18:30:24 -07002006struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002007 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07002008 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002009 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002010 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002011 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002012};
2013
Rich Lanee9c37db2013-06-21 18:30:24 -07002014struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002015 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07002016 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002017 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07002018 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002019 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002020 of_octets_t data;
2021};
2022
Rich Lane68ae4d72013-05-09 10:55:19 -07002023struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07002024 uint32_t queue_id;
2025 of_port_no_t port;
2026 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002027 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002028 list(of_queue_prop_t) properties;
2029};
2030
Rich Lanee9c37db2013-06-21 18:30:24 -07002031struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002032 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002033 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07002034 uint16_t length;
2035 uint32_t xid;
2036 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002037 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002038};
2039
Rich Lanee9c37db2013-06-21 18:30:24 -07002040struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002041 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002042 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07002043 uint16_t length;
2044 uint32_t xid;
2045 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002046 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002047 list(of_packet_queue_t) queues;
2048};
2049
Rich Lanee9c37db2013-06-21 18:30:24 -07002050struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002051 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002052 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07002053 uint16_t length;
2054 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002055 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002056 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002057 uint64_t generation_id;
2058};
2059
Rich Lanee9c37db2013-06-21 18:30:24 -07002060struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002061 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002062 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07002063 uint16_t length;
2064 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002065 enum ofp_controller_role role;
2066 pad(4);
2067 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07002068};
2069
2070////////////////////////////////////////////////////////////////
2071// FIXME understand async; where do bitmasks live?
2072// Determine bitmap type for masks below.
2073// DOCUMENT masks where uint32_t[0] is interest for equal/master
2074// while uint32_t[1] is interest for slave
2075////////////////////////////////////////////////////////////////
2076
Rich Lanee9c37db2013-06-21 18:30:24 -07002077struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002078 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002079 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002080 uint16_t length;
2081 uint32_t xid;
2082 uint32_t packet_in_mask_equal_master;
2083 uint32_t packet_in_mask_slave;
2084 uint32_t port_status_mask_equal_master;
2085 uint32_t port_status_mask_slave;
2086 uint32_t flow_removed_mask_equal_master;
2087 uint32_t flow_removed_mask_slave;
2088};
2089
Rich Lanee9c37db2013-06-21 18:30:24 -07002090struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002091 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002092 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002093 uint16_t length;
2094 uint32_t xid;
2095 uint32_t packet_in_mask_equal_master;
2096 uint32_t packet_in_mask_slave;
2097 uint32_t port_status_mask_equal_master;
2098 uint32_t port_status_mask_slave;
2099 uint32_t flow_removed_mask_equal_master;
2100 uint32_t flow_removed_mask_slave;
2101};
2102
Rich Lanee9c37db2013-06-21 18:30:24 -07002103struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002104 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002105 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002106 uint16_t length;
2107 uint32_t xid;
2108 uint32_t packet_in_mask_equal_master;
2109 uint32_t packet_in_mask_slave;
2110 uint32_t port_status_mask_equal_master;
2111 uint32_t port_status_mask_slave;
2112 uint32_t flow_removed_mask_equal_master;
2113 uint32_t flow_removed_mask_slave;
2114};