blob: c1e8a2b139cae14c0c5233769c2d1cf59de4f945 [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 3
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
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59 OFPQ_MAX_RATE_UNCFG = 0xffff,
60};
61
Andreas Wundsam4ee51462013-07-30 11:00:37 -070062enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070063 OFPP_MAX = 0xffffff00,
64 OFPP_IN_PORT = 0xfffffff8,
65 OFPP_TABLE = 0xfffffff9,
66 OFPP_NORMAL = 0xfffffffa,
67 OFPP_FLOOD = 0xfffffffb,
68 OFPP_ALL = 0xfffffffc,
69 OFPP_CONTROLLER = 0xfffffffd,
70 OFPP_LOCAL = 0xfffffffe,
Rich Lane5d33a622013-04-08 17:33:11 -070071 OFPP_ANY = 0xffffffff,
72};
73
Andreas Wundsam4ee51462013-07-30 11:00:37 -070074enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070075 OFPT_HELLO = 0,
76 OFPT_ERROR = 1,
77 OFPT_ECHO_REQUEST = 2,
78 OFPT_ECHO_REPLY = 3,
79 OFPT_EXPERIMENTER = 4,
80 OFPT_FEATURES_REQUEST = 5,
81 OFPT_FEATURES_REPLY = 6,
82 OFPT_GET_CONFIG_REQUEST = 7,
83 OFPT_GET_CONFIG_REPLY = 8,
84 OFPT_SET_CONFIG = 9,
85 OFPT_PACKET_IN = 10,
86 OFPT_FLOW_REMOVED = 11,
87 OFPT_PORT_STATUS = 12,
88 OFPT_PACKET_OUT = 13,
89 OFPT_FLOW_MOD = 14,
90 OFPT_GROUP_MOD = 15,
91 OFPT_PORT_MOD = 16,
92 OFPT_TABLE_MOD = 17,
93 OFPT_STATS_REQUEST = 18,
94 OFPT_STATS_REPLY = 19,
95 OFPT_BARRIER_REQUEST = 20,
96 OFPT_BARRIER_REPLY = 21,
97 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
98 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
99 OFPT_ROLE_REQUEST = 24,
100 OFPT_ROLE_REPLY = 25,
101};
102
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700103enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700104 OFPC_FRAG_NORMAL = 0,
105 OFPC_FRAG_DROP = 1,
106 OFPC_FRAG_REASM = 2,
107 OFPC_FRAG_MASK = 3,
108 OFPC_INVALID_TTL_TO_CONTROLLER = 4,
109};
110
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700111enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700112 OFPTC_TABLE_MISS_CONTROLLER = 0,
113 OFPTC_TABLE_MISS_CONTINUE = 1,
114 OFPTC_TABLE_MISS_DROP = 2,
115 OFPTC_TABLE_MISS_MASK = 3,
116};
117
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700118enum ofp_table(wire_type=uint8_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700119 OFPTT_MAX = 0xfe,
120 OFPTT_ALL = 0xff,
121};
122
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700123enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700124 OFPC_FLOW_STATS = 0x1,
125 OFPC_TABLE_STATS = 0x2,
126 OFPC_PORT_STATS = 0x4,
127 OFPC_GROUP_STATS = 0x8,
128 OFPC_IP_REASM = 0x20,
129 OFPC_QUEUE_STATS = 0x40,
130 OFPC_PORT_BLOCKED = 0x100,
131};
132
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700133enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700134 OFPPC_PORT_DOWN = 0x1,
135 OFPPC_NO_RECV = 0x4,
136 OFPPC_NO_FWD = 0x20,
137 OFPPC_NO_PACKET_IN = 0x40,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -0700138 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700139};
140
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700141enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700142 OFPPS_LINK_DOWN = 0x1,
143 OFPPS_BLOCKED = 0x2,
144 OFPPS_LIVE = 0x4,
145};
146
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700147enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700148 OFPPF_10MB_HD = 0x1,
149 OFPPF_10MB_FD = 0x2,
150 OFPPF_100MB_HD = 0x4,
151 OFPPF_100MB_FD = 0x8,
152 OFPPF_1GB_HD = 0x10,
153 OFPPF_1GB_FD = 0x20,
154 OFPPF_10GB_FD = 0x40,
155 OFPPF_40GB_FD = 0x80,
156 OFPPF_100GB_FD = 0x100,
157 OFPPF_1TB_FD = 0x200,
158 OFPPF_OTHER = 0x400,
159 OFPPF_COPPER = 0x800,
160 OFPPF_FIBER = 0x1000,
161 OFPPF_AUTONEG = 0x2000,
162 OFPPF_PAUSE = 0x4000,
163 OFPPF_PAUSE_ASYM = 0x8000,
164};
165
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700166enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700167 OFPPR_ADD = 0,
168 OFPPR_DELETE = 1,
169 OFPPR_MODIFY = 2,
170};
171
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700172enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700173 OFPMT_STANDARD = 0,
174 OFPMT_OXM = 1,
175};
176
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700177enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700178 OFPXMC_NXM_0 = 0,
179 OFPXMC_NXM_1 = 1,
180 OFPXMC_OPENFLOW_BASIC = 0x8000,
181 OFPXMC_EXPERIMENTER = 0xffff,
182};
183
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700184enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700185 OFPVID_NONE = 0,
186 OFPVID_PRESENT = 0x1000,
187};
188
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700189enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700190 OFPAT_OUTPUT = 0,
191 OFPAT_COPY_TTL_OUT = 0xb,
192 OFPAT_COPY_TTL_IN = 0xc,
193 OFPAT_SET_MPLS_TTL = 0xf,
194 OFPAT_DEC_MPLS_TTL = 0x10,
195 OFPAT_PUSH_VLAN = 0x11,
196 OFPAT_POP_VLAN = 0x12,
197 OFPAT_PUSH_MPLS = 0x13,
198 OFPAT_POP_MPLS = 0x14,
199 OFPAT_SET_QUEUE = 0x15,
200 OFPAT_GROUP = 0x16,
201 OFPAT_SET_NW_TTL = 0x17,
202 OFPAT_DEC_NW_TTL = 0x18,
203 OFPAT_SET_FIELD = 0x19,
204 OFPAT_EXPERIMENTER = 0xffff,
205};
206
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700207enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700208 OFPCML_MAX = 0xffe5,
209 OFPCML_NO_BUFFER = 0xffff,
210};
211
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700212enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700213 OFPIT_GOTO_TABLE = 0x1,
214 OFPIT_WRITE_METADATA = 0x2,
215 OFPIT_WRITE_ACTIONS = 0x3,
216 OFPIT_APPLY_ACTIONS = 0x4,
217 OFPIT_CLEAR_ACTIONS = 0x5,
218 OFPIT_EXPERIMENTER = 0xffff,
219};
220
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700221enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700222 OFPFC_ADD = 0,
223 OFPFC_MODIFY = 1,
224 OFPFC_MODIFY_STRICT = 2,
225 OFPFC_DELETE = 3,
226 OFPFC_DELETE_STRICT = 4,
227};
228
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700229enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700230 OFPFF_SEND_FLOW_REM = 0x1,
231 OFPFF_CHECK_OVERLAP = 0x2,
232 OFPFF_RESET_COUNTS = 0x4,
233};
234
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700235enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700236 OFPG_MAX = 0xffffff00,
237 OFPG_ALL = 0xfffffffc,
238 OFPG_ANY = 0xffffffff,
239};
240
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700241enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700242 OFPGC_ADD = 0,
243 OFPGC_MODIFY = 1,
244 OFPGC_DELETE = 2,
245};
246
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700247enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700248 OFPGT_ALL = 0,
249 OFPGT_SELECT = 1,
250 OFPGT_INDIRECT = 2,
251 OFPGT_FF = 3,
252};
253
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700254enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700255 OFPR_NO_MATCH = 0,
256 OFPR_ACTION = 1,
257 OFPR_INVALID_TTL = 2,
258};
259
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700260enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700261 OFPRR_IDLE_TIMEOUT = 0,
262 OFPRR_HARD_TIMEOUT = 1,
263 OFPRR_DELETE = 2,
264 OFPRR_GROUP_DELETE = 3,
265};
266
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700267enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700268 OFPET_HELLO_FAILED = 0,
269 OFPET_BAD_REQUEST = 1,
270 OFPET_BAD_ACTION = 2,
271 OFPET_BAD_INSTRUCTION = 3,
272 OFPET_BAD_MATCH = 4,
273 OFPET_FLOW_MOD_FAILED = 5,
274 OFPET_GROUP_MOD_FAILED = 6,
275 OFPET_PORT_MOD_FAILED = 7,
276 OFPET_TABLE_MOD_FAILED = 8,
277 OFPET_QUEUE_OP_FAILED = 9,
278 OFPET_SWITCH_CONFIG_FAILED = 10,
279 OFPET_ROLE_REQUEST_FAILED = 11,
280 OFPET_EXPERIMENTER = 0xffff,
281};
282
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700283enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700284 OFPHFC_INCOMPATIBLE = 0,
285 OFPHFC_EPERM = 1,
286};
287
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700288enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700289 OFPBRC_BAD_VERSION = 0,
290 OFPBRC_BAD_TYPE = 1,
291 OFPBRC_BAD_STAT = 2,
292 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700293 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700294 OFPBRC_EPERM = 5,
295 OFPBRC_BAD_LEN = 6,
296 OFPBRC_BUFFER_EMPTY = 7,
297 OFPBRC_BUFFER_UNKNOWN = 8,
298 OFPBRC_BAD_TABLE_ID = 9,
299 OFPBRC_IS_SLAVE = 10,
300 OFPBRC_BAD_PORT = 11,
301 OFPBRC_BAD_PACKET = 12,
302};
303
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700304enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700305 OFPBAC_BAD_TYPE = 0,
306 OFPBAC_BAD_LEN = 1,
307 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700308 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700309 OFPBAC_BAD_OUT_PORT = 4,
310 OFPBAC_BAD_ARGUMENT = 5,
311 OFPBAC_EPERM = 6,
312 OFPBAC_TOO_MANY = 7,
313 OFPBAC_BAD_QUEUE = 8,
314 OFPBAC_BAD_OUT_GROUP = 9,
315 OFPBAC_MATCH_INCONSISTENT = 10,
316 OFPBAC_UNSUPPORTED_ORDER = 11,
317 OFPBAC_BAD_TAG = 12,
318 OFPBAC_BAD_SET_TYPE = 13,
319 OFPBAC_BAD_SET_LEN = 14,
320 OFPBAC_BAD_SET_ARGUMENT = 15,
321};
322
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700323enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700324 OFPBIC_UNKNOWN_INST = 0,
325 OFPBIC_UNSUP_INST = 1,
326 OFPBIC_BAD_TABLE_ID = 2,
327 OFPBIC_UNSUP_METADATA = 3,
328 OFPBIC_UNSUP_METADATA_MASK = 4,
329 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700330 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700331 OFPBIC_BAD_LEN = 7,
332 OFPBIC_EPERM = 8,
333};
334
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700335enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700336 OFPBMC_BAD_TYPE = 0,
337 OFPBMC_BAD_LEN = 1,
338 OFPBMC_BAD_TAG = 2,
339 OFPBMC_BAD_DL_ADDR_MASK = 3,
340 OFPBMC_BAD_NW_ADDR_MASK = 4,
341 OFPBMC_BAD_WILDCARDS = 5,
342 OFPBMC_BAD_FIELD = 6,
343 OFPBMC_BAD_VALUE = 7,
344 OFPBMC_BAD_MASK = 8,
345 OFPBMC_BAD_PREREQ = 9,
346 OFPBMC_DUP_FIELD = 10,
347 OFPBMC_EPERM = 11,
348};
349
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700350enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700351 OFPFMFC_UNKNOWN = 0,
352 OFPFMFC_TABLE_FULL = 1,
353 OFPFMFC_BAD_TABLE_ID = 2,
354 OFPFMFC_OVERLAP = 3,
355 OFPFMFC_EPERM = 4,
356 OFPFMFC_BAD_TIMEOUT = 5,
357 OFPFMFC_BAD_COMMAND = 6,
358 OFPFMFC_BAD_FLAGS = 7,
359};
360
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700361enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700362 OFPGMFC_GROUP_EXISTS = 0,
363 OFPGMFC_INVALID_GROUP = 1,
364 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
365 OFPGMFC_OUT_OF_GROUPS = 3,
366 OFPGMFC_OUT_OF_BUCKETS = 4,
367 OFPGMFC_CHAINING_UNSUPPORTED = 5,
368 OFPGMFC_WATCH_UNSUPPORTED = 6,
369 OFPGMFC_LOOP = 7,
370 OFPGMFC_UNKNOWN_GROUP = 8,
371 OFPGMFC_CHAINED_GROUP = 9,
372 OFPGMFC_BAD_TYPE = 10,
373 OFPGMFC_BAD_COMMAND = 11,
374 OFPGMFC_BAD_BUCKET = 12,
375 OFPGMFC_BAD_WATCH = 13,
376 OFPGMFC_EPERM = 14,
377};
378
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700379enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700380 OFPPMFC_BAD_PORT = 0,
381 OFPPMFC_BAD_HW_ADDR = 1,
382 OFPPMFC_BAD_CONFIG = 2,
383 OFPPMFC_BAD_ADVERTISE = 3,
384 OFPPMFC_EPERM = 4,
385};
386
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700387enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700388 OFPTMFC_BAD_TABLE = 0,
389 OFPTMFC_BAD_CONFIG = 1,
390 OFPTMFC_EPERM = 2,
391};
392
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700393enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700394 OFPQOFC_BAD_PORT = 0,
395 OFPQOFC_BAD_QUEUE = 1,
396 OFPQOFC_EPERM = 2,
397};
398
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700399enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700400 OFPSCFC_BAD_FLAGS = 0,
401 OFPSCFC_BAD_LEN = 1,
402 OFPSCFC_EPERM = 2,
403};
404
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700405enum ofp_role_request_failed_code (wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700406 OFPRRFC_STALE = 0,
407 OFPRRFC_UNSUP = 1,
408 OFPRRFC_BAD_ROLE = 2,
409};
410
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700411enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700412 OFPST_DESC = 0,
413 OFPST_FLOW = 1,
414 OFPST_AGGREGATE = 2,
415 OFPST_TABLE = 3,
416 OFPST_PORT = 4,
417 OFPST_QUEUE = 5,
418 OFPST_GROUP = 6,
419 OFPST_GROUP_DESC = 7,
420 OFPST_GROUP_FEATURES = 8,
421 OFPST_EXPERIMENTER = 0xffff,
422};
423
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700424enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
425};
426
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700427enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700428 OFPSF_REPLY_MORE = 0x1,
429};
430
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700431enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700432 OFPGFC_SELECT_WEIGHT = 0x1,
433 OFPGFC_SELECT_LIVENESS = 0x2,
434 OFPGFC_CHAINING = 0x4,
435 OFPGFC_CHAINING_CHECKS = 0x8,
436};
437
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700438enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700439 OFPQT_MIN_RATE = 0x1,
440 OFPQT_MAX_RATE = 0x2,
441 OFPQT_EXPERIMENTER = 0xffff,
442};
443
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700444enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700445 OFPCR_ROLE_NOCHANGE = 0,
446 OFPCR_ROLE_EQUAL = 1,
447 OFPCR_ROLE_MASTER = 2,
448 OFPCR_ROLE_SLAVE = 3,
449};
450
Rich Lanee9c37db2013-06-21 18:30:24 -0700451/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700452struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700453 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700454 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700455 uint16_t length;
456 uint32_t xid;
457};
458
Rich Lanee9c37db2013-06-21 18:30:24 -0700459struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700460 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700461 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700462 uint16_t length;
463 uint32_t xid;
464};
465
Rich Lanee9c37db2013-06-21 18:30:24 -0700466struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700467 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700468 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700469 uint16_t length;
470 uint32_t xid;
471 of_octets_t data;
472};
473
Rich Lanee9c37db2013-06-21 18:30:24 -0700474struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700475 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700476 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700477 uint16_t length;
478 uint32_t xid;
479 of_octets_t data;
480};
481
Rich Lanee9c37db2013-06-21 18:30:24 -0700482struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700483 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700484 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700485 uint16_t length;
486 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700487 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700488 uint32_t subtype;
489 of_octets_t data;
490};
491
Rich Lanee9c37db2013-06-21 18:30:24 -0700492struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700493 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700494 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700495 uint16_t length;
496 uint32_t xid;
497};
498
Rich Lanee9c37db2013-06-21 18:30:24 -0700499struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700500 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700501 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700502 uint16_t length;
503 uint32_t xid;
504};
505
Rich Lanee9c37db2013-06-21 18:30:24 -0700506struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700507 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700508 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700509 uint16_t length;
510 uint32_t xid;
511};
512
Rich Lanee9c37db2013-06-21 18:30:24 -0700513struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700514 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700515 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700516 uint16_t length;
517 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800518 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700519 uint16_t miss_send_len;
520};
521
Rich Lanee9c37db2013-06-21 18:30:24 -0700522struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700523 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700524 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700525 uint16_t length;
526 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800527 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700528 uint16_t miss_send_len;
529};
530
Rich Lanee9c37db2013-06-21 18:30:24 -0700531struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700532 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700533 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700534 uint16_t length;
535 uint32_t xid;
536 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700537 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700538 uint32_t config;
539};
540
Rich Lane68ae4d72013-05-09 10:55:19 -0700541struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700542 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700543 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700544 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700545 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700546 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700547 enum ofp_port_config config;
548 enum ofp_port_state state;
549 enum ofp_port_features curr;
550 enum ofp_port_features advertised;
551 enum ofp_port_features supported;
552 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700553 uint32_t curr_speed;
554 uint32_t max_speed;
555};
556
Rich Lanee9c37db2013-06-21 18:30:24 -0700557struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700558 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700559 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700560 uint16_t length;
561 uint32_t xid;
562};
563
Rich Lanee9c37db2013-06-21 18:30:24 -0700564struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700565 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700566 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700567 uint16_t length;
568 uint32_t xid;
569 uint64_t datapath_id;
570 uint32_t n_buffers;
571 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700572 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700573 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700574 uint32_t reserved;
575 list(of_port_desc_t) ports;
576};
577
Rich Lanee9c37db2013-06-21 18:30:24 -0700578struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700579 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700580 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700581 uint16_t length;
582 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700583 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700584 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700585 of_port_desc_t desc;
586};
587
Rich Lanee9c37db2013-06-21 18:30:24 -0700588struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700589 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700590 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700591 uint16_t length;
592 uint32_t xid;
593 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700594 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700595 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700596 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint32_t config;
598 uint32_t mask;
599 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700600 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700601};
602
Andreas Wundsam5da68512013-10-22 22:18:00 -0700603struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700604 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700605 uint16_t length;
606 list(of_oxm_t) oxm_list;
607};
608
Rich Lanee9c37db2013-06-21 18:30:24 -0700609struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700610 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700611 uint16_t len;
612 of_port_no_t port;
613 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700614 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700615};
616
Rich Lanee9c37db2013-06-21 18:30:24 -0700617struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700618 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700619 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700620 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700621};
622
Rich Lanee9c37db2013-06-21 18:30:24 -0700623struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700624 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700625 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700626 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700627};
628
Rich Lanee9c37db2013-06-21 18:30:24 -0700629struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700630 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint16_t len;
632 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700633 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700634};
635
Rich Lanee9c37db2013-06-21 18:30:24 -0700636struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700637 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700638 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700639 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700640};
641
Rich Lanee9c37db2013-06-21 18:30:24 -0700642struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700643 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700644 uint16_t len;
645 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700646 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700647};
648
Rich Lanee9c37db2013-06-21 18:30:24 -0700649struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700650 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700651 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700652 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700653};
654
Rich Lanee9c37db2013-06-21 18:30:24 -0700655struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700656 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700657 uint16_t len;
658 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700659 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700660};
661
Rich Lanee9c37db2013-06-21 18:30:24 -0700662struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700663 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700664 uint16_t len;
665 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700666 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700667};
668
Rich Lanee9c37db2013-06-21 18:30:24 -0700669struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700670 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700671 uint16_t len;
672 uint32_t queue_id;
673};
674
Rich Lanee9c37db2013-06-21 18:30:24 -0700675struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700676 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700677 uint16_t len;
678 uint32_t group_id;
679};
680
Rich Lanee9c37db2013-06-21 18:30:24 -0700681struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700682 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700683 uint16_t len;
684 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700685 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700686};
687
Rich Lanee9c37db2013-06-21 18:30:24 -0700688struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700689 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700690 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700691 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700692};
693
Andreas Wundsam5da68512013-10-22 22:18:00 -0700694struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700695 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700697 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700698};
699
Andreas Wundsam5da68512013-10-22 22:18:00 -0700700struct of_action_experimenter(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700701 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700702 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700703 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700704 of_octets_t data;
705};
706
Rich Lane68ae4d72013-05-09 10:55:19 -0700707struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700708 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700709 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700710 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700711};
712
Rich Lane68ae4d72013-05-09 10:55:19 -0700713struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700714 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700715 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700716 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700717};
718
Rich Lanee9c37db2013-06-21 18:30:24 -0700719struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700720 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700721 uint16_t len;
722 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700723 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700724};
725
Rich Lanee9c37db2013-06-21 18:30:24 -0700726struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700727 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700728 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700729 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700730 uint64_t metadata;
731 uint64_t metadata_mask;
732};
733
Rich Lanee9c37db2013-06-21 18:30:24 -0700734struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700735 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700736 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700737 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700738 list(of_action_t) actions;
739};
740
Rich Lanee9c37db2013-06-21 18:30:24 -0700741struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700742 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700743 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700744 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700745 list(of_action_t) actions;
746};
747
Rich Lanee9c37db2013-06-21 18:30:24 -0700748struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700749 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700750 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700751 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700752};
753
Rich Lanee9c37db2013-06-21 18:30:24 -0700754struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700755 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700756 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700757 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700758 of_octets_t data;
759};
760
Rich Lanee9c37db2013-06-21 18:30:24 -0700761struct of_flow_mod : of_header {
762 uint8_t version;
763 uint8_t type == 14;
764 uint16_t length;
765 uint32_t xid;
766 uint64_t cookie;
767 uint64_t cookie_mask;
768 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700769 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700770 uint16_t idle_timeout;
771 uint16_t hard_timeout;
772 uint16_t priority;
773 uint32_t buffer_id;
774 of_port_no_t out_port;
775 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700776 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700777 pad(2);
778 of_match_t match;
779 list(of_instruction_t) instructions;
780};
781
782struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700783 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700784 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700785 uint16_t length;
786 uint32_t xid;
787 uint64_t cookie;
788 uint64_t cookie_mask;
789 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700790 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700791 uint16_t idle_timeout;
792 uint16_t hard_timeout;
793 uint16_t priority;
794 uint32_t buffer_id;
795 of_port_no_t out_port;
796 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700797 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700798 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700799 of_match_t match;
800 list(of_instruction_t) instructions;
801};
802
Rich Lanee9c37db2013-06-21 18:30:24 -0700803struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700804 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700805 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700806 uint16_t length;
807 uint32_t xid;
808 uint64_t cookie;
809 uint64_t cookie_mask;
810 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700811 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700812 uint16_t idle_timeout;
813 uint16_t hard_timeout;
814 uint16_t priority;
815 uint32_t buffer_id;
816 of_port_no_t out_port;
817 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700818 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700819 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700820 of_match_t match;
821 list(of_instruction_t) instructions;
822};
823
Rich Lanee9c37db2013-06-21 18:30:24 -0700824struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700825 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700826 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700827 uint16_t length;
828 uint32_t xid;
829 uint64_t cookie;
830 uint64_t cookie_mask;
831 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700832 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700833 uint16_t idle_timeout;
834 uint16_t hard_timeout;
835 uint16_t priority;
836 uint32_t buffer_id;
837 of_port_no_t out_port;
838 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700839 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700840 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700841 of_match_t match;
842 list(of_instruction_t) instructions;
843};
844
Rich Lanee9c37db2013-06-21 18:30:24 -0700845struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700846 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700847 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700848 uint16_t length;
849 uint32_t xid;
850 uint64_t cookie;
851 uint64_t cookie_mask;
852 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700853 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700854 uint16_t idle_timeout;
855 uint16_t hard_timeout;
856 uint16_t priority;
857 uint32_t buffer_id;
858 of_port_no_t out_port;
859 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700860 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700861 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700862 of_match_t match;
863 list(of_instruction_t) instructions;
864};
865
Rich Lanee9c37db2013-06-21 18:30:24 -0700866struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700867 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700868 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700869 uint16_t length;
870 uint32_t xid;
871 uint64_t cookie;
872 uint64_t cookie_mask;
873 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700874 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700875 uint16_t idle_timeout;
876 uint16_t hard_timeout;
877 uint16_t priority;
878 uint32_t buffer_id;
879 of_port_no_t out_port;
880 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700881 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700882 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700883 of_match_t match;
884 list(of_instruction_t) instructions;
885};
886
Rich Lane68ae4d72013-05-09 10:55:19 -0700887struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 uint16_t len;
889 uint16_t weight;
890 of_port_no_t watch_port;
891 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700892 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700893 list(of_action_t) actions;
894};
895
Rich Lanee9c37db2013-06-21 18:30:24 -0700896struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700897 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700898 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700899 uint16_t length;
900 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -0800901 enum ofp_group_mod_command command == ?;
902 enum ofp_group_type group_type;
903 pad(1);
904 uint32_t group_id;
905 list(of_bucket_t) buckets;
906};
907
908struct of_group_add : of_group_mod {
909 uint8_t version;
910 uint8_t type == 15;
911 uint16_t length;
912 uint32_t xid;
913 enum ofp_group_mod_command command == 0;
914 enum ofp_group_type group_type;
915 pad(1);
916 uint32_t group_id;
917 list(of_bucket_t) buckets;
918};
919
920struct of_group_modify : of_group_mod {
921 uint8_t version;
922 uint8_t type == 15;
923 uint16_t length;
924 uint32_t xid;
925 enum ofp_group_mod_command command == 1;
926 enum ofp_group_type group_type;
927 pad(1);
928 uint32_t group_id;
929 list(of_bucket_t) buckets;
930};
931
932struct of_group_delete : of_group_mod {
933 uint8_t version;
934 uint8_t type == 15;
935 uint16_t length;
936 uint32_t xid;
937 enum ofp_group_mod_command command == 2;
938 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700939 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700940 uint32_t group_id;
941 list(of_bucket_t) buckets;
942};
943
Rich Lanee9c37db2013-06-21 18:30:24 -0700944struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700945 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700946 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700947 uint16_t length;
948 uint32_t xid;
949 uint32_t buffer_id;
950 of_port_no_t in_port;
951 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700952 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700953 list(of_action_t) actions;
954 of_octets_t data;
955};
956
Rich Lanee9c37db2013-06-21 18:30:24 -0700957struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700958 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700959 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700960 uint16_t length;
961 uint32_t xid;
962 uint32_t buffer_id;
963 uint16_t total_len;
964 uint8_t reason;
965 uint8_t table_id;
966 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700967 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700968 of_octets_t data; /* FIXME: Ensure total_len gets updated */
969};
970
Rich Lanee9c37db2013-06-21 18:30:24 -0700971struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700972 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700973 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700974 uint16_t length;
975 uint32_t xid;
976 uint64_t cookie;
977 uint16_t priority;
978 uint8_t reason;
979 uint8_t table_id;
980 uint32_t duration_sec;
981 uint32_t duration_nsec;
982 uint16_t idle_timeout;
983 uint16_t hard_timeout;
984 uint64_t packet_count;
985 uint64_t byte_count;
986 of_match_t match;
987};
988
Rich Lanee9c37db2013-06-21 18:30:24 -0700989struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700990 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700991 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700992 uint16_t length;
993 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700994 uint16_t err_type == ?;
995};
996
997struct of_hello_failed_error_msg : of_error_msg {
998 uint8_t version;
999 uint8_t type == 1;
1000 uint16_t length;
1001 uint32_t xid;
1002 uint16_t err_type == 0;
1003 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001004 of_octets_t data;
1005};
1006
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001007struct of_bad_request_error_msg : of_error_msg {
1008 uint8_t version;
1009 uint8_t type == 1;
1010 uint16_t length;
1011 uint32_t xid;
1012 uint16_t err_type == 1;
1013 enum ofp_bad_request_code code;
1014 of_octets_t data;
1015};
1016
1017struct of_bad_action_error_msg : of_error_msg {
1018 uint8_t version;
1019 uint8_t type == 1;
1020 uint16_t length;
1021 uint32_t xid;
1022 uint16_t err_type == 2;
1023 enum ofp_bad_action_code code;
1024 of_octets_t data;
1025};
1026
1027struct of_bad_instruction_error_msg : of_error_msg {
1028 uint8_t version;
1029 uint8_t type == 1;
1030 uint16_t length;
1031 uint32_t xid;
1032 uint16_t err_type == 3;
1033 enum ofp_bad_instruction_code code;
1034 of_octets_t data;
1035};
1036
1037struct of_bad_match_error_msg : of_error_msg {
1038 uint8_t version;
1039 uint8_t type == 1;
1040 uint16_t length;
1041 uint32_t xid;
1042 uint16_t err_type == 4;
1043 enum ofp_bad_match_code code;
1044 of_octets_t data;
1045};
1046
1047struct of_flow_mod_failed_error_msg : of_error_msg {
1048 uint8_t version;
1049 uint8_t type == 1;
1050 uint16_t length;
1051 uint32_t xid;
1052 uint16_t err_type == 5;
1053 enum ofp_flow_mod_failed_code code;
1054 of_octets_t data;
1055};
1056
1057struct of_group_mod_failed_error_msg : of_error_msg {
1058 uint8_t version;
1059 uint8_t type == 1;
1060 uint16_t length;
1061 uint32_t xid;
1062 uint16_t err_type == 6;
1063 enum ofp_group_mod_failed_code code;
1064 of_octets_t data;
1065};
1066
1067struct of_port_mod_failed_error_msg : of_error_msg {
1068 uint8_t version;
1069 uint8_t type == 1;
1070 uint16_t length;
1071 uint32_t xid;
1072 uint16_t err_type == 7;
1073 enum ofp_port_mod_failed_code code;
1074 of_octets_t data;
1075};
1076
1077struct of_table_mod_failed_error_msg : of_error_msg {
1078 uint8_t version;
1079 uint8_t type == 1;
1080 uint16_t length;
1081 uint32_t xid;
1082 uint16_t err_type == 8;
1083 enum ofp_table_mod_failed_code code;
1084 of_octets_t data;
1085};
1086
1087struct of_queue_op_failed_error_msg : of_error_msg {
1088 uint8_t version;
1089 uint8_t type == 1;
1090 uint16_t length;
1091 uint32_t xid;
1092 uint16_t err_type == 9;
1093 enum ofp_queue_op_failed_code code;
1094 of_octets_t data;
1095};
1096
1097struct of_switch_config_failed_error_msg : of_error_msg {
1098 uint8_t version;
1099 uint8_t type == 1;
1100 uint16_t length;
1101 uint32_t xid;
1102 uint16_t err_type == 10;
1103 enum ofp_switch_config_failed_code code;
1104 of_octets_t data;
1105};
1106
1107struct of_role_request_failed_error_msg : of_error_msg {
1108 uint8_t version;
1109 uint8_t type == 1;
1110 uint16_t length;
1111 uint32_t xid;
1112 uint16_t err_type == 11;
1113 enum ofp_role_request_failed_code code;
1114 of_octets_t data;
1115};
1116
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001117struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001118 uint8_t version;
1119 uint8_t type == 1;
1120 uint16_t length;
1121 uint32_t xid;
1122 uint16_t err_type == 0xffff;
1123 uint16_t subtype;
1124 uint32_t experimenter;
1125 of_octets_t data;
1126};
Rich Lanea06d0c32013-03-25 08:52:03 -07001127
1128// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1129// FIXME: Verify disambiguation w/ length in object and entry
1130
Rich Lane68ae4d72013-05-09 10:55:19 -07001131struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001132 uint16_t length;
1133 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001134 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001135 uint32_t duration_sec;
1136 uint32_t duration_nsec;
1137 uint16_t priority;
1138 uint16_t idle_timeout;
1139 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001140 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001141 uint64_t cookie;
1142 uint64_t packet_count;
1143 uint64_t byte_count;
1144 of_match_t match;
1145 list(of_instruction_t) instructions;
1146};
1147
Rich Lane68ae4d72013-05-09 10:55:19 -07001148struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001149 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001150 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -07001151 of_table_name_t name;
1152 of_match_bmap_t match;
1153 of_wc_bmap_t wildcards;
1154 uint32_t write_actions;
1155 uint32_t apply_actions;
1156 uint64_t write_setfields;
1157 uint64_t apply_setfields;
1158 uint64_t metadata_match;
1159 uint64_t metadata_write;
1160 uint32_t instructions;
1161 uint32_t config;
1162 uint32_t max_entries;
1163 uint32_t active_count;
1164 uint64_t lookup_count;
1165 uint64_t matched_count;
1166};
1167
Rich Lane68ae4d72013-05-09 10:55:19 -07001168struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001169 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001170 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001171 uint64_t rx_packets;
1172 uint64_t tx_packets;
1173 uint64_t rx_bytes;
1174 uint64_t tx_bytes;
1175 uint64_t rx_dropped;
1176 uint64_t tx_dropped;
1177 uint64_t rx_errors;
1178 uint64_t tx_errors;
1179 uint64_t rx_frame_err;
1180 uint64_t rx_over_err;
1181 uint64_t rx_crc_err;
1182 uint64_t collisions;
1183};
1184
Rich Lane68ae4d72013-05-09 10:55:19 -07001185struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001186 of_port_no_t port_no;
1187 uint32_t queue_id;
1188 uint64_t tx_bytes;
1189 uint64_t tx_packets;
1190 uint64_t tx_errors;
1191};
1192
Rich Lane68ae4d72013-05-09 10:55:19 -07001193struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001194 uint64_t packet_count;
1195 uint64_t byte_count;
1196};
1197
Rich Lane68ae4d72013-05-09 10:55:19 -07001198struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001199 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001200 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001201 uint32_t group_id;
1202 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001203 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001204 uint64_t packet_count;
1205 uint64_t byte_count;
1206 list(of_bucket_counter_t) bucket_stats;
1207};
1208
Rich Lane68ae4d72013-05-09 10:55:19 -07001209struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001210 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001211 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001212 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001213 uint32_t group_id;
1214 list(of_bucket_t) buckets;
1215};
1216
1217// STATS:
1218// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1219
Rich Lanee9c37db2013-06-21 18:30:24 -07001220struct of_stats_request : of_header {
1221 uint8_t version;
1222 uint8_t type == 18;
1223 uint16_t length;
1224 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001225 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001226 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001227 pad(4);
1228};
1229
1230struct of_stats_reply : of_header {
1231 uint8_t version;
1232 uint8_t type == 19;
1233 uint16_t length;
1234 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001235 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001236 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001237 pad(4);
1238};
1239
1240struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001241 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001242 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001243 uint16_t length;
1244 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001245 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001246 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001247 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001248};
1249
Rich Lanee9c37db2013-06-21 18:30:24 -07001250struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001251 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001252 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001253 uint16_t length;
1254 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001255 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001256 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001257 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001258 of_desc_str_t mfr_desc;
1259 of_desc_str_t hw_desc;
1260 of_desc_str_t sw_desc;
1261 of_serial_num_t serial_num;
1262 of_desc_str_t dp_desc;
1263};
1264
Rich Lanee9c37db2013-06-21 18:30:24 -07001265struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001266 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001267 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001268 uint16_t length;
1269 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001270 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001271 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001272 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001273 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001274 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001275 of_port_no_t out_port;
1276 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001277 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001278 uint64_t cookie;
1279 uint64_t cookie_mask;
1280 of_match_t match;
1281};
1282
Rich Lanee9c37db2013-06-21 18:30:24 -07001283struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001284 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001285 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001286 uint16_t length;
1287 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001288 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001289 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001290 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001291 list(of_flow_stats_entry_t) entries;
1292};
1293
Rich Lanee9c37db2013-06-21 18:30:24 -07001294struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001295 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001296 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001297 uint16_t length;
1298 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001299 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001300 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001301 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001302 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001303 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001304 of_port_no_t out_port;
1305 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001306 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001307 uint64_t cookie;
1308 uint64_t cookie_mask;
1309 of_match_t match;
1310};
1311
Rich Lanee9c37db2013-06-21 18:30:24 -07001312struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001313 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001314 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001315 uint16_t length;
1316 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001317 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001318 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001319 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001320 uint64_t packet_count;
1321 uint64_t byte_count;
1322 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001323 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001324};
1325
Rich Lanee9c37db2013-06-21 18:30:24 -07001326struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001327 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001328 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001329 uint16_t length;
1330 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001331 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001332 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001333 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001334};
1335
Rich Lanee9c37db2013-06-21 18:30:24 -07001336struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001337 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001338 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001339 uint16_t length;
1340 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001341 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001342 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001343 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001344 list(of_table_stats_entry_t) entries;
1345};
1346
Rich Lanee9c37db2013-06-21 18:30:24 -07001347struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001348 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001349 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001350 uint16_t length;
1351 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001352 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001353 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001354 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001355 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001356 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001357};
1358
Rich Lanee9c37db2013-06-21 18:30:24 -07001359struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001360 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001361 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001362 uint16_t length;
1363 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001364 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001365 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001366 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001367 list(of_port_stats_entry_t) entries;
1368};
1369
Rich Lanee9c37db2013-06-21 18:30:24 -07001370struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001371 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001372 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001373 uint16_t length;
1374 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001375 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001376 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001377 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001378 of_port_no_t port_no;
1379 uint32_t queue_id;
1380};
1381
Rich Lanee9c37db2013-06-21 18:30:24 -07001382struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001383 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001384 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001385 uint16_t length;
1386 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001387 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001388 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001389 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001390 list(of_queue_stats_entry_t) entries;
1391};
1392
Rich Lanee9c37db2013-06-21 18:30:24 -07001393struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001394 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001395 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001396 uint16_t length;
1397 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001398 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001399 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001400 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001402 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001403};
1404
Rich Lanee9c37db2013-06-21 18:30:24 -07001405struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001406 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001407 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001408 uint16_t length;
1409 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001410 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001411 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001412 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001413 list(of_group_stats_entry_t) entries;
1414};
1415
Rich Lanee9c37db2013-06-21 18:30:24 -07001416struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001417 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001418 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001419 uint16_t length;
1420 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001421 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001422 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001423 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001424};
1425
Rich Lanee9c37db2013-06-21 18:30:24 -07001426struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001427 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001428 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001429 uint16_t length;
1430 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001431 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001432 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001433 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001434 list(of_group_desc_stats_entry_t) entries;
1435};
1436
Rich Lanee9c37db2013-06-21 18:30:24 -07001437struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001438 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001439 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001440 uint16_t length;
1441 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001442 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001443 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001444 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001445};
1446
Rich Lanee9c37db2013-06-21 18:30:24 -07001447struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001448 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001449 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 uint16_t length;
1451 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001452 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001453 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001454 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001455 uint32_t types;
1456 uint32_t capabilities;
1457 uint32_t max_groups_all;
1458 uint32_t max_groups_select;
1459 uint32_t max_groups_indirect;
1460 uint32_t max_groups_ff;
1461 uint32_t actions_all;
1462 uint32_t actions_select;
1463 uint32_t actions_indirect;
1464 uint32_t actions_ff;
1465};
1466
Rich Lanee9c37db2013-06-21 18:30:24 -07001467struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001468 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001469 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001470 uint16_t length;
1471 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001472 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001473 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001474 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001475 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001476 uint32_t subtype;
1477 of_octets_t data;
1478};
1479
Rich Lanee9c37db2013-06-21 18:30:24 -07001480struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001481 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001482 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001483 uint16_t length;
1484 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001485 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001486 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001487 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001488 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001489 uint32_t subtype;
1490 of_octets_t data;
1491};
1492
1493// END OF STATS OBJECTS
1494
Rich Lane68ae4d72013-05-09 10:55:19 -07001495struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001496 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001497 uint16_t len;
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_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001502 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001503 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001504 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001505 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001506 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001507};
1508
Rich Lanee9c37db2013-06-21 18:30:24 -07001509struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001510 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001511 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001512 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001513 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001514 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001515};
1516
Rich Lanee9c37db2013-06-21 18:30:24 -07001517struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001518 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001519 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001520 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001521 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001522 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001523 of_octets_t data;
1524};
1525
Rich Lane68ae4d72013-05-09 10:55:19 -07001526struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001527 uint32_t queue_id;
1528 of_port_no_t port;
1529 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001530 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001531 list(of_queue_prop_t) properties;
1532};
1533
Rich Lanee9c37db2013-06-21 18:30:24 -07001534struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001535 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001536 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001537 uint16_t length;
1538 uint32_t xid;
1539 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001540 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001541};
1542
Rich Lanee9c37db2013-06-21 18:30:24 -07001543struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001544 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001545 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001546 uint16_t length;
1547 uint32_t xid;
1548 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001549 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001550 list(of_packet_queue_t) queues;
1551};
1552
Rich Lanee9c37db2013-06-21 18:30:24 -07001553struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001554 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001555 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001556 uint16_t length;
1557 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07001558 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001559 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001560 uint64_t generation_id;
1561};
1562
Rich Lanee9c37db2013-06-21 18:30:24 -07001563struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001564 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001565 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001566 uint16_t length;
1567 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07001568 enum ofp_controller_role role;
1569 pad(4);
1570 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07001571};