blob: 97adfd4129113624dd302d6cad944ed9058db976 [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
38 OFP_TCP_PORT = 6633,
39 OFP_SSL_PORT = 6633,
40
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,
140};
141
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700142enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700143 OFPPS_LINK_DOWN = 0x1,
144 OFPPS_BLOCKED = 0x2,
145 OFPPS_LIVE = 0x4,
146};
147
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700148enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700149 OFPPF_10MB_HD = 0x1,
150 OFPPF_10MB_FD = 0x2,
151 OFPPF_100MB_HD = 0x4,
152 OFPPF_100MB_FD = 0x8,
153 OFPPF_1GB_HD = 0x10,
154 OFPPF_1GB_FD = 0x20,
155 OFPPF_10GB_FD = 0x40,
156 OFPPF_40GB_FD = 0x80,
157 OFPPF_100GB_FD = 0x100,
158 OFPPF_1TB_FD = 0x200,
159 OFPPF_OTHER = 0x400,
160 OFPPF_COPPER = 0x800,
161 OFPPF_FIBER = 0x1000,
162 OFPPF_AUTONEG = 0x2000,
163 OFPPF_PAUSE = 0x4000,
164 OFPPF_PAUSE_ASYM = 0x8000,
165};
166
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700167enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700168 OFPPR_ADD = 0,
169 OFPPR_DELETE = 1,
170 OFPPR_MODIFY = 2,
171};
172
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700173enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700174 OFPMT_STANDARD = 0,
175 OFPMT_OXM = 1,
176};
177
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700178enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700179 OFPXMC_NXM_0 = 0,
180 OFPXMC_NXM_1 = 1,
181 OFPXMC_OPENFLOW_BASIC = 0x8000,
182 OFPXMC_EXPERIMENTER = 0xffff,
183};
184
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700185enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700186 OFPVID_NONE = 0,
187 OFPVID_PRESENT = 0x1000,
188};
189
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700190// FIXME: OF spec specified this as '9' bits, implicitly adding
191// to full byte
192enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700193 OFPIEH_NONEXT = 0x1,
194 OFPIEH_ESP = 0x2,
195 OFPIEH_AUTH = 0x4,
196 OFPIEH_DEST = 0x8,
197 OFPIEH_FRAG = 0x10,
198 OFPIEH_ROUTER = 0x20,
199 OFPIEH_HOP = 0x40,
200 OFPIEH_UNREP = 0x80,
201 OFPIEH_UNSEQ = 0x100,
202};
203
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700204enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700205 OFPAT_OUTPUT = 0,
206 OFPAT_COPY_TTL_OUT = 0xb,
207 OFPAT_COPY_TTL_IN = 0xc,
208 OFPAT_SET_MPLS_TTL = 0xf,
209 OFPAT_DEC_MPLS_TTL = 0x10,
210 OFPAT_PUSH_VLAN = 0x11,
211 OFPAT_POP_VLAN = 0x12,
212 OFPAT_PUSH_MPLS = 0x13,
213 OFPAT_POP_MPLS = 0x14,
214 OFPAT_SET_QUEUE = 0x15,
215 OFPAT_GROUP = 0x16,
216 OFPAT_SET_NW_TTL = 0x17,
217 OFPAT_DEC_NW_TTL = 0x18,
218 OFPAT_SET_FIELD = 0x19,
219 OFPAT_PUSH_PBB = 0x1a,
220 OFPAT_POP_PBB = 0x1b,
221 OFPAT_EXPERIMENTER = 0xffff,
222};
223
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700224enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700225 OFPCML_MAX = 0xffe5,
226 OFPCML_NO_BUFFER = 0xffff,
227};
228
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700229enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700230 OFPIT_GOTO_TABLE = 0x1,
231 OFPIT_WRITE_METADATA = 0x2,
232 OFPIT_WRITE_ACTIONS = 0x3,
233 OFPIT_APPLY_ACTIONS = 0x4,
234 OFPIT_CLEAR_ACTIONS = 0x5,
235 OFPIT_METER = 0x6,
236 OFPIT_EXPERIMENTER = 0xffff,
237};
238
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700239enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700240 OFPFC_ADD = 0,
241 OFPFC_MODIFY = 1,
242 OFPFC_MODIFY_STRICT = 2,
243 OFPFC_DELETE = 3,
244 OFPFC_DELETE_STRICT = 4,
245};
246
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700247enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700248 OFPFF_SEND_FLOW_REM = 0x1,
249 OFPFF_CHECK_OVERLAP = 0x2,
250 OFPFF_RESET_COUNTS = 0x4,
251 OFPFF_NO_PKT_COUNTS = 0x8,
252 OFPFF_NO_BYT_COUNTS = 0x10,
253};
254
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700255enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700256 OFPG_MAX = 0xffffff00,
257 OFPG_ALL = 0xfffffffc,
258 OFPG_ANY = 0xffffffff,
259};
260
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700261enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700262 OFPGC_ADD = 0,
263 OFPGC_MODIFY = 1,
264 OFPGC_DELETE = 2,
265};
266
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700267enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700268 OFPGT_ALL = 0,
269 OFPGT_SELECT = 1,
270 OFPGT_INDIRECT = 2,
271 OFPGT_FF = 3,
272};
273
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700274enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700275 OFPR_NO_MATCH = 0,
276 OFPR_ACTION = 1,
277 OFPR_INVALID_TTL = 2,
278};
279
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700280enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700281 OFPRR_IDLE_TIMEOUT = 0,
282 OFPRR_HARD_TIMEOUT = 1,
283 OFPRR_DELETE = 2,
284 OFPRR_GROUP_DELETE = 3,
285};
286
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700287enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700288 OFPM_MAX = 0xffff0000,
289 OFPM_SLOWPATH = 0xfffffffd,
290 OFPM_CONTROLLER = 0xfffffffe,
291 OFPM_ALL = 0xffffffff,
292};
293
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700294enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700295 OFPMBT_DROP = 0x1,
296 OFPMBT_DSCP_REMARK = 0x2,
297 OFPMBT_EXPERIMENTER = 0xffff,
298};
299
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700300enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700301 OFPMC_ADD = 0,
302 OFPMC_MODIFY = 1,
303 OFPMC_DELETE = 2,
304};
305
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700306enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700307 OFPMF_KBPS = 0x1,
308 OFPMF_PKTPS = 0x2,
309 OFPMF_BURST = 0x4,
310 OFPMF_STATS = 0x8,
311};
312
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700313enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700314 OFPET_HELLO_FAILED = 0,
315 OFPET_BAD_REQUEST = 1,
316 OFPET_BAD_ACTION = 2,
317 OFPET_BAD_INSTRUCTION = 3,
318 OFPET_BAD_MATCH = 4,
319 OFPET_FLOW_MOD_FAILED = 5,
320 OFPET_GROUP_MOD_FAILED = 6,
321 OFPET_PORT_MOD_FAILED = 7,
322 OFPET_TABLE_MOD_FAILED = 8,
323 OFPET_QUEUE_OP_FAILED = 9,
324 OFPET_SWITCH_CONFIG_FAILED = 10,
325 OFPET_ROLE_REQUEST_FAILED = 11,
326 OFPET_METER_MOD_FAILED = 12,
327 OFPET_TABLE_FEATURES_FAILED = 13,
328 OFPET_EXPERIMENTER = 0xffff,
329};
330
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700331enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700332 OFPHFC_INCOMPATIBLE = 0,
333 OFPHFC_EPERM = 1,
334};
335
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700336enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700337 OFPBRC_BAD_VERSION = 0,
338 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700339 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700340 OFPBRC_BAD_EXPERIMENTER = 3,
341 OFPBRC_BAD_EXP_TYPE = 4,
342 OFPBRC_EPERM = 5,
343 OFPBRC_BAD_LEN = 6,
344 OFPBRC_BUFFER_EMPTY = 7,
345 OFPBRC_BUFFER_UNKNOWN = 8,
346 OFPBRC_BAD_TABLE_ID = 9,
347 OFPBRC_IS_SLAVE = 10,
348 OFPBRC_BAD_PORT = 11,
349 OFPBRC_BAD_PACKET = 12,
350 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
351};
352
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700353enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700354 OFPBAC_BAD_TYPE = 0,
355 OFPBAC_BAD_LEN = 1,
356 OFPBAC_BAD_EXPERIMENTER = 2,
357 OFPBAC_BAD_EXP_TYPE = 3,
358 OFPBAC_BAD_OUT_PORT = 4,
359 OFPBAC_BAD_ARGUMENT = 5,
360 OFPBAC_EPERM = 6,
361 OFPBAC_TOO_MANY = 7,
362 OFPBAC_BAD_QUEUE = 8,
363 OFPBAC_BAD_OUT_GROUP = 9,
364 OFPBAC_MATCH_INCONSISTENT = 10,
365 OFPBAC_UNSUPPORTED_ORDER = 11,
366 OFPBAC_BAD_TAG = 12,
367 OFPBAC_BAD_SET_TYPE = 13,
368 OFPBAC_BAD_SET_LEN = 14,
369 OFPBAC_BAD_SET_ARGUMENT = 15,
370};
371
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700372enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700373 OFPBIC_UNKNOWN_INST = 0,
374 OFPBIC_UNSUP_INST = 1,
375 OFPBIC_BAD_TABLE_ID = 2,
376 OFPBIC_UNSUP_METADATA = 3,
377 OFPBIC_UNSUP_METADATA_MASK = 4,
378 OFPBIC_BAD_EXPERIMENTER = 5,
379 OFPBIC_BAD_EXP_TYPE = 6,
380 OFPBIC_BAD_LEN = 7,
381 OFPBIC_EPERM = 8,
382};
383
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700384enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700385 OFPBMC_BAD_TYPE = 0,
386 OFPBMC_BAD_LEN = 1,
387 OFPBMC_BAD_TAG = 2,
388 OFPBMC_BAD_DL_ADDR_MASK = 3,
389 OFPBMC_BAD_NW_ADDR_MASK = 4,
390 OFPBMC_BAD_WILDCARDS = 5,
391 OFPBMC_BAD_FIELD = 6,
392 OFPBMC_BAD_VALUE = 7,
393 OFPBMC_BAD_MASK = 8,
394 OFPBMC_BAD_PREREQ = 9,
395 OFPBMC_DUP_FIELD = 10,
396 OFPBMC_EPERM = 11,
397};
398
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700399enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700400 OFPFMFC_UNKNOWN = 0,
401 OFPFMFC_TABLE_FULL = 1,
402 OFPFMFC_BAD_TABLE_ID = 2,
403 OFPFMFC_OVERLAP = 3,
404 OFPFMFC_EPERM = 4,
405 OFPFMFC_BAD_TIMEOUT = 5,
406 OFPFMFC_BAD_COMMAND = 6,
407 OFPFMFC_BAD_FLAGS = 7,
408};
409
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700410enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700411 OFPGMFC_GROUP_EXISTS = 0,
412 OFPGMFC_INVALID_GROUP = 1,
413 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
414 OFPGMFC_OUT_OF_GROUPS = 3,
415 OFPGMFC_OUT_OF_BUCKETS = 4,
416 OFPGMFC_CHAINING_UNSUPPORTED = 5,
417 OFPGMFC_WATCH_UNSUPPORTED = 6,
418 OFPGMFC_LOOP = 7,
419 OFPGMFC_UNKNOWN_GROUP = 8,
420 OFPGMFC_CHAINED_GROUP = 9,
421 OFPGMFC_BAD_TYPE = 10,
422 OFPGMFC_BAD_COMMAND = 11,
423 OFPGMFC_BAD_BUCKET = 12,
424 OFPGMFC_BAD_WATCH = 13,
425 OFPGMFC_EPERM = 14,
426};
427
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700428enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700429 OFPPMFC_BAD_PORT = 0,
430 OFPPMFC_BAD_HW_ADDR = 1,
431 OFPPMFC_BAD_CONFIG = 2,
432 OFPPMFC_BAD_ADVERTISE = 3,
433 OFPPMFC_EPERM = 4,
434};
435
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700436enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700437 OFPTMFC_BAD_TABLE = 0,
438 OFPTMFC_BAD_CONFIG = 1,
439 OFPTMFC_EPERM = 2,
440};
441
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700442enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700443 OFPQOFC_BAD_PORT = 0,
444 OFPQOFC_BAD_QUEUE = 1,
445 OFPQOFC_EPERM = 2,
446};
447
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700448enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700449 OFPSCFC_BAD_FLAGS = 0,
450 OFPSCFC_BAD_LEN = 1,
451 OFPSCFC_EPERM = 2,
452};
453
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700454enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700455 OFPRRFC_STALE = 0,
456 OFPRRFC_UNSUP = 1,
457 OFPRRFC_BAD_ROLE = 2,
458};
459
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700460enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700461 OFPMMFC_UNKNOWN = 0,
462 OFPMMFC_METER_EXISTS = 1,
463 OFPMMFC_INVALID_METER = 2,
464 OFPMMFC_UNKNOWN_METER = 3,
465 OFPMMFC_BAD_COMMAND = 4,
466 OFPMMFC_BAD_FLAGS = 5,
467 OFPMMFC_BAD_RATE = 6,
468 OFPMMFC_BAD_BURST = 7,
469 OFPMMFC_BAD_BAND = 8,
470 OFPMMFC_BAD_BAND_VALUE = 9,
471 OFPMMFC_OUT_OF_METERS = 10,
472 OFPMMFC_OUT_OF_BANDS = 11,
473};
474
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700475enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700476 OFPTFFC_BAD_TABLE = 0,
477 OFPTFFC_BAD_METADATA = 1,
478 OFPTFFC_BAD_TYPE = 2,
479 OFPTFFC_BAD_LEN = 3,
480 OFPTFFC_BAD_ARGUMENT = 4,
481 OFPTFFC_EPERM = 5,
482};
483
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700484enum ofp_stats_type(wire_type=uint16_t) {
485 OFPST_DESC = 0,
486 OFPST_FLOW = 1,
487 OFPST_AGGREGATE = 2,
488 OFPST_TABLE = 3,
489 OFPST_PORT = 4,
490 OFPST_QUEUE = 5,
491 OFPST_GROUP = 6,
492 OFPST_GROUP_DESC = 7,
493 OFPST_GROUP_FEATURES = 8,
494 OFPST_METER = 9,
495 OFPST_METER_CONFIG = 10,
496 OFPST_METER_FEATURES = 11,
497 OFPST_TABLE_FEATURES = 12,
498 OFPST_PORT_DESC = 13,
499 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700500};
501
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700502enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
503 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700504};
505
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700506enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
507 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700508};
509
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700510enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700511 OFPTFPT_INSTRUCTIONS = 0,
512 OFPTFPT_INSTRUCTIONS_MISS = 1,
513 OFPTFPT_NEXT_TABLES = 2,
514 OFPTFPT_NEXT_TABLES_MISS = 3,
515 OFPTFPT_WRITE_ACTIONS = 4,
516 OFPTFPT_WRITE_ACTIONS_MISS = 5,
517 OFPTFPT_APPLY_ACTIONS = 6,
518 OFPTFPT_APPLY_ACTIONS_MISS = 7,
519 OFPTFPT_MATCH = 8,
520 OFPTFPT_WILDCARDS = 0xa,
521 OFPTFPT_WRITE_SETFIELD = 0xc,
522 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
523 OFPTFPT_APPLY_SETFIELD = 0xe,
524 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
525 OFPTFPT_EXPERIMENTER = 0xfffe,
526 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
527};
528
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700529enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700530 OFPGFC_SELECT_WEIGHT = 0x1,
531 OFPGFC_SELECT_LIVENESS = 0x2,
532 OFPGFC_CHAINING = 0x4,
533 OFPGFC_CHAINING_CHECKS = 0x8,
534};
535
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700536enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700537 OFPQT_MIN_RATE = 0x1,
538 OFPQT_MAX_RATE = 0x2,
539 OFPQT_EXPERIMENTER = 0xffff,
540};
541
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700542enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700543 OFPCR_ROLE_NOCHANGE = 0,
544 OFPCR_ROLE_EQUAL = 1,
545 OFPCR_ROLE_MASTER = 2,
546 OFPCR_ROLE_SLAVE = 3,
547};
548
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700549enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700550 OFPHET_VERSIONBITMAP = 1,
551};
552
Rich Lanee9c37db2013-06-21 18:30:24 -0700553/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700554struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700555 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700556 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700557 uint16_t length;
558 uint32_t xid;
559};
560
561// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700562struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700563 uint32_t value;
564};
565
566// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700567struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700568 uint8_t value;
569};
570
Rich Lane68ae4d72013-05-09 10:55:19 -0700571struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700572 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700573 uint16_t length;
574};
575
Rich Lanee9c37db2013-06-21 18:30:24 -0700576struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700577 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700578 uint16_t length;
579 list(of_uint32_t) bitmaps;
580};
581
Rich Lanee9c37db2013-06-21 18:30:24 -0700582struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700583 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700584 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700585 uint16_t length;
586 uint32_t xid;
587 list(of_hello_elem_t) elements;
588};
589
Rich Lanee9c37db2013-06-21 18:30:24 -0700590struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700591 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700592 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700593 uint16_t length;
594 uint32_t xid;
595 of_octets_t data;
596};
597
Rich Lanee9c37db2013-06-21 18:30:24 -0700598struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700599 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700600 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700601 uint16_t length;
602 uint32_t xid;
603 of_octets_t data;
604};
605
Rich Lanee9c37db2013-06-21 18:30:24 -0700606struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700607 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700608 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700609 uint16_t length;
610 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700611 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700612 uint32_t subtype;
613 of_octets_t data;
614};
615
Rich Lanee9c37db2013-06-21 18:30:24 -0700616struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700617 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700618 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700619 uint16_t length;
620 uint32_t xid;
621};
622
Rich Lanee9c37db2013-06-21 18:30:24 -0700623struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700624 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700625 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700626 uint16_t length;
627 uint32_t xid;
628};
629
Rich Lanee9c37db2013-06-21 18:30:24 -0700630struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700632 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700633 uint16_t length;
634 uint32_t xid;
635};
636
Rich Lanee9c37db2013-06-21 18:30:24 -0700637struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700638 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700639 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700640 uint16_t length;
641 uint32_t xid;
642 uint16_t flags;
643 uint16_t miss_send_len;
644};
645
Rich Lanee9c37db2013-06-21 18:30:24 -0700646struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700647 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700648 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700649 uint16_t length;
650 uint32_t xid;
651 uint16_t flags;
652 uint16_t miss_send_len;
653};
654
Rich Lanee9c37db2013-06-21 18:30:24 -0700655struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700656 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700657 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700658 uint16_t length;
659 uint32_t xid;
660 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700661 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700662 uint32_t config;
663};
664
Rich Lane68ae4d72013-05-09 10:55:19 -0700665struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700666 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700667 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700668 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700669 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700670 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700671 enum ofp_port_config config;
672 enum ofp_port_state state;
673 enum ofp_port_features curr;
674 enum ofp_port_features advertised;
675 enum ofp_port_features supported;
676 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700677 uint32_t curr_speed;
678 uint32_t max_speed;
679};
680
Rich Lanee9c37db2013-06-21 18:30:24 -0700681struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700683 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700684 uint16_t length;
685 uint32_t xid;
686};
687
Rich Lanee9c37db2013-06-21 18:30:24 -0700688struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700689 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700690 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700691 uint16_t length;
692 uint32_t xid;
693 uint64_t datapath_id;
694 uint32_t n_buffers;
695 uint8_t n_tables;
696 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700697 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700698 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700699 uint32_t reserved;
700};
701
Rich Lanee9c37db2013-06-21 18:30:24 -0700702struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700703 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700704 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700705 uint16_t length;
706 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700707 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700708 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700709 of_port_desc_t desc;
710};
711
Rich Lanee9c37db2013-06-21 18:30:24 -0700712struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700713 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700714 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700715 uint16_t length;
716 uint32_t xid;
717 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700718 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700719 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700720 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700721 uint32_t config;
722 uint32_t mask;
723 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700724 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700725};
726
727// FIXME Does this need to be v4?
Andreas Wundsamfef7d5f2013-08-01 22:15:44 -0700728struct of_match_v3(align=8) {
Rich Lane31b87142013-05-09 22:05:42 -0700729 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700730 uint16_t length;
731 list(of_oxm_t) oxm_list;
732};
733
Rich Lanea06d0c32013-03-25 08:52:03 -0700734// This looks like an action header, but is standalone. See
735// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700736struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700737 uint16_t type;
738 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700739 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700740};
741
Rich Lanee9c37db2013-06-21 18:30:24 -0700742struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700743 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700744 uint16_t len;
745 of_port_no_t port;
746 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700747 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700748};
749
Rich Lanee9c37db2013-06-21 18:30:24 -0700750struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700751 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700752 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700753 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700754};
755
Rich Lanee9c37db2013-06-21 18:30:24 -0700756struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700757 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700758 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700759 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700760};
761
Rich Lanee9c37db2013-06-21 18:30:24 -0700762struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700763 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700764 uint16_t len;
765 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700766 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700767};
768
Rich Lanee9c37db2013-06-21 18:30:24 -0700769struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700770 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700771 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700772 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700773};
774
Rich Lanee9c37db2013-06-21 18:30:24 -0700775struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700776 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700777 uint16_t len;
778 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700779 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700780};
781
Rich Lanee9c37db2013-06-21 18:30:24 -0700782struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700783 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700784 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700785 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700786};
787
Rich Lanee9c37db2013-06-21 18:30:24 -0700788struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700789 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700790 uint16_t len;
791 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700792 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700793};
794
Rich Lanee9c37db2013-06-21 18:30:24 -0700795struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700796 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700797 uint16_t len;
798 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700799 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700800};
801
Rich Lanee9c37db2013-06-21 18:30:24 -0700802struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700803 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700804 uint16_t len;
805 uint32_t queue_id;
806};
807
Rich Lanee9c37db2013-06-21 18:30:24 -0700808struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700809 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700810 uint16_t len;
811 uint32_t group_id;
812};
813
Rich Lanee9c37db2013-06-21 18:30:24 -0700814struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700815 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700816 uint16_t len;
817 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700818 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700819};
820
Rich Lanee9c37db2013-06-21 18:30:24 -0700821struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700822 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700823 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700824 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700825};
826
Rich Lanee9c37db2013-06-21 18:30:24 -0700827struct of_action_set_field : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700828 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700829 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700830 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700831};
832
Rich Lanee9c37db2013-06-21 18:30:24 -0700833struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700834 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700835 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700836 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700837 of_octets_t data;
838};
839
Rich Lanee9c37db2013-06-21 18:30:24 -0700840struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700841 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700842 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700843 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700844};
845
Rich Lanee9c37db2013-06-21 18:30:24 -0700846struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700847 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700848 uint16_t len;
849 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700850 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700851};
852
Rich Lane68ae4d72013-05-09 10:55:19 -0700853struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700854 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700855 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700856 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700857};
858
Rich Lane68ae4d72013-05-09 10:55:19 -0700859struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700860 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700861 uint16_t len;
862};
863
Rich Lanee9c37db2013-06-21 18:30:24 -0700864struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700865 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700866 uint16_t len;
867 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700868 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700869};
870
Rich Lanee9c37db2013-06-21 18:30:24 -0700871struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700872 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700873 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700874 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700875 uint64_t metadata;
876 uint64_t metadata_mask;
877};
878
Rich Lanee9c37db2013-06-21 18:30:24 -0700879struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700880 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700881 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700882 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700883 list(of_action_t) actions;
884};
885
Rich Lanee9c37db2013-06-21 18:30:24 -0700886struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700887 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700889 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700890 list(of_action_t) actions;
891};
892
Rich Lanee9c37db2013-06-21 18:30:24 -0700893struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700894 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700896 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700897};
898
Rich Lanee9c37db2013-06-21 18:30:24 -0700899struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700900 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700901 uint16_t len;
902 uint32_t meter_id;
903};
904
Rich Lanee9c37db2013-06-21 18:30:24 -0700905struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700906 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700907 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700908 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 of_octets_t data;
910};
911
Rich Lanee9c37db2013-06-21 18:30:24 -0700912struct of_flow_mod : of_header {
913 uint8_t version;
914 uint8_t type == 14;
915 uint16_t length;
916 uint32_t xid;
917 uint64_t cookie;
918 uint64_t cookie_mask;
919 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700920 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700921 uint16_t idle_timeout;
922 uint16_t hard_timeout;
923 uint16_t priority;
924 uint32_t buffer_id;
925 of_port_no_t out_port;
926 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700927 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700928 pad(2);
929 of_match_t match;
930 list(of_instruction_t) instructions;
931};
932
933struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700934 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700935 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700936 uint16_t length;
937 uint32_t xid;
938 uint64_t cookie;
939 uint64_t cookie_mask;
940 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700941 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700942 uint16_t idle_timeout;
943 uint16_t hard_timeout;
944 uint16_t priority;
945 uint32_t buffer_id;
946 of_port_no_t out_port;
947 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700948 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700949 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700950 of_match_t match;
951 list(of_instruction_t) instructions;
952};
953
Rich Lanee9c37db2013-06-21 18:30:24 -0700954struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700955 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700956 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700957 uint16_t length;
958 uint32_t xid;
959 uint64_t cookie;
960 uint64_t cookie_mask;
961 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700962 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700963 uint16_t idle_timeout;
964 uint16_t hard_timeout;
965 uint16_t priority;
966 uint32_t buffer_id;
967 of_port_no_t out_port;
968 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700969 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700970 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700971 of_match_t match;
972 list(of_instruction_t) instructions;
973};
974
Rich Lanee9c37db2013-06-21 18:30:24 -0700975struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700976 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700977 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700978 uint16_t length;
979 uint32_t xid;
980 uint64_t cookie;
981 uint64_t cookie_mask;
982 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700983 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700984 uint16_t idle_timeout;
985 uint16_t hard_timeout;
986 uint16_t priority;
987 uint32_t buffer_id;
988 of_port_no_t out_port;
989 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700990 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700991 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700992 of_match_t match;
993 list(of_instruction_t) instructions;
994};
995
Rich Lanee9c37db2013-06-21 18:30:24 -0700996struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700997 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700998 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700999 uint16_t length;
1000 uint32_t xid;
1001 uint64_t cookie;
1002 uint64_t cookie_mask;
1003 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001004 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001005 uint16_t idle_timeout;
1006 uint16_t hard_timeout;
1007 uint16_t priority;
1008 uint32_t buffer_id;
1009 of_port_no_t out_port;
1010 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001011 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001012 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001013 of_match_t match;
1014 list(of_instruction_t) instructions;
1015};
1016
Rich Lanee9c37db2013-06-21 18:30:24 -07001017struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001018 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001019 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001020 uint16_t length;
1021 uint32_t xid;
1022 uint64_t cookie;
1023 uint64_t cookie_mask;
1024 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001025 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001026 uint16_t idle_timeout;
1027 uint16_t hard_timeout;
1028 uint16_t priority;
1029 uint32_t buffer_id;
1030 of_port_no_t out_port;
1031 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001032 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001033 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001034 of_match_t match;
1035 list(of_instruction_t) instructions;
1036};
1037
Rich Lane68ae4d72013-05-09 10:55:19 -07001038struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001039 uint16_t len;
1040 uint16_t weight;
1041 of_port_no_t watch_port;
1042 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001043 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001044 list(of_action_t) actions;
1045};
1046
Rich Lanee9c37db2013-06-21 18:30:24 -07001047struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001048 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001049 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001050 uint16_t length;
1051 uint32_t xid;
1052 uint16_t command;
1053 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001054 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001055 uint32_t group_id;
1056 list(of_bucket_t) buckets;
1057};
1058
Rich Lanee9c37db2013-06-21 18:30:24 -07001059struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001060 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001061 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001062 uint16_t length;
1063 uint32_t xid;
1064 uint32_t buffer_id;
1065 of_port_no_t in_port;
1066 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001067 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001068 list(of_action_t) actions;
1069 of_octets_t data;
1070};
1071
Rich Lanee9c37db2013-06-21 18:30:24 -07001072struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001073 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001074 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001075 uint16_t length;
1076 uint32_t xid;
1077 uint32_t buffer_id;
1078 uint16_t total_len;
1079 uint8_t reason;
1080 uint8_t table_id;
1081 uint64_t cookie;
1082 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001083 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001084 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1085};
1086
Rich Lanee9c37db2013-06-21 18:30:24 -07001087struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001088 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001089 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001090 uint16_t length;
1091 uint32_t xid;
1092 uint64_t cookie;
1093 uint16_t priority;
1094 uint8_t reason;
1095 uint8_t table_id;
1096 uint32_t duration_sec;
1097 uint32_t duration_nsec;
1098 uint16_t idle_timeout;
1099 uint16_t hard_timeout;
1100 uint64_t packet_count;
1101 uint64_t byte_count;
1102 of_match_t match;
1103};
1104
Rich Lane68ae4d72013-05-09 10:55:19 -07001105struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001106 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001107 uint16_t len;
1108// uint32_t rate; // These are excluded b/c this is the header
1109// uint32_t burst_size; // These are excluded b/c this is the header
1110};
1111
Rich Lanee9c37db2013-06-21 18:30:24 -07001112struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001113 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001114 uint16_t len;
1115 uint32_t rate;
1116 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001117 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001118};
1119
Rich Lanee9c37db2013-06-21 18:30:24 -07001120struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001121 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001122 uint16_t len;
1123 uint32_t rate;
1124 uint32_t burst_size;
1125 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001126 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001127};
1128
Rich Lanee9c37db2013-06-21 18:30:24 -07001129struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001130 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001131 uint16_t len;
1132 uint32_t rate;
1133 uint32_t burst_size;
1134 uint32_t experimenter;
1135};
1136
Rich Lanee9c37db2013-06-21 18:30:24 -07001137struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001138 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001139 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001140 uint16_t length;
1141 uint32_t xid;
1142 uint16_t command;
1143 uint16_t flags;
1144 uint32_t meter_id;
1145 list(of_meter_band_t) meters;
1146};
1147
Rich Lanee9c37db2013-06-21 18:30:24 -07001148struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001149 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001150 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001151 uint16_t length;
1152 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001153 uint16_t err_type == ?;
1154};
1155
1156struct of_hello_failed_error_msg : of_error_msg {
1157 uint8_t version;
1158 uint8_t type == 1;
1159 uint16_t length;
1160 uint32_t xid;
1161 uint16_t err_type == 0;
1162 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001163 of_octets_t data;
1164};
1165
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001166struct of_bad_request_error_msg : of_error_msg {
1167 uint8_t version;
1168 uint8_t type == 1;
1169 uint16_t length;
1170 uint32_t xid;
1171 uint16_t err_type == 1;
1172 enum ofp_bad_request_code code;
1173 of_octets_t data;
1174};
1175
1176struct of_bad_action_error_msg : of_error_msg {
1177 uint8_t version;
1178 uint8_t type == 1;
1179 uint16_t length;
1180 uint32_t xid;
1181 uint16_t err_type == 2;
1182 enum ofp_bad_action_code code;
1183 of_octets_t data;
1184};
1185
1186struct of_bad_instruction_error_msg : of_error_msg {
1187 uint8_t version;
1188 uint8_t type == 1;
1189 uint16_t length;
1190 uint32_t xid;
1191 uint16_t err_type == 3;
1192 enum ofp_bad_instruction_code code;
1193 of_octets_t data;
1194};
1195
1196struct of_bad_match_error_msg : of_error_msg {
1197 uint8_t version;
1198 uint8_t type == 1;
1199 uint16_t length;
1200 uint32_t xid;
1201 uint16_t err_type == 4;
1202 enum ofp_bad_match_code code;
1203 of_octets_t data;
1204};
1205
1206struct of_flow_mod_failed_error_msg : of_error_msg {
1207 uint8_t version;
1208 uint8_t type == 1;
1209 uint16_t length;
1210 uint32_t xid;
1211 uint16_t err_type == 5;
1212 enum ofp_flow_mod_failed_code code;
1213 of_octets_t data;
1214};
1215
1216struct of_group_mod_failed_error_msg : of_error_msg {
1217 uint8_t version;
1218 uint8_t type == 1;
1219 uint16_t length;
1220 uint32_t xid;
1221 uint16_t err_type == 6;
1222 enum ofp_group_mod_failed_code code;
1223 of_octets_t data;
1224};
1225
1226struct of_port_mod_failed_error_msg : of_error_msg {
1227 uint8_t version;
1228 uint8_t type == 1;
1229 uint16_t length;
1230 uint32_t xid;
1231 uint16_t err_type == 7;
1232 enum ofp_port_mod_failed_code code;
1233 of_octets_t data;
1234};
1235
1236struct of_table_mod_failed_error_msg : of_error_msg {
1237 uint8_t version;
1238 uint8_t type == 1;
1239 uint16_t length;
1240 uint32_t xid;
1241 uint16_t err_type == 8;
1242 enum ofp_table_mod_failed_code code;
1243 of_octets_t data;
1244};
1245
1246struct of_queue_op_failed_error_msg : of_error_msg {
1247 uint8_t version;
1248 uint8_t type == 1;
1249 uint16_t length;
1250 uint32_t xid;
1251 uint16_t err_type == 9;
1252 enum ofp_queue_op_failed_code code;
1253 of_octets_t data;
1254};
1255
1256struct of_switch_config_failed_error_msg : of_error_msg {
1257 uint8_t version;
1258 uint8_t type == 1;
1259 uint16_t length;
1260 uint32_t xid;
1261 uint16_t err_type == 10;
1262 enum ofp_switch_config_failed_code code;
1263 of_octets_t data;
1264};
1265
1266struct of_role_request_failed_error_msg : of_error_msg {
1267 uint8_t version;
1268 uint8_t type == 1;
1269 uint16_t length;
1270 uint32_t xid;
1271 uint16_t err_type == 11;
1272 enum ofp_role_request_failed_code code;
1273 of_octets_t data;
1274};
1275
1276struct of_meter_mod_failed_error_msg : of_error_msg {
1277 uint8_t version;
1278 uint8_t type == 1;
1279 uint16_t length;
1280 uint32_t xid;
1281 uint16_t err_type == 12;
1282 enum ofp_meter_mod_failed_code code;
1283 of_octets_t data;
1284};
1285
1286struct of_table_features_failed_error_msg : of_error_msg {
1287 uint8_t version;
1288 uint8_t type == 1;
1289 uint16_t length;
1290 uint32_t xid;
1291 uint16_t err_type == 13;
1292 enum ofp_table_features_failed_code code;
1293 of_octets_t data;
1294};
1295
1296struct of_experimenter_error_msg {
1297 uint8_t version;
1298 uint8_t type == 1;
1299 uint16_t length;
1300 uint32_t xid;
1301 uint16_t err_type == 0xffff;
1302 uint16_t subtype;
1303 uint32_t experimenter;
1304 of_octets_t data;
1305};
Rich Lanea06d0c32013-03-25 08:52:03 -07001306
1307// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1308
Rich Lane68ae4d72013-05-09 10:55:19 -07001309struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001310 uint16_t length;
1311 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001312 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001313 uint32_t duration_sec;
1314 uint32_t duration_nsec;
1315 uint16_t priority;
1316 uint16_t idle_timeout;
1317 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001318 uint16_t flags;
1319 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001320 uint64_t cookie;
1321 uint64_t packet_count;
1322 uint64_t byte_count;
1323 of_match_t match;
1324 list(of_instruction_t) instructions;
1325};
1326
1327
Rich Lane68ae4d72013-05-09 10:55:19 -07001328struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001329 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001330 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001331 uint32_t active_count;
1332 uint64_t lookup_count;
1333 uint64_t matched_count;
1334};
1335
Rich Lane68ae4d72013-05-09 10:55:19 -07001336struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001337 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001338 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001339 uint64_t rx_packets;
1340 uint64_t tx_packets;
1341 uint64_t rx_bytes;
1342 uint64_t tx_bytes;
1343 uint64_t rx_dropped;
1344 uint64_t tx_dropped;
1345 uint64_t rx_errors;
1346 uint64_t tx_errors;
1347 uint64_t rx_frame_err;
1348 uint64_t rx_over_err;
1349 uint64_t rx_crc_err;
1350 uint64_t collisions;
1351 uint32_t duration_sec;
1352 uint32_t duration_nsec;
1353};
1354
Rich Lane68ae4d72013-05-09 10:55:19 -07001355struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001356 of_port_no_t port_no;
1357 uint32_t queue_id;
1358 uint64_t tx_bytes;
1359 uint64_t tx_packets;
1360 uint64_t tx_errors;
1361 uint32_t duration_sec;
1362 uint32_t duration_nsec;
1363};
1364
Rich Lane68ae4d72013-05-09 10:55:19 -07001365struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001366 uint64_t packet_count;
1367 uint64_t byte_count;
1368};
1369
Rich Lane68ae4d72013-05-09 10:55:19 -07001370struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001371 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001372 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001373 uint32_t group_id;
1374 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001375 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001376 uint64_t packet_count;
1377 uint64_t byte_count;
1378 uint32_t duration_sec;
1379 uint32_t duration_nsec;
1380 list(of_bucket_counter_t) bucket_stats;
1381};
1382
Rich Lane68ae4d72013-05-09 10:55:19 -07001383struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 uint16_t length;
1385 uint8_t type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001386 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001387 uint32_t group_id;
1388 list(of_bucket_t) buckets;
1389};
1390
1391// STATS:
1392// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1393
Rich Lanee9c37db2013-06-21 18:30:24 -07001394struct of_stats_request : of_header {
1395 uint8_t version;
1396 uint8_t type == 18;
1397 uint16_t length;
1398 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001399 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001400 uint16_t flags;
1401 pad(4);
1402};
1403
1404struct of_stats_reply : of_header {
1405 uint8_t version;
1406 uint8_t type == 19;
1407 uint16_t length;
1408 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001409 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001410 uint16_t flags;
1411 pad(4);
1412};
1413
1414struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001415 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001416 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001417 uint16_t length;
1418 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001419 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001420 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001421 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001422};
1423
Rich Lanee9c37db2013-06-21 18:30:24 -07001424struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001425 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001426 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001427 uint16_t length;
1428 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001429 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001430 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001431 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001432 of_desc_str_t mfr_desc;
1433 of_desc_str_t hw_desc;
1434 of_desc_str_t sw_desc;
1435 of_serial_num_t serial_num;
1436 of_desc_str_t dp_desc;
1437};
1438
Rich Lanee9c37db2013-06-21 18:30:24 -07001439struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001440 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001441 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001442 uint16_t length;
1443 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001444 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001445 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001446 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001447 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001448 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001449 of_port_no_t out_port;
1450 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001451 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001452 uint64_t cookie;
1453 uint64_t cookie_mask;
1454 of_match_t match;
1455};
1456
Rich Lanee9c37db2013-06-21 18:30:24 -07001457struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001458 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001459 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001460 uint16_t length;
1461 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001462 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001463 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001464 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001465 list(of_flow_stats_entry_t) entries;
1466};
1467
Rich Lanee9c37db2013-06-21 18:30:24 -07001468struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001469 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001470 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001471 uint16_t length;
1472 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001473 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001474 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001475 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001476 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001477 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001478 of_port_no_t out_port;
1479 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001480 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001481 uint64_t cookie;
1482 uint64_t cookie_mask;
1483 of_match_t match;
1484};
1485
Rich Lanee9c37db2013-06-21 18:30:24 -07001486struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001487 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001488 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001489 uint16_t length;
1490 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001491 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001492 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001493 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001494 uint64_t packet_count;
1495 uint64_t byte_count;
1496 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001497 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001498};
1499
Rich Lanee9c37db2013-06-21 18:30:24 -07001500struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001501 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001502 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001503 uint16_t length;
1504 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001505 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001506 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001507 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001508};
1509
Rich Lanee9c37db2013-06-21 18:30:24 -07001510struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001511 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001512 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001513 uint16_t length;
1514 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001515 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001516 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001517 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001518 list(of_table_stats_entry_t) entries;
1519};
1520
Rich Lanea06d0c32013-03-25 08:52:03 -07001521// FIXME: These are padded to 8 byte align beyond the length indicated
1522
Rich Lane68ae4d72013-05-09 10:55:19 -07001523struct of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001524 uint16_t type;
1525 uint16_t length;
1526};
1527
Rich Lanee9c37db2013-06-21 18:30:24 -07001528struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001529 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001530 uint16_t length;
1531 // FIXME Check if instruction_t is right for ids here
1532 list(of_instruction_t) instruction_ids;
1533};
1534
Rich Lanee9c37db2013-06-21 18:30:24 -07001535struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001536 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001537 uint16_t length;
1538 list(of_instruction_t) instruction_ids;
1539};
1540
Rich Lanee9c37db2013-06-21 18:30:24 -07001541struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001542 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001543 uint16_t length;
1544 list(of_uint8_t) next_table_ids;
1545};
1546
Rich Lanee9c37db2013-06-21 18:30:24 -07001547struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001548 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001549 uint16_t length;
1550 list(of_uint8_t) next_table_ids;
1551};
1552
Rich Lanee9c37db2013-06-21 18:30:24 -07001553struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001554 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001555 uint16_t length;
1556 list(of_action_id_t) action_ids;
1557};
1558
Rich Lanee9c37db2013-06-21 18:30:24 -07001559struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001560 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001561 uint16_t length;
1562 list(of_action_id_t) action_ids;
1563};
1564
Rich Lanee9c37db2013-06-21 18:30:24 -07001565struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001566 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001567 uint16_t length;
1568 list(of_action_id_t) action_ids;
1569};
1570
Rich Lanee9c37db2013-06-21 18:30:24 -07001571struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001572 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001573 uint16_t length;
1574 list(of_action_id_t) action_ids;
1575};
1576
Rich Lanee9c37db2013-06-21 18:30:24 -07001577struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001578 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001579 uint16_t length;
1580 list(of_uint32_t) oxm_ids;
1581};
1582
Rich Lanee9c37db2013-06-21 18:30:24 -07001583struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001584 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001585 uint16_t length;
1586 list(of_uint32_t) oxm_ids;
1587};
1588
Rich Lanee9c37db2013-06-21 18:30:24 -07001589struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001590 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001591 uint16_t length;
1592 list(of_uint32_t) oxm_ids;
1593};
1594
Rich Lanee9c37db2013-06-21 18:30:24 -07001595struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001596 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001597 uint16_t length;
1598 list(of_uint32_t) oxm_ids;
1599};
1600
Rich Lanee9c37db2013-06-21 18:30:24 -07001601struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001602 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001603 uint16_t length;
1604 list(of_uint32_t) oxm_ids;
1605};
1606
Rich Lanee9c37db2013-06-21 18:30:24 -07001607struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001608 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001609 uint16_t length;
1610 list(of_uint32_t) oxm_ids;
1611};
1612
Rich Lanee9c37db2013-06-21 18:30:24 -07001613struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001614 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001615 uint16_t length;
1616 uint32_t experimenter;
1617 uint32_t subtype;
1618 of_octets_t experimenter_data;
1619};
1620
1621// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001622// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001623// uint16_t type;
1624// uint16_t length;
1625// uint32_t experimenter;
1626// uint32_t subtype;
1627// of_octets_t experimenter_data;
1628// };
1629
Rich Lane68ae4d72013-05-09 10:55:19 -07001630struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001631 uint16_t length;
1632 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001633 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001634 of_table_name_t name;
1635 uint64_t metadata_match;
1636 uint64_t metadata_write;
1637 uint32_t config;
1638 uint32_t max_entries;
1639 list(of_table_feature_prop_t) properties;
1640};
1641
Rich Lane68ae4d72013-05-09 10:55:19 -07001642struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001643 uint32_t max_meter;
1644 uint32_t band_types;
1645 uint32_t capabilities;
1646 uint8_t max_bands;
1647 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001648 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001649};
1650
Rich Lanee9c37db2013-06-21 18:30:24 -07001651struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001652 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001653 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001654 uint16_t length;
1655 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001656 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001657 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001658 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001659 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001660 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001661};
1662
Rich Lanee9c37db2013-06-21 18:30:24 -07001663struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001664 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001665 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001666 uint16_t length;
1667 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001668 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001669 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001670 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001671 list(of_port_stats_entry_t) entries;
1672};
1673
Rich Lanee9c37db2013-06-21 18:30:24 -07001674struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001675 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001676 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001677 uint16_t length;
1678 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001679 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001680 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001681 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001682 of_port_no_t port_no;
1683 uint32_t queue_id;
1684};
1685
Rich Lanee9c37db2013-06-21 18:30:24 -07001686struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001687 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001688 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001689 uint16_t length;
1690 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001691 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001692 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001693 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001694 list(of_queue_stats_entry_t) entries;
1695};
1696
Rich Lanee9c37db2013-06-21 18:30:24 -07001697struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001698 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001699 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001700 uint16_t length;
1701 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001702 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001703 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001704 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001705 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001706 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001707};
1708
Rich Lanee9c37db2013-06-21 18:30:24 -07001709struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001710 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001711 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001712 uint16_t length;
1713 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001714 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001715 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001716 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001717 list(of_group_stats_entry_t) entries;
1718};
1719
Rich Lanee9c37db2013-06-21 18:30:24 -07001720struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001721 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001722 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001723 uint16_t length;
1724 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001725 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001726 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001727 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001728};
1729
Rich Lanee9c37db2013-06-21 18:30:24 -07001730struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001731 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001732 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001733 uint16_t length;
1734 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001735 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001736 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001737 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001738 list(of_group_desc_stats_entry_t) entries;
1739};
1740
Rich Lanee9c37db2013-06-21 18:30:24 -07001741struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001742 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001743 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001744 uint16_t length;
1745 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001746 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001747 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001748 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001749};
1750
Rich Lanee9c37db2013-06-21 18:30:24 -07001751struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001752 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001753 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001754 uint16_t length;
1755 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001756 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001757 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001758 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001759 uint32_t types;
1760 uint32_t capabilities;
1761 uint32_t max_groups_all;
1762 uint32_t max_groups_select;
1763 uint32_t max_groups_indirect;
1764 uint32_t max_groups_ff;
1765 uint32_t actions_all;
1766 uint32_t actions_select;
1767 uint32_t actions_indirect;
1768 uint32_t actions_ff;
1769};
1770
Rich Lanee9c37db2013-06-21 18:30:24 -07001771struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001772 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001773 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001774 uint16_t length;
1775 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001776 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001777 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001778 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001779 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001780 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001781};
1782
Rich Lanee9c37db2013-06-21 18:30:24 -07001783struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001784 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001785 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001786 uint16_t length;
1787 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001788 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001789 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001790 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001791 list(of_meter_stats_t) entries;
1792};
1793
Rich Lanee9c37db2013-06-21 18:30:24 -07001794struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001795 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001796 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001797 uint16_t length;
1798 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001799 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001800 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001801 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001802 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001803 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001804};
1805
Rich Lanee9c37db2013-06-21 18:30:24 -07001806struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001807 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001808 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001809 uint16_t length;
1810 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001811 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001812 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001813 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001814 list(of_meter_band_t) entries;
1815};
1816
1817// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001818struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001819 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001820 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001821 uint16_t length;
1822 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001823 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001824 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001825 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001826};
1827
1828// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001829struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001830 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001831 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001832 uint16_t length;
1833 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001834 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001835 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001836 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001837 of_meter_features_t features;
1838};
1839
1840// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001841struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001842 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001843 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001844 uint16_t length;
1845 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001846 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001847 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001848 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001849 list(of_table_features_t) entries;
1850};
1851
1852// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001853struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001854 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001855 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001856 uint16_t length;
1857 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001858 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001859 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001860 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001861 list(of_table_features_t) entries;
1862};
1863
1864// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001865struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001866 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001867 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001868 uint16_t length;
1869 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001870 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001871 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001872 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001873};
1874
1875// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001876struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001877 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001878 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001879 uint16_t length;
1880 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001881 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001882 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001883 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001884 list(of_port_desc_t) entries;
1885};
1886
Rich Lane68ae4d72013-05-09 10:55:19 -07001887struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001888 uint64_t packet_band_count;
1889 uint64_t byte_band_count;
1890};
1891
Rich Lane68ae4d72013-05-09 10:55:19 -07001892struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001893 uint32_t meter_id;
1894 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001895 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001896 uint32_t flow_count;
1897 uint64_t packet_in_count;
1898 uint64_t byte_in_count;
1899 uint32_t duration_sec;
1900 uint32_t duration_nsec;
1901 list(of_meter_band_stats_t) band_stats;
1902};
1903
Rich Lane68ae4d72013-05-09 10:55:19 -07001904struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001905 uint16_t length;
1906 uint16_t flags;
1907 uint32_t meter_id;
1908 list(of_meter_band_t) entries;
1909};
1910
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001911struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001912 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001913 uint32_t subtype;
1914};
1915
1916// END OF STATS OBJECTS
1917
Rich Lane68ae4d72013-05-09 10:55:19 -07001918struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001919 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001920 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001921 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001922};
1923
Rich Lanee9c37db2013-06-21 18:30:24 -07001924struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001925 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001926 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001927 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001928 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001929 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001930};
1931
Rich Lanee9c37db2013-06-21 18:30:24 -07001932struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001933 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001934 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001935 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001936 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001937 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001938};
1939
Rich Lanee9c37db2013-06-21 18:30:24 -07001940struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001941 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001942 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001943 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001944 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001945 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001946 of_octets_t data;
1947};
1948
Rich Lane68ae4d72013-05-09 10:55:19 -07001949struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001950 uint32_t queue_id;
1951 of_port_no_t port;
1952 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001953 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001954 list(of_queue_prop_t) properties;
1955};
1956
Rich Lanee9c37db2013-06-21 18:30:24 -07001957struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001958 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001959 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001960 uint16_t length;
1961 uint32_t xid;
1962 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001963 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001964};
1965
Rich Lanee9c37db2013-06-21 18:30:24 -07001966struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001967 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001968 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001969 uint16_t length;
1970 uint32_t xid;
1971 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001972 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001973 list(of_packet_queue_t) queues;
1974};
1975
Rich Lanee9c37db2013-06-21 18:30:24 -07001976struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001977 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001978 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001979 uint16_t length;
1980 uint32_t xid;
1981 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001982 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001983 uint64_t generation_id;
1984};
1985
Rich Lanee9c37db2013-06-21 18:30:24 -07001986struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001987 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001988 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001989 uint16_t length;
1990 uint32_t xid;
1991 of_octets_t data;
1992};
1993
1994////////////////////////////////////////////////////////////////
1995// FIXME understand async; where do bitmasks live?
1996// Determine bitmap type for masks below.
1997// DOCUMENT masks where uint32_t[0] is interest for equal/master
1998// while uint32_t[1] is interest for slave
1999////////////////////////////////////////////////////////////////
2000
Rich Lanee9c37db2013-06-21 18:30:24 -07002001struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002002 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002003 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002004 uint16_t length;
2005 uint32_t xid;
2006 uint32_t packet_in_mask_equal_master;
2007 uint32_t packet_in_mask_slave;
2008 uint32_t port_status_mask_equal_master;
2009 uint32_t port_status_mask_slave;
2010 uint32_t flow_removed_mask_equal_master;
2011 uint32_t flow_removed_mask_slave;
2012};
2013
Rich Lanee9c37db2013-06-21 18:30:24 -07002014struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002015 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002016 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002017 uint16_t length;
2018 uint32_t xid;
2019 uint32_t packet_in_mask_equal_master;
2020 uint32_t packet_in_mask_slave;
2021 uint32_t port_status_mask_equal_master;
2022 uint32_t port_status_mask_slave;
2023 uint32_t flow_removed_mask_equal_master;
2024 uint32_t flow_removed_mask_slave;
2025};
2026
Rich Lanee9c37db2013-06-21 18:30:24 -07002027struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002028 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002029 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002030 uint16_t length;
2031 uint32_t xid;
2032 uint32_t packet_in_mask_equal_master;
2033 uint32_t packet_in_mask_slave;
2034 uint32_t port_status_mask_equal_master;
2035 uint32_t port_status_mask_slave;
2036 uint32_t flow_removed_mask_equal_master;
2037 uint32_t flow_removed_mask_slave;
2038};