blob: ac6fb5c17c237fcd85a6f019b7fc08e0266a0c64 [file] [log] [blame]
Rich Lanea06d0c32013-03-25 08:52:03 -07001// Copyright 2013, Big Switch Networks, Inc.
2//
3// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
4// the following special exception:
5//
6// LOXI Exception
7//
8// As a special exception to the terms of the EPL, you may distribute libraries
9// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
10// that copyright and licensing notices generated by LoxiGen are not altered or removed
11// from the LoxiGen Libraries and the notice provided below is (i) included in
12// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
13// documentation for the LoxiGen Libraries, if distributed in binary form.
14//
15// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
16//
17// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
18// a copy of the EPL at:
19//
20// http://www.eclipse.org/legal/epl-v10.html
21//
22// Unless required by applicable law or agreed to in writing, software
23// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
25// EPL for the specific language governing permissions and limitations
26// under the EPL.
Rich Lane5d33a622013-04-08 17:33:11 -070027//
28// Also derived from the OpenFlow header files which have these copyrights:
29// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
30// Copyright (c) 2011, 2012 Open Networking Foundation
Rich Lanea06d0c32013-03-25 08:52:03 -070031
32#version 4
33
Rich Lane5d33a622013-04-08 17:33:11 -070034enum macro_definitions {
35 OFP_MAX_TABLE_NAME_LEN = 32,
36 OFP_MAX_PORT_NAME_LEN = 16,
37
Wilson Ngd72013d2013-09-29 10:21:48 -070038 OFP_TCP_PORT = 6653,
39 OFP_SSL_PORT = 6653,
Rich Lane5d33a622013-04-08 17:33:11 -070040
41 OFP_ETH_ALEN = 6,
42
43 OFP_DEFAULT_MISS_SEND_LEN = 128,
44
45 OFP_VLAN_NONE = 0,
46
47 OFP_FLOW_PERMANENT = 0,
48
49 OFP_DEFAULT_PRIORITY = 0x8000,
50
51 OFP_NO_BUFFER = 0xffffffff,
52
53 DESC_STR_LEN = 256,
54 SERIAL_NUM_LEN = 32,
55
56 OFPQ_ALL = 0xffffffff,
57 OFPQ_MAX_RATE_UNCFG = 0xffff,
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59};
60
Andreas Wundsam4ee51462013-07-30 11:00:37 -070061enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070062 OFPP_MAX = 0xffffff00,
63 OFPP_IN_PORT = 0xfffffff8,
64 OFPP_TABLE = 0xfffffff9,
65 OFPP_NORMAL = 0xfffffffa,
66 OFPP_FLOOD = 0xfffffffb,
67 OFPP_ALL = 0xfffffffc,
68 OFPP_CONTROLLER = 0xfffffffd,
69 OFPP_LOCAL = 0xfffffffe,
Tomasz949aa522013-10-23 16:12:27 -070070 OFPP_ANY = 0xffffffff,
Rich Lane5d33a622013-04-08 17:33:11 -070071};
72
Andreas Wundsam4ee51462013-07-30 11:00:37 -070073enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070074 OFPT_HELLO = 0,
75 OFPT_ERROR = 1,
76 OFPT_ECHO_REQUEST = 2,
77 OFPT_ECHO_REPLY = 3,
78 OFPT_EXPERIMENTER = 4,
79 OFPT_FEATURES_REQUEST = 5,
80 OFPT_FEATURES_REPLY = 6,
81 OFPT_GET_CONFIG_REQUEST = 7,
82 OFPT_GET_CONFIG_REPLY = 8,
83 OFPT_SET_CONFIG = 9,
84 OFPT_PACKET_IN = 10,
85 OFPT_FLOW_REMOVED = 11,
86 OFPT_PORT_STATUS = 12,
87 OFPT_PACKET_OUT = 13,
88 OFPT_FLOW_MOD = 14,
89 OFPT_GROUP_MOD = 15,
90 OFPT_PORT_MOD = 16,
91 OFPT_TABLE_MOD = 17,
Rob Vaterlausfeee3712013-09-30 11:24:19 -070092 OFPT_STATS_REQUEST = 18,
93 OFPT_STATS_REPLY = 19,
Rich Lane5d33a622013-04-08 17:33:11 -070094 OFPT_BARRIER_REQUEST = 20,
95 OFPT_BARRIER_REPLY = 21,
96 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
97 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
98 OFPT_ROLE_REQUEST = 24,
99 OFPT_ROLE_REPLY = 25,
100 OFPT_GET_ASYNC_REQUEST = 26,
101 OFPT_GET_ASYNC_REPLY = 27,
102 OFPT_SET_ASYNC = 28,
103 OFPT_METER_MOD = 29,
104};
105
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700106enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700107 OFPC_FRAG_NORMAL = 0,
108 OFPC_FRAG_DROP = 1,
109 OFPC_FRAG_REASM = 2,
110 OFPC_FRAG_MASK = 3,
111};
112
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700113enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700114 OFPTC_DEPRECATED_MASK = 0x3,
115};
116
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700117enum ofp_table(wire_type=uint8_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700118 OFPTT_MAX = 0xfe,
119 OFPTT_ALL = 0xff,
120};
121
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700122enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700123 OFPC_FLOW_STATS = 0x1,
124 OFPC_TABLE_STATS = 0x2,
125 OFPC_PORT_STATS = 0x4,
126 OFPC_GROUP_STATS = 0x8,
127 OFPC_IP_REASM = 0x20,
128 OFPC_QUEUE_STATS = 0x40,
129 OFPC_PORT_BLOCKED = 0x100,
130};
131
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700132enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700133 OFPPC_PORT_DOWN = 0x1,
134 OFPPC_NO_RECV = 0x4,
135 OFPPC_NO_FWD = 0x20,
136 OFPPC_NO_PACKET_IN = 0x40,
137};
138
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700139enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700140 OFPPS_LINK_DOWN = 0x1,
141 OFPPS_BLOCKED = 0x2,
142 OFPPS_LIVE = 0x4,
143};
144
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700145enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700146 OFPPF_10MB_HD = 0x1,
147 OFPPF_10MB_FD = 0x2,
148 OFPPF_100MB_HD = 0x4,
149 OFPPF_100MB_FD = 0x8,
150 OFPPF_1GB_HD = 0x10,
151 OFPPF_1GB_FD = 0x20,
152 OFPPF_10GB_FD = 0x40,
153 OFPPF_40GB_FD = 0x80,
154 OFPPF_100GB_FD = 0x100,
155 OFPPF_1TB_FD = 0x200,
156 OFPPF_OTHER = 0x400,
157 OFPPF_COPPER = 0x800,
158 OFPPF_FIBER = 0x1000,
159 OFPPF_AUTONEG = 0x2000,
160 OFPPF_PAUSE = 0x4000,
161 OFPPF_PAUSE_ASYM = 0x8000,
162};
163
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700164enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700165 OFPPR_ADD = 0,
166 OFPPR_DELETE = 1,
167 OFPPR_MODIFY = 2,
168};
169
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700170enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700171 OFPMT_STANDARD = 0,
172 OFPMT_OXM = 1,
173};
174
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700175enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700176 OFPXMC_NXM_0 = 0,
177 OFPXMC_NXM_1 = 1,
178 OFPXMC_OPENFLOW_BASIC = 0x8000,
179 OFPXMC_EXPERIMENTER = 0xffff,
180};
181
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700182enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700183 OFPVID_NONE = 0,
184 OFPVID_PRESENT = 0x1000,
185};
186
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700187// FIXME: OF spec specified this as '9' bits, implicitly adding
188// to full byte
189enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700190 OFPIEH_NONEXT = 0x1,
191 OFPIEH_ESP = 0x2,
192 OFPIEH_AUTH = 0x4,
193 OFPIEH_DEST = 0x8,
194 OFPIEH_FRAG = 0x10,
195 OFPIEH_ROUTER = 0x20,
196 OFPIEH_HOP = 0x40,
197 OFPIEH_UNREP = 0x80,
198 OFPIEH_UNSEQ = 0x100,
199};
200
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700201enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700202 OFPAT_OUTPUT = 0,
203 OFPAT_COPY_TTL_OUT = 0xb,
204 OFPAT_COPY_TTL_IN = 0xc,
205 OFPAT_SET_MPLS_TTL = 0xf,
206 OFPAT_DEC_MPLS_TTL = 0x10,
207 OFPAT_PUSH_VLAN = 0x11,
208 OFPAT_POP_VLAN = 0x12,
209 OFPAT_PUSH_MPLS = 0x13,
210 OFPAT_POP_MPLS = 0x14,
211 OFPAT_SET_QUEUE = 0x15,
212 OFPAT_GROUP = 0x16,
213 OFPAT_SET_NW_TTL = 0x17,
214 OFPAT_DEC_NW_TTL = 0x18,
215 OFPAT_SET_FIELD = 0x19,
216 OFPAT_PUSH_PBB = 0x1a,
217 OFPAT_POP_PBB = 0x1b,
218 OFPAT_EXPERIMENTER = 0xffff,
219};
220
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700221enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700222 OFPCML_MAX = 0xffe5,
223 OFPCML_NO_BUFFER = 0xffff,
224};
225
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700226enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700227 OFPIT_GOTO_TABLE = 0x1,
228 OFPIT_WRITE_METADATA = 0x2,
229 OFPIT_WRITE_ACTIONS = 0x3,
230 OFPIT_APPLY_ACTIONS = 0x4,
231 OFPIT_CLEAR_ACTIONS = 0x5,
232 OFPIT_METER = 0x6,
233 OFPIT_EXPERIMENTER = 0xffff,
234};
235
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700236enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700237 OFPFC_ADD = 0,
238 OFPFC_MODIFY = 1,
239 OFPFC_MODIFY_STRICT = 2,
240 OFPFC_DELETE = 3,
241 OFPFC_DELETE_STRICT = 4,
242};
243
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700244enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700245 OFPFF_SEND_FLOW_REM = 0x1,
246 OFPFF_CHECK_OVERLAP = 0x2,
247 OFPFF_RESET_COUNTS = 0x4,
248 OFPFF_NO_PKT_COUNTS = 0x8,
249 OFPFF_NO_BYT_COUNTS = 0x10,
250};
251
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700252enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700253 OFPG_MAX = 0xffffff00,
254 OFPG_ALL = 0xfffffffc,
255 OFPG_ANY = 0xffffffff,
256};
257
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700258enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700259 OFPGC_ADD = 0,
260 OFPGC_MODIFY = 1,
261 OFPGC_DELETE = 2,
262};
263
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700264enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700265 OFPGT_ALL = 0,
266 OFPGT_SELECT = 1,
267 OFPGT_INDIRECT = 2,
268 OFPGT_FF = 3,
269};
270
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700271enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700272 OFPR_NO_MATCH = 0,
273 OFPR_ACTION = 1,
274 OFPR_INVALID_TTL = 2,
275};
276
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700277enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700278 OFPRR_IDLE_TIMEOUT = 0,
279 OFPRR_HARD_TIMEOUT = 1,
280 OFPRR_DELETE = 2,
281 OFPRR_GROUP_DELETE = 3,
282};
283
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700284enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700285 OFPM_MAX = 0xffff0000,
286 OFPM_SLOWPATH = 0xfffffffd,
287 OFPM_CONTROLLER = 0xfffffffe,
288 OFPM_ALL = 0xffffffff,
289};
290
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700291enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700292 OFPMBT_DROP = 0x1,
293 OFPMBT_DSCP_REMARK = 0x2,
294 OFPMBT_EXPERIMENTER = 0xffff,
295};
296
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700297enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700298 OFPMC_ADD = 0,
299 OFPMC_MODIFY = 1,
300 OFPMC_DELETE = 2,
301};
302
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700303enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700304 OFPMF_KBPS = 0x1,
305 OFPMF_PKTPS = 0x2,
306 OFPMF_BURST = 0x4,
307 OFPMF_STATS = 0x8,
308};
309
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700310enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700311 OFPET_HELLO_FAILED = 0,
312 OFPET_BAD_REQUEST = 1,
313 OFPET_BAD_ACTION = 2,
314 OFPET_BAD_INSTRUCTION = 3,
315 OFPET_BAD_MATCH = 4,
316 OFPET_FLOW_MOD_FAILED = 5,
317 OFPET_GROUP_MOD_FAILED = 6,
318 OFPET_PORT_MOD_FAILED = 7,
319 OFPET_TABLE_MOD_FAILED = 8,
320 OFPET_QUEUE_OP_FAILED = 9,
321 OFPET_SWITCH_CONFIG_FAILED = 10,
322 OFPET_ROLE_REQUEST_FAILED = 11,
323 OFPET_METER_MOD_FAILED = 12,
324 OFPET_TABLE_FEATURES_FAILED = 13,
325 OFPET_EXPERIMENTER = 0xffff,
326};
327
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700328enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700329 OFPHFC_INCOMPATIBLE = 0,
330 OFPHFC_EPERM = 1,
331};
332
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700333enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700334 OFPBRC_BAD_VERSION = 0,
335 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700336 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700337 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700338 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700339 OFPBRC_EPERM = 5,
340 OFPBRC_BAD_LEN = 6,
341 OFPBRC_BUFFER_EMPTY = 7,
342 OFPBRC_BUFFER_UNKNOWN = 8,
343 OFPBRC_BAD_TABLE_ID = 9,
344 OFPBRC_IS_SLAVE = 10,
345 OFPBRC_BAD_PORT = 11,
346 OFPBRC_BAD_PACKET = 12,
347 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
348};
349
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700350enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700351 OFPBAC_BAD_TYPE = 0,
352 OFPBAC_BAD_LEN = 1,
353 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700354 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700355 OFPBAC_BAD_OUT_PORT = 4,
356 OFPBAC_BAD_ARGUMENT = 5,
357 OFPBAC_EPERM = 6,
358 OFPBAC_TOO_MANY = 7,
359 OFPBAC_BAD_QUEUE = 8,
360 OFPBAC_BAD_OUT_GROUP = 9,
361 OFPBAC_MATCH_INCONSISTENT = 10,
362 OFPBAC_UNSUPPORTED_ORDER = 11,
363 OFPBAC_BAD_TAG = 12,
364 OFPBAC_BAD_SET_TYPE = 13,
365 OFPBAC_BAD_SET_LEN = 14,
366 OFPBAC_BAD_SET_ARGUMENT = 15,
367};
368
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700369enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700370 OFPBIC_UNKNOWN_INST = 0,
371 OFPBIC_UNSUP_INST = 1,
372 OFPBIC_BAD_TABLE_ID = 2,
373 OFPBIC_UNSUP_METADATA = 3,
374 OFPBIC_UNSUP_METADATA_MASK = 4,
375 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700376 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700377 OFPBIC_BAD_LEN = 7,
378 OFPBIC_EPERM = 8,
379};
380
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700381enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700382 OFPBMC_BAD_TYPE = 0,
383 OFPBMC_BAD_LEN = 1,
384 OFPBMC_BAD_TAG = 2,
385 OFPBMC_BAD_DL_ADDR_MASK = 3,
386 OFPBMC_BAD_NW_ADDR_MASK = 4,
387 OFPBMC_BAD_WILDCARDS = 5,
388 OFPBMC_BAD_FIELD = 6,
389 OFPBMC_BAD_VALUE = 7,
390 OFPBMC_BAD_MASK = 8,
391 OFPBMC_BAD_PREREQ = 9,
392 OFPBMC_DUP_FIELD = 10,
393 OFPBMC_EPERM = 11,
394};
395
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700396enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700397 OFPFMFC_UNKNOWN = 0,
398 OFPFMFC_TABLE_FULL = 1,
399 OFPFMFC_BAD_TABLE_ID = 2,
400 OFPFMFC_OVERLAP = 3,
401 OFPFMFC_EPERM = 4,
402 OFPFMFC_BAD_TIMEOUT = 5,
403 OFPFMFC_BAD_COMMAND = 6,
404 OFPFMFC_BAD_FLAGS = 7,
405};
406
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700407enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700408 OFPGMFC_GROUP_EXISTS = 0,
409 OFPGMFC_INVALID_GROUP = 1,
410 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
411 OFPGMFC_OUT_OF_GROUPS = 3,
412 OFPGMFC_OUT_OF_BUCKETS = 4,
413 OFPGMFC_CHAINING_UNSUPPORTED = 5,
414 OFPGMFC_WATCH_UNSUPPORTED = 6,
415 OFPGMFC_LOOP = 7,
416 OFPGMFC_UNKNOWN_GROUP = 8,
417 OFPGMFC_CHAINED_GROUP = 9,
418 OFPGMFC_BAD_TYPE = 10,
419 OFPGMFC_BAD_COMMAND = 11,
420 OFPGMFC_BAD_BUCKET = 12,
421 OFPGMFC_BAD_WATCH = 13,
422 OFPGMFC_EPERM = 14,
423};
424
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700425enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700426 OFPPMFC_BAD_PORT = 0,
427 OFPPMFC_BAD_HW_ADDR = 1,
428 OFPPMFC_BAD_CONFIG = 2,
429 OFPPMFC_BAD_ADVERTISE = 3,
430 OFPPMFC_EPERM = 4,
431};
432
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700433enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700434 OFPTMFC_BAD_TABLE = 0,
435 OFPTMFC_BAD_CONFIG = 1,
436 OFPTMFC_EPERM = 2,
437};
438
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700439enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700440 OFPQOFC_BAD_PORT = 0,
441 OFPQOFC_BAD_QUEUE = 1,
442 OFPQOFC_EPERM = 2,
443};
444
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700445enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700446 OFPSCFC_BAD_FLAGS = 0,
447 OFPSCFC_BAD_LEN = 1,
448 OFPSCFC_EPERM = 2,
449};
450
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700451enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700452 OFPRRFC_STALE = 0,
453 OFPRRFC_UNSUP = 1,
454 OFPRRFC_BAD_ROLE = 2,
455};
456
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700457enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700458 OFPMMFC_UNKNOWN = 0,
459 OFPMMFC_METER_EXISTS = 1,
460 OFPMMFC_INVALID_METER = 2,
461 OFPMMFC_UNKNOWN_METER = 3,
462 OFPMMFC_BAD_COMMAND = 4,
463 OFPMMFC_BAD_FLAGS = 5,
464 OFPMMFC_BAD_RATE = 6,
465 OFPMMFC_BAD_BURST = 7,
466 OFPMMFC_BAD_BAND = 8,
467 OFPMMFC_BAD_BAND_VALUE = 9,
468 OFPMMFC_OUT_OF_METERS = 10,
469 OFPMMFC_OUT_OF_BANDS = 11,
470};
471
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700472enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700473 OFPTFFC_BAD_TABLE = 0,
474 OFPTFFC_BAD_METADATA = 1,
475 OFPTFFC_BAD_TYPE = 2,
476 OFPTFFC_BAD_LEN = 3,
477 OFPTFFC_BAD_ARGUMENT = 4,
478 OFPTFFC_EPERM = 5,
479};
480
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700481enum ofp_stats_type(wire_type=uint16_t) {
482 OFPST_DESC = 0,
483 OFPST_FLOW = 1,
484 OFPST_AGGREGATE = 2,
485 OFPST_TABLE = 3,
486 OFPST_PORT = 4,
487 OFPST_QUEUE = 5,
488 OFPST_GROUP = 6,
489 OFPST_GROUP_DESC = 7,
490 OFPST_GROUP_FEATURES = 8,
491 OFPST_METER = 9,
492 OFPST_METER_CONFIG = 10,
493 OFPST_METER_FEATURES = 11,
494 OFPST_TABLE_FEATURES = 12,
495 OFPST_PORT_DESC = 13,
496 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700497};
498
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700499enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
500 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700501};
502
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700503enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
504 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700505};
506
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700507enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700508 OFPTFPT_INSTRUCTIONS = 0,
509 OFPTFPT_INSTRUCTIONS_MISS = 1,
510 OFPTFPT_NEXT_TABLES = 2,
511 OFPTFPT_NEXT_TABLES_MISS = 3,
512 OFPTFPT_WRITE_ACTIONS = 4,
513 OFPTFPT_WRITE_ACTIONS_MISS = 5,
514 OFPTFPT_APPLY_ACTIONS = 6,
515 OFPTFPT_APPLY_ACTIONS_MISS = 7,
516 OFPTFPT_MATCH = 8,
517 OFPTFPT_WILDCARDS = 0xa,
518 OFPTFPT_WRITE_SETFIELD = 0xc,
519 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
520 OFPTFPT_APPLY_SETFIELD = 0xe,
521 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
522 OFPTFPT_EXPERIMENTER = 0xfffe,
523 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
524};
525
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700526enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700527 OFPGFC_SELECT_WEIGHT = 0x1,
528 OFPGFC_SELECT_LIVENESS = 0x2,
529 OFPGFC_CHAINING = 0x4,
530 OFPGFC_CHAINING_CHECKS = 0x8,
531};
532
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700533enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700534 OFPQT_MIN_RATE = 0x1,
535 OFPQT_MAX_RATE = 0x2,
536 OFPQT_EXPERIMENTER = 0xffff,
537};
538
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700539enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700540 OFPCR_ROLE_NOCHANGE = 0,
541 OFPCR_ROLE_EQUAL = 1,
542 OFPCR_ROLE_MASTER = 2,
543 OFPCR_ROLE_SLAVE = 3,
544};
545
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700546enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700547 OFPHET_VERSIONBITMAP = 1,
548};
549
Rich Lanee9c37db2013-06-21 18:30:24 -0700550/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700551struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700552 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700553 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700554 uint16_t length;
555 uint32_t xid;
556};
557
558// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700559struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700560 uint32_t value;
561};
562
563// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700564struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700565 uint8_t value;
566};
567
Rich Lane68ae4d72013-05-09 10:55:19 -0700568struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700569 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700570 uint16_t length;
571};
572
Rich Lanee9c37db2013-06-21 18:30:24 -0700573struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700574 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700575 uint16_t length;
576 list(of_uint32_t) bitmaps;
577};
578
Rich Lanee9c37db2013-06-21 18:30:24 -0700579struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700580 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700581 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700582 uint16_t length;
583 uint32_t xid;
584 list(of_hello_elem_t) elements;
585};
586
Rich Lanee9c37db2013-06-21 18:30:24 -0700587struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700588 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700589 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700590 uint16_t length;
591 uint32_t xid;
592 of_octets_t data;
593};
594
Rich Lanee9c37db2013-06-21 18:30:24 -0700595struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700596 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700597 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700598 uint16_t length;
599 uint32_t xid;
600 of_octets_t data;
601};
602
Rich Lanee9c37db2013-06-21 18:30:24 -0700603struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700604 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700605 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700606 uint16_t length;
607 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700608 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700609 uint32_t subtype;
610 of_octets_t data;
611};
612
Rich Lanee9c37db2013-06-21 18:30:24 -0700613struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700614 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700615 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700616 uint16_t length;
617 uint32_t xid;
618};
619
Rich Lanee9c37db2013-06-21 18:30:24 -0700620struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700621 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700622 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700623 uint16_t length;
624 uint32_t xid;
625};
626
Rich Lanee9c37db2013-06-21 18:30:24 -0700627struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700628 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700629 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700630 uint16_t length;
631 uint32_t xid;
632};
633
Rich Lanee9c37db2013-06-21 18:30:24 -0700634struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700635 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700636 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700637 uint16_t length;
638 uint32_t xid;
639 uint16_t flags;
640 uint16_t miss_send_len;
641};
642
Rich Lanee9c37db2013-06-21 18:30:24 -0700643struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700644 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700645 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700646 uint16_t length;
647 uint32_t xid;
648 uint16_t flags;
649 uint16_t miss_send_len;
650};
651
Rich Lanee9c37db2013-06-21 18:30:24 -0700652struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700653 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700654 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700655 uint16_t length;
656 uint32_t xid;
657 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700658 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700659 uint32_t config;
660};
661
Rich Lane68ae4d72013-05-09 10:55:19 -0700662struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700664 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700665 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700666 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700667 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700668 enum ofp_port_config config;
669 enum ofp_port_state state;
670 enum ofp_port_features curr;
671 enum ofp_port_features advertised;
672 enum ofp_port_features supported;
673 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700674 uint32_t curr_speed;
675 uint32_t max_speed;
676};
677
Rich Lanee9c37db2013-06-21 18:30:24 -0700678struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700679 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700680 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700681 uint16_t length;
682 uint32_t xid;
683};
684
Rich Lanee9c37db2013-06-21 18:30:24 -0700685struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700686 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700687 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700688 uint16_t length;
689 uint32_t xid;
690 uint64_t datapath_id;
691 uint32_t n_buffers;
692 uint8_t n_tables;
693 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700694 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700695 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint32_t reserved;
697};
698
Rich Lanee9c37db2013-06-21 18:30:24 -0700699struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700700 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700701 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700702 uint16_t length;
703 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700704 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700705 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700706 of_port_desc_t desc;
707};
708
Rich Lanee9c37db2013-06-21 18:30:24 -0700709struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700710 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700711 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700712 uint16_t length;
713 uint32_t xid;
714 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700715 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700716 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700717 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700718 uint32_t config;
719 uint32_t mask;
720 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700721 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700722};
723
724// FIXME Does this need to be v4?
Andreas Wundsamfef7d5f2013-08-01 22:15:44 -0700725struct of_match_v3(align=8) {
Rich Lane31b87142013-05-09 22:05:42 -0700726 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700727 uint16_t length;
728 list(of_oxm_t) oxm_list;
729};
730
Rich Lanea06d0c32013-03-25 08:52:03 -0700731// This looks like an action header, but is standalone. See
732// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700733struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700734 uint16_t type;
735 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700736 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700737};
738
Rich Lanee9c37db2013-06-21 18:30:24 -0700739struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700740 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700741 uint16_t len;
742 of_port_no_t port;
743 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700744 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700745};
746
Rich Lanee9c37db2013-06-21 18:30:24 -0700747struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700748 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700749 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700750 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700751};
752
Rich Lanee9c37db2013-06-21 18:30:24 -0700753struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700754 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700755 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700756 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700757};
758
Rich Lanee9c37db2013-06-21 18:30:24 -0700759struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700760 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700761 uint16_t len;
762 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700763 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700764};
765
Rich Lanee9c37db2013-06-21 18:30:24 -0700766struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700767 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700768 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700769 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700770};
771
Rich Lanee9c37db2013-06-21 18:30:24 -0700772struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700773 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700774 uint16_t len;
775 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700776 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700777};
778
Rich Lanee9c37db2013-06-21 18:30:24 -0700779struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700780 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700781 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700782 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700783};
784
Rich Lanee9c37db2013-06-21 18:30:24 -0700785struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700786 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700787 uint16_t len;
788 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700789 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700790};
791
Rich Lanee9c37db2013-06-21 18:30:24 -0700792struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700793 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700794 uint16_t len;
795 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700796 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700797};
798
Rich Lanee9c37db2013-06-21 18:30:24 -0700799struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700800 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700801 uint16_t len;
802 uint32_t queue_id;
803};
804
Rich Lanee9c37db2013-06-21 18:30:24 -0700805struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700806 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700807 uint16_t len;
808 uint32_t group_id;
809};
810
Rich Lanee9c37db2013-06-21 18:30:24 -0700811struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700812 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700813 uint16_t len;
814 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700815 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700816};
817
Rich Lanee9c37db2013-06-21 18:30:24 -0700818struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700819 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700820 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700821 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700822};
823
Rich Lanee9c37db2013-06-21 18:30:24 -0700824struct of_action_set_field : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700825 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700826 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700827 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700828};
829
Rich Lanee9c37db2013-06-21 18:30:24 -0700830struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700831 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700832 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700833 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700834 of_octets_t data;
835};
836
Rich Lanee9c37db2013-06-21 18:30:24 -0700837struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700838 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700839 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700840 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700841};
842
Rich Lanee9c37db2013-06-21 18:30:24 -0700843struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700844 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700845 uint16_t len;
846 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700847 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700848};
849
Rich Lane68ae4d72013-05-09 10:55:19 -0700850struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700851 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700852 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700853 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700854};
855
Rich Lane68ae4d72013-05-09 10:55:19 -0700856struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700857 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700858 uint16_t len;
859};
860
Rich Lanee9c37db2013-06-21 18:30:24 -0700861struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700862 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700863 uint16_t len;
864 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700865 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700866};
867
Rich Lanee9c37db2013-06-21 18:30:24 -0700868struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700869 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700870 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700871 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700872 uint64_t metadata;
873 uint64_t metadata_mask;
874};
875
Rich Lanee9c37db2013-06-21 18:30:24 -0700876struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700877 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700878 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700879 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700880 list(of_action_t) actions;
881};
882
Rich Lanee9c37db2013-06-21 18:30:24 -0700883struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700884 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700885 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700886 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700887 list(of_action_t) actions;
888};
889
Rich Lanee9c37db2013-06-21 18:30:24 -0700890struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700891 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700892 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700893 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700894};
895
Rich Lanee9c37db2013-06-21 18:30:24 -0700896struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700897 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700898 uint16_t len;
899 uint32_t meter_id;
900};
901
Rich Lanee9c37db2013-06-21 18:30:24 -0700902struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700903 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700904 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700905 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700906 of_octets_t data;
907};
908
Rich Lanee9c37db2013-06-21 18:30:24 -0700909struct of_flow_mod : of_header {
910 uint8_t version;
911 uint8_t type == 14;
912 uint16_t length;
913 uint32_t xid;
914 uint64_t cookie;
915 uint64_t cookie_mask;
916 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700917 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700918 uint16_t idle_timeout;
919 uint16_t hard_timeout;
920 uint16_t priority;
921 uint32_t buffer_id;
922 of_port_no_t out_port;
923 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700924 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700925 pad(2);
926 of_match_t match;
927 list(of_instruction_t) instructions;
928};
929
930struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700931 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700932 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700933 uint16_t length;
934 uint32_t xid;
935 uint64_t cookie;
936 uint64_t cookie_mask;
937 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700938 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700939 uint16_t idle_timeout;
940 uint16_t hard_timeout;
941 uint16_t priority;
942 uint32_t buffer_id;
943 of_port_no_t out_port;
944 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700945 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700946 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700947 of_match_t match;
948 list(of_instruction_t) instructions;
949};
950
Rich Lanee9c37db2013-06-21 18:30:24 -0700951struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700952 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700953 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700954 uint16_t length;
955 uint32_t xid;
956 uint64_t cookie;
957 uint64_t cookie_mask;
958 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700959 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700960 uint16_t idle_timeout;
961 uint16_t hard_timeout;
962 uint16_t priority;
963 uint32_t buffer_id;
964 of_port_no_t out_port;
965 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700966 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700967 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700968 of_match_t match;
969 list(of_instruction_t) instructions;
970};
971
Rich Lanee9c37db2013-06-21 18:30:24 -0700972struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700973 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700974 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700975 uint16_t length;
976 uint32_t xid;
977 uint64_t cookie;
978 uint64_t cookie_mask;
979 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700980 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700981 uint16_t idle_timeout;
982 uint16_t hard_timeout;
983 uint16_t priority;
984 uint32_t buffer_id;
985 of_port_no_t out_port;
986 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700987 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700988 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700989 of_match_t match;
990 list(of_instruction_t) instructions;
991};
992
Rich Lanee9c37db2013-06-21 18:30:24 -0700993struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700994 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700995 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700996 uint16_t length;
997 uint32_t xid;
998 uint64_t cookie;
999 uint64_t cookie_mask;
1000 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001001 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001002 uint16_t idle_timeout;
1003 uint16_t hard_timeout;
1004 uint16_t priority;
1005 uint32_t buffer_id;
1006 of_port_no_t out_port;
1007 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001008 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001009 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001010 of_match_t match;
1011 list(of_instruction_t) instructions;
1012};
1013
Rich Lanee9c37db2013-06-21 18:30:24 -07001014struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001015 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001016 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001017 uint16_t length;
1018 uint32_t xid;
1019 uint64_t cookie;
1020 uint64_t cookie_mask;
1021 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001022 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001023 uint16_t idle_timeout;
1024 uint16_t hard_timeout;
1025 uint16_t priority;
1026 uint32_t buffer_id;
1027 of_port_no_t out_port;
1028 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001029 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001030 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001031 of_match_t match;
1032 list(of_instruction_t) instructions;
1033};
1034
Rich Lane68ae4d72013-05-09 10:55:19 -07001035struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001036 uint16_t len;
1037 uint16_t weight;
1038 of_port_no_t watch_port;
1039 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001040 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001041 list(of_action_t) actions;
1042};
1043
Rich Lanee9c37db2013-06-21 18:30:24 -07001044struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001045 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001046 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001047 uint16_t length;
1048 uint32_t xid;
1049 uint16_t command;
1050 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001051 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001052 uint32_t group_id;
1053 list(of_bucket_t) buckets;
1054};
1055
Rich Lanee9c37db2013-06-21 18:30:24 -07001056struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001057 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001058 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001059 uint16_t length;
1060 uint32_t xid;
1061 uint32_t buffer_id;
1062 of_port_no_t in_port;
1063 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001064 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001065 list(of_action_t) actions;
1066 of_octets_t data;
1067};
1068
Rich Lanee9c37db2013-06-21 18:30:24 -07001069struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001070 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001071 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001072 uint16_t length;
1073 uint32_t xid;
1074 uint32_t buffer_id;
1075 uint16_t total_len;
1076 uint8_t reason;
1077 uint8_t table_id;
1078 uint64_t cookie;
1079 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001080 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001081 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1082};
1083
Rich Lanee9c37db2013-06-21 18:30:24 -07001084struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001085 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001086 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001087 uint16_t length;
1088 uint32_t xid;
1089 uint64_t cookie;
1090 uint16_t priority;
1091 uint8_t reason;
1092 uint8_t table_id;
1093 uint32_t duration_sec;
1094 uint32_t duration_nsec;
1095 uint16_t idle_timeout;
1096 uint16_t hard_timeout;
1097 uint64_t packet_count;
1098 uint64_t byte_count;
1099 of_match_t match;
1100};
1101
Rich Lane68ae4d72013-05-09 10:55:19 -07001102struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001103 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001104 uint16_t len;
1105// uint32_t rate; // These are excluded b/c this is the header
1106// uint32_t burst_size; // These are excluded b/c this is the header
1107};
1108
Rich Lanee9c37db2013-06-21 18:30:24 -07001109struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001110 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001111 uint16_t len;
1112 uint32_t rate;
1113 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001114 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001115};
1116
Rich Lanee9c37db2013-06-21 18:30:24 -07001117struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001118 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001119 uint16_t len;
1120 uint32_t rate;
1121 uint32_t burst_size;
1122 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001123 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001124};
1125
Rich Lanee9c37db2013-06-21 18:30:24 -07001126struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001127 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001128 uint16_t len;
1129 uint32_t rate;
1130 uint32_t burst_size;
1131 uint32_t experimenter;
1132};
1133
Rich Lanee9c37db2013-06-21 18:30:24 -07001134struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001135 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001136 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001137 uint16_t length;
1138 uint32_t xid;
1139 uint16_t command;
1140 uint16_t flags;
1141 uint32_t meter_id;
1142 list(of_meter_band_t) meters;
1143};
1144
Rich Lanee9c37db2013-06-21 18:30:24 -07001145struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001146 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001147 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001148 uint16_t length;
1149 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001150 uint16_t err_type == ?;
1151};
1152
1153struct of_hello_failed_error_msg : of_error_msg {
1154 uint8_t version;
1155 uint8_t type == 1;
1156 uint16_t length;
1157 uint32_t xid;
1158 uint16_t err_type == 0;
1159 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001160 of_octets_t data;
1161};
1162
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001163struct of_bad_request_error_msg : of_error_msg {
1164 uint8_t version;
1165 uint8_t type == 1;
1166 uint16_t length;
1167 uint32_t xid;
1168 uint16_t err_type == 1;
1169 enum ofp_bad_request_code code;
1170 of_octets_t data;
1171};
1172
1173struct of_bad_action_error_msg : of_error_msg {
1174 uint8_t version;
1175 uint8_t type == 1;
1176 uint16_t length;
1177 uint32_t xid;
1178 uint16_t err_type == 2;
1179 enum ofp_bad_action_code code;
1180 of_octets_t data;
1181};
1182
1183struct of_bad_instruction_error_msg : of_error_msg {
1184 uint8_t version;
1185 uint8_t type == 1;
1186 uint16_t length;
1187 uint32_t xid;
1188 uint16_t err_type == 3;
1189 enum ofp_bad_instruction_code code;
1190 of_octets_t data;
1191};
1192
1193struct of_bad_match_error_msg : of_error_msg {
1194 uint8_t version;
1195 uint8_t type == 1;
1196 uint16_t length;
1197 uint32_t xid;
1198 uint16_t err_type == 4;
1199 enum ofp_bad_match_code code;
1200 of_octets_t data;
1201};
1202
1203struct of_flow_mod_failed_error_msg : of_error_msg {
1204 uint8_t version;
1205 uint8_t type == 1;
1206 uint16_t length;
1207 uint32_t xid;
1208 uint16_t err_type == 5;
1209 enum ofp_flow_mod_failed_code code;
1210 of_octets_t data;
1211};
1212
1213struct of_group_mod_failed_error_msg : of_error_msg {
1214 uint8_t version;
1215 uint8_t type == 1;
1216 uint16_t length;
1217 uint32_t xid;
1218 uint16_t err_type == 6;
1219 enum ofp_group_mod_failed_code code;
1220 of_octets_t data;
1221};
1222
1223struct of_port_mod_failed_error_msg : of_error_msg {
1224 uint8_t version;
1225 uint8_t type == 1;
1226 uint16_t length;
1227 uint32_t xid;
1228 uint16_t err_type == 7;
1229 enum ofp_port_mod_failed_code code;
1230 of_octets_t data;
1231};
1232
1233struct of_table_mod_failed_error_msg : of_error_msg {
1234 uint8_t version;
1235 uint8_t type == 1;
1236 uint16_t length;
1237 uint32_t xid;
1238 uint16_t err_type == 8;
1239 enum ofp_table_mod_failed_code code;
1240 of_octets_t data;
1241};
1242
1243struct of_queue_op_failed_error_msg : of_error_msg {
1244 uint8_t version;
1245 uint8_t type == 1;
1246 uint16_t length;
1247 uint32_t xid;
1248 uint16_t err_type == 9;
1249 enum ofp_queue_op_failed_code code;
1250 of_octets_t data;
1251};
1252
1253struct of_switch_config_failed_error_msg : of_error_msg {
1254 uint8_t version;
1255 uint8_t type == 1;
1256 uint16_t length;
1257 uint32_t xid;
1258 uint16_t err_type == 10;
1259 enum ofp_switch_config_failed_code code;
1260 of_octets_t data;
1261};
1262
1263struct of_role_request_failed_error_msg : of_error_msg {
1264 uint8_t version;
1265 uint8_t type == 1;
1266 uint16_t length;
1267 uint32_t xid;
1268 uint16_t err_type == 11;
1269 enum ofp_role_request_failed_code code;
1270 of_octets_t data;
1271};
1272
1273struct of_meter_mod_failed_error_msg : of_error_msg {
1274 uint8_t version;
1275 uint8_t type == 1;
1276 uint16_t length;
1277 uint32_t xid;
1278 uint16_t err_type == 12;
1279 enum ofp_meter_mod_failed_code code;
1280 of_octets_t data;
1281};
1282
1283struct of_table_features_failed_error_msg : of_error_msg {
1284 uint8_t version;
1285 uint8_t type == 1;
1286 uint16_t length;
1287 uint32_t xid;
1288 uint16_t err_type == 13;
1289 enum ofp_table_features_failed_code code;
1290 of_octets_t data;
1291};
1292
1293struct of_experimenter_error_msg {
1294 uint8_t version;
1295 uint8_t type == 1;
1296 uint16_t length;
1297 uint32_t xid;
1298 uint16_t err_type == 0xffff;
1299 uint16_t subtype;
1300 uint32_t experimenter;
1301 of_octets_t data;
1302};
Rich Lanea06d0c32013-03-25 08:52:03 -07001303
1304// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1305
Rich Lane68ae4d72013-05-09 10:55:19 -07001306struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001307 uint16_t length;
1308 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001309 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001310 uint32_t duration_sec;
1311 uint32_t duration_nsec;
1312 uint16_t priority;
1313 uint16_t idle_timeout;
1314 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001315 uint16_t flags;
1316 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001317 uint64_t cookie;
1318 uint64_t packet_count;
1319 uint64_t byte_count;
1320 of_match_t match;
1321 list(of_instruction_t) instructions;
1322};
1323
1324
Rich Lane68ae4d72013-05-09 10:55:19 -07001325struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001326 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001327 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001328 uint32_t active_count;
1329 uint64_t lookup_count;
1330 uint64_t matched_count;
1331};
1332
Rich Lane68ae4d72013-05-09 10:55:19 -07001333struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001334 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001335 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001336 uint64_t rx_packets;
1337 uint64_t tx_packets;
1338 uint64_t rx_bytes;
1339 uint64_t tx_bytes;
1340 uint64_t rx_dropped;
1341 uint64_t tx_dropped;
1342 uint64_t rx_errors;
1343 uint64_t tx_errors;
1344 uint64_t rx_frame_err;
1345 uint64_t rx_over_err;
1346 uint64_t rx_crc_err;
1347 uint64_t collisions;
1348 uint32_t duration_sec;
1349 uint32_t duration_nsec;
1350};
1351
Rich Lane68ae4d72013-05-09 10:55:19 -07001352struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001353 of_port_no_t port_no;
1354 uint32_t queue_id;
1355 uint64_t tx_bytes;
1356 uint64_t tx_packets;
1357 uint64_t tx_errors;
1358 uint32_t duration_sec;
1359 uint32_t duration_nsec;
1360};
1361
Rich Lane68ae4d72013-05-09 10:55:19 -07001362struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001363 uint64_t packet_count;
1364 uint64_t byte_count;
1365};
1366
Rich Lane68ae4d72013-05-09 10:55:19 -07001367struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001368 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001369 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001370 uint32_t group_id;
1371 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001372 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001373 uint64_t packet_count;
1374 uint64_t byte_count;
1375 uint32_t duration_sec;
1376 uint32_t duration_nsec;
1377 list(of_bucket_counter_t) bucket_stats;
1378};
1379
Rich Lane68ae4d72013-05-09 10:55:19 -07001380struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001381 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001382 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001383 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 uint32_t group_id;
1385 list(of_bucket_t) buckets;
1386};
1387
1388// STATS:
1389// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1390
Rich Lanee9c37db2013-06-21 18:30:24 -07001391struct of_stats_request : of_header {
1392 uint8_t version;
1393 uint8_t type == 18;
1394 uint16_t length;
1395 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001396 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001397 uint16_t flags;
1398 pad(4);
1399};
1400
1401struct of_stats_reply : of_header {
1402 uint8_t version;
1403 uint8_t type == 19;
1404 uint16_t length;
1405 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001406 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001407 uint16_t flags;
1408 pad(4);
1409};
1410
1411struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001412 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001413 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001414 uint16_t length;
1415 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001416 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001417 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001418 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001419};
1420
Rich Lanee9c37db2013-06-21 18:30:24 -07001421struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001422 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001423 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001424 uint16_t length;
1425 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001426 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001427 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001428 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001429 of_desc_str_t mfr_desc;
1430 of_desc_str_t hw_desc;
1431 of_desc_str_t sw_desc;
1432 of_serial_num_t serial_num;
1433 of_desc_str_t dp_desc;
1434};
1435
Rich Lanee9c37db2013-06-21 18:30:24 -07001436struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001438 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001439 uint16_t length;
1440 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001441 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001442 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001443 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001444 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001445 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001446 of_port_no_t out_port;
1447 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001448 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001449 uint64_t cookie;
1450 uint64_t cookie_mask;
1451 of_match_t match;
1452};
1453
Rich Lanee9c37db2013-06-21 18:30:24 -07001454struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001455 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001456 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001457 uint16_t length;
1458 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001459 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001460 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001461 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001462 list(of_flow_stats_entry_t) entries;
1463};
1464
Rich Lanee9c37db2013-06-21 18:30:24 -07001465struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001466 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001467 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001468 uint16_t length;
1469 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001470 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001471 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001472 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001473 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001474 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001475 of_port_no_t out_port;
1476 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001477 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001478 uint64_t cookie;
1479 uint64_t cookie_mask;
1480 of_match_t match;
1481};
1482
Rich Lanee9c37db2013-06-21 18:30:24 -07001483struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001484 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001485 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001486 uint16_t length;
1487 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001488 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001489 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001490 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001491 uint64_t packet_count;
1492 uint64_t byte_count;
1493 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001494 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001495};
1496
Rich Lanee9c37db2013-06-21 18:30:24 -07001497struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001498 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001499 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001500 uint16_t length;
1501 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001502 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001503 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001504 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001505};
1506
Rich Lanee9c37db2013-06-21 18:30:24 -07001507struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001508 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001509 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001510 uint16_t length;
1511 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001512 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001513 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001514 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001515 list(of_table_stats_entry_t) entries;
1516};
1517
Rich Lanea06d0c32013-03-25 08:52:03 -07001518// FIXME: These are padded to 8 byte align beyond the length indicated
1519
Rich Lane68ae4d72013-05-09 10:55:19 -07001520struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001521 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001522 uint16_t length;
1523};
1524
Rich Lanee9c37db2013-06-21 18:30:24 -07001525struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001526 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001527 uint16_t length;
1528 // FIXME Check if instruction_t is right for ids here
1529 list(of_instruction_t) instruction_ids;
1530};
1531
Rich Lanee9c37db2013-06-21 18:30:24 -07001532struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001533 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001534 uint16_t length;
1535 list(of_instruction_t) instruction_ids;
1536};
1537
Rich Lanee9c37db2013-06-21 18:30:24 -07001538struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001539 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001540 uint16_t length;
1541 list(of_uint8_t) next_table_ids;
1542};
1543
Rich Lanee9c37db2013-06-21 18:30:24 -07001544struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001545 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001546 uint16_t length;
1547 list(of_uint8_t) next_table_ids;
1548};
1549
Rich Lanee9c37db2013-06-21 18:30:24 -07001550struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001551 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001552 uint16_t length;
1553 list(of_action_id_t) action_ids;
1554};
1555
Rich Lanee9c37db2013-06-21 18:30:24 -07001556struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001557 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001558 uint16_t length;
1559 list(of_action_id_t) action_ids;
1560};
1561
Rich Lanee9c37db2013-06-21 18:30:24 -07001562struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001563 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001564 uint16_t length;
1565 list(of_action_id_t) action_ids;
1566};
1567
Rich Lanee9c37db2013-06-21 18:30:24 -07001568struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001569 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001570 uint16_t length;
1571 list(of_action_id_t) action_ids;
1572};
1573
Rich Lanee9c37db2013-06-21 18:30:24 -07001574struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001575 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001576 uint16_t length;
1577 list(of_uint32_t) oxm_ids;
1578};
1579
Rich Lanee9c37db2013-06-21 18:30:24 -07001580struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001581 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001582 uint16_t length;
1583 list(of_uint32_t) oxm_ids;
1584};
1585
Rich Lanee9c37db2013-06-21 18:30:24 -07001586struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001587 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001588 uint16_t length;
1589 list(of_uint32_t) oxm_ids;
1590};
1591
Rich Lanee9c37db2013-06-21 18:30:24 -07001592struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001593 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001594 uint16_t length;
1595 list(of_uint32_t) oxm_ids;
1596};
1597
Rich Lanee9c37db2013-06-21 18:30:24 -07001598struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001599 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001600 uint16_t length;
1601 list(of_uint32_t) oxm_ids;
1602};
1603
Rich Lanee9c37db2013-06-21 18:30:24 -07001604struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001605 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001606 uint16_t length;
1607 list(of_uint32_t) oxm_ids;
1608};
1609
Rich Lanee9c37db2013-06-21 18:30:24 -07001610struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001611 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001612 uint16_t length;
1613 uint32_t experimenter;
1614 uint32_t subtype;
1615 of_octets_t experimenter_data;
1616};
1617
1618// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001619// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001620// uint16_t type;
1621// uint16_t length;
1622// uint32_t experimenter;
1623// uint32_t subtype;
1624// of_octets_t experimenter_data;
1625// };
1626
Rich Lane68ae4d72013-05-09 10:55:19 -07001627struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001628 uint16_t length;
1629 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001630 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001631 of_table_name_t name;
1632 uint64_t metadata_match;
1633 uint64_t metadata_write;
1634 uint32_t config;
1635 uint32_t max_entries;
1636 list(of_table_feature_prop_t) properties;
1637};
1638
Rich Lane68ae4d72013-05-09 10:55:19 -07001639struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001640 uint32_t max_meter;
1641 uint32_t band_types;
1642 uint32_t capabilities;
1643 uint8_t max_bands;
1644 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001645 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001646};
1647
Rich Lanee9c37db2013-06-21 18:30:24 -07001648struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001649 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001650 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001651 uint16_t length;
1652 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001653 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001654 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001655 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001656 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001657 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001658};
1659
Rich Lanee9c37db2013-06-21 18:30:24 -07001660struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001661 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001662 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001663 uint16_t length;
1664 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001665 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001666 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001667 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001668 list(of_port_stats_entry_t) entries;
1669};
1670
Rich Lanee9c37db2013-06-21 18:30:24 -07001671struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001672 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001673 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001674 uint16_t length;
1675 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001676 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001677 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001678 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001679 of_port_no_t port_no;
1680 uint32_t queue_id;
1681};
1682
Rich Lanee9c37db2013-06-21 18:30:24 -07001683struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001684 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001685 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001686 uint16_t length;
1687 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001688 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001689 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001690 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001691 list(of_queue_stats_entry_t) entries;
1692};
1693
Rich Lanee9c37db2013-06-21 18:30:24 -07001694struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001695 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001696 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001697 uint16_t length;
1698 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001699 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001700 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001701 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001702 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001703 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001704};
1705
Rich Lanee9c37db2013-06-21 18:30:24 -07001706struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001707 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001708 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001709 uint16_t length;
1710 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001711 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001712 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001713 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001714 list(of_group_stats_entry_t) entries;
1715};
1716
Rich Lanee9c37db2013-06-21 18:30:24 -07001717struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001718 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001719 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001720 uint16_t length;
1721 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001722 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001723 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001724 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001725};
1726
Rich Lanee9c37db2013-06-21 18:30:24 -07001727struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001728 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001729 uint8_t type == 19;
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 == 7;
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 list(of_group_desc_stats_entry_t) entries;
1736};
1737
Rich Lanee9c37db2013-06-21 18:30:24 -07001738struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001739 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001740 uint8_t type == 18;
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 == 8;
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};
1747
Rich Lanee9c37db2013-06-21 18:30:24 -07001748struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001749 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001750 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001751 uint16_t length;
1752 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001753 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001754 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001755 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001756 uint32_t types;
1757 uint32_t capabilities;
1758 uint32_t max_groups_all;
1759 uint32_t max_groups_select;
1760 uint32_t max_groups_indirect;
1761 uint32_t max_groups_ff;
1762 uint32_t actions_all;
1763 uint32_t actions_select;
1764 uint32_t actions_indirect;
1765 uint32_t actions_ff;
1766};
1767
Rich Lanee9c37db2013-06-21 18:30:24 -07001768struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001769 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001770 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001771 uint16_t length;
1772 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001773 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001774 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001775 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001776 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001777 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001778};
1779
Rich Lanee9c37db2013-06-21 18:30:24 -07001780struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001781 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001782 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001783 uint16_t length;
1784 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001785 uint16_t stats_type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001786 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001787 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001788 list(of_meter_stats_t) entries;
1789};
1790
Rich Lanee9c37db2013-06-21 18:30:24 -07001791struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001792 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001793 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001794 uint16_t length;
1795 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001796 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001797 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001798 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001799 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001800 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001801};
1802
Rich Lanee9c37db2013-06-21 18:30:24 -07001803struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001804 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001805 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001806 uint16_t length;
1807 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001808 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001809 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001810 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001811 list(of_meter_band_t) entries;
1812};
1813
1814// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001815struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001816 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001817 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001818 uint16_t length;
1819 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001820 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001821 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001822 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001823};
1824
1825// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001826struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001827 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001828 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001829 uint16_t length;
1830 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001831 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001832 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001833 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001834 of_meter_features_t features;
1835};
1836
1837// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001838struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001839 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001840 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001841 uint16_t length;
1842 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001843 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001844 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001845 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001846 list(of_table_features_t) entries;
1847};
1848
1849// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001850struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001851 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001852 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001853 uint16_t length;
1854 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001855 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001856 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001857 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001858 list(of_table_features_t) entries;
1859};
1860
1861// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001862struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001863 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001864 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001865 uint16_t length;
1866 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001867 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001868 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001869 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001870};
1871
1872// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001873struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001874 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001875 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001876 uint16_t length;
1877 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001878 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001879 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001880 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001881 list(of_port_desc_t) entries;
1882};
1883
Rich Lane68ae4d72013-05-09 10:55:19 -07001884struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001885 uint64_t packet_band_count;
1886 uint64_t byte_band_count;
1887};
1888
Rich Lane68ae4d72013-05-09 10:55:19 -07001889struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001890 uint32_t meter_id;
1891 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001892 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001893 uint32_t flow_count;
1894 uint64_t packet_in_count;
1895 uint64_t byte_in_count;
1896 uint32_t duration_sec;
1897 uint32_t duration_nsec;
1898 list(of_meter_band_stats_t) band_stats;
1899};
1900
Rich Lane68ae4d72013-05-09 10:55:19 -07001901struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001902 uint16_t length;
1903 uint16_t flags;
1904 uint32_t meter_id;
1905 list(of_meter_band_t) entries;
1906};
1907
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001908struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001909 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001910 uint32_t subtype;
1911};
1912
1913// END OF STATS OBJECTS
1914
Rich Lane68ae4d72013-05-09 10:55:19 -07001915struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001916 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001917 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001918 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001919};
1920
Rich Lanee9c37db2013-06-21 18:30:24 -07001921struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001922 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001923 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001924 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001925 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001926 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001927};
1928
Rich Lanee9c37db2013-06-21 18:30:24 -07001929struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001930 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001931 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001932 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001933 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001934 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001935};
1936
Rich Lanee9c37db2013-06-21 18:30:24 -07001937struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001938 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001939 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001940 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001941 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001942 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001943 of_octets_t data;
1944};
1945
Rich Lane68ae4d72013-05-09 10:55:19 -07001946struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001947 uint32_t queue_id;
1948 of_port_no_t port;
1949 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001950 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001951 list(of_queue_prop_t) properties;
1952};
1953
Rich Lanee9c37db2013-06-21 18:30:24 -07001954struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001955 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001956 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001957 uint16_t length;
1958 uint32_t xid;
1959 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001960 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001961};
1962
Rich Lanee9c37db2013-06-21 18:30:24 -07001963struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001964 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001965 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001966 uint16_t length;
1967 uint32_t xid;
1968 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001969 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001970 list(of_packet_queue_t) queues;
1971};
1972
Rich Lanee9c37db2013-06-21 18:30:24 -07001973struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001974 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001975 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001976 uint16_t length;
1977 uint32_t xid;
1978 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001979 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001980 uint64_t generation_id;
1981};
1982
Rich Lanee9c37db2013-06-21 18:30:24 -07001983struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001984 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001985 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001986 uint16_t length;
1987 uint32_t xid;
1988 of_octets_t data;
1989};
1990
1991////////////////////////////////////////////////////////////////
1992// FIXME understand async; where do bitmasks live?
1993// Determine bitmap type for masks below.
1994// DOCUMENT masks where uint32_t[0] is interest for equal/master
1995// while uint32_t[1] is interest for slave
1996////////////////////////////////////////////////////////////////
1997
Rich Lanee9c37db2013-06-21 18:30:24 -07001998struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001999 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002000 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002001 uint16_t length;
2002 uint32_t xid;
2003 uint32_t packet_in_mask_equal_master;
2004 uint32_t packet_in_mask_slave;
2005 uint32_t port_status_mask_equal_master;
2006 uint32_t port_status_mask_slave;
2007 uint32_t flow_removed_mask_equal_master;
2008 uint32_t flow_removed_mask_slave;
2009};
2010
Rich Lanee9c37db2013-06-21 18:30:24 -07002011struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002012 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002013 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002014 uint16_t length;
2015 uint32_t xid;
2016 uint32_t packet_in_mask_equal_master;
2017 uint32_t packet_in_mask_slave;
2018 uint32_t port_status_mask_equal_master;
2019 uint32_t port_status_mask_slave;
2020 uint32_t flow_removed_mask_equal_master;
2021 uint32_t flow_removed_mask_slave;
2022};
2023
Rich Lanee9c37db2013-06-21 18:30:24 -07002024struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002025 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002026 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002027 uint16_t length;
2028 uint32_t xid;
2029 uint32_t packet_in_mask_equal_master;
2030 uint32_t packet_in_mask_slave;
2031 uint32_t port_status_mask_equal_master;
2032 uint32_t port_status_mask_slave;
2033 uint32_t flow_removed_mask_equal_master;
2034 uint32_t flow_removed_mask_slave;
2035};