2 * Copyright (c) 2012 Nicira, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 /* OpenFlow message headers abstraction.
22 * OpenFlow headers are unnecessarily complicated:
24 * - Some messages with the same meaning were renumbered between 1.0 and 1.1.
26 * - "Statistics" (aka multipart) messages have a different format from other
29 * - The 1.0 header for statistics messages is an odd number of 32-bit words
30 * long, leaving 64-bit quantities in the body misaligned. The 1.1 header
31 * for statistics added a padding word to fix this misalignment, although
32 * many statistic message bodies did not change.
34 * - Vendor-defined messages have an additional header but no standard way to
35 * distinguish individual types of message within a given vendor.
37 * This file attempts to abstract out the differences between the various forms
41 #include "openvswitch/types.h"
42 #include "ofp-errors.h"
47 /* Raw identifiers for OpenFlow messages.
49 * Some OpenFlow messages with similar meanings have multiple variants across
50 * OpenFlow versions or vendor extensions. Each variant has a different
51 * OFPRAW_* enumeration constant. More specifically, if two messages have
52 * different types, different numbers, or different arguments, then they must
53 * have different OFPRAW_* values.
55 * The comments here must follow a stylized form because the "extract-ofp-msgs"
56 * program parses them at build time to generate data tables. The syntax of
59 * type versions (number): arguments.
61 * where the syntax of each part is:
63 * - type: One of OFPT (standard OpenFlow message), OFPST (standard OpenFlow
64 * statistics message), NXT (Nicira extension message), or NXST (Nicira
65 * extension statistics message).
67 * As new vendors implement extensions it will make sense to expand the
68 * dictionary of possible types.
70 * - versions: The OpenFlow version or versions in which this message is
71 * supported, e.g. "1.0" or "1.1" or "1.0+".
74 * For OFPT, the 'type' in struct ofp_header.
75 * For OFPST, the 'type' in struct ofp_stats_msg or ofp11_stats_msg.
76 * For NXT, the 'subtype' in struct nicira_header.
77 * For NXST, the 'subtype' in struct nicira10_stats_msg or
80 * - arguments: The types of data that follow the OpenFlow headers (the
81 * message "body"). This can be "void" if the message has no body.
82 * Otherwise, it should be a comma-separated sequence of C types. The
83 * last type in the sequence can end with [] if the body ends in a
84 * variable-length sequence.
86 * The arguments are used to validate the lengths of messages when a
87 * header is parsed. Any message whose length isn't valid as a length of
88 * the specified types will be rejected with OFPERR_OFPBRC_BAD_LEN.
90 * A few OpenFlow messages, such as OFPT_PACKET_IN, intentionally end with
91 * only part of a structure, up to some specified member. The syntax "up
92 * to <member>" indicates this, e.g. "struct ofp11_packet_in up to data".
95 /* Immutable standard messages.
97 * The OpenFlow standard promises to preserve these messages and their numbers
98 * in future versions, so we mark them as <all>, which covers every OpenFlow
99 * version numbered 0x01...0xff, rather than as OF1.0+, which covers only
100 * OpenFlow versions that we otherwise implement.
102 * Without <all> here, then we would fail to decode "hello" messages that
103 * announce a version higher than we understand, even though there still could
104 * be a version in common with the peer that we do understand. The <all>
105 * keyword is less useful for the other messages, because our OpenFlow channels
106 * accept only OpenFlow messages with a previously negotiated version.
109 /* OFPT <all> (0): uint8_t[]. */
112 /* OFPT <all> (1): struct ofp_error_msg, uint8_t[]. */
115 /* OFPT <all> (2): uint8_t[]. */
116 OFPRAW_OFPT_ECHO_REQUEST,
118 /* OFPT <all> (3): uint8_t[]. */
119 OFPRAW_OFPT_ECHO_REPLY,
121 /* Other standard messages.
123 * The meanings of these messages can (and often do) change from one version
124 * of OpenFlow to another. */
126 /* OFPT 1.0+ (5): void. */
127 OFPRAW_OFPT_FEATURES_REQUEST,
129 /* OFPT 1.0 (6): struct ofp_switch_features, struct ofp10_phy_port[]. */
130 OFPRAW_OFPT10_FEATURES_REPLY,
131 /* OFPT 1.1+ (6): struct ofp_switch_features, struct ofp11_port[]. */
132 OFPRAW_OFPT11_FEATURES_REPLY,
134 /* OFPT 1.0+ (7): void. */
135 OFPRAW_OFPT_GET_CONFIG_REQUEST,
137 /* OFPT 1.0+ (8): struct ofp_switch_config. */
138 OFPRAW_OFPT_GET_CONFIG_REPLY,
140 /* OFPT 1.0+ (9): struct ofp_switch_config. */
141 OFPRAW_OFPT_SET_CONFIG,
143 /* OFPT 1.0 (10): struct ofp_packet_in up to data, uint8_t[]. */
144 OFPRAW_OFPT10_PACKET_IN,
145 /* OFPT 1.1 (10): struct ofp11_packet_in up to data, uint8_t[]. */
146 OFPRAW_OFPT11_PACKET_IN,
147 /* OFPT 1.2 (10): struct ofp12_packet_in, uint8_t[]. */
148 OFPRAW_OFPT12_PACKET_IN,
149 /* NXT 1.0+ (17): struct nx_packet_in, uint8_t[]. */
150 OFPRAW_NXT_PACKET_IN,
152 /* OFPT 1.0 (11): struct ofp_flow_removed. */
153 OFPRAW_OFPT10_FLOW_REMOVED,
154 /* OFPT 1.1+ (11): struct ofp11_flow_removed, uint8_t[8][]. */
155 OFPRAW_OFPT11_FLOW_REMOVED,
156 /* NXT 1.0+ (14): struct nx_flow_removed, uint8_t[8][]. */
157 OFPRAW_NXT_FLOW_REMOVED,
159 /* OFPT 1.0 (12): struct ofp_port_status, struct ofp10_phy_port. */
160 OFPRAW_OFPT10_PORT_STATUS,
161 /* OFPT 1.1+ (12): struct ofp_port_status, struct ofp11_port. */
162 OFPRAW_OFPT11_PORT_STATUS,
164 /* OFPT 1.0 (13): struct ofp_packet_out, uint8_t[]. */
165 OFPRAW_OFPT10_PACKET_OUT,
166 /* OFPT 1.1+ (13): struct ofp11_packet_out, uint8_t[]. */
167 OFPRAW_OFPT11_PACKET_OUT,
169 /* OFPT 1.0 (14): struct ofp10_flow_mod, struct ofp_action_header[]. */
170 OFPRAW_OFPT10_FLOW_MOD,
171 /* OFPT 1.1+ (14): struct ofp11_flow_mod, struct ofp11_instruction[]. */
172 OFPRAW_OFPT11_FLOW_MOD,
173 /* NXT 1.0+ (13): struct nx_flow_mod, uint8_t[8][]. */
176 /* OFPT 1.0 (15): struct ofp10_port_mod. */
177 OFPRAW_OFPT10_PORT_MOD,
178 /* OFPT 1.1+ (16): struct ofp11_port_mod. */
179 OFPRAW_OFPT11_PORT_MOD,
181 /* OFPT 1.0 (18): void. */
182 OFPRAW_OFPT10_BARRIER_REQUEST,
183 /* OFPT 1.1+ (20): void. */
184 OFPRAW_OFPT11_BARRIER_REQUEST,
186 /* OFPT 1.0 (19): void. */
187 OFPRAW_OFPT10_BARRIER_REPLY,
188 /* OFPT 1.1+ (21): void. */
189 OFPRAW_OFPT11_BARRIER_REPLY,
191 /* Standard statistics. */
193 /* OFPST 1.0+ (0): void. */
194 OFPRAW_OFPST_DESC_REQUEST,
196 /* OFPST 1.0+ (0): struct ofp_desc_stats. */
197 OFPRAW_OFPST_DESC_REPLY,
199 /* OFPST 1.0 (1): struct ofp10_flow_stats_request. */
200 OFPRAW_OFPST10_FLOW_REQUEST,
201 /* OFPST 1.1+ (1): struct ofp11_flow_stats_request, uint8_t[8][]. */
202 OFPRAW_OFPST11_FLOW_REQUEST,
203 /* NXST 1.0 (0): struct nx_flow_stats_request, uint8_t[8][]. */
204 OFPRAW_NXST_FLOW_REQUEST,
206 /* OFPST 1.0 (1): uint8_t[]. */
207 OFPRAW_OFPST10_FLOW_REPLY,
208 /* OFPST 1.1+ (1): uint8_t[]. */
209 OFPRAW_OFPST11_FLOW_REPLY,
210 /* NXST 1.0 (0): uint8_t[]. */
211 OFPRAW_NXST_FLOW_REPLY,
213 /* OFPST 1.0 (2): struct ofp10_flow_stats_request. */
214 OFPRAW_OFPST10_AGGREGATE_REQUEST,
215 /* OFPST 1.1+ (2): struct ofp11_flow_stats_request, uint8_t[8][]. */
216 OFPRAW_OFPST11_AGGREGATE_REQUEST,
217 /* NXST 1.0 (1): struct nx_flow_stats_request, uint8_t[8][]. */
218 OFPRAW_NXST_AGGREGATE_REQUEST,
220 /* OFPST 1.0+ (2): struct ofp_aggregate_stats_reply. */
221 OFPRAW_OFPST_AGGREGATE_REPLY,
222 /* NXST 1.0 (1): struct ofp_aggregate_stats_reply. */
223 OFPRAW_NXST_AGGREGATE_REPLY,
225 /* OFPST 1.0-1.2 (3): void. */
226 OFPRAW_OFPST_TABLE_REQUEST,
228 /* OFPST 1.0 (3): struct ofp10_table_stats[]. */
229 OFPRAW_OFPST10_TABLE_REPLY,
230 /* OFPST 1.1 (3): struct ofp11_table_stats[]. */
231 OFPRAW_OFPST11_TABLE_REPLY,
232 /* OFPST 1.2 (3): struct ofp12_table_stats[]. */
233 OFPRAW_OFPST12_TABLE_REPLY,
235 /* OFPST 1.0 (4): struct ofp10_port_stats_request. */
236 OFPRAW_OFPST10_PORT_REQUEST,
237 /* OFPST 1.1+ (4): struct ofp11_port_stats_request. */
238 OFPRAW_OFPST11_PORT_REQUEST,
240 /* OFPST 1.0 (4): struct ofp10_port_stats[]. */
241 OFPRAW_OFPST10_PORT_REPLY,
242 /* OFPST 1.1+ (4): struct ofp11_port_stats[]. */
243 OFPRAW_OFPST11_PORT_REPLY,
245 /* OFPST 1.0 (5): struct ofp10_queue_stats_request. */
246 OFPRAW_OFPST10_QUEUE_REQUEST,
247 /* OFPST 1.1+ (5): struct ofp11_queue_stats_request. */
248 OFPRAW_OFPST11_QUEUE_REQUEST,
250 /* OFPST 1.0 (5): struct ofp10_queue_stats[]. */
251 OFPRAW_OFPST10_QUEUE_REPLY,
252 /* OFPST 1.1+ (5): struct ofp11_queue_stats[]. */
253 OFPRAW_OFPST11_QUEUE_REPLY,
255 /* OFPST 1.0+ (13): void. */
256 OFPRAW_OFPST_PORT_DESC_REQUEST,
258 /* OFPST 1.0 (13): struct ofp10_phy_port[]. */
259 OFPRAW_OFPST10_PORT_DESC_REPLY,
260 /* OFPST 1.1+ (13): struct ofp11_port[]. */
261 OFPRAW_OFPST11_PORT_DESC_REPLY,
263 /* Nicira extension messages.
265 * Nicira extensions that correspond to standard OpenFlow messages are listed
266 * alongside the standard versions above. */
268 /* NXT 1.0+ (10): struct nx_role_request. */
269 OFPRAW_NXT_ROLE_REQUEST,
271 /* NXT 1.0+ (11): struct nx_role_request. */
272 OFPRAW_NXT_ROLE_REPLY,
274 /* NXT 1.0 (12): struct nx_set_flow_format. */
275 OFPRAW_NXT_SET_FLOW_FORMAT,
277 /* NXT 1.0+ (15): struct nx_flow_mod_table_id. */
278 OFPRAW_NXT_FLOW_MOD_TABLE_ID,
280 /* NXT 1.0+ (16): struct nx_set_packet_in_format. */
281 OFPRAW_NXT_SET_PACKET_IN_FORMAT,
283 /* NXT 1.0+ (18): void. */
286 /* NXT 1.0+ (19): struct nx_async_config. */
287 OFPRAW_NXT_SET_ASYNC_CONFIG,
289 /* NXT 1.0+ (20): struct nx_controller_id. */
290 OFPRAW_NXT_SET_CONTROLLER_ID,
292 /* NXT 1.0+ (21): struct nx_flow_monitor_cancel. */
293 OFPRAW_NXT_FLOW_MONITOR_CANCEL,
295 /* NXT 1.0+ (22): void. */
296 OFPRAW_NXT_FLOW_MONITOR_PAUSED,
298 /* NXT 1.0+ (23): void. */
299 OFPRAW_NXT_FLOW_MONITOR_RESUMED,
301 /* Nicira extension statistics.
303 * Nicira extension statistics that correspond to standard OpenFlow statistics
304 * are listed alongside the standard versions above. */
306 /* NXST 1.0 (2): uint8_t[8][]. */
307 OFPRAW_NXST_FLOW_MONITOR_REQUEST,
309 /* NXST 1.0 (2): uint8_t[8][]. */
310 OFPRAW_NXST_FLOW_MONITOR_REPLY,
313 /* Decoding messages into OFPRAW_* values. */
314 enum ofperr ofpraw_decode(enum ofpraw *, const struct ofp_header *);
315 enum ofperr ofpraw_pull(enum ofpraw *, struct ofpbuf *);
316 enum ofpraw ofpraw_pull_assert(struct ofpbuf *);
318 enum ofperr ofpraw_decode_partial(enum ofpraw *,
319 const struct ofp_header *, size_t length);
321 /* Encoding messages using OFPRAW_* values. */
322 struct ofpbuf *ofpraw_alloc(enum ofpraw, uint8_t ofp_version,
323 size_t extra_tailroom);
324 struct ofpbuf *ofpraw_alloc_xid(enum ofpraw, uint8_t ofp_version,
325 ovs_be32 xid, size_t extra_tailroom);
326 struct ofpbuf *ofpraw_alloc_reply(enum ofpraw,
327 const struct ofp_header *request,
328 size_t extra_tailroom);
329 struct ofpbuf *ofpraw_alloc_stats_reply(const struct ofp_header *request,
330 size_t extra_tailroom);
332 void ofpraw_put(enum ofpraw, uint8_t ofp_version, struct ofpbuf *);
333 void ofpraw_put_xid(enum ofpraw, uint8_t ofp_version, ovs_be32 xid,
335 void ofpraw_put_reply(enum ofpraw, const struct ofp_header *request,
337 void ofpraw_put_stats_reply(const struct ofp_header *request, struct ofpbuf *);
339 /* Information about OFPRAW_* values. */
340 const char *ofpraw_get_name(enum ofpraw);
341 enum ofpraw ofpraw_stats_request_to_reply(enum ofpraw, uint8_t version);
343 /* Semantic identifiers for OpenFlow messages.
345 * Each OFPTYPE_* enumeration constant represents one or more concrete format
346 * of OpenFlow message. When two variants of a message have essentially the
347 * same meaning, they are assigned a single OFPTYPE_* value.
349 * The comments here must follow a stylized form because the "extract-ofp-msgs"
350 * program parses them at build time to generate data tables. The format is
351 * simply to list each OFPRAW_* enumeration constant for a given OFPTYPE_*,
352 * each followed by a period. */
354 /* Immutable messages. */
355 OFPTYPE_HELLO, /* OFPRAW_OFPT_HELLO. */
356 OFPTYPE_ERROR, /* OFPRAW_OFPT_ERROR. */
357 OFPTYPE_ECHO_REQUEST, /* OFPRAW_OFPT_ECHO_REQUEST. */
358 OFPTYPE_ECHO_REPLY, /* OFPRAW_OFPT_ECHO_REPLY. */
360 /* Switch configuration messages. */
361 OFPTYPE_FEATURES_REQUEST, /* OFPRAW_OFPT_FEATURES_REQUEST. */
362 OFPTYPE_FEATURES_REPLY, /* OFPRAW_OFPT10_FEATURES_REPLY.
363 * OFPRAW_OFPT11_FEATURES_REPLY. */
364 OFPTYPE_GET_CONFIG_REQUEST, /* OFPRAW_OFPT_GET_CONFIG_REQUEST. */
365 OFPTYPE_GET_CONFIG_REPLY, /* OFPRAW_OFPT_GET_CONFIG_REPLY. */
366 OFPTYPE_SET_CONFIG, /* OFPRAW_OFPT_SET_CONFIG. */
368 /* Asynchronous messages. */
369 OFPTYPE_PACKET_IN, /* OFPRAW_OFPT10_PACKET_IN.
370 * OFPRAW_OFPT11_PACKET_IN.
371 * OFPRAW_OFPT12_PACKET_IN.
372 * OFPRAW_NXT_PACKET_IN. */
373 OFPTYPE_FLOW_REMOVED, /* OFPRAW_OFPT10_FLOW_REMOVED.
374 * OFPRAW_OFPT11_FLOW_REMOVED.
375 * OFPRAW_NXT_FLOW_REMOVED. */
376 OFPTYPE_PORT_STATUS, /* OFPRAW_OFPT10_PORT_STATUS.
377 * OFPRAW_OFPT11_PORT_STATUS. */
379 /* Controller command messages. */
380 OFPTYPE_PACKET_OUT, /* OFPRAW_OFPT10_PACKET_OUT.
381 * OFPRAW_OFPT11_PACKET_OUT. */
382 OFPTYPE_FLOW_MOD, /* OFPRAW_OFPT10_FLOW_MOD.
383 * OFPRAW_OFPT11_FLOW_MOD.
384 * OFPRAW_NXT_FLOW_MOD. */
385 OFPTYPE_PORT_MOD, /* OFPRAW_OFPT10_PORT_MOD.
386 * OFPRAW_OFPT11_PORT_MOD. */
388 /* Barrier messages. */
389 OFPTYPE_BARRIER_REQUEST, /* OFPRAW_OFPT10_BARRIER_REQUEST.
390 * OFPRAW_OFPT11_BARRIER_REQUEST. */
391 OFPTYPE_BARRIER_REPLY, /* OFPRAW_OFPT10_BARRIER_REPLY.
392 * OFPRAW_OFPT11_BARRIER_REPLY. */
395 OFPTYPE_DESC_STATS_REQUEST, /* OFPRAW_OFPST_DESC_REQUEST. */
396 OFPTYPE_DESC_STATS_REPLY, /* OFPRAW_OFPST_DESC_REPLY. */
397 OFPTYPE_FLOW_STATS_REQUEST, /* OFPRAW_OFPST10_FLOW_REQUEST.
398 * OFPRAW_OFPST11_FLOW_REQUEST.
399 * OFPRAW_NXST_FLOW_REQUEST. */
400 OFPTYPE_FLOW_STATS_REPLY, /* OFPRAW_OFPST10_FLOW_REPLY.
401 * OFPRAW_OFPST11_FLOW_REPLY.
402 * OFPRAW_NXST_FLOW_REPLY. */
403 OFPTYPE_AGGREGATE_STATS_REQUEST, /* OFPRAW_OFPST10_AGGREGATE_REQUEST.
404 * OFPRAW_OFPST11_AGGREGATE_REQUEST.
405 * OFPRAW_NXST_AGGREGATE_REQUEST. */
406 OFPTYPE_AGGREGATE_STATS_REPLY, /* OFPRAW_OFPST_AGGREGATE_REPLY.
407 * OFPRAW_NXST_AGGREGATE_REPLY. */
408 OFPTYPE_TABLE_STATS_REQUEST, /* OFPRAW_OFPST_TABLE_REQUEST. */
409 OFPTYPE_TABLE_STATS_REPLY, /* OFPRAW_OFPST10_TABLE_REPLY.
410 * OFPRAW_OFPST11_TABLE_REPLY.
411 * OFPRAW_OFPST12_TABLE_REPLY. */
412 OFPTYPE_PORT_STATS_REQUEST, /* OFPRAW_OFPST10_PORT_REQUEST.
413 * OFPRAW_OFPST11_PORT_REQUEST. */
414 OFPTYPE_PORT_STATS_REPLY, /* OFPRAW_OFPST10_PORT_REPLY.
415 * OFPRAW_OFPST11_PORT_REPLY. */
416 OFPTYPE_QUEUE_STATS_REQUEST, /* OFPRAW_OFPST10_QUEUE_REQUEST.
417 * OFPRAW_OFPST11_QUEUE_REQUEST. */
418 OFPTYPE_QUEUE_STATS_REPLY, /* OFPRAW_OFPST10_QUEUE_REPLY.
419 * OFPRAW_OFPST11_QUEUE_REPLY. */
420 OFPTYPE_PORT_DESC_STATS_REQUEST, /* OFPRAW_OFPST_PORT_DESC_REQUEST. */
422 OFPTYPE_PORT_DESC_STATS_REPLY, /* OFPRAW_OFPST10_PORT_DESC_REPLY.
423 * OFPRAW_OFPST11_PORT_DESC_REPLY. */
425 /* Nicira extensions. */
426 OFPTYPE_ROLE_REQUEST, /* OFPRAW_NXT_ROLE_REQUEST. */
427 OFPTYPE_ROLE_REPLY, /* OFPRAW_NXT_ROLE_REPLY. */
428 OFPTYPE_SET_FLOW_FORMAT, /* OFPRAW_NXT_SET_FLOW_FORMAT. */
429 OFPTYPE_FLOW_MOD_TABLE_ID, /* OFPRAW_NXT_FLOW_MOD_TABLE_ID. */
430 OFPTYPE_SET_PACKET_IN_FORMAT, /* OFPRAW_NXT_SET_PACKET_IN_FORMAT. */
431 OFPTYPE_FLOW_AGE, /* OFPRAW_NXT_FLOW_AGE. */
432 OFPTYPE_SET_ASYNC_CONFIG, /* OFPRAW_NXT_SET_ASYNC_CONFIG. */
433 OFPTYPE_SET_CONTROLLER_ID, /* OFPRAW_NXT_SET_CONTROLLER_ID. */
435 /* Flow monitor extension. */
436 OFPTYPE_FLOW_MONITOR_STATS_REQUEST, /* OFPRAW_NXST_FLOW_MONITOR_REQUEST. */
437 OFPTYPE_FLOW_MONITOR_STATS_REPLY, /* OFPRAW_NXST_FLOW_MONITOR_REPLY. */
438 OFPTYPE_FLOW_MONITOR_CANCEL, /* OFPRAW_NXT_FLOW_MONITOR_CANCEL. */
439 OFPTYPE_FLOW_MONITOR_PAUSED, /* OFPRAW_NXT_FLOW_MONITOR_PAUSED. */
440 OFPTYPE_FLOW_MONITOR_RESUMED, /* OFPRAW_NXT_FLOW_MONITOR_RESUMED. */
443 /* Decoding messages into OFPTYPE_* values. */
444 enum ofperr ofptype_decode(enum ofptype *, const struct ofp_header *);
445 enum ofperr ofptype_pull(enum ofptype *, struct ofpbuf *);
446 enum ofptype ofptype_from_ofpraw(enum ofpraw);
448 /* OpenFlow message properties. */
449 void ofpmsg_update_length(struct ofpbuf *);
450 const void *ofpmsg_body(const struct ofp_header *);
452 /* Multipart messages (aka "statistics").
454 * Individual OpenFlow messages are limited to 64 kB in size, but some messages
455 * need to be longer. Therefore, multipart messages allow a longer message to
456 * be divided into multiple parts at some convenient boundary. For example,
457 * limiting the response to a "flow dump" request to 64 kB would unreasonably
458 * limit the maximum number of flows in an OpenFlow switch, so a "flow dump" is
459 * expressed as a multipart request/reply pair, with the reply broken into
460 * pieces between flows.
462 * Multipart messages always consist of a request/reply pair.
464 * In OpenFlow 1.0, 1.1, and 1.2, requests must always fit in a single message,
465 * that is, only a multipart reply may have more than one part. OpenFlow 1.3
466 * adds one multipart request. This code does not yet support multipart
469 /* Encoding multipart replies.
471 * These functions are useful for multipart replies that might really require
472 * more than one message. A multipart message that is known in advance to fit
473 * within 64 kB doesn't need any special treatment, so you might as well use
474 * the ofpraw_alloc_*() functions.
476 * These functions work with a "struct list" of "struct ofpbuf"s, each of
477 * which represents one part of a multipart message. */
478 void ofpmp_init(struct list *, const struct ofp_header *request);
479 struct ofpbuf *ofpmp_reserve(struct list *, size_t len);
480 void *ofpmp_append(struct list *, size_t len);
481 void ofpmp_postappend(struct list *, size_t start_ofs);
483 /* Decoding multipart replies. */
484 uint16_t ofpmp_flags(const struct ofp_header *);
485 bool ofpmp_more(const struct ofp_header *);
487 #endif /* ofp-msgs.h */