blob: 624800580fb985663ac124c550dec2e589e763fe [file] [log] [blame]
Rich Lanea06d0c32013-03-25 08:52:03 -07001// Copyright 2013, Big Switch Networks, Inc.
2//
3// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
4// the following special exception:
5//
6// LOXI Exception
7//
8// As a special exception to the terms of the EPL, you may distribute libraries
9// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
10// that copyright and licensing notices generated by LoxiGen are not altered or removed
11// from the LoxiGen Libraries and the notice provided below is (i) included in
12// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
13// documentation for the LoxiGen Libraries, if distributed in binary form.
14//
15// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
16//
17// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
18// a copy of the EPL at:
19//
20// http://www.eclipse.org/legal/epl-v10.html
21//
22// Unless required by applicable law or agreed to in writing, software
23// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
25// EPL for the specific language governing permissions and limitations
26// under the EPL.
Rich Lane5d33a622013-04-08 17:33:11 -070027//
28// Also derived from the OpenFlow header files which have these copyrights:
29// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
30// Copyright (c) 2011, 2012 Open Networking Foundation
Rich Lanea06d0c32013-03-25 08:52:03 -070031
32#version 4
33
Rich Lane5d33a622013-04-08 17:33:11 -070034enum macro_definitions {
35 OFP_MAX_TABLE_NAME_LEN = 32,
36 OFP_MAX_PORT_NAME_LEN = 16,
37
Wilson Ngd72013d2013-09-29 10:21:48 -070038 OFP_TCP_PORT = 6653,
39 OFP_SSL_PORT = 6653,
Rich Lane5d33a622013-04-08 17:33:11 -070040
41 OFP_ETH_ALEN = 6,
42
43 OFP_DEFAULT_MISS_SEND_LEN = 128,
44
45 OFP_VLAN_NONE = 0,
46
47 OFP_FLOW_PERMANENT = 0,
48
49 OFP_DEFAULT_PRIORITY = 0x8000,
50
51 OFP_NO_BUFFER = 0xffffffff,
52
53 DESC_STR_LEN = 256,
54 SERIAL_NUM_LEN = 32,
55
56 OFPQ_ALL = 0xffffffff,
57 OFPQ_MAX_RATE_UNCFG = 0xffff,
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59};
60
Andreas Wundsam7933beb2013-08-02 22:36:42 -070061enum ofp_port_no(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -070062 OFPP_ANY = 0xffffffff,
63};
64
Andreas Wundsam4ee51462013-07-30 11:00:37 -070065enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070066 OFPP_MAX = 0xffffff00,
67 OFPP_IN_PORT = 0xfffffff8,
68 OFPP_TABLE = 0xfffffff9,
69 OFPP_NORMAL = 0xfffffffa,
70 OFPP_FLOOD = 0xfffffffb,
71 OFPP_ALL = 0xfffffffc,
72 OFPP_CONTROLLER = 0xfffffffd,
73 OFPP_LOCAL = 0xfffffffe,
74};
75
Andreas Wundsam4ee51462013-07-30 11:00:37 -070076enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070077 OFPT_HELLO = 0,
78 OFPT_ERROR = 1,
79 OFPT_ECHO_REQUEST = 2,
80 OFPT_ECHO_REPLY = 3,
81 OFPT_EXPERIMENTER = 4,
82 OFPT_FEATURES_REQUEST = 5,
83 OFPT_FEATURES_REPLY = 6,
84 OFPT_GET_CONFIG_REQUEST = 7,
85 OFPT_GET_CONFIG_REPLY = 8,
86 OFPT_SET_CONFIG = 9,
87 OFPT_PACKET_IN = 10,
88 OFPT_FLOW_REMOVED = 11,
89 OFPT_PORT_STATUS = 12,
90 OFPT_PACKET_OUT = 13,
91 OFPT_FLOW_MOD = 14,
92 OFPT_GROUP_MOD = 15,
93 OFPT_PORT_MOD = 16,
94 OFPT_TABLE_MOD = 17,
95 OFPT_MULTIPART_REQUEST = 18,
96 OFPT_MULTIPART_REPLY = 19,
97 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,
339 OFPBRC_BAD_MULTIPART = 2,
340 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
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700484enum ofp_multipart_types(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700485 OFPMP_DESC = 0,
486 OFPMP_FLOW = 1,
487 OFPMP_AGGREGATE = 2,
488 OFPMP_TABLE = 3,
489 OFPMP_PORT_STATS = 4,
490 OFPMP_QUEUE = 5,
491 OFPMP_GROUP = 6,
492 OFPMP_GROUP_DESC = 7,
493 OFPMP_GROUP_FEATURES = 8,
494 OFPMP_METER = 9,
495 OFPMP_METER_CONFIG = 10,
496 OFPMP_METER_FEATURES = 11,
497 OFPMP_TABLE_FEATURES = 12,
498 OFPMP_PORT_DESC = 13,
499 OFPMP_EXPERIMENTER = 0xffff,
500};
501
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700502enum ofp_multipart_request_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700503 OFPMPF_REQ_MORE = 0x1,
504};
505
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700506enum ofp_multipart_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700507 OFPMPF_REPLY_MORE = 0x1,
508};
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);
Rich Lanea06d0c32013-03-25 08:52:03 -0700698 uint32_t capabilities;
699 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;
1153 uint16_t err_type;
1154 uint16_t code;
1155 of_octets_t data;
1156};
1157
Rich Lane68ae4d72013-05-09 10:55:19 -07001158//struct of_error_experimenter_msg {
Rich Lanea06d0c32013-03-25 08:52:03 -07001159// uint8_t version;
1160// uint8_t type;
1161// uint16_t length;
1162// uint32_t xid;
1163// uint16_t err_type;
1164// uint16_t subtype;
1165// uint32_t experimenter;
1166// of_octets_t data;
1167//};
1168
1169// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1170
Rich Lane68ae4d72013-05-09 10:55:19 -07001171struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001172 uint16_t length;
1173 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001174 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001175 uint32_t duration_sec;
1176 uint32_t duration_nsec;
1177 uint16_t priority;
1178 uint16_t idle_timeout;
1179 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001180 uint16_t flags;
1181 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001182 uint64_t cookie;
1183 uint64_t packet_count;
1184 uint64_t byte_count;
1185 of_match_t match;
1186 list(of_instruction_t) instructions;
1187};
1188
1189
Rich Lane68ae4d72013-05-09 10:55:19 -07001190struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001191 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001192 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001193 uint32_t active_count;
1194 uint64_t lookup_count;
1195 uint64_t matched_count;
1196};
1197
Rich Lane68ae4d72013-05-09 10:55:19 -07001198struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001199 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001200 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001201 uint64_t rx_packets;
1202 uint64_t tx_packets;
1203 uint64_t rx_bytes;
1204 uint64_t tx_bytes;
1205 uint64_t rx_dropped;
1206 uint64_t tx_dropped;
1207 uint64_t rx_errors;
1208 uint64_t tx_errors;
1209 uint64_t rx_frame_err;
1210 uint64_t rx_over_err;
1211 uint64_t rx_crc_err;
1212 uint64_t collisions;
1213 uint32_t duration_sec;
1214 uint32_t duration_nsec;
1215};
1216
Rich Lane68ae4d72013-05-09 10:55:19 -07001217struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001218 of_port_no_t port_no;
1219 uint32_t queue_id;
1220 uint64_t tx_bytes;
1221 uint64_t tx_packets;
1222 uint64_t tx_errors;
1223 uint32_t duration_sec;
1224 uint32_t duration_nsec;
1225};
1226
Rich Lane68ae4d72013-05-09 10:55:19 -07001227struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001228 uint64_t packet_count;
1229 uint64_t byte_count;
1230};
1231
Rich Lane68ae4d72013-05-09 10:55:19 -07001232struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001233 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001234 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001235 uint32_t group_id;
1236 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001237 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001238 uint64_t packet_count;
1239 uint64_t byte_count;
1240 uint32_t duration_sec;
1241 uint32_t duration_nsec;
1242 list(of_bucket_counter_t) bucket_stats;
1243};
1244
Rich Lane68ae4d72013-05-09 10:55:19 -07001245struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001246 uint16_t length;
1247 uint8_t type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001248 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001249 uint32_t group_id;
1250 list(of_bucket_t) buckets;
1251};
1252
1253// STATS:
1254// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1255
Rich Lanee9c37db2013-06-21 18:30:24 -07001256struct of_stats_request : of_header {
1257 uint8_t version;
1258 uint8_t type == 18;
1259 uint16_t length;
1260 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001261 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001262 uint16_t flags;
1263 pad(4);
1264};
1265
1266struct of_stats_reply : of_header {
1267 uint8_t version;
1268 uint8_t type == 19;
1269 uint16_t length;
1270 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001271 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001272 uint16_t flags;
1273 pad(4);
1274};
1275
1276struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001277 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001278 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001279 uint16_t length;
1280 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001281 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001282 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001283 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001284};
1285
Rich Lanee9c37db2013-06-21 18:30:24 -07001286struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001287 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001288 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001289 uint16_t length;
1290 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001291 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001292 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001293 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001294 of_desc_str_t mfr_desc;
1295 of_desc_str_t hw_desc;
1296 of_desc_str_t sw_desc;
1297 of_serial_num_t serial_num;
1298 of_desc_str_t dp_desc;
1299};
1300
Rich Lanee9c37db2013-06-21 18:30:24 -07001301struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001302 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001303 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001304 uint16_t length;
1305 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001306 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001307 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001308 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001309 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001310 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001311 of_port_no_t out_port;
1312 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001313 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001314 uint64_t cookie;
1315 uint64_t cookie_mask;
1316 of_match_t match;
1317};
1318
Rich Lanee9c37db2013-06-21 18:30:24 -07001319struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001320 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001321 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001322 uint16_t length;
1323 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001324 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001325 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001326 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001327 list(of_flow_stats_entry_t) entries;
1328};
1329
Rich Lanee9c37db2013-06-21 18:30:24 -07001330struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001331 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001332 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001333 uint16_t length;
1334 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001335 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001336 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001337 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001338 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001339 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001340 of_port_no_t out_port;
1341 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001342 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001343 uint64_t cookie;
1344 uint64_t cookie_mask;
1345 of_match_t match;
1346};
1347
Rich Lanee9c37db2013-06-21 18:30:24 -07001348struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001349 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001350 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001351 uint16_t length;
1352 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001353 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001354 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001355 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001356 uint64_t packet_count;
1357 uint64_t byte_count;
1358 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001359 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001360};
1361
Rich Lanee9c37db2013-06-21 18:30:24 -07001362struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001363 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001364 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001365 uint16_t length;
1366 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001367 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001368 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001369 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001370};
1371
Rich Lanee9c37db2013-06-21 18:30:24 -07001372struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001373 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001374 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001375 uint16_t length;
1376 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001377 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001378 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001379 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001380 list(of_table_stats_entry_t) entries;
1381};
1382
Rich Lanea06d0c32013-03-25 08:52:03 -07001383// FIXME: These are padded to 8 byte align beyond the length indicated
1384
Rich Lane68ae4d72013-05-09 10:55:19 -07001385struct of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001386 uint16_t type;
1387 uint16_t length;
1388};
1389
Rich Lanee9c37db2013-06-21 18:30:24 -07001390struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001391 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001392 uint16_t length;
1393 // FIXME Check if instruction_t is right for ids here
1394 list(of_instruction_t) instruction_ids;
1395};
1396
Rich Lanee9c37db2013-06-21 18:30:24 -07001397struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001398 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001399 uint16_t length;
1400 list(of_instruction_t) instruction_ids;
1401};
1402
Rich Lanee9c37db2013-06-21 18:30:24 -07001403struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001404 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001405 uint16_t length;
1406 list(of_uint8_t) next_table_ids;
1407};
1408
Rich Lanee9c37db2013-06-21 18:30:24 -07001409struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001410 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001411 uint16_t length;
1412 list(of_uint8_t) next_table_ids;
1413};
1414
Rich Lanee9c37db2013-06-21 18:30:24 -07001415struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001416 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001417 uint16_t length;
1418 list(of_action_id_t) action_ids;
1419};
1420
Rich Lanee9c37db2013-06-21 18:30:24 -07001421struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001422 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001423 uint16_t length;
1424 list(of_action_id_t) action_ids;
1425};
1426
Rich Lanee9c37db2013-06-21 18:30:24 -07001427struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001428 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001429 uint16_t length;
1430 list(of_action_id_t) action_ids;
1431};
1432
Rich Lanee9c37db2013-06-21 18:30:24 -07001433struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001434 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001435 uint16_t length;
1436 list(of_action_id_t) action_ids;
1437};
1438
Rich Lanee9c37db2013-06-21 18:30:24 -07001439struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001440 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001441 uint16_t length;
1442 list(of_uint32_t) oxm_ids;
1443};
1444
Rich Lanee9c37db2013-06-21 18:30:24 -07001445struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001446 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001447 uint16_t length;
1448 list(of_uint32_t) oxm_ids;
1449};
1450
Rich Lanee9c37db2013-06-21 18:30:24 -07001451struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001452 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001453 uint16_t length;
1454 list(of_uint32_t) oxm_ids;
1455};
1456
Rich Lanee9c37db2013-06-21 18:30:24 -07001457struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001458 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001459 uint16_t length;
1460 list(of_uint32_t) oxm_ids;
1461};
1462
Rich Lanee9c37db2013-06-21 18:30:24 -07001463struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001464 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001465 uint16_t length;
1466 list(of_uint32_t) oxm_ids;
1467};
1468
Rich Lanee9c37db2013-06-21 18:30:24 -07001469struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001470 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001471 uint16_t length;
1472 list(of_uint32_t) oxm_ids;
1473};
1474
Rich Lanee9c37db2013-06-21 18:30:24 -07001475struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001476 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001477 uint16_t length;
1478 uint32_t experimenter;
1479 uint32_t subtype;
1480 of_octets_t experimenter_data;
1481};
1482
1483// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001484// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001485// uint16_t type;
1486// uint16_t length;
1487// uint32_t experimenter;
1488// uint32_t subtype;
1489// of_octets_t experimenter_data;
1490// };
1491
Rich Lane68ae4d72013-05-09 10:55:19 -07001492struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001493 uint16_t length;
1494 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001495 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001496 of_table_name_t name;
1497 uint64_t metadata_match;
1498 uint64_t metadata_write;
1499 uint32_t config;
1500 uint32_t max_entries;
1501 list(of_table_feature_prop_t) properties;
1502};
1503
Rich Lane68ae4d72013-05-09 10:55:19 -07001504struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001505 uint32_t max_meter;
1506 uint32_t band_types;
1507 uint32_t capabilities;
1508 uint8_t max_bands;
1509 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001510 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001511};
1512
Rich Lanee9c37db2013-06-21 18:30:24 -07001513struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001514 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001515 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001516 uint16_t length;
1517 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001518 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001519 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001520 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001521 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001522 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001523};
1524
Rich Lanee9c37db2013-06-21 18:30:24 -07001525struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001526 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001527 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001528 uint16_t length;
1529 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001530 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001531 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001532 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001533 list(of_port_stats_entry_t) entries;
1534};
1535
Rich Lanee9c37db2013-06-21 18:30:24 -07001536struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001537 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001538 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001539 uint16_t length;
1540 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001541 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001542 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001543 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001544 of_port_no_t port_no;
1545 uint32_t queue_id;
1546};
1547
Rich Lanee9c37db2013-06-21 18:30:24 -07001548struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001549 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001550 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001551 uint16_t length;
1552 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001553 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001554 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001555 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001556 list(of_queue_stats_entry_t) entries;
1557};
1558
Rich Lanee9c37db2013-06-21 18:30:24 -07001559struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001560 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001561 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001562 uint16_t length;
1563 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001564 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001565 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001566 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001567 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001568 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001569};
1570
Rich Lanee9c37db2013-06-21 18:30:24 -07001571struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001572 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001573 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001574 uint16_t length;
1575 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001576 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001577 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001578 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001579 list(of_group_stats_entry_t) entries;
1580};
1581
Rich Lanee9c37db2013-06-21 18:30:24 -07001582struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001583 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001584 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001585 uint16_t length;
1586 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001587 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001588 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001589 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001590};
1591
Rich Lanee9c37db2013-06-21 18:30:24 -07001592struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001593 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001594 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001595 uint16_t length;
1596 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001597 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001598 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001599 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001600 list(of_group_desc_stats_entry_t) entries;
1601};
1602
Rich Lanee9c37db2013-06-21 18:30:24 -07001603struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001604 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001605 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001606 uint16_t length;
1607 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001608 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001609 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001610 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001611};
1612
Rich Lanee9c37db2013-06-21 18:30:24 -07001613struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001614 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001615 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001616 uint16_t length;
1617 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001618 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001619 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001620 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001621 uint32_t types;
1622 uint32_t capabilities;
1623 uint32_t max_groups_all;
1624 uint32_t max_groups_select;
1625 uint32_t max_groups_indirect;
1626 uint32_t max_groups_ff;
1627 uint32_t actions_all;
1628 uint32_t actions_select;
1629 uint32_t actions_indirect;
1630 uint32_t actions_ff;
1631};
1632
Rich Lanee9c37db2013-06-21 18:30:24 -07001633struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001634 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001635 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001636 uint16_t length;
1637 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001638 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001639 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001640 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001641 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001642 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001643};
1644
Rich Lanee9c37db2013-06-21 18:30:24 -07001645struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001646 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001647 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001648 uint16_t length;
1649 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001650 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001651 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001652 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001653 list(of_meter_stats_t) entries;
1654};
1655
Rich Lanee9c37db2013-06-21 18:30:24 -07001656struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001657 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001658 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001659 uint16_t length;
1660 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001661 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001662 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001663 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001664 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001665 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001666};
1667
Rich Lanee9c37db2013-06-21 18:30:24 -07001668struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001669 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001670 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001671 uint16_t length;
1672 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001673 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001674 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001675 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001676 list(of_meter_band_t) entries;
1677};
1678
1679// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001680struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001681 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001682 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001683 uint16_t length;
1684 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001685 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001686 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001687 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001688};
1689
1690// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001691struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001692 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001693 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001694 uint16_t length;
1695 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001696 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001697 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001698 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001699 of_meter_features_t features;
1700};
1701
1702// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001703struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001704 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001705 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001706 uint16_t length;
1707 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001708 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001709 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001710 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001711 list(of_table_features_t) entries;
1712};
1713
1714// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001715struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001716 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001717 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001718 uint16_t length;
1719 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001720 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001721 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001722 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001723 list(of_table_features_t) entries;
1724};
1725
1726// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001727struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001728 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001729 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001730 uint16_t length;
1731 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001732 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001733 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001734 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001735};
1736
1737// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001738struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001739 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001740 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001741 uint16_t length;
1742 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001743 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001744 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001745 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001746 list(of_port_desc_t) entries;
1747};
1748
Rich Lane68ae4d72013-05-09 10:55:19 -07001749struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001750 uint64_t packet_band_count;
1751 uint64_t byte_band_count;
1752};
1753
Rich Lane68ae4d72013-05-09 10:55:19 -07001754struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001755 uint32_t meter_id;
1756 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001757 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001758 uint32_t flow_count;
1759 uint64_t packet_in_count;
1760 uint64_t byte_in_count;
1761 uint32_t duration_sec;
1762 uint32_t duration_nsec;
1763 list(of_meter_band_stats_t) band_stats;
1764};
1765
Rich Lane68ae4d72013-05-09 10:55:19 -07001766struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001767 uint16_t length;
1768 uint16_t flags;
1769 uint32_t meter_id;
1770 list(of_meter_band_t) entries;
1771};
1772
Rich Lane68ae4d72013-05-09 10:55:19 -07001773struct of_experimenter_multipart_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001774 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001775 uint32_t subtype;
1776};
1777
1778// END OF STATS OBJECTS
1779
Rich Lane68ae4d72013-05-09 10:55:19 -07001780struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001781 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001782 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001783 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001784};
1785
Rich Lanee9c37db2013-06-21 18:30:24 -07001786struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001787 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001788 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001789 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001790 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001791 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001792};
1793
Rich Lanee9c37db2013-06-21 18:30:24 -07001794struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001795 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001796 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001797 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001798 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001799 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001800};
1801
Rich Lanee9c37db2013-06-21 18:30:24 -07001802struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001803 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001804 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001805 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001806 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001807 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001808 of_octets_t data;
1809};
1810
Rich Lane68ae4d72013-05-09 10:55:19 -07001811struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001812 uint32_t queue_id;
1813 of_port_no_t port;
1814 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001815 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001816 list(of_queue_prop_t) properties;
1817};
1818
Rich Lanee9c37db2013-06-21 18:30:24 -07001819struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001820 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001821 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001822 uint16_t length;
1823 uint32_t xid;
1824 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001825 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001826};
1827
Rich Lanee9c37db2013-06-21 18:30:24 -07001828struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001829 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001830 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001831 uint16_t length;
1832 uint32_t xid;
1833 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001834 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001835 list(of_packet_queue_t) queues;
1836};
1837
Rich Lanee9c37db2013-06-21 18:30:24 -07001838struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001839 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001840 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001841 uint16_t length;
1842 uint32_t xid;
1843 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001844 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001845 uint64_t generation_id;
1846};
1847
Rich Lanee9c37db2013-06-21 18:30:24 -07001848struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001849 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001850 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001851 uint16_t length;
1852 uint32_t xid;
1853 of_octets_t data;
1854};
1855
1856////////////////////////////////////////////////////////////////
1857// FIXME understand async; where do bitmasks live?
1858// Determine bitmap type for masks below.
1859// DOCUMENT masks where uint32_t[0] is interest for equal/master
1860// while uint32_t[1] is interest for slave
1861////////////////////////////////////////////////////////////////
1862
Rich Lanee9c37db2013-06-21 18:30:24 -07001863struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001864 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001865 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07001866 uint16_t length;
1867 uint32_t xid;
1868 uint32_t packet_in_mask_equal_master;
1869 uint32_t packet_in_mask_slave;
1870 uint32_t port_status_mask_equal_master;
1871 uint32_t port_status_mask_slave;
1872 uint32_t flow_removed_mask_equal_master;
1873 uint32_t flow_removed_mask_slave;
1874};
1875
Rich Lanee9c37db2013-06-21 18:30:24 -07001876struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001877 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001878 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07001879 uint16_t length;
1880 uint32_t xid;
1881 uint32_t packet_in_mask_equal_master;
1882 uint32_t packet_in_mask_slave;
1883 uint32_t port_status_mask_equal_master;
1884 uint32_t port_status_mask_slave;
1885 uint32_t flow_removed_mask_equal_master;
1886 uint32_t flow_removed_mask_slave;
1887};
1888
Rich Lanee9c37db2013-06-21 18:30:24 -07001889struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001890 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001891 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07001892 uint16_t length;
1893 uint32_t xid;
1894 uint32_t packet_in_mask_equal_master;
1895 uint32_t packet_in_mask_slave;
1896 uint32_t port_status_mask_equal_master;
1897 uint32_t port_status_mask_slave;
1898 uint32_t flow_removed_mask_equal_master;
1899 uint32_t flow_removed_mask_slave;
1900};