blob: fdc1a1e7e2c1b6f58c74881fda80a7f4e3b3fc70 [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 Wundsam7933beb2013-08-02 22:36:42 -070061enum ofp_port_no(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -070062 OFPP_ANY = 0xffffffff,
63};
64
Andreas Wundsam4ee51462013-07-30 11:00:37 -070065enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070066 OFPP_MAX = 0xffffff00,
67 OFPP_IN_PORT = 0xfffffff8,
68 OFPP_TABLE = 0xfffffff9,
69 OFPP_NORMAL = 0xfffffffa,
70 OFPP_FLOOD = 0xfffffffb,
71 OFPP_ALL = 0xfffffffc,
72 OFPP_CONTROLLER = 0xfffffffd,
73 OFPP_LOCAL = 0xfffffffe,
74};
75
Andreas Wundsam4ee51462013-07-30 11:00:37 -070076enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070077 OFPT_HELLO = 0,
78 OFPT_ERROR = 1,
79 OFPT_ECHO_REQUEST = 2,
80 OFPT_ECHO_REPLY = 3,
81 OFPT_EXPERIMENTER = 4,
82 OFPT_FEATURES_REQUEST = 5,
83 OFPT_FEATURES_REPLY = 6,
84 OFPT_GET_CONFIG_REQUEST = 7,
85 OFPT_GET_CONFIG_REPLY = 8,
86 OFPT_SET_CONFIG = 9,
87 OFPT_PACKET_IN = 10,
88 OFPT_FLOW_REMOVED = 11,
89 OFPT_PORT_STATUS = 12,
90 OFPT_PACKET_OUT = 13,
91 OFPT_FLOW_MOD = 14,
92 OFPT_GROUP_MOD = 15,
93 OFPT_PORT_MOD = 16,
94 OFPT_TABLE_MOD = 17,
Rob Vaterlausfeee3712013-09-30 11:24:19 -070095 OFPT_STATS_REQUEST = 18,
96 OFPT_STATS_REPLY = 19,
Rich Lane5d33a622013-04-08 17:33:11 -070097 OFPT_BARRIER_REQUEST = 20,
98 OFPT_BARRIER_REPLY = 21,
99 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
100 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
101 OFPT_ROLE_REQUEST = 24,
102 OFPT_ROLE_REPLY = 25,
103 OFPT_GET_ASYNC_REQUEST = 26,
104 OFPT_GET_ASYNC_REPLY = 27,
105 OFPT_SET_ASYNC = 28,
106 OFPT_METER_MOD = 29,
107};
108
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700109enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700110 OFPC_FRAG_NORMAL = 0,
111 OFPC_FRAG_DROP = 1,
112 OFPC_FRAG_REASM = 2,
113 OFPC_FRAG_MASK = 3,
114};
115
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700116enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700117 OFPTC_DEPRECATED_MASK = 0x3,
118};
119
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700120enum ofp_table(wire_type=uint8_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700121 OFPTT_MAX = 0xfe,
122 OFPTT_ALL = 0xff,
123};
124
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700125enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700126 OFPC_FLOW_STATS = 0x1,
127 OFPC_TABLE_STATS = 0x2,
128 OFPC_PORT_STATS = 0x4,
129 OFPC_GROUP_STATS = 0x8,
130 OFPC_IP_REASM = 0x20,
131 OFPC_QUEUE_STATS = 0x40,
132 OFPC_PORT_BLOCKED = 0x100,
133};
134
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700135enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700136 OFPPC_PORT_DOWN = 0x1,
137 OFPPC_NO_RECV = 0x4,
138 OFPPC_NO_FWD = 0x20,
139 OFPPC_NO_PACKET_IN = 0x40,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -0700140 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700141};
142
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700143enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700144 OFPPS_LINK_DOWN = 0x1,
145 OFPPS_BLOCKED = 0x2,
146 OFPPS_LIVE = 0x4,
147};
148
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700149enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700150 OFPPF_10MB_HD = 0x1,
151 OFPPF_10MB_FD = 0x2,
152 OFPPF_100MB_HD = 0x4,
153 OFPPF_100MB_FD = 0x8,
154 OFPPF_1GB_HD = 0x10,
155 OFPPF_1GB_FD = 0x20,
156 OFPPF_10GB_FD = 0x40,
157 OFPPF_40GB_FD = 0x80,
158 OFPPF_100GB_FD = 0x100,
159 OFPPF_1TB_FD = 0x200,
160 OFPPF_OTHER = 0x400,
161 OFPPF_COPPER = 0x800,
162 OFPPF_FIBER = 0x1000,
163 OFPPF_AUTONEG = 0x2000,
164 OFPPF_PAUSE = 0x4000,
165 OFPPF_PAUSE_ASYM = 0x8000,
166};
167
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700168enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700169 OFPPR_ADD = 0,
170 OFPPR_DELETE = 1,
171 OFPPR_MODIFY = 2,
172};
173
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700174enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700175 OFPMT_STANDARD = 0,
176 OFPMT_OXM = 1,
177};
178
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700179enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700180 OFPXMC_NXM_0 = 0,
181 OFPXMC_NXM_1 = 1,
182 OFPXMC_OPENFLOW_BASIC = 0x8000,
183 OFPXMC_EXPERIMENTER = 0xffff,
184};
185
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700186enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700187 OFPVID_NONE = 0,
188 OFPVID_PRESENT = 0x1000,
189};
190
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700191// FIXME: OF spec specified this as '9' bits, implicitly adding
192// to full byte
193enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700194 OFPIEH_NONEXT = 0x1,
195 OFPIEH_ESP = 0x2,
196 OFPIEH_AUTH = 0x4,
197 OFPIEH_DEST = 0x8,
198 OFPIEH_FRAG = 0x10,
199 OFPIEH_ROUTER = 0x20,
200 OFPIEH_HOP = 0x40,
201 OFPIEH_UNREP = 0x80,
202 OFPIEH_UNSEQ = 0x100,
203};
204
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700205enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700206 OFPAT_OUTPUT = 0,
207 OFPAT_COPY_TTL_OUT = 0xb,
208 OFPAT_COPY_TTL_IN = 0xc,
209 OFPAT_SET_MPLS_TTL = 0xf,
210 OFPAT_DEC_MPLS_TTL = 0x10,
211 OFPAT_PUSH_VLAN = 0x11,
212 OFPAT_POP_VLAN = 0x12,
213 OFPAT_PUSH_MPLS = 0x13,
214 OFPAT_POP_MPLS = 0x14,
215 OFPAT_SET_QUEUE = 0x15,
216 OFPAT_GROUP = 0x16,
217 OFPAT_SET_NW_TTL = 0x17,
218 OFPAT_DEC_NW_TTL = 0x18,
219 OFPAT_SET_FIELD = 0x19,
220 OFPAT_PUSH_PBB = 0x1a,
221 OFPAT_POP_PBB = 0x1b,
222 OFPAT_EXPERIMENTER = 0xffff,
223};
224
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700225enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700226 OFPCML_MAX = 0xffe5,
227 OFPCML_NO_BUFFER = 0xffff,
228};
229
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700230enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700231 OFPIT_GOTO_TABLE = 0x1,
232 OFPIT_WRITE_METADATA = 0x2,
233 OFPIT_WRITE_ACTIONS = 0x3,
234 OFPIT_APPLY_ACTIONS = 0x4,
235 OFPIT_CLEAR_ACTIONS = 0x5,
236 OFPIT_METER = 0x6,
237 OFPIT_EXPERIMENTER = 0xffff,
238};
239
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700240enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700241 OFPFC_ADD = 0,
242 OFPFC_MODIFY = 1,
243 OFPFC_MODIFY_STRICT = 2,
244 OFPFC_DELETE = 3,
245 OFPFC_DELETE_STRICT = 4,
246};
247
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700248enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700249 OFPFF_SEND_FLOW_REM = 0x1,
250 OFPFF_CHECK_OVERLAP = 0x2,
251 OFPFF_RESET_COUNTS = 0x4,
252 OFPFF_NO_PKT_COUNTS = 0x8,
253 OFPFF_NO_BYT_COUNTS = 0x10,
254};
255
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700256enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700257 OFPG_MAX = 0xffffff00,
258 OFPG_ALL = 0xfffffffc,
259 OFPG_ANY = 0xffffffff,
260};
261
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700262enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700263 OFPGC_ADD = 0,
264 OFPGC_MODIFY = 1,
265 OFPGC_DELETE = 2,
266};
267
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700268enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700269 OFPGT_ALL = 0,
270 OFPGT_SELECT = 1,
271 OFPGT_INDIRECT = 2,
272 OFPGT_FF = 3,
273};
274
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700275enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700276 OFPR_NO_MATCH = 0,
277 OFPR_ACTION = 1,
278 OFPR_INVALID_TTL = 2,
279};
280
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700281enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700282 OFPRR_IDLE_TIMEOUT = 0,
283 OFPRR_HARD_TIMEOUT = 1,
284 OFPRR_DELETE = 2,
285 OFPRR_GROUP_DELETE = 3,
286};
287
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700288enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700289 OFPM_MAX = 0xffff0000,
290 OFPM_SLOWPATH = 0xfffffffd,
291 OFPM_CONTROLLER = 0xfffffffe,
292 OFPM_ALL = 0xffffffff,
293};
294
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700295enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700296 OFPMBT_DROP = 0x1,
297 OFPMBT_DSCP_REMARK = 0x2,
298 OFPMBT_EXPERIMENTER = 0xffff,
299};
300
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700301enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700302 OFPMC_ADD = 0,
303 OFPMC_MODIFY = 1,
304 OFPMC_DELETE = 2,
305};
306
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700307enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700308 OFPMF_KBPS = 0x1,
309 OFPMF_PKTPS = 0x2,
310 OFPMF_BURST = 0x4,
311 OFPMF_STATS = 0x8,
312};
313
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700314enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700315 OFPET_HELLO_FAILED = 0,
316 OFPET_BAD_REQUEST = 1,
317 OFPET_BAD_ACTION = 2,
318 OFPET_BAD_INSTRUCTION = 3,
319 OFPET_BAD_MATCH = 4,
320 OFPET_FLOW_MOD_FAILED = 5,
321 OFPET_GROUP_MOD_FAILED = 6,
322 OFPET_PORT_MOD_FAILED = 7,
323 OFPET_TABLE_MOD_FAILED = 8,
324 OFPET_QUEUE_OP_FAILED = 9,
325 OFPET_SWITCH_CONFIG_FAILED = 10,
326 OFPET_ROLE_REQUEST_FAILED = 11,
327 OFPET_METER_MOD_FAILED = 12,
328 OFPET_TABLE_FEATURES_FAILED = 13,
329 OFPET_EXPERIMENTER = 0xffff,
330};
331
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700332enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700333 OFPHFC_INCOMPATIBLE = 0,
334 OFPHFC_EPERM = 1,
335};
336
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700337enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700338 OFPBRC_BAD_VERSION = 0,
339 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700340 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700341 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700342 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700343 OFPBRC_EPERM = 5,
344 OFPBRC_BAD_LEN = 6,
345 OFPBRC_BUFFER_EMPTY = 7,
346 OFPBRC_BUFFER_UNKNOWN = 8,
347 OFPBRC_BAD_TABLE_ID = 9,
348 OFPBRC_IS_SLAVE = 10,
349 OFPBRC_BAD_PORT = 11,
350 OFPBRC_BAD_PACKET = 12,
351 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
352};
353
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700354enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700355 OFPBAC_BAD_TYPE = 0,
356 OFPBAC_BAD_LEN = 1,
357 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700358 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700359 OFPBAC_BAD_OUT_PORT = 4,
360 OFPBAC_BAD_ARGUMENT = 5,
361 OFPBAC_EPERM = 6,
362 OFPBAC_TOO_MANY = 7,
363 OFPBAC_BAD_QUEUE = 8,
364 OFPBAC_BAD_OUT_GROUP = 9,
365 OFPBAC_MATCH_INCONSISTENT = 10,
366 OFPBAC_UNSUPPORTED_ORDER = 11,
367 OFPBAC_BAD_TAG = 12,
368 OFPBAC_BAD_SET_TYPE = 13,
369 OFPBAC_BAD_SET_LEN = 14,
370 OFPBAC_BAD_SET_ARGUMENT = 15,
371};
372
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700373enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700374 OFPBIC_UNKNOWN_INST = 0,
375 OFPBIC_UNSUP_INST = 1,
376 OFPBIC_BAD_TABLE_ID = 2,
377 OFPBIC_UNSUP_METADATA = 3,
378 OFPBIC_UNSUP_METADATA_MASK = 4,
379 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700380 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700381 OFPBIC_BAD_LEN = 7,
382 OFPBIC_EPERM = 8,
383};
384
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700385enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700386 OFPBMC_BAD_TYPE = 0,
387 OFPBMC_BAD_LEN = 1,
388 OFPBMC_BAD_TAG = 2,
389 OFPBMC_BAD_DL_ADDR_MASK = 3,
390 OFPBMC_BAD_NW_ADDR_MASK = 4,
391 OFPBMC_BAD_WILDCARDS = 5,
392 OFPBMC_BAD_FIELD = 6,
393 OFPBMC_BAD_VALUE = 7,
394 OFPBMC_BAD_MASK = 8,
395 OFPBMC_BAD_PREREQ = 9,
396 OFPBMC_DUP_FIELD = 10,
397 OFPBMC_EPERM = 11,
398};
399
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700400enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700401 OFPFMFC_UNKNOWN = 0,
402 OFPFMFC_TABLE_FULL = 1,
403 OFPFMFC_BAD_TABLE_ID = 2,
404 OFPFMFC_OVERLAP = 3,
405 OFPFMFC_EPERM = 4,
406 OFPFMFC_BAD_TIMEOUT = 5,
407 OFPFMFC_BAD_COMMAND = 6,
408 OFPFMFC_BAD_FLAGS = 7,
409};
410
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700411enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700412 OFPGMFC_GROUP_EXISTS = 0,
413 OFPGMFC_INVALID_GROUP = 1,
414 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
415 OFPGMFC_OUT_OF_GROUPS = 3,
416 OFPGMFC_OUT_OF_BUCKETS = 4,
417 OFPGMFC_CHAINING_UNSUPPORTED = 5,
418 OFPGMFC_WATCH_UNSUPPORTED = 6,
419 OFPGMFC_LOOP = 7,
420 OFPGMFC_UNKNOWN_GROUP = 8,
421 OFPGMFC_CHAINED_GROUP = 9,
422 OFPGMFC_BAD_TYPE = 10,
423 OFPGMFC_BAD_COMMAND = 11,
424 OFPGMFC_BAD_BUCKET = 12,
425 OFPGMFC_BAD_WATCH = 13,
426 OFPGMFC_EPERM = 14,
427};
428
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700429enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700430 OFPPMFC_BAD_PORT = 0,
431 OFPPMFC_BAD_HW_ADDR = 1,
432 OFPPMFC_BAD_CONFIG = 2,
433 OFPPMFC_BAD_ADVERTISE = 3,
434 OFPPMFC_EPERM = 4,
435};
436
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700437enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700438 OFPTMFC_BAD_TABLE = 0,
439 OFPTMFC_BAD_CONFIG = 1,
440 OFPTMFC_EPERM = 2,
441};
442
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700443enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700444 OFPQOFC_BAD_PORT = 0,
445 OFPQOFC_BAD_QUEUE = 1,
446 OFPQOFC_EPERM = 2,
447};
448
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700449enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700450 OFPSCFC_BAD_FLAGS = 0,
451 OFPSCFC_BAD_LEN = 1,
452 OFPSCFC_EPERM = 2,
453};
454
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700455enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700456 OFPRRFC_STALE = 0,
457 OFPRRFC_UNSUP = 1,
458 OFPRRFC_BAD_ROLE = 2,
459};
460
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700461enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700462 OFPMMFC_UNKNOWN = 0,
463 OFPMMFC_METER_EXISTS = 1,
464 OFPMMFC_INVALID_METER = 2,
465 OFPMMFC_UNKNOWN_METER = 3,
466 OFPMMFC_BAD_COMMAND = 4,
467 OFPMMFC_BAD_FLAGS = 5,
468 OFPMMFC_BAD_RATE = 6,
469 OFPMMFC_BAD_BURST = 7,
470 OFPMMFC_BAD_BAND = 8,
471 OFPMMFC_BAD_BAND_VALUE = 9,
472 OFPMMFC_OUT_OF_METERS = 10,
473 OFPMMFC_OUT_OF_BANDS = 11,
474};
475
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700476enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700477 OFPTFFC_BAD_TABLE = 0,
478 OFPTFFC_BAD_METADATA = 1,
479 OFPTFFC_BAD_TYPE = 2,
480 OFPTFFC_BAD_LEN = 3,
481 OFPTFFC_BAD_ARGUMENT = 4,
482 OFPTFFC_EPERM = 5,
483};
484
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700485enum ofp_stats_type(wire_type=uint16_t) {
486 OFPST_DESC = 0,
487 OFPST_FLOW = 1,
488 OFPST_AGGREGATE = 2,
489 OFPST_TABLE = 3,
490 OFPST_PORT = 4,
491 OFPST_QUEUE = 5,
492 OFPST_GROUP = 6,
493 OFPST_GROUP_DESC = 7,
494 OFPST_GROUP_FEATURES = 8,
495 OFPST_METER = 9,
496 OFPST_METER_CONFIG = 10,
497 OFPST_METER_FEATURES = 11,
498 OFPST_TABLE_FEATURES = 12,
499 OFPST_PORT_DESC = 13,
500 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700501};
502
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700503enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
504 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700505};
506
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700507enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
508 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700509};
510
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700511enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700512 OFPTFPT_INSTRUCTIONS = 0,
513 OFPTFPT_INSTRUCTIONS_MISS = 1,
514 OFPTFPT_NEXT_TABLES = 2,
515 OFPTFPT_NEXT_TABLES_MISS = 3,
516 OFPTFPT_WRITE_ACTIONS = 4,
517 OFPTFPT_WRITE_ACTIONS_MISS = 5,
518 OFPTFPT_APPLY_ACTIONS = 6,
519 OFPTFPT_APPLY_ACTIONS_MISS = 7,
520 OFPTFPT_MATCH = 8,
521 OFPTFPT_WILDCARDS = 0xa,
522 OFPTFPT_WRITE_SETFIELD = 0xc,
523 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
524 OFPTFPT_APPLY_SETFIELD = 0xe,
525 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
526 OFPTFPT_EXPERIMENTER = 0xfffe,
527 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
528};
529
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700530enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700531 OFPGFC_SELECT_WEIGHT = 0x1,
532 OFPGFC_SELECT_LIVENESS = 0x2,
533 OFPGFC_CHAINING = 0x4,
534 OFPGFC_CHAINING_CHECKS = 0x8,
535};
536
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700537enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700538 OFPQT_MIN_RATE = 0x1,
539 OFPQT_MAX_RATE = 0x2,
540 OFPQT_EXPERIMENTER = 0xffff,
541};
542
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700543enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700544 OFPCR_ROLE_NOCHANGE = 0,
545 OFPCR_ROLE_EQUAL = 1,
546 OFPCR_ROLE_MASTER = 2,
547 OFPCR_ROLE_SLAVE = 3,
548};
549
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700550enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700551 OFPHET_VERSIONBITMAP = 1,
552};
553
Rich Lanee9c37db2013-06-21 18:30:24 -0700554/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700555struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700556 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700557 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700558 uint16_t length;
559 uint32_t xid;
560};
561
562// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700563struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700564 uint32_t value;
565};
566
567// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700568struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700569 uint8_t value;
570};
571
Rich Lane68ae4d72013-05-09 10:55:19 -0700572struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700573 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700574 uint16_t length;
575};
576
Rich Lanee9c37db2013-06-21 18:30:24 -0700577struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700578 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700579 uint16_t length;
580 list(of_uint32_t) bitmaps;
581};
582
Rich Lanee9c37db2013-06-21 18:30:24 -0700583struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700584 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700585 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700586 uint16_t length;
587 uint32_t xid;
588 list(of_hello_elem_t) elements;
589};
590
Rich Lanee9c37db2013-06-21 18:30:24 -0700591struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700592 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700593 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700594 uint16_t length;
595 uint32_t xid;
596 of_octets_t data;
597};
598
Rich Lanee9c37db2013-06-21 18:30:24 -0700599struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700600 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700601 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700602 uint16_t length;
603 uint32_t xid;
604 of_octets_t data;
605};
606
Rich Lanee9c37db2013-06-21 18:30:24 -0700607struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700608 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700609 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700610 uint16_t length;
611 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700612 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700613 uint32_t subtype;
614 of_octets_t data;
615};
616
Rich Lanee9c37db2013-06-21 18:30:24 -0700617struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700618 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700619 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700620 uint16_t length;
621 uint32_t xid;
622};
623
Rich Lanee9c37db2013-06-21 18:30:24 -0700624struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700625 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700626 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700627 uint16_t length;
628 uint32_t xid;
629};
630
Rich Lanee9c37db2013-06-21 18:30:24 -0700631struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700632 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700633 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700634 uint16_t length;
635 uint32_t xid;
636};
637
Rich Lanee9c37db2013-06-21 18:30:24 -0700638struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700639 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700640 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700641 uint16_t length;
642 uint32_t xid;
643 uint16_t flags;
644 uint16_t miss_send_len;
645};
646
Rich Lanee9c37db2013-06-21 18:30:24 -0700647struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700648 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700649 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700650 uint16_t length;
651 uint32_t xid;
652 uint16_t flags;
653 uint16_t miss_send_len;
654};
655
Rich Lanee9c37db2013-06-21 18:30:24 -0700656struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700657 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700658 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700659 uint16_t length;
660 uint32_t xid;
661 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700662 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint32_t config;
664};
665
Rich Lane68ae4d72013-05-09 10:55:19 -0700666struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700667 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700668 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700669 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700670 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700671 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700672 enum ofp_port_config config;
673 enum ofp_port_state state;
674 enum ofp_port_features curr;
675 enum ofp_port_features advertised;
676 enum ofp_port_features supported;
677 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700678 uint32_t curr_speed;
679 uint32_t max_speed;
680};
681
Rich Lanee9c37db2013-06-21 18:30:24 -0700682struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700683 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700684 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700685 uint16_t length;
686 uint32_t xid;
687};
688
Rich Lanee9c37db2013-06-21 18:30:24 -0700689struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700690 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700691 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700692 uint16_t length;
693 uint32_t xid;
694 uint64_t datapath_id;
695 uint32_t n_buffers;
696 uint8_t n_tables;
697 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700698 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700699 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700700 uint32_t reserved;
701};
702
Rich Lanee9c37db2013-06-21 18:30:24 -0700703struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700704 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700705 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700706 uint16_t length;
707 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700708 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700709 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700710 of_port_desc_t desc;
711};
712
Rich Lanee9c37db2013-06-21 18:30:24 -0700713struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700714 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700715 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700716 uint16_t length;
717 uint32_t xid;
718 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700719 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700720 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700721 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700722 uint32_t config;
723 uint32_t mask;
724 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700725 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700726};
727
728// FIXME Does this need to be v4?
Andreas Wundsamfef7d5f2013-08-01 22:15:44 -0700729struct of_match_v3(align=8) {
Rich Lane31b87142013-05-09 22:05:42 -0700730 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700731 uint16_t length;
732 list(of_oxm_t) oxm_list;
733};
734
Rich Lanea06d0c32013-03-25 08:52:03 -0700735// This looks like an action header, but is standalone. See
736// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700737struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700738 uint16_t type;
739 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700740 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700741};
742
Rich Lanee9c37db2013-06-21 18:30:24 -0700743struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700744 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700745 uint16_t len;
746 of_port_no_t port;
747 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700748 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700749};
750
Rich Lanee9c37db2013-06-21 18:30:24 -0700751struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700752 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700753 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700754 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700755};
756
Rich Lanee9c37db2013-06-21 18:30:24 -0700757struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700758 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700759 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700760 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700761};
762
Rich Lanee9c37db2013-06-21 18:30:24 -0700763struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700764 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700765 uint16_t len;
766 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700767 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700768};
769
Rich Lanee9c37db2013-06-21 18:30:24 -0700770struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700771 uint16_t type == 16;
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_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700777 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700778 uint16_t len;
779 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700780 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700781};
782
Rich Lanee9c37db2013-06-21 18:30:24 -0700783struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700784 uint16_t type == 18;
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_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700790 uint16_t type == 19;
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_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700797 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700798 uint16_t len;
799 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700800 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700801};
802
Rich Lanee9c37db2013-06-21 18:30:24 -0700803struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700804 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700805 uint16_t len;
806 uint32_t queue_id;
807};
808
Rich Lanee9c37db2013-06-21 18:30:24 -0700809struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700810 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700811 uint16_t len;
812 uint32_t group_id;
813};
814
Rich Lanee9c37db2013-06-21 18:30:24 -0700815struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700816 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700817 uint16_t len;
818 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700819 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700820};
821
Rich Lanee9c37db2013-06-21 18:30:24 -0700822struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700823 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700824 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700825 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700826};
827
Rich Lanee9c37db2013-06-21 18:30:24 -0700828struct of_action_set_field : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700829 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700830 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700831 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700832};
833
Rich Lanee9c37db2013-06-21 18:30:24 -0700834struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700835 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700836 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700837 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700838 of_octets_t data;
839};
840
Rich Lanee9c37db2013-06-21 18:30:24 -0700841struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700842 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700843 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700844 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700845};
846
Rich Lanee9c37db2013-06-21 18:30:24 -0700847struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700848 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700849 uint16_t len;
850 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700851 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700852};
853
Rich Lane68ae4d72013-05-09 10:55:19 -0700854struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700855 uint16_t type == ?;
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 Lane68ae4d72013-05-09 10:55:19 -0700860struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700861 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700862 uint16_t len;
863};
864
Rich Lanee9c37db2013-06-21 18:30:24 -0700865struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700866 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700867 uint16_t len;
868 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700869 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700870};
871
Rich Lanee9c37db2013-06-21 18:30:24 -0700872struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700873 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700874 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700875 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700876 uint64_t metadata;
877 uint64_t metadata_mask;
878};
879
Rich Lanee9c37db2013-06-21 18:30:24 -0700880struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700881 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700882 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700883 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700884 list(of_action_t) actions;
885};
886
Rich Lanee9c37db2013-06-21 18:30:24 -0700887struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700888 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700889 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700890 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700891 list(of_action_t) actions;
892};
893
Rich Lanee9c37db2013-06-21 18:30:24 -0700894struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700895 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700896 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700897 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700898};
899
Rich Lanee9c37db2013-06-21 18:30:24 -0700900struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700901 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700902 uint16_t len;
903 uint32_t meter_id;
904};
905
Rich Lanee9c37db2013-06-21 18:30:24 -0700906struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700907 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700908 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700909 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700910 of_octets_t data;
911};
912
Rich Lanee9c37db2013-06-21 18:30:24 -0700913struct of_flow_mod : of_header {
914 uint8_t version;
915 uint8_t type == 14;
916 uint16_t length;
917 uint32_t xid;
918 uint64_t cookie;
919 uint64_t cookie_mask;
920 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700921 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700922 uint16_t idle_timeout;
923 uint16_t hard_timeout;
924 uint16_t priority;
925 uint32_t buffer_id;
926 of_port_no_t out_port;
927 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700928 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700929 pad(2);
930 of_match_t match;
931 list(of_instruction_t) instructions;
932};
933
934struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700935 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700936 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700937 uint16_t length;
938 uint32_t xid;
939 uint64_t cookie;
940 uint64_t cookie_mask;
941 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700942 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700943 uint16_t idle_timeout;
944 uint16_t hard_timeout;
945 uint16_t priority;
946 uint32_t buffer_id;
947 of_port_no_t out_port;
948 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700949 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700950 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700951 of_match_t match;
952 list(of_instruction_t) instructions;
953};
954
Rich Lanee9c37db2013-06-21 18:30:24 -0700955struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700956 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700957 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700958 uint16_t length;
959 uint32_t xid;
960 uint64_t cookie;
961 uint64_t cookie_mask;
962 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700963 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700964 uint16_t idle_timeout;
965 uint16_t hard_timeout;
966 uint16_t priority;
967 uint32_t buffer_id;
968 of_port_no_t out_port;
969 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700970 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700971 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700972 of_match_t match;
973 list(of_instruction_t) instructions;
974};
975
Rich Lanee9c37db2013-06-21 18:30:24 -0700976struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700978 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700979 uint16_t length;
980 uint32_t xid;
981 uint64_t cookie;
982 uint64_t cookie_mask;
983 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700984 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700985 uint16_t idle_timeout;
986 uint16_t hard_timeout;
987 uint16_t priority;
988 uint32_t buffer_id;
989 of_port_no_t out_port;
990 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700991 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700992 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700993 of_match_t match;
994 list(of_instruction_t) instructions;
995};
996
Rich Lanee9c37db2013-06-21 18:30:24 -0700997struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700998 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700999 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001000 uint16_t length;
1001 uint32_t xid;
1002 uint64_t cookie;
1003 uint64_t cookie_mask;
1004 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001005 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001006 uint16_t idle_timeout;
1007 uint16_t hard_timeout;
1008 uint16_t priority;
1009 uint32_t buffer_id;
1010 of_port_no_t out_port;
1011 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001012 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001013 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001014 of_match_t match;
1015 list(of_instruction_t) instructions;
1016};
1017
Rich Lanee9c37db2013-06-21 18:30:24 -07001018struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001019 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001020 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001021 uint16_t length;
1022 uint32_t xid;
1023 uint64_t cookie;
1024 uint64_t cookie_mask;
1025 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001026 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001027 uint16_t idle_timeout;
1028 uint16_t hard_timeout;
1029 uint16_t priority;
1030 uint32_t buffer_id;
1031 of_port_no_t out_port;
1032 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001033 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001034 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001035 of_match_t match;
1036 list(of_instruction_t) instructions;
1037};
1038
Rich Lane68ae4d72013-05-09 10:55:19 -07001039struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001040 uint16_t len;
1041 uint16_t weight;
1042 of_port_no_t watch_port;
1043 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001044 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001045 list(of_action_t) actions;
1046};
1047
Rich Lanee9c37db2013-06-21 18:30:24 -07001048struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001049 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001050 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001051 uint16_t length;
1052 uint32_t xid;
1053 uint16_t command;
1054 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001055 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001056 uint32_t group_id;
1057 list(of_bucket_t) buckets;
1058};
1059
Rich Lanee9c37db2013-06-21 18:30:24 -07001060struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001061 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001062 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001063 uint16_t length;
1064 uint32_t xid;
1065 uint32_t buffer_id;
1066 of_port_no_t in_port;
1067 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001068 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001069 list(of_action_t) actions;
1070 of_octets_t data;
1071};
1072
Rich Lanee9c37db2013-06-21 18:30:24 -07001073struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001074 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001075 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001076 uint16_t length;
1077 uint32_t xid;
1078 uint32_t buffer_id;
1079 uint16_t total_len;
1080 uint8_t reason;
1081 uint8_t table_id;
1082 uint64_t cookie;
1083 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001084 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001085 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1086};
1087
Rich Lanee9c37db2013-06-21 18:30:24 -07001088struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001089 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001090 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001091 uint16_t length;
1092 uint32_t xid;
1093 uint64_t cookie;
1094 uint16_t priority;
1095 uint8_t reason;
1096 uint8_t table_id;
1097 uint32_t duration_sec;
1098 uint32_t duration_nsec;
1099 uint16_t idle_timeout;
1100 uint16_t hard_timeout;
1101 uint64_t packet_count;
1102 uint64_t byte_count;
1103 of_match_t match;
1104};
1105
Rich Lane68ae4d72013-05-09 10:55:19 -07001106struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001107 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001108 uint16_t len;
1109// uint32_t rate; // These are excluded b/c this is the header
1110// uint32_t burst_size; // These are excluded b/c this is the header
1111};
1112
Rich Lanee9c37db2013-06-21 18:30:24 -07001113struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001114 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001115 uint16_t len;
1116 uint32_t rate;
1117 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001118 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001119};
1120
Rich Lanee9c37db2013-06-21 18:30:24 -07001121struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001122 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001123 uint16_t len;
1124 uint32_t rate;
1125 uint32_t burst_size;
1126 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001127 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001128};
1129
Rich Lanee9c37db2013-06-21 18:30:24 -07001130struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001131 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001132 uint16_t len;
1133 uint32_t rate;
1134 uint32_t burst_size;
1135 uint32_t experimenter;
1136};
1137
Rich Lanee9c37db2013-06-21 18:30:24 -07001138struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001139 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001140 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001141 uint16_t length;
1142 uint32_t xid;
1143 uint16_t command;
1144 uint16_t flags;
1145 uint32_t meter_id;
1146 list(of_meter_band_t) meters;
1147};
1148
Rich Lanee9c37db2013-06-21 18:30:24 -07001149struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001150 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001151 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001152 uint16_t length;
1153 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001154 uint16_t err_type == ?;
1155};
1156
1157struct of_hello_failed_error_msg : of_error_msg {
1158 uint8_t version;
1159 uint8_t type == 1;
1160 uint16_t length;
1161 uint32_t xid;
1162 uint16_t err_type == 0;
1163 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001164 of_octets_t data;
1165};
1166
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001167struct of_bad_request_error_msg : of_error_msg {
1168 uint8_t version;
1169 uint8_t type == 1;
1170 uint16_t length;
1171 uint32_t xid;
1172 uint16_t err_type == 1;
1173 enum ofp_bad_request_code code;
1174 of_octets_t data;
1175};
1176
1177struct of_bad_action_error_msg : of_error_msg {
1178 uint8_t version;
1179 uint8_t type == 1;
1180 uint16_t length;
1181 uint32_t xid;
1182 uint16_t err_type == 2;
1183 enum ofp_bad_action_code code;
1184 of_octets_t data;
1185};
1186
1187struct of_bad_instruction_error_msg : of_error_msg {
1188 uint8_t version;
1189 uint8_t type == 1;
1190 uint16_t length;
1191 uint32_t xid;
1192 uint16_t err_type == 3;
1193 enum ofp_bad_instruction_code code;
1194 of_octets_t data;
1195};
1196
1197struct of_bad_match_error_msg : of_error_msg {
1198 uint8_t version;
1199 uint8_t type == 1;
1200 uint16_t length;
1201 uint32_t xid;
1202 uint16_t err_type == 4;
1203 enum ofp_bad_match_code code;
1204 of_octets_t data;
1205};
1206
1207struct of_flow_mod_failed_error_msg : of_error_msg {
1208 uint8_t version;
1209 uint8_t type == 1;
1210 uint16_t length;
1211 uint32_t xid;
1212 uint16_t err_type == 5;
1213 enum ofp_flow_mod_failed_code code;
1214 of_octets_t data;
1215};
1216
1217struct of_group_mod_failed_error_msg : of_error_msg {
1218 uint8_t version;
1219 uint8_t type == 1;
1220 uint16_t length;
1221 uint32_t xid;
1222 uint16_t err_type == 6;
1223 enum ofp_group_mod_failed_code code;
1224 of_octets_t data;
1225};
1226
1227struct of_port_mod_failed_error_msg : of_error_msg {
1228 uint8_t version;
1229 uint8_t type == 1;
1230 uint16_t length;
1231 uint32_t xid;
1232 uint16_t err_type == 7;
1233 enum ofp_port_mod_failed_code code;
1234 of_octets_t data;
1235};
1236
1237struct of_table_mod_failed_error_msg : of_error_msg {
1238 uint8_t version;
1239 uint8_t type == 1;
1240 uint16_t length;
1241 uint32_t xid;
1242 uint16_t err_type == 8;
1243 enum ofp_table_mod_failed_code code;
1244 of_octets_t data;
1245};
1246
1247struct of_queue_op_failed_error_msg : of_error_msg {
1248 uint8_t version;
1249 uint8_t type == 1;
1250 uint16_t length;
1251 uint32_t xid;
1252 uint16_t err_type == 9;
1253 enum ofp_queue_op_failed_code code;
1254 of_octets_t data;
1255};
1256
1257struct of_switch_config_failed_error_msg : of_error_msg {
1258 uint8_t version;
1259 uint8_t type == 1;
1260 uint16_t length;
1261 uint32_t xid;
1262 uint16_t err_type == 10;
1263 enum ofp_switch_config_failed_code code;
1264 of_octets_t data;
1265};
1266
1267struct of_role_request_failed_error_msg : of_error_msg {
1268 uint8_t version;
1269 uint8_t type == 1;
1270 uint16_t length;
1271 uint32_t xid;
1272 uint16_t err_type == 11;
1273 enum ofp_role_request_failed_code code;
1274 of_octets_t data;
1275};
1276
1277struct of_meter_mod_failed_error_msg : of_error_msg {
1278 uint8_t version;
1279 uint8_t type == 1;
1280 uint16_t length;
1281 uint32_t xid;
1282 uint16_t err_type == 12;
1283 enum ofp_meter_mod_failed_code code;
1284 of_octets_t data;
1285};
1286
1287struct of_table_features_failed_error_msg : of_error_msg {
1288 uint8_t version;
1289 uint8_t type == 1;
1290 uint16_t length;
1291 uint32_t xid;
1292 uint16_t err_type == 13;
1293 enum ofp_table_features_failed_code code;
1294 of_octets_t data;
1295};
1296
1297struct of_experimenter_error_msg {
1298 uint8_t version;
1299 uint8_t type == 1;
1300 uint16_t length;
1301 uint32_t xid;
1302 uint16_t err_type == 0xffff;
1303 uint16_t subtype;
1304 uint32_t experimenter;
1305 of_octets_t data;
1306};
Rich Lanea06d0c32013-03-25 08:52:03 -07001307
1308// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1309
Rich Lane68ae4d72013-05-09 10:55:19 -07001310struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001311 uint16_t length;
1312 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001313 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001314 uint32_t duration_sec;
1315 uint32_t duration_nsec;
1316 uint16_t priority;
1317 uint16_t idle_timeout;
1318 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001319 uint16_t flags;
1320 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001321 uint64_t cookie;
1322 uint64_t packet_count;
1323 uint64_t byte_count;
1324 of_match_t match;
1325 list(of_instruction_t) instructions;
1326};
1327
1328
Rich Lane68ae4d72013-05-09 10:55:19 -07001329struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001330 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001331 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001332 uint32_t active_count;
1333 uint64_t lookup_count;
1334 uint64_t matched_count;
1335};
1336
Rich Lane68ae4d72013-05-09 10:55:19 -07001337struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001338 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001339 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001340 uint64_t rx_packets;
1341 uint64_t tx_packets;
1342 uint64_t rx_bytes;
1343 uint64_t tx_bytes;
1344 uint64_t rx_dropped;
1345 uint64_t tx_dropped;
1346 uint64_t rx_errors;
1347 uint64_t tx_errors;
1348 uint64_t rx_frame_err;
1349 uint64_t rx_over_err;
1350 uint64_t rx_crc_err;
1351 uint64_t collisions;
1352 uint32_t duration_sec;
1353 uint32_t duration_nsec;
1354};
1355
Rich Lane68ae4d72013-05-09 10:55:19 -07001356struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001357 of_port_no_t port_no;
1358 uint32_t queue_id;
1359 uint64_t tx_bytes;
1360 uint64_t tx_packets;
1361 uint64_t tx_errors;
1362 uint32_t duration_sec;
1363 uint32_t duration_nsec;
1364};
1365
Rich Lane68ae4d72013-05-09 10:55:19 -07001366struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001367 uint64_t packet_count;
1368 uint64_t byte_count;
1369};
1370
Rich Lane68ae4d72013-05-09 10:55:19 -07001371struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001372 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001373 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001374 uint32_t group_id;
1375 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001376 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001377 uint64_t packet_count;
1378 uint64_t byte_count;
1379 uint32_t duration_sec;
1380 uint32_t duration_nsec;
1381 list(of_bucket_counter_t) bucket_stats;
1382};
1383
Rich Lane68ae4d72013-05-09 10:55:19 -07001384struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001385 uint16_t length;
1386 uint8_t type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001387 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001388 uint32_t group_id;
1389 list(of_bucket_t) buckets;
1390};
1391
1392// STATS:
1393// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1394
Rich Lanee9c37db2013-06-21 18:30:24 -07001395struct of_stats_request : of_header {
1396 uint8_t version;
1397 uint8_t type == 18;
1398 uint16_t length;
1399 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001400 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001401 uint16_t flags;
1402 pad(4);
1403};
1404
1405struct of_stats_reply : of_header {
1406 uint8_t version;
1407 uint8_t type == 19;
1408 uint16_t length;
1409 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001410 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001411 uint16_t flags;
1412 pad(4);
1413};
1414
1415struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001416 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001417 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001418 uint16_t length;
1419 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001420 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001421 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001422 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001423};
1424
Rich Lanee9c37db2013-06-21 18:30:24 -07001425struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001426 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001427 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001428 uint16_t length;
1429 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001430 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001431 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001432 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001433 of_desc_str_t mfr_desc;
1434 of_desc_str_t hw_desc;
1435 of_desc_str_t sw_desc;
1436 of_serial_num_t serial_num;
1437 of_desc_str_t dp_desc;
1438};
1439
Rich Lanee9c37db2013-06-21 18:30:24 -07001440struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001441 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001442 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001443 uint16_t length;
1444 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001445 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001446 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001447 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001448 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001449 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 of_port_no_t out_port;
1451 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001452 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001453 uint64_t cookie;
1454 uint64_t cookie_mask;
1455 of_match_t match;
1456};
1457
Rich Lanee9c37db2013-06-21 18:30:24 -07001458struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001459 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001460 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001461 uint16_t length;
1462 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001463 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001464 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001465 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001466 list(of_flow_stats_entry_t) entries;
1467};
1468
Rich Lanee9c37db2013-06-21 18:30:24 -07001469struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001470 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001471 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001472 uint16_t length;
1473 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001474 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001475 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001476 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001477 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001478 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001479 of_port_no_t out_port;
1480 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001481 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001482 uint64_t cookie;
1483 uint64_t cookie_mask;
1484 of_match_t match;
1485};
1486
Rich Lanee9c37db2013-06-21 18:30:24 -07001487struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001488 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001489 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 uint16_t length;
1491 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001492 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001493 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001494 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001495 uint64_t packet_count;
1496 uint64_t byte_count;
1497 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001498 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001499};
1500
Rich Lanee9c37db2013-06-21 18:30:24 -07001501struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001502 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001503 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001504 uint16_t length;
1505 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001506 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001507 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001508 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001509};
1510
Rich Lanee9c37db2013-06-21 18:30:24 -07001511struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001512 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001513 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001514 uint16_t length;
1515 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001516 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001517 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001518 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001519 list(of_table_stats_entry_t) entries;
1520};
1521
Rich Lanea06d0c32013-03-25 08:52:03 -07001522// FIXME: These are padded to 8 byte align beyond the length indicated
1523
Rich Lane68ae4d72013-05-09 10:55:19 -07001524struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001525 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001526 uint16_t length;
1527};
1528
Rich Lanee9c37db2013-06-21 18:30:24 -07001529struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001530 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001531 uint16_t length;
1532 // FIXME Check if instruction_t is right for ids here
1533 list(of_instruction_t) instruction_ids;
1534};
1535
Rich Lanee9c37db2013-06-21 18:30:24 -07001536struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001537 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001538 uint16_t length;
1539 list(of_instruction_t) instruction_ids;
1540};
1541
Rich Lanee9c37db2013-06-21 18:30:24 -07001542struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001543 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001544 uint16_t length;
1545 list(of_uint8_t) next_table_ids;
1546};
1547
Rich Lanee9c37db2013-06-21 18:30:24 -07001548struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001549 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001550 uint16_t length;
1551 list(of_uint8_t) next_table_ids;
1552};
1553
Rich Lanee9c37db2013-06-21 18:30:24 -07001554struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001555 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001556 uint16_t length;
1557 list(of_action_id_t) action_ids;
1558};
1559
Rich Lanee9c37db2013-06-21 18:30:24 -07001560struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001561 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001562 uint16_t length;
1563 list(of_action_id_t) action_ids;
1564};
1565
Rich Lanee9c37db2013-06-21 18:30:24 -07001566struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001567 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001568 uint16_t length;
1569 list(of_action_id_t) action_ids;
1570};
1571
Rich Lanee9c37db2013-06-21 18:30:24 -07001572struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001573 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001574 uint16_t length;
1575 list(of_action_id_t) action_ids;
1576};
1577
Rich Lanee9c37db2013-06-21 18:30:24 -07001578struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001579 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001580 uint16_t length;
1581 list(of_uint32_t) oxm_ids;
1582};
1583
Rich Lanee9c37db2013-06-21 18:30:24 -07001584struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001585 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001586 uint16_t length;
1587 list(of_uint32_t) oxm_ids;
1588};
1589
Rich Lanee9c37db2013-06-21 18:30:24 -07001590struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001591 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001592 uint16_t length;
1593 list(of_uint32_t) oxm_ids;
1594};
1595
Rich Lanee9c37db2013-06-21 18:30:24 -07001596struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001597 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001598 uint16_t length;
1599 list(of_uint32_t) oxm_ids;
1600};
1601
Rich Lanee9c37db2013-06-21 18:30:24 -07001602struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001603 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001604 uint16_t length;
1605 list(of_uint32_t) oxm_ids;
1606};
1607
Rich Lanee9c37db2013-06-21 18:30:24 -07001608struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001609 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001610 uint16_t length;
1611 list(of_uint32_t) oxm_ids;
1612};
1613
Rich Lanee9c37db2013-06-21 18:30:24 -07001614struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001615 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001616 uint16_t length;
1617 uint32_t experimenter;
1618 uint32_t subtype;
1619 of_octets_t experimenter_data;
1620};
1621
1622// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001623// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001624// uint16_t type;
1625// uint16_t length;
1626// uint32_t experimenter;
1627// uint32_t subtype;
1628// of_octets_t experimenter_data;
1629// };
1630
Rich Lane68ae4d72013-05-09 10:55:19 -07001631struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001632 uint16_t length;
1633 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001634 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001635 of_table_name_t name;
1636 uint64_t metadata_match;
1637 uint64_t metadata_write;
1638 uint32_t config;
1639 uint32_t max_entries;
1640 list(of_table_feature_prop_t) properties;
1641};
1642
Rich Lane68ae4d72013-05-09 10:55:19 -07001643struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001644 uint32_t max_meter;
1645 uint32_t band_types;
1646 uint32_t capabilities;
1647 uint8_t max_bands;
1648 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001649 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001650};
1651
Rich Lanee9c37db2013-06-21 18:30:24 -07001652struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001653 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001654 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001655 uint16_t length;
1656 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001657 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001658 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001659 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001660 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001661 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001662};
1663
Rich Lanee9c37db2013-06-21 18:30:24 -07001664struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001665 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001666 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001667 uint16_t length;
1668 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001669 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001670 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001671 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001672 list(of_port_stats_entry_t) entries;
1673};
1674
Rich Lanee9c37db2013-06-21 18:30:24 -07001675struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001676 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001677 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001678 uint16_t length;
1679 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001680 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001681 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001682 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001683 of_port_no_t port_no;
1684 uint32_t queue_id;
1685};
1686
Rich Lanee9c37db2013-06-21 18:30:24 -07001687struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001688 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001689 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001690 uint16_t length;
1691 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001692 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001693 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001694 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001695 list(of_queue_stats_entry_t) entries;
1696};
1697
Rich Lanee9c37db2013-06-21 18:30:24 -07001698struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001699 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001700 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001701 uint16_t length;
1702 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001703 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001704 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001705 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001706 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001707 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001708};
1709
Rich Lanee9c37db2013-06-21 18:30:24 -07001710struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001711 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001712 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001713 uint16_t length;
1714 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001715 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001716 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001717 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001718 list(of_group_stats_entry_t) entries;
1719};
1720
Rich Lanee9c37db2013-06-21 18:30:24 -07001721struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001722 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001723 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001724 uint16_t length;
1725 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001726 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001727 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001728 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001729};
1730
Rich Lanee9c37db2013-06-21 18:30:24 -07001731struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001732 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001733 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001734 uint16_t length;
1735 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001736 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001737 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001738 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001739 list(of_group_desc_stats_entry_t) entries;
1740};
1741
Rich Lanee9c37db2013-06-21 18:30:24 -07001742struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001743 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001744 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001745 uint16_t length;
1746 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001747 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001748 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001749 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001750};
1751
Rich Lanee9c37db2013-06-21 18:30:24 -07001752struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001753 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001754 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001755 uint16_t length;
1756 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001757 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001758 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001759 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001760 uint32_t types;
1761 uint32_t capabilities;
1762 uint32_t max_groups_all;
1763 uint32_t max_groups_select;
1764 uint32_t max_groups_indirect;
1765 uint32_t max_groups_ff;
1766 uint32_t actions_all;
1767 uint32_t actions_select;
1768 uint32_t actions_indirect;
1769 uint32_t actions_ff;
1770};
1771
Rich Lanee9c37db2013-06-21 18:30:24 -07001772struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001773 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001774 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001775 uint16_t length;
1776 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001777 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001778 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001779 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001780 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001781 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001782};
1783
Rich Lanee9c37db2013-06-21 18:30:24 -07001784struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001785 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001786 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001787 uint16_t length;
1788 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001789 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001790 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001791 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001792 list(of_meter_stats_t) entries;
1793};
1794
Rich Lanee9c37db2013-06-21 18:30:24 -07001795struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001796 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001797 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001798 uint16_t length;
1799 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001800 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001801 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001802 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001803 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001804 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001805};
1806
Rich Lanee9c37db2013-06-21 18:30:24 -07001807struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001808 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001809 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001810 uint16_t length;
1811 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001812 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001813 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001814 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001815 list(of_meter_band_t) entries;
1816};
1817
1818// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001819struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001820 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001821 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001822 uint16_t length;
1823 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001824 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001825 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001826 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001827};
1828
1829// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001830struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001831 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001832 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001833 uint16_t length;
1834 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001835 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001836 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001837 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001838 of_meter_features_t features;
1839};
1840
1841// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001842struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001843 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001844 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001845 uint16_t length;
1846 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001847 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001848 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001849 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001850 list(of_table_features_t) entries;
1851};
1852
1853// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001854struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001855 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001856 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001857 uint16_t length;
1858 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001859 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001860 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001861 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001862 list(of_table_features_t) entries;
1863};
1864
1865// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001866struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001867 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001868 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001869 uint16_t length;
1870 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001871 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001872 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001873 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001874};
1875
1876// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001877struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001878 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001879 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001880 uint16_t length;
1881 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001882 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001883 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001884 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001885 list(of_port_desc_t) entries;
1886};
1887
Rich Lane68ae4d72013-05-09 10:55:19 -07001888struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001889 uint64_t packet_band_count;
1890 uint64_t byte_band_count;
1891};
1892
Rich Lane68ae4d72013-05-09 10:55:19 -07001893struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001894 uint32_t meter_id;
1895 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001896 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001897 uint32_t flow_count;
1898 uint64_t packet_in_count;
1899 uint64_t byte_in_count;
1900 uint32_t duration_sec;
1901 uint32_t duration_nsec;
1902 list(of_meter_band_stats_t) band_stats;
1903};
1904
Rich Lane68ae4d72013-05-09 10:55:19 -07001905struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001906 uint16_t length;
1907 uint16_t flags;
1908 uint32_t meter_id;
1909 list(of_meter_band_t) entries;
1910};
1911
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001912struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001913 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001914 uint32_t subtype;
1915};
1916
1917// END OF STATS OBJECTS
1918
Rich Lane68ae4d72013-05-09 10:55:19 -07001919struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001920 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001921 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001922 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001923};
1924
Rich Lanee9c37db2013-06-21 18:30:24 -07001925struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001926 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001927 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001928 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001929 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001930 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001931};
1932
Rich Lanee9c37db2013-06-21 18:30:24 -07001933struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001934 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001935 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001936 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001937 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001938 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001939};
1940
Rich Lanee9c37db2013-06-21 18:30:24 -07001941struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001942 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001943 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001944 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001945 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001946 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001947 of_octets_t data;
1948};
1949
Rich Lane68ae4d72013-05-09 10:55:19 -07001950struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001951 uint32_t queue_id;
1952 of_port_no_t port;
1953 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001954 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001955 list(of_queue_prop_t) properties;
1956};
1957
Rich Lanee9c37db2013-06-21 18:30:24 -07001958struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001959 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001960 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001961 uint16_t length;
1962 uint32_t xid;
1963 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001964 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001965};
1966
Rich Lanee9c37db2013-06-21 18:30:24 -07001967struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001968 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001969 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001970 uint16_t length;
1971 uint32_t xid;
1972 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001973 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001974 list(of_packet_queue_t) queues;
1975};
1976
Rich Lanee9c37db2013-06-21 18:30:24 -07001977struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001978 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001979 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001980 uint16_t length;
1981 uint32_t xid;
1982 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001983 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001984 uint64_t generation_id;
1985};
1986
Rich Lanee9c37db2013-06-21 18:30:24 -07001987struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001988 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001989 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001990 uint16_t length;
1991 uint32_t xid;
1992 of_octets_t data;
1993};
1994
1995////////////////////////////////////////////////////////////////
1996// FIXME understand async; where do bitmasks live?
1997// Determine bitmap type for masks below.
1998// DOCUMENT masks where uint32_t[0] is interest for equal/master
1999// while uint32_t[1] is interest for slave
2000////////////////////////////////////////////////////////////////
2001
Rich Lanee9c37db2013-06-21 18:30:24 -07002002struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002003 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002004 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002005 uint16_t length;
2006 uint32_t xid;
2007 uint32_t packet_in_mask_equal_master;
2008 uint32_t packet_in_mask_slave;
2009 uint32_t port_status_mask_equal_master;
2010 uint32_t port_status_mask_slave;
2011 uint32_t flow_removed_mask_equal_master;
2012 uint32_t flow_removed_mask_slave;
2013};
2014
Rich Lanee9c37db2013-06-21 18:30:24 -07002015struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002016 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002017 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002018 uint16_t length;
2019 uint32_t xid;
2020 uint32_t packet_in_mask_equal_master;
2021 uint32_t packet_in_mask_slave;
2022 uint32_t port_status_mask_equal_master;
2023 uint32_t port_status_mask_slave;
2024 uint32_t flow_removed_mask_equal_master;
2025 uint32_t flow_removed_mask_slave;
2026};
2027
Rich Lanee9c37db2013-06-21 18:30:24 -07002028struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002029 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002030 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002031 uint16_t length;
2032 uint32_t xid;
2033 uint32_t packet_in_mask_equal_master;
2034 uint32_t packet_in_mask_slave;
2035 uint32_t port_status_mask_equal_master;
2036 uint32_t port_status_mask_slave;
2037 uint32_t flow_removed_mask_equal_master;
2038 uint32_t flow_removed_mask_slave;
2039};