blob: 2994fba8bb7301a9edbea293749e8ee42320c7be [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,
Vishnu Emmadia219b512014-10-28 10:50:08 -0700137 OFPPC_BSN_BREAKOUT_ENABLED = 0x40000000,
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,
Vishnu Emmadi21ad5202014-10-28 17:29:59 -0700164 OFPPF_BSN_BREAKOUT_CAPABLE = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700165};
166
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700167enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700168 OFPPR_ADD = 0,
169 OFPPR_DELETE = 1,
170 OFPPR_MODIFY = 2,
171};
172
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700173enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700174 OFPMT_STANDARD = 0,
175 OFPMT_OXM = 1,
176};
177
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700178enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700179 OFPXMC_NXM_0 = 0,
180 OFPXMC_NXM_1 = 1,
181 OFPXMC_OPENFLOW_BASIC = 0x8000,
182 OFPXMC_EXPERIMENTER = 0xffff,
183};
184
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700185enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700186 OFPVID_NONE = 0,
187 OFPVID_PRESENT = 0x1000,
188};
189
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700190// FIXME: OF spec specified this as '9' bits, implicitly adding
191// to full byte
192enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700193 OFPIEH_NONEXT = 0x1,
194 OFPIEH_ESP = 0x2,
195 OFPIEH_AUTH = 0x4,
196 OFPIEH_DEST = 0x8,
197 OFPIEH_FRAG = 0x10,
198 OFPIEH_ROUTER = 0x20,
199 OFPIEH_HOP = 0x40,
200 OFPIEH_UNREP = 0x80,
201 OFPIEH_UNSEQ = 0x100,
202};
203
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700204enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700205 OFPAT_OUTPUT = 0,
206 OFPAT_COPY_TTL_OUT = 0xb,
207 OFPAT_COPY_TTL_IN = 0xc,
208 OFPAT_SET_MPLS_TTL = 0xf,
209 OFPAT_DEC_MPLS_TTL = 0x10,
210 OFPAT_PUSH_VLAN = 0x11,
211 OFPAT_POP_VLAN = 0x12,
212 OFPAT_PUSH_MPLS = 0x13,
213 OFPAT_POP_MPLS = 0x14,
214 OFPAT_SET_QUEUE = 0x15,
215 OFPAT_GROUP = 0x16,
216 OFPAT_SET_NW_TTL = 0x17,
217 OFPAT_DEC_NW_TTL = 0x18,
218 OFPAT_SET_FIELD = 0x19,
219 OFPAT_PUSH_PBB = 0x1a,
220 OFPAT_POP_PBB = 0x1b,
221 OFPAT_EXPERIMENTER = 0xffff,
222};
223
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700224enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700225 OFPCML_MAX = 0xffe5,
226 OFPCML_NO_BUFFER = 0xffff,
227};
228
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700229enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700230 OFPIT_GOTO_TABLE = 0x1,
231 OFPIT_WRITE_METADATA = 0x2,
232 OFPIT_WRITE_ACTIONS = 0x3,
233 OFPIT_APPLY_ACTIONS = 0x4,
234 OFPIT_CLEAR_ACTIONS = 0x5,
235 OFPIT_METER = 0x6,
236 OFPIT_EXPERIMENTER = 0xffff,
237};
238
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700239enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700240 OFPFC_ADD = 0,
241 OFPFC_MODIFY = 1,
242 OFPFC_MODIFY_STRICT = 2,
243 OFPFC_DELETE = 3,
244 OFPFC_DELETE_STRICT = 4,
245};
246
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700247enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700248 OFPFF_SEND_FLOW_REM = 0x1,
249 OFPFF_CHECK_OVERLAP = 0x2,
250 OFPFF_RESET_COUNTS = 0x4,
251 OFPFF_NO_PKT_COUNTS = 0x8,
252 OFPFF_NO_BYT_COUNTS = 0x10,
Rich Lanef86f39a2013-10-07 18:04:11 -0700253
254 /* Non-standard, enabled by an experimenter message */
255 /* See the bsn_flow_idle input file */
256 OFPFF_BSN_SEND_IDLE = 0x80,
Rich Lane5d33a622013-04-08 17:33:11 -0700257};
258
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700259enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700260 OFPG_MAX = 0xffffff00,
261 OFPG_ALL = 0xfffffffc,
262 OFPG_ANY = 0xffffffff,
263};
264
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700265enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700266 OFPGC_ADD = 0,
267 OFPGC_MODIFY = 1,
268 OFPGC_DELETE = 2,
269};
270
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700271enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700272 OFPGT_ALL = 0,
273 OFPGT_SELECT = 1,
274 OFPGT_INDIRECT = 2,
275 OFPGT_FF = 3,
276};
277
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700278enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700279 OFPR_NO_MATCH = 0,
280 OFPR_ACTION = 1,
281 OFPR_INVALID_TTL = 2,
Andreas Wundsam7723c562013-10-23 16:27:40 -0700282
283 // non-standard BSN extensions. OF does not have a standard-conformant
284 // way to extend the set of packet_in reasons
285 OFPR_BSN_NEW_HOST = 128,
286 OFPR_BSN_STATION_MOVE = 129,
287 OFPR_BSN_BAD_VLAN = 130,
288 OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131,
Rich Lanee13d7842013-12-21 14:39:25 -0800289 OFPR_BSN_NO_ROUTE = 132,
Harshmeet Singh192b1b02013-12-14 07:46:24 -0800290 OFPR_BSN_ICMP_ECHO_REQUEST = 133,
291 OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134,
292 OFPR_BSN_DEST_HOST_UNREACHABLE = 135,
293 OFPR_BSN_DEST_PORT_UNREACHABLE = 136,
294 OFPR_BSN_FRAGMENTATION_REQUIRED = 137,
Rich Lanec1c6df62014-01-24 17:18:00 -0800295 OFPR_BSN_ARP = 139,
Duc Pham9d29ed02014-01-30 16:23:16 -0800296 OFPR_BSN_DHCP = 140,
xinwud847c692014-02-20 18:37:34 -0800297 OFPR_BSN_DEBUG = 141,
Rich Laneb2de0052014-03-19 16:57:46 -0700298 OFPR_BSN_PACKET_OF_DEATH = 142,
Rich Lane5d33a622013-04-08 17:33:11 -0700299};
300
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700301enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700302 OFPRR_IDLE_TIMEOUT = 0,
303 OFPRR_HARD_TIMEOUT = 1,
304 OFPRR_DELETE = 2,
305 OFPRR_GROUP_DELETE = 3,
306};
307
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700308enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700309 OFPM_MAX = 0xffff0000,
310 OFPM_SLOWPATH = 0xfffffffd,
311 OFPM_CONTROLLER = 0xfffffffe,
312 OFPM_ALL = 0xffffffff,
313};
314
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700315enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700316 OFPMBT_DROP = 0x1,
317 OFPMBT_DSCP_REMARK = 0x2,
318 OFPMBT_EXPERIMENTER = 0xffff,
319};
320
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700321enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700322 OFPMC_ADD = 0,
323 OFPMC_MODIFY = 1,
324 OFPMC_DELETE = 2,
325};
326
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700327enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700328 OFPMF_KBPS = 0x1,
329 OFPMF_PKTPS = 0x2,
330 OFPMF_BURST = 0x4,
331 OFPMF_STATS = 0x8,
332};
333
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700334enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700335 OFPET_HELLO_FAILED = 0,
336 OFPET_BAD_REQUEST = 1,
337 OFPET_BAD_ACTION = 2,
338 OFPET_BAD_INSTRUCTION = 3,
339 OFPET_BAD_MATCH = 4,
340 OFPET_FLOW_MOD_FAILED = 5,
341 OFPET_GROUP_MOD_FAILED = 6,
342 OFPET_PORT_MOD_FAILED = 7,
343 OFPET_TABLE_MOD_FAILED = 8,
344 OFPET_QUEUE_OP_FAILED = 9,
345 OFPET_SWITCH_CONFIG_FAILED = 10,
346 OFPET_ROLE_REQUEST_FAILED = 11,
347 OFPET_METER_MOD_FAILED = 12,
348 OFPET_TABLE_FEATURES_FAILED = 13,
349 OFPET_EXPERIMENTER = 0xffff,
350};
351
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700352enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700353 OFPHFC_INCOMPATIBLE = 0,
354 OFPHFC_EPERM = 1,
355};
356
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700357enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700358 OFPBRC_BAD_VERSION = 0,
359 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700360 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700361 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700362 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700363 OFPBRC_EPERM = 5,
364 OFPBRC_BAD_LEN = 6,
365 OFPBRC_BUFFER_EMPTY = 7,
366 OFPBRC_BUFFER_UNKNOWN = 8,
367 OFPBRC_BAD_TABLE_ID = 9,
368 OFPBRC_IS_SLAVE = 10,
369 OFPBRC_BAD_PORT = 11,
370 OFPBRC_BAD_PACKET = 12,
371 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
372};
373
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700374enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700375 OFPBAC_BAD_TYPE = 0,
376 OFPBAC_BAD_LEN = 1,
377 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700378 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700379 OFPBAC_BAD_OUT_PORT = 4,
380 OFPBAC_BAD_ARGUMENT = 5,
381 OFPBAC_EPERM = 6,
382 OFPBAC_TOO_MANY = 7,
383 OFPBAC_BAD_QUEUE = 8,
384 OFPBAC_BAD_OUT_GROUP = 9,
385 OFPBAC_MATCH_INCONSISTENT = 10,
386 OFPBAC_UNSUPPORTED_ORDER = 11,
387 OFPBAC_BAD_TAG = 12,
388 OFPBAC_BAD_SET_TYPE = 13,
389 OFPBAC_BAD_SET_LEN = 14,
390 OFPBAC_BAD_SET_ARGUMENT = 15,
391};
392
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700393enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700394 OFPBIC_UNKNOWN_INST = 0,
395 OFPBIC_UNSUP_INST = 1,
396 OFPBIC_BAD_TABLE_ID = 2,
397 OFPBIC_UNSUP_METADATA = 3,
398 OFPBIC_UNSUP_METADATA_MASK = 4,
399 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700400 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700401 OFPBIC_BAD_LEN = 7,
402 OFPBIC_EPERM = 8,
403};
404
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700405enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700406 OFPBMC_BAD_TYPE = 0,
407 OFPBMC_BAD_LEN = 1,
408 OFPBMC_BAD_TAG = 2,
409 OFPBMC_BAD_DL_ADDR_MASK = 3,
410 OFPBMC_BAD_NW_ADDR_MASK = 4,
411 OFPBMC_BAD_WILDCARDS = 5,
412 OFPBMC_BAD_FIELD = 6,
413 OFPBMC_BAD_VALUE = 7,
414 OFPBMC_BAD_MASK = 8,
415 OFPBMC_BAD_PREREQ = 9,
416 OFPBMC_DUP_FIELD = 10,
417 OFPBMC_EPERM = 11,
418};
419
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700420enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700421 OFPFMFC_UNKNOWN = 0,
422 OFPFMFC_TABLE_FULL = 1,
423 OFPFMFC_BAD_TABLE_ID = 2,
424 OFPFMFC_OVERLAP = 3,
425 OFPFMFC_EPERM = 4,
426 OFPFMFC_BAD_TIMEOUT = 5,
427 OFPFMFC_BAD_COMMAND = 6,
428 OFPFMFC_BAD_FLAGS = 7,
429};
430
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700431enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700432 OFPGMFC_GROUP_EXISTS = 0,
433 OFPGMFC_INVALID_GROUP = 1,
434 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
435 OFPGMFC_OUT_OF_GROUPS = 3,
436 OFPGMFC_OUT_OF_BUCKETS = 4,
437 OFPGMFC_CHAINING_UNSUPPORTED = 5,
438 OFPGMFC_WATCH_UNSUPPORTED = 6,
439 OFPGMFC_LOOP = 7,
440 OFPGMFC_UNKNOWN_GROUP = 8,
441 OFPGMFC_CHAINED_GROUP = 9,
442 OFPGMFC_BAD_TYPE = 10,
443 OFPGMFC_BAD_COMMAND = 11,
444 OFPGMFC_BAD_BUCKET = 12,
445 OFPGMFC_BAD_WATCH = 13,
446 OFPGMFC_EPERM = 14,
447};
448
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700449enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700450 OFPPMFC_BAD_PORT = 0,
451 OFPPMFC_BAD_HW_ADDR = 1,
452 OFPPMFC_BAD_CONFIG = 2,
453 OFPPMFC_BAD_ADVERTISE = 3,
454 OFPPMFC_EPERM = 4,
455};
456
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700457enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700458 OFPTMFC_BAD_TABLE = 0,
459 OFPTMFC_BAD_CONFIG = 1,
460 OFPTMFC_EPERM = 2,
461};
462
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700463enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700464 OFPQOFC_BAD_PORT = 0,
465 OFPQOFC_BAD_QUEUE = 1,
466 OFPQOFC_EPERM = 2,
467};
468
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700469enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700470 OFPSCFC_BAD_FLAGS = 0,
471 OFPSCFC_BAD_LEN = 1,
472 OFPSCFC_EPERM = 2,
473};
474
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700475enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700476 OFPRRFC_STALE = 0,
477 OFPRRFC_UNSUP = 1,
478 OFPRRFC_BAD_ROLE = 2,
479};
480
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700481enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700482 OFPMMFC_UNKNOWN = 0,
483 OFPMMFC_METER_EXISTS = 1,
484 OFPMMFC_INVALID_METER = 2,
485 OFPMMFC_UNKNOWN_METER = 3,
486 OFPMMFC_BAD_COMMAND = 4,
487 OFPMMFC_BAD_FLAGS = 5,
488 OFPMMFC_BAD_RATE = 6,
489 OFPMMFC_BAD_BURST = 7,
490 OFPMMFC_BAD_BAND = 8,
491 OFPMMFC_BAD_BAND_VALUE = 9,
492 OFPMMFC_OUT_OF_METERS = 10,
493 OFPMMFC_OUT_OF_BANDS = 11,
494};
495
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700496enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700497 OFPTFFC_BAD_TABLE = 0,
498 OFPTFFC_BAD_METADATA = 1,
499 OFPTFFC_BAD_TYPE = 2,
500 OFPTFFC_BAD_LEN = 3,
501 OFPTFFC_BAD_ARGUMENT = 4,
502 OFPTFFC_EPERM = 5,
503};
504
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700505enum ofp_stats_type(wire_type=uint16_t) {
506 OFPST_DESC = 0,
507 OFPST_FLOW = 1,
508 OFPST_AGGREGATE = 2,
509 OFPST_TABLE = 3,
510 OFPST_PORT = 4,
511 OFPST_QUEUE = 5,
512 OFPST_GROUP = 6,
513 OFPST_GROUP_DESC = 7,
514 OFPST_GROUP_FEATURES = 8,
515 OFPST_METER = 9,
516 OFPST_METER_CONFIG = 10,
517 OFPST_METER_FEATURES = 11,
518 OFPST_TABLE_FEATURES = 12,
519 OFPST_PORT_DESC = 13,
520 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700521};
522
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700523enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
524 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700525};
526
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700527enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
528 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700529};
530
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700531enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700532 OFPTFPT_INSTRUCTIONS = 0,
533 OFPTFPT_INSTRUCTIONS_MISS = 1,
534 OFPTFPT_NEXT_TABLES = 2,
535 OFPTFPT_NEXT_TABLES_MISS = 3,
536 OFPTFPT_WRITE_ACTIONS = 4,
537 OFPTFPT_WRITE_ACTIONS_MISS = 5,
538 OFPTFPT_APPLY_ACTIONS = 6,
539 OFPTFPT_APPLY_ACTIONS_MISS = 7,
540 OFPTFPT_MATCH = 8,
541 OFPTFPT_WILDCARDS = 0xa,
542 OFPTFPT_WRITE_SETFIELD = 0xc,
543 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
544 OFPTFPT_APPLY_SETFIELD = 0xe,
545 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
546 OFPTFPT_EXPERIMENTER = 0xfffe,
547 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
548};
549
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700550enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700551 OFPGFC_SELECT_WEIGHT = 0x1,
552 OFPGFC_SELECT_LIVENESS = 0x2,
553 OFPGFC_CHAINING = 0x4,
554 OFPGFC_CHAINING_CHECKS = 0x8,
555};
556
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700557enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700558 OFPQT_MIN_RATE = 0x1,
559 OFPQT_MAX_RATE = 0x2,
560 OFPQT_EXPERIMENTER = 0xffff,
561};
562
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700563enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700564 OFPCR_ROLE_NOCHANGE = 0,
565 OFPCR_ROLE_EQUAL = 1,
566 OFPCR_ROLE_MASTER = 2,
567 OFPCR_ROLE_SLAVE = 3,
568};
569
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700570enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700571 OFPHET_VERSIONBITMAP = 1,
572};
573
Rich Lanee9c37db2013-06-21 18:30:24 -0700574/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700575struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700576 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700577 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700578 uint16_t length;
579 uint32_t xid;
580};
581
xinwuf08ef682013-12-05 18:29:20 -0800582struct of_uint64 {
583 uint64_t value;
584};
585
Rich Lanea06d0c32013-03-25 08:52:03 -0700586// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700587struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700588 uint32_t value;
589};
590
591// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700592struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700593 uint8_t value;
594};
595
Rich Lane68ae4d72013-05-09 10:55:19 -0700596struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700597 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700598 uint16_t length;
599};
600
Rich Lanee9c37db2013-06-21 18:30:24 -0700601struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700602 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700603 uint16_t length;
604 list(of_uint32_t) bitmaps;
605};
606
Rich Lanee9c37db2013-06-21 18:30:24 -0700607struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700608 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700609 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700610 uint16_t length;
611 uint32_t xid;
612 list(of_hello_elem_t) elements;
613};
614
Rich Lanee9c37db2013-06-21 18:30:24 -0700615struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700616 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700617 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700618 uint16_t length;
619 uint32_t xid;
620 of_octets_t data;
621};
622
Rich Lanee9c37db2013-06-21 18:30:24 -0700623struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700624 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700625 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700626 uint16_t length;
627 uint32_t xid;
628 of_octets_t data;
629};
630
Rich Lanee9c37db2013-06-21 18:30:24 -0700631struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700632 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700633 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700634 uint16_t length;
635 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700636 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700637 uint32_t subtype;
638 of_octets_t data;
639};
640
Rich Lanee9c37db2013-06-21 18:30:24 -0700641struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700642 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700643 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700644 uint16_t length;
645 uint32_t xid;
646};
647
Rich Lanee9c37db2013-06-21 18:30:24 -0700648struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700649 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700650 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700651 uint16_t length;
652 uint32_t xid;
653};
654
Rich Lanee9c37db2013-06-21 18:30:24 -0700655struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700656 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700657 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700658 uint16_t length;
659 uint32_t xid;
660};
661
Rich Lanee9c37db2013-06-21 18:30:24 -0700662struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700664 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700665 uint16_t length;
666 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800667 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700668 uint16_t miss_send_len;
669};
670
Rich Lanee9c37db2013-06-21 18:30:24 -0700671struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700672 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700673 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700674 uint16_t length;
675 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800676 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700677 uint16_t miss_send_len;
678};
679
Rich Lanee9c37db2013-06-21 18:30:24 -0700680struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700681 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700682 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700683 uint16_t length;
684 uint32_t xid;
685 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700686 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700687 uint32_t config;
688};
689
Rich Lane68ae4d72013-05-09 10:55:19 -0700690struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700691 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700692 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700693 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700694 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700695 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700696 enum ofp_port_config config;
697 enum ofp_port_state state;
698 enum ofp_port_features curr;
699 enum ofp_port_features advertised;
700 enum ofp_port_features supported;
701 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700702 uint32_t curr_speed;
703 uint32_t max_speed;
704};
705
Rich Lanee9c37db2013-06-21 18:30:24 -0700706struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700707 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700708 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700709 uint16_t length;
710 uint32_t xid;
711};
712
Rich Lanee9c37db2013-06-21 18:30:24 -0700713struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700714 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700715 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700716 uint16_t length;
717 uint32_t xid;
718 uint64_t datapath_id;
719 uint32_t n_buffers;
720 uint8_t n_tables;
721 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700722 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700723 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700724 uint32_t reserved;
725};
726
Rich Lanee9c37db2013-06-21 18:30:24 -0700727struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700728 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700729 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700730 uint16_t length;
731 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700732 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700733 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700734 of_port_desc_t desc;
735};
736
Rich Lanee9c37db2013-06-21 18:30:24 -0700737struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700738 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700739 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700740 uint16_t length;
741 uint32_t xid;
742 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700743 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700744 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700745 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700746 uint32_t config;
747 uint32_t mask;
748 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700749 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700750};
751
752// FIXME Does this need to be v4?
Andreas Wundsam5da68512013-10-22 22:18:00 -0700753struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700754 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700755 uint16_t length;
756 list(of_oxm_t) oxm_list;
757};
758
Rich Lanea06d0c32013-03-25 08:52:03 -0700759// This looks like an action header, but is standalone. See
760// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700761struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700762 uint16_t type;
763 uint16_t len;
Rich Lanea06d0c32013-03-25 08:52:03 -0700764};
765
Rich Lanee9c37db2013-06-21 18:30:24 -0700766struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700767 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700768 uint16_t len;
769 of_port_no_t port;
770 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700771 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700772};
773
Rich Lanee9c37db2013-06-21 18:30:24 -0700774struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700775 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700776 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700777 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700778};
779
Rich Lanee9c37db2013-06-21 18:30:24 -0700780struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700781 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700782 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700783 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700784};
785
Rich Lanee9c37db2013-06-21 18:30:24 -0700786struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700787 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700788 uint16_t len;
789 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700790 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700791};
792
Rich Lanee9c37db2013-06-21 18:30:24 -0700793struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700794 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700795 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700796 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700797};
798
Rich Lanee9c37db2013-06-21 18:30:24 -0700799struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700800 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700801 uint16_t len;
802 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700803 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700804};
805
Rich Lanee9c37db2013-06-21 18:30:24 -0700806struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700807 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700808 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700809 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700810};
811
Rich Lanee9c37db2013-06-21 18:30:24 -0700812struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700813 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700814 uint16_t len;
815 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700816 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700817};
818
Rich Lanee9c37db2013-06-21 18:30:24 -0700819struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700820 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700821 uint16_t len;
822 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700823 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700824};
825
Rich Lanee9c37db2013-06-21 18:30:24 -0700826struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700827 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700828 uint16_t len;
829 uint32_t queue_id;
830};
831
Rich Lanee9c37db2013-06-21 18:30:24 -0700832struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700833 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700834 uint16_t len;
835 uint32_t group_id;
836};
837
Rich Lanee9c37db2013-06-21 18:30:24 -0700838struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700839 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700840 uint16_t len;
841 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700842 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700843};
844
Rich Lanee9c37db2013-06-21 18:30:24 -0700845struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700846 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700847 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700848 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700849};
850
Andreas Wundsam5da68512013-10-22 22:18:00 -0700851struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700852 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700853 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700854 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700855};
856
Andreas Wundsam5da68512013-10-22 22:18:00 -0700857struct of_action_experimenter(align=8, length_includes_align=True): of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700858 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700859 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700860 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700861 of_octets_t data;
862};
863
Rich Lanee9c37db2013-06-21 18:30:24 -0700864struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700865 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700866 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700867 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700868};
869
Rich Lanee9c37db2013-06-21 18:30:24 -0700870struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700871 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700872 uint16_t len;
873 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700874 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700875};
876
Rich Lane68ae4d72013-05-09 10:55:19 -0700877struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700878 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700879 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700880 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700881};
882
Jonathan Stout661c4682014-03-03 12:35:31 -0500883struct of_instruction_id {
884 uint16_t type;
885 uint16_t len;
886};
887
Rich Lane68ae4d72013-05-09 10:55:19 -0700888struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700889 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700890 uint16_t len;
891};
892
Rich Lanee9c37db2013-06-21 18:30:24 -0700893struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700894 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 uint16_t len;
896 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700897 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700898};
899
Rich Lanee9c37db2013-06-21 18:30:24 -0700900struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700901 uint16_t type == 2;
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 uint64_t metadata;
905 uint64_t metadata_mask;
906};
907
Rich Lanee9c37db2013-06-21 18:30:24 -0700908struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700909 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700910 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700911 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700912 list(of_action_t) actions;
913};
914
Rich Lanee9c37db2013-06-21 18:30:24 -0700915struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700916 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700917 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700918 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700919 list(of_action_t) actions;
920};
921
Rich Lanee9c37db2013-06-21 18:30:24 -0700922struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700923 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700924 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700925 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700926};
927
Rich Lanee9c37db2013-06-21 18:30:24 -0700928struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700929 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700930 uint16_t len;
931 uint32_t meter_id;
932};
933
Rich Lanee9c37db2013-06-21 18:30:24 -0700934struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700935 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700936 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700937 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700938 of_octets_t data;
939};
940
Rich Lanee9c37db2013-06-21 18:30:24 -0700941struct of_flow_mod : of_header {
942 uint8_t version;
943 uint8_t type == 14;
944 uint16_t length;
945 uint32_t xid;
946 uint64_t cookie;
947 uint64_t cookie_mask;
948 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700949 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700950 uint16_t idle_timeout;
951 uint16_t hard_timeout;
952 uint16_t priority;
953 uint32_t buffer_id;
954 of_port_no_t out_port;
955 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700956 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700957 pad(2);
958 of_match_t match;
959 list(of_instruction_t) instructions;
960};
961
962struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700963 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700964 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700965 uint16_t length;
966 uint32_t xid;
967 uint64_t cookie;
968 uint64_t cookie_mask;
969 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700970 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700971 uint16_t idle_timeout;
972 uint16_t hard_timeout;
973 uint16_t priority;
974 uint32_t buffer_id;
975 of_port_no_t out_port;
976 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700977 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700978 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700979 of_match_t match;
980 list(of_instruction_t) instructions;
981};
982
Rich Lanee9c37db2013-06-21 18:30:24 -0700983struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700984 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700985 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700986 uint16_t length;
987 uint32_t xid;
988 uint64_t cookie;
989 uint64_t cookie_mask;
990 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700991 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700992 uint16_t idle_timeout;
993 uint16_t hard_timeout;
994 uint16_t priority;
995 uint32_t buffer_id;
996 of_port_no_t out_port;
997 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700998 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700999 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001000 of_match_t match;
1001 list(of_instruction_t) instructions;
1002};
1003
Rich Lanee9c37db2013-06-21 18:30:24 -07001004struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001005 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001006 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001007 uint16_t length;
1008 uint32_t xid;
1009 uint64_t cookie;
1010 uint64_t cookie_mask;
1011 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001012 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001013 uint16_t idle_timeout;
1014 uint16_t hard_timeout;
1015 uint16_t priority;
1016 uint32_t buffer_id;
1017 of_port_no_t out_port;
1018 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001019 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001020 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001021 of_match_t match;
1022 list(of_instruction_t) instructions;
1023};
1024
Rich Lanee9c37db2013-06-21 18:30:24 -07001025struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001026 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001027 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001028 uint16_t length;
1029 uint32_t xid;
1030 uint64_t cookie;
1031 uint64_t cookie_mask;
1032 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001033 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001034 uint16_t idle_timeout;
1035 uint16_t hard_timeout;
1036 uint16_t priority;
1037 uint32_t buffer_id;
1038 of_port_no_t out_port;
1039 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001040 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001041 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001042 of_match_t match;
1043 list(of_instruction_t) instructions;
1044};
1045
Rich Lanee9c37db2013-06-21 18:30:24 -07001046struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001047 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001048 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001049 uint16_t length;
1050 uint32_t xid;
1051 uint64_t cookie;
1052 uint64_t cookie_mask;
1053 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001054 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001055 uint16_t idle_timeout;
1056 uint16_t hard_timeout;
1057 uint16_t priority;
1058 uint32_t buffer_id;
1059 of_port_no_t out_port;
1060 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001061 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001062 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001063 of_match_t match;
1064 list(of_instruction_t) instructions;
1065};
1066
Rich Lane68ae4d72013-05-09 10:55:19 -07001067struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001068 uint16_t len;
1069 uint16_t weight;
1070 of_port_no_t watch_port;
1071 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001072 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001073 list(of_action_t) actions;
1074};
1075
Rich Lanee9c37db2013-06-21 18:30:24 -07001076struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001077 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001078 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001079 uint16_t length;
1080 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -08001081 enum ofp_group_mod_command command == ?;
1082 enum ofp_group_type group_type;
1083 pad(1);
1084 uint32_t group_id;
1085 list(of_bucket_t) buckets;
1086};
1087
1088struct of_group_add : of_group_mod {
1089 uint8_t version;
1090 uint8_t type == 15;
1091 uint16_t length;
1092 uint32_t xid;
1093 enum ofp_group_mod_command command == 0;
1094 enum ofp_group_type group_type;
1095 pad(1);
1096 uint32_t group_id;
1097 list(of_bucket_t) buckets;
1098};
1099
1100struct of_group_modify : of_group_mod {
1101 uint8_t version;
1102 uint8_t type == 15;
1103 uint16_t length;
1104 uint32_t xid;
1105 enum ofp_group_mod_command command == 1;
1106 enum ofp_group_type group_type;
1107 pad(1);
1108 uint32_t group_id;
1109 list(of_bucket_t) buckets;
1110};
1111
1112struct of_group_delete : of_group_mod {
1113 uint8_t version;
1114 uint8_t type == 15;
1115 uint16_t length;
1116 uint32_t xid;
1117 enum ofp_group_mod_command command == 2;
1118 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001119 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001120 uint32_t group_id;
1121 list(of_bucket_t) buckets;
1122};
1123
Rich Lanee9c37db2013-06-21 18:30:24 -07001124struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001125 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001126 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001127 uint16_t length;
1128 uint32_t xid;
1129 uint32_t buffer_id;
1130 of_port_no_t in_port;
1131 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001132 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001133 list(of_action_t) actions;
1134 of_octets_t data;
1135};
1136
Rich Lanee9c37db2013-06-21 18:30:24 -07001137struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001138 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001139 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001140 uint16_t length;
1141 uint32_t xid;
1142 uint32_t buffer_id;
1143 uint16_t total_len;
1144 uint8_t reason;
1145 uint8_t table_id;
1146 uint64_t cookie;
1147 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001148 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001149 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1150};
1151
Rich Lanee9c37db2013-06-21 18:30:24 -07001152struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001153 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001154 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001155 uint16_t length;
1156 uint32_t xid;
1157 uint64_t cookie;
1158 uint16_t priority;
1159 uint8_t reason;
1160 uint8_t table_id;
1161 uint32_t duration_sec;
1162 uint32_t duration_nsec;
1163 uint16_t idle_timeout;
1164 uint16_t hard_timeout;
1165 uint64_t packet_count;
1166 uint64_t byte_count;
1167 of_match_t match;
1168};
1169
Rich Lane68ae4d72013-05-09 10:55:19 -07001170struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001171 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001172 uint16_t len;
1173// uint32_t rate; // These are excluded b/c this is the header
1174// uint32_t burst_size; // These are excluded b/c this is the header
1175};
1176
Rich Lanee9c37db2013-06-21 18:30:24 -07001177struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001178 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001179 uint16_t len;
1180 uint32_t rate;
1181 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001182 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001183};
1184
Rich Lanee9c37db2013-06-21 18:30:24 -07001185struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001186 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001187 uint16_t len;
1188 uint32_t rate;
1189 uint32_t burst_size;
1190 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001191 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001192};
1193
Rich Lanee9c37db2013-06-21 18:30:24 -07001194struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001195 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001196 uint16_t len;
1197 uint32_t rate;
1198 uint32_t burst_size;
1199 uint32_t experimenter;
1200};
1201
Rich Lanee9c37db2013-06-21 18:30:24 -07001202struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001203 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001204 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001205 uint16_t length;
1206 uint32_t xid;
1207 uint16_t command;
1208 uint16_t flags;
1209 uint32_t meter_id;
1210 list(of_meter_band_t) meters;
1211};
1212
Rich Lanee9c37db2013-06-21 18:30:24 -07001213struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001214 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001215 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001216 uint16_t length;
1217 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001218 uint16_t err_type == ?;
1219};
1220
1221struct of_hello_failed_error_msg : of_error_msg {
1222 uint8_t version;
1223 uint8_t type == 1;
1224 uint16_t length;
1225 uint32_t xid;
1226 uint16_t err_type == 0;
1227 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001228 of_octets_t data;
1229};
1230
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001231struct of_bad_request_error_msg : of_error_msg {
1232 uint8_t version;
1233 uint8_t type == 1;
1234 uint16_t length;
1235 uint32_t xid;
1236 uint16_t err_type == 1;
1237 enum ofp_bad_request_code code;
1238 of_octets_t data;
1239};
1240
1241struct of_bad_action_error_msg : of_error_msg {
1242 uint8_t version;
1243 uint8_t type == 1;
1244 uint16_t length;
1245 uint32_t xid;
1246 uint16_t err_type == 2;
1247 enum ofp_bad_action_code code;
1248 of_octets_t data;
1249};
1250
1251struct of_bad_instruction_error_msg : of_error_msg {
1252 uint8_t version;
1253 uint8_t type == 1;
1254 uint16_t length;
1255 uint32_t xid;
1256 uint16_t err_type == 3;
1257 enum ofp_bad_instruction_code code;
1258 of_octets_t data;
1259};
1260
1261struct of_bad_match_error_msg : of_error_msg {
1262 uint8_t version;
1263 uint8_t type == 1;
1264 uint16_t length;
1265 uint32_t xid;
1266 uint16_t err_type == 4;
1267 enum ofp_bad_match_code code;
1268 of_octets_t data;
1269};
1270
1271struct of_flow_mod_failed_error_msg : of_error_msg {
1272 uint8_t version;
1273 uint8_t type == 1;
1274 uint16_t length;
1275 uint32_t xid;
1276 uint16_t err_type == 5;
1277 enum ofp_flow_mod_failed_code code;
1278 of_octets_t data;
1279};
1280
1281struct of_group_mod_failed_error_msg : of_error_msg {
1282 uint8_t version;
1283 uint8_t type == 1;
1284 uint16_t length;
1285 uint32_t xid;
1286 uint16_t err_type == 6;
1287 enum ofp_group_mod_failed_code code;
1288 of_octets_t data;
1289};
1290
1291struct of_port_mod_failed_error_msg : of_error_msg {
1292 uint8_t version;
1293 uint8_t type == 1;
1294 uint16_t length;
1295 uint32_t xid;
1296 uint16_t err_type == 7;
1297 enum ofp_port_mod_failed_code code;
1298 of_octets_t data;
1299};
1300
1301struct of_table_mod_failed_error_msg : of_error_msg {
1302 uint8_t version;
1303 uint8_t type == 1;
1304 uint16_t length;
1305 uint32_t xid;
1306 uint16_t err_type == 8;
1307 enum ofp_table_mod_failed_code code;
1308 of_octets_t data;
1309};
1310
1311struct of_queue_op_failed_error_msg : of_error_msg {
1312 uint8_t version;
1313 uint8_t type == 1;
1314 uint16_t length;
1315 uint32_t xid;
1316 uint16_t err_type == 9;
1317 enum ofp_queue_op_failed_code code;
1318 of_octets_t data;
1319};
1320
1321struct of_switch_config_failed_error_msg : of_error_msg {
1322 uint8_t version;
1323 uint8_t type == 1;
1324 uint16_t length;
1325 uint32_t xid;
1326 uint16_t err_type == 10;
1327 enum ofp_switch_config_failed_code code;
1328 of_octets_t data;
1329};
1330
1331struct of_role_request_failed_error_msg : of_error_msg {
1332 uint8_t version;
1333 uint8_t type == 1;
1334 uint16_t length;
1335 uint32_t xid;
1336 uint16_t err_type == 11;
1337 enum ofp_role_request_failed_code code;
1338 of_octets_t data;
1339};
1340
1341struct of_meter_mod_failed_error_msg : of_error_msg {
1342 uint8_t version;
1343 uint8_t type == 1;
1344 uint16_t length;
1345 uint32_t xid;
1346 uint16_t err_type == 12;
1347 enum ofp_meter_mod_failed_code code;
1348 of_octets_t data;
1349};
1350
1351struct of_table_features_failed_error_msg : of_error_msg {
1352 uint8_t version;
1353 uint8_t type == 1;
1354 uint16_t length;
1355 uint32_t xid;
1356 uint16_t err_type == 13;
1357 enum ofp_table_features_failed_code code;
1358 of_octets_t data;
1359};
1360
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001361struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001362 uint8_t version;
1363 uint8_t type == 1;
1364 uint16_t length;
1365 uint32_t xid;
1366 uint16_t err_type == 0xffff;
1367 uint16_t subtype;
1368 uint32_t experimenter;
1369 of_octets_t data;
1370};
Rich Lanea06d0c32013-03-25 08:52:03 -07001371
1372// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1373
Rich Lane68ae4d72013-05-09 10:55:19 -07001374struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001375 uint16_t length;
1376 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001377 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001378 uint32_t duration_sec;
1379 uint32_t duration_nsec;
1380 uint16_t priority;
1381 uint16_t idle_timeout;
1382 uint16_t hard_timeout;
Andreas Wundsam078fcfd2014-06-25 15:49:01 -07001383 enum ofp_flow_mod_flags flags;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001384 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001385 uint64_t cookie;
1386 uint64_t packet_count;
1387 uint64_t byte_count;
1388 of_match_t match;
1389 list(of_instruction_t) instructions;
1390};
1391
1392
Rich Lane68ae4d72013-05-09 10:55:19 -07001393struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001394 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001395 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001396 uint32_t active_count;
1397 uint64_t lookup_count;
1398 uint64_t matched_count;
1399};
1400
Rich Lane68ae4d72013-05-09 10:55:19 -07001401struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001402 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001403 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001404 uint64_t rx_packets;
1405 uint64_t tx_packets;
1406 uint64_t rx_bytes;
1407 uint64_t tx_bytes;
1408 uint64_t rx_dropped;
1409 uint64_t tx_dropped;
1410 uint64_t rx_errors;
1411 uint64_t tx_errors;
1412 uint64_t rx_frame_err;
1413 uint64_t rx_over_err;
1414 uint64_t rx_crc_err;
1415 uint64_t collisions;
1416 uint32_t duration_sec;
1417 uint32_t duration_nsec;
1418};
1419
Rich Lane68ae4d72013-05-09 10:55:19 -07001420struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001421 of_port_no_t port_no;
1422 uint32_t queue_id;
1423 uint64_t tx_bytes;
1424 uint64_t tx_packets;
1425 uint64_t tx_errors;
1426 uint32_t duration_sec;
1427 uint32_t duration_nsec;
1428};
1429
Rich Lane68ae4d72013-05-09 10:55:19 -07001430struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001431 uint64_t packet_count;
1432 uint64_t byte_count;
1433};
1434
Rich Lane68ae4d72013-05-09 10:55:19 -07001435struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001436 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001437 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001438 uint32_t group_id;
1439 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001440 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001441 uint64_t packet_count;
1442 uint64_t byte_count;
1443 uint32_t duration_sec;
1444 uint32_t duration_nsec;
1445 list(of_bucket_counter_t) bucket_stats;
1446};
1447
Rich Lane68ae4d72013-05-09 10:55:19 -07001448struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001449 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001450 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001451 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001452 uint32_t group_id;
1453 list(of_bucket_t) buckets;
1454};
1455
1456// STATS:
1457// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1458
Rich Lanee9c37db2013-06-21 18:30:24 -07001459struct of_stats_request : of_header {
1460 uint8_t version;
1461 uint8_t type == 18;
1462 uint16_t length;
1463 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001464 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001465 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001466 pad(4);
1467};
1468
1469struct of_stats_reply : of_header {
1470 uint8_t version;
1471 uint8_t type == 19;
1472 uint16_t length;
1473 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001474 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001475 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001476 pad(4);
1477};
1478
1479struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001480 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001481 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001482 uint16_t length;
1483 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001484 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001485 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001486 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001487};
1488
Rich Lanee9c37db2013-06-21 18:30:24 -07001489struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001491 uint8_t type == 19;
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 == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001495 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001496 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001497 of_desc_str_t mfr_desc;
1498 of_desc_str_t hw_desc;
1499 of_desc_str_t sw_desc;
1500 of_serial_num_t serial_num;
1501 of_desc_str_t dp_desc;
1502};
1503
Rich Lanee9c37db2013-06-21 18:30:24 -07001504struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001505 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001506 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001507 uint16_t length;
1508 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001509 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001510 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001511 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001512 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001513 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001514 of_port_no_t out_port;
1515 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001516 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001517 uint64_t cookie;
1518 uint64_t cookie_mask;
1519 of_match_t match;
1520};
1521
Rich Lanee9c37db2013-06-21 18:30:24 -07001522struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001523 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001524 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001525 uint16_t length;
1526 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001527 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001528 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001529 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001530 list(of_flow_stats_entry_t) entries;
1531};
1532
Rich Lanee9c37db2013-06-21 18:30:24 -07001533struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001534 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001535 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001536 uint16_t length;
1537 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001538 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001539 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001540 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001541 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001542 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001543 of_port_no_t out_port;
1544 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001545 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001546 uint64_t cookie;
1547 uint64_t cookie_mask;
1548 of_match_t match;
1549};
1550
Rich Lanee9c37db2013-06-21 18:30:24 -07001551struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001552 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001553 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001554 uint16_t length;
1555 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001556 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001557 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001558 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001559 uint64_t packet_count;
1560 uint64_t byte_count;
1561 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001562 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001563};
1564
Rich Lanee9c37db2013-06-21 18:30:24 -07001565struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001566 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001567 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001568 uint16_t length;
1569 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001570 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001571 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001572 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001573};
1574
Rich Lanee9c37db2013-06-21 18:30:24 -07001575struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001576 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001577 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001578 uint16_t length;
1579 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001580 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001581 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001582 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001583 list(of_table_stats_entry_t) entries;
1584};
1585
Rich Lane6d434332013-11-13 09:23:10 -08001586struct of_experimenter_stats_request : of_stats_request {
1587 uint8_t version;
1588 uint8_t type == 18;
1589 uint16_t length;
1590 uint32_t xid;
1591 uint16_t stats_type == 0xffff;
1592 enum ofp_stats_request_flags flags;
1593 pad(4);
1594 uint32_t experimenter == ?;
1595 uint32_t subtype;
1596};
1597
1598struct of_experimenter_stats_reply : of_stats_reply {
1599 uint8_t version;
1600 uint8_t type == 19;
1601 uint16_t length;
1602 uint32_t xid;
1603 uint16_t stats_type == 0xffff;
1604 enum ofp_stats_reply_flags flags;
1605 pad(4);
1606 uint32_t experimenter == ?;
1607 uint32_t subtype;
1608};
1609
Rich Lanea06d0c32013-03-25 08:52:03 -07001610// FIXME: These are padded to 8 byte align beyond the length indicated
1611
Rich Lane68ae4d72013-05-09 10:55:19 -07001612struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001613 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001614 uint16_t length;
1615};
1616
Rich Lanee9c37db2013-06-21 18:30:24 -07001617struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001618 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001619 uint16_t length;
1620 // FIXME Check if instruction_t is right for ids here
Jonathan Stout661c4682014-03-03 12:35:31 -05001621 list(of_instruction_id_t) instruction_ids;
Rich Lanea06d0c32013-03-25 08:52:03 -07001622};
1623
Rich Lanee9c37db2013-06-21 18:30:24 -07001624struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001625 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001626 uint16_t length;
Jonathan Stout661c4682014-03-03 12:35:31 -05001627 list(of_instruction_id_t) instruction_ids;
Rich Lanea06d0c32013-03-25 08:52:03 -07001628};
1629
Rich Lanee9c37db2013-06-21 18:30:24 -07001630struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001631 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001632 uint16_t length;
1633 list(of_uint8_t) next_table_ids;
1634};
1635
Rich Lanee9c37db2013-06-21 18:30:24 -07001636struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001637 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001638 uint16_t length;
1639 list(of_uint8_t) next_table_ids;
1640};
1641
Rich Lanee9c37db2013-06-21 18:30:24 -07001642struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001643 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001644 uint16_t length;
1645 list(of_action_id_t) action_ids;
1646};
1647
Rich Lanee9c37db2013-06-21 18:30:24 -07001648struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001649 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001650 uint16_t length;
1651 list(of_action_id_t) action_ids;
1652};
1653
Rich Lanee9c37db2013-06-21 18:30:24 -07001654struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001655 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001656 uint16_t length;
1657 list(of_action_id_t) action_ids;
1658};
1659
Rich Lanee9c37db2013-06-21 18:30:24 -07001660struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001661 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001662 uint16_t length;
1663 list(of_action_id_t) action_ids;
1664};
1665
Rich Lanee9c37db2013-06-21 18:30:24 -07001666struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001667 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001668 uint16_t length;
1669 list(of_uint32_t) oxm_ids;
1670};
1671
Rich Lanee9c37db2013-06-21 18:30:24 -07001672struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001673 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001674 uint16_t length;
1675 list(of_uint32_t) oxm_ids;
1676};
1677
Rich Lanee9c37db2013-06-21 18:30:24 -07001678struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001679 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001680 uint16_t length;
1681 list(of_uint32_t) oxm_ids;
1682};
1683
Rich Lanee9c37db2013-06-21 18:30:24 -07001684struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001685 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001686 uint16_t length;
1687 list(of_uint32_t) oxm_ids;
1688};
1689
Rich Lanee9c37db2013-06-21 18:30:24 -07001690struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001691 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001692 uint16_t length;
1693 list(of_uint32_t) oxm_ids;
1694};
1695
Rich Lanee9c37db2013-06-21 18:30:24 -07001696struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001697 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001698 uint16_t length;
1699 list(of_uint32_t) oxm_ids;
1700};
1701
Rich Lanee9c37db2013-06-21 18:30:24 -07001702struct of_table_feature_prop_experimenter : of_table_feature_prop {
Jonathan Stoutacb3e322014-02-13 13:23:16 -05001703 uint16_t type == 65534;
Rich Lanea06d0c32013-03-25 08:52:03 -07001704 uint16_t length;
1705 uint32_t experimenter;
1706 uint32_t subtype;
1707 of_octets_t experimenter_data;
1708};
1709
Jonathan Stoutaf15dee2014-02-13 14:22:26 -05001710struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
1711 uint16_t type == 65535;
1712 uint16_t length;
1713 uint32_t experimenter;
1714 uint32_t subtype;
1715 of_octets_t experimenter_data;
1716};
Rich Lanea06d0c32013-03-25 08:52:03 -07001717
Rich Lane68ae4d72013-05-09 10:55:19 -07001718struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001719 uint16_t length;
1720 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001721 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001722 of_table_name_t name;
1723 uint64_t metadata_match;
1724 uint64_t metadata_write;
1725 uint32_t config;
1726 uint32_t max_entries;
1727 list(of_table_feature_prop_t) properties;
1728};
1729
Rich Lane68ae4d72013-05-09 10:55:19 -07001730struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001731 uint32_t max_meter;
1732 uint32_t band_types;
1733 uint32_t capabilities;
1734 uint8_t max_bands;
1735 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001736 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001737};
1738
Rich Lanee9c37db2013-06-21 18:30:24 -07001739struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001740 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001741 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001742 uint16_t length;
1743 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001744 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001745 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001746 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001747 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001748 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001749};
1750
Rich Lanee9c37db2013-06-21 18:30:24 -07001751struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001752 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001753 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001754 uint16_t length;
1755 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001756 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001757 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001758 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001759 list(of_port_stats_entry_t) entries;
1760};
1761
Rich Lanee9c37db2013-06-21 18:30:24 -07001762struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001763 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001764 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001765 uint16_t length;
1766 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001767 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001768 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001769 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001770 of_port_no_t port_no;
1771 uint32_t queue_id;
1772};
1773
Rich Lanee9c37db2013-06-21 18:30:24 -07001774struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001775 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001776 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001777 uint16_t length;
1778 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001779 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001780 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001781 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001782 list(of_queue_stats_entry_t) entries;
1783};
1784
Rich Lanee9c37db2013-06-21 18:30:24 -07001785struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001786 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001787 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001788 uint16_t length;
1789 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001790 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001791 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001792 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001793 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001794 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001795};
1796
Rich Lanee9c37db2013-06-21 18:30:24 -07001797struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001798 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001799 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001800 uint16_t length;
1801 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001802 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001803 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001804 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001805 list(of_group_stats_entry_t) entries;
1806};
1807
Rich Lanee9c37db2013-06-21 18:30:24 -07001808struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001809 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001810 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001811 uint16_t length;
1812 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001813 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001814 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001815 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001816};
1817
Rich Lanee9c37db2013-06-21 18:30:24 -07001818struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001819 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001820 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001821 uint16_t length;
1822 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001823 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001824 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001825 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001826 list(of_group_desc_stats_entry_t) entries;
1827};
1828
Rich Lanee9c37db2013-06-21 18:30:24 -07001829struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001830 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001831 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001832 uint16_t length;
1833 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001834 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001835 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001836 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001837};
1838
Rich Lanee9c37db2013-06-21 18:30:24 -07001839struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001840 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001841 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001842 uint16_t length;
1843 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001844 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001845 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001846 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001847 uint32_t types;
1848 uint32_t capabilities;
1849 uint32_t max_groups_all;
1850 uint32_t max_groups_select;
1851 uint32_t max_groups_indirect;
1852 uint32_t max_groups_ff;
1853 uint32_t actions_all;
1854 uint32_t actions_select;
1855 uint32_t actions_indirect;
1856 uint32_t actions_ff;
1857};
1858
Rich Lanee9c37db2013-06-21 18:30:24 -07001859struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001860 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001861 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001862 uint16_t length;
1863 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001864 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001865 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001866 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001867 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001868 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001869};
1870
Rich Lanee9c37db2013-06-21 18:30:24 -07001871struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001872 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001873 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001874 uint16_t length;
1875 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001876 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001877 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001878 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001879 list(of_meter_stats_t) entries;
1880};
1881
Rich Lanee9c37db2013-06-21 18:30:24 -07001882struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001883 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001884 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001885 uint16_t length;
1886 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001887 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001888 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001889 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001890 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001891 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001892};
1893
Rich Lanee9c37db2013-06-21 18:30:24 -07001894struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001895 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001896 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001897 uint16_t length;
1898 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001899 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001900 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001901 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001902 list(of_meter_band_t) entries;
1903};
1904
1905// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001906struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001907 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001908 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001909 uint16_t length;
1910 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001911 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001912 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001913 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001914};
1915
1916// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001917struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001918 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001919 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001920 uint16_t length;
1921 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001922 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001923 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001924 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001925 of_meter_features_t features;
1926};
1927
1928// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001929struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001930 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001931 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001932 uint16_t length;
1933 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001934 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001935 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001936 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001937 list(of_table_features_t) entries;
1938};
1939
1940// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001941struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001942 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001943 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001944 uint16_t length;
1945 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001946 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001947 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001948 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001949 list(of_table_features_t) entries;
1950};
1951
1952// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001953struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001954 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001955 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001956 uint16_t length;
1957 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001958 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001959 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001960 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001961};
1962
1963// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001964struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001965 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001966 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001967 uint16_t length;
1968 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001969 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001970 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001971 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001972 list(of_port_desc_t) entries;
1973};
1974
Rich Lane68ae4d72013-05-09 10:55:19 -07001975struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001976 uint64_t packet_band_count;
1977 uint64_t byte_band_count;
1978};
1979
Rich Lane68ae4d72013-05-09 10:55:19 -07001980struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001981 uint32_t meter_id;
1982 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001983 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001984 uint32_t flow_count;
1985 uint64_t packet_in_count;
1986 uint64_t byte_in_count;
1987 uint32_t duration_sec;
1988 uint32_t duration_nsec;
1989 list(of_meter_band_stats_t) band_stats;
1990};
1991
Rich Lane68ae4d72013-05-09 10:55:19 -07001992struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001993 uint16_t length;
1994 uint16_t flags;
1995 uint32_t meter_id;
1996 list(of_meter_band_t) entries;
1997};
1998
Rich Lanea06d0c32013-03-25 08:52:03 -07001999// END OF STATS OBJECTS
2000
Rich Lane68ae4d72013-05-09 10:55:19 -07002001struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07002002 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07002003 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002004 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002005};
2006
Rich Lanee9c37db2013-06-21 18:30:24 -07002007struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002008 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07002009 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002010 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002011 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002012 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002013};
2014
Rich Lanee9c37db2013-06-21 18:30:24 -07002015struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002016 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07002017 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002018 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002019 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002020 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002021};
2022
Rich Lanee9c37db2013-06-21 18:30:24 -07002023struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002024 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07002025 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002026 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07002027 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002028 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002029 of_octets_t data;
2030};
2031
Rich Lane68ae4d72013-05-09 10:55:19 -07002032struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07002033 uint32_t queue_id;
2034 of_port_no_t port;
2035 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002036 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002037 list(of_queue_prop_t) properties;
2038};
2039
Rich Lanee9c37db2013-06-21 18:30:24 -07002040struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002041 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002042 uint8_t type == 22;
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};
2048
Rich Lanee9c37db2013-06-21 18:30:24 -07002049struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002050 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002051 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07002052 uint16_t length;
2053 uint32_t xid;
2054 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002055 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002056 list(of_packet_queue_t) queues;
2057};
2058
Rich Lanee9c37db2013-06-21 18:30:24 -07002059struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002060 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002061 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07002062 uint16_t length;
2063 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002064 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002065 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002066 uint64_t generation_id;
2067};
2068
Rich Lanee9c37db2013-06-21 18:30:24 -07002069struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002070 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002071 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07002072 uint16_t length;
2073 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002074 enum ofp_controller_role role;
2075 pad(4);
2076 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07002077};
2078
2079////////////////////////////////////////////////////////////////
2080// FIXME understand async; where do bitmasks live?
2081// Determine bitmap type for masks below.
2082// DOCUMENT masks where uint32_t[0] is interest for equal/master
2083// while uint32_t[1] is interest for slave
2084////////////////////////////////////////////////////////////////
2085
Rich Lanee9c37db2013-06-21 18:30:24 -07002086struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002087 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002088 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002089 uint16_t length;
2090 uint32_t xid;
2091 uint32_t packet_in_mask_equal_master;
2092 uint32_t packet_in_mask_slave;
2093 uint32_t port_status_mask_equal_master;
2094 uint32_t port_status_mask_slave;
2095 uint32_t flow_removed_mask_equal_master;
2096 uint32_t flow_removed_mask_slave;
2097};
2098
Rich Lanee9c37db2013-06-21 18:30:24 -07002099struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002100 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002101 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002102 uint16_t length;
2103 uint32_t xid;
2104 uint32_t packet_in_mask_equal_master;
2105 uint32_t packet_in_mask_slave;
2106 uint32_t port_status_mask_equal_master;
2107 uint32_t port_status_mask_slave;
2108 uint32_t flow_removed_mask_equal_master;
2109 uint32_t flow_removed_mask_slave;
2110};
2111
Rich Lanee9c37db2013-06-21 18:30:24 -07002112struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002113 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002114 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002115 uint16_t length;
2116 uint32_t xid;
2117 uint32_t packet_in_mask_equal_master;
2118 uint32_t packet_in_mask_slave;
2119 uint32_t port_status_mask_equal_master;
2120 uint32_t port_status_mask_slave;
2121 uint32_t flow_removed_mask_equal_master;
2122 uint32_t flow_removed_mask_slave;
2123};