2 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 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.
29 #include "openflow/nicira-ext.h"
30 #include "openvswitch/types.h"
31 #include "type-props.h"
35 struct ofpact_set_field;
38 enum ofperr ofputil_port_from_ofp11(ovs_be32 ofp11_port,
39 ofp_port_t *ofp10_port);
40 ovs_be32 ofputil_port_to_ofp11(ofp_port_t ofp10_port);
42 bool ofputil_port_from_string(const char *, ofp_port_t *portp);
43 void ofputil_format_port(ofp_port_t port, struct ds *);
44 void ofputil_port_to_string(ofp_port_t, char namebuf[OFP_MAX_PORT_NAME_LEN],
48 enum { MAX_GROUP_NAME_LEN = INT_STRLEN(uint32_t) };
49 bool ofputil_group_from_string(const char *, uint32_t *group_id);
50 void ofputil_format_group(uint32_t group_id, struct ds *);
51 void ofputil_group_to_string(uint32_t group_id,
52 char namebuf[MAX_GROUP_NAME_LEN + 1],
55 /* Converting OFPFW10_NW_SRC_MASK and OFPFW10_NW_DST_MASK wildcard bit counts
56 * to and from IP bitmasks. */
57 ovs_be32 ofputil_wcbits_to_netmask(int wcbits);
58 int ofputil_netmask_to_wcbits(ovs_be32 netmask);
62 * A "protocol" is an OpenFlow version plus, for some OpenFlow versions,
63 * a bit extra about the flow match format in use.
65 * These are arranged from most portable to least portable, or alternatively
66 * from least powerful to most powerful. Protocols earlier on the list are
67 * more likely to be understood for the purpose of making requests, but
68 * protocol later on the list are more likely to accurately describe a flow
71 * On any given OpenFlow connection, a single protocol is in effect at any
72 * given time. These values use separate bits only because that makes it easy
73 * to test whether a particular protocol is within a given set of protocols and
74 * to implement set union and intersection.
76 enum ofputil_protocol {
77 /* OpenFlow 1.0 protocols.
79 * The "STD" protocols use the standard OpenFlow 1.0 flow format.
80 * The "NXM" protocols use the Nicira Extensible Match (NXM) flow format.
82 * The protocols with "TID" mean that the nx_flow_mod_table_id Nicira
83 * extension has been enabled. The other protocols have it disabled.
85 #define OFPUTIL_P_NONE 0
86 OFPUTIL_P_OF10_STD = 1 << 0,
87 OFPUTIL_P_OF10_STD_TID = 1 << 1,
88 OFPUTIL_P_OF10_NXM = 1 << 2,
89 OFPUTIL_P_OF10_NXM_TID = 1 << 3,
90 #define OFPUTIL_P_OF10_STD_ANY (OFPUTIL_P_OF10_STD | OFPUTIL_P_OF10_STD_TID)
91 #define OFPUTIL_P_OF10_NXM_ANY (OFPUTIL_P_OF10_NXM | OFPUTIL_P_OF10_NXM_TID)
92 #define OFPUTIL_P_OF10_ANY (OFPUTIL_P_OF10_STD_ANY | OFPUTIL_P_OF10_NXM_ANY)
94 /* OpenFlow 1.1 protocol.
96 * We only support the standard OpenFlow 1.1 flow format.
98 * OpenFlow 1.1 always operates with an equivalent of the
99 * nx_flow_mod_table_id Nicira extension enabled, so there is no "TID"
101 OFPUTIL_P_OF11_STD = 1 << 4,
103 /* OpenFlow 1.2+ protocols (only one variant each).
105 * These use the standard OpenFlow Extensible Match (OXM) flow format.
107 * OpenFlow 1.2+ always operates with an equivalent of the
108 * nx_flow_mod_table_id Nicira extension enabled, so there is no "TID"
110 OFPUTIL_P_OF12_OXM = 1 << 5,
111 OFPUTIL_P_OF13_OXM = 1 << 6,
112 OFPUTIL_P_OF14_OXM = 1 << 7,
113 OFPUTIL_P_OF15_OXM = 1 << 8,
114 #define OFPUTIL_P_ANY_OXM (OFPUTIL_P_OF12_OXM | \
115 OFPUTIL_P_OF13_OXM | \
116 OFPUTIL_P_OF14_OXM | \
119 #define OFPUTIL_P_NXM_OF11_UP (OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF11_STD | \
122 #define OFPUTIL_P_NXM_OXM_ANY (OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_ANY_OXM)
124 #define OFPUTIL_P_OF11_UP (OFPUTIL_P_OF11_STD | OFPUTIL_P_ANY_OXM)
126 #define OFPUTIL_P_OF12_UP (OFPUTIL_P_OF12_OXM | OFPUTIL_P_OF13_UP)
127 #define OFPUTIL_P_OF13_UP (OFPUTIL_P_OF13_OXM | OFPUTIL_P_OF14_UP)
128 #define OFPUTIL_P_OF14_UP (OFPUTIL_P_OF14_OXM | OFPUTIL_P_OF15_UP)
129 #define OFPUTIL_P_OF15_UP OFPUTIL_P_OF15_OXM
132 #define OFPUTIL_P_ANY ((1 << 9) - 1)
134 /* Protocols in which a specific table may be specified in flow_mods. */
135 #define OFPUTIL_P_TID (OFPUTIL_P_OF10_STD_TID | \
136 OFPUTIL_P_OF10_NXM_TID | \
137 OFPUTIL_P_OF11_STD | \
141 /* Protocols to use for flow dumps, from most to least preferred. */
142 extern enum ofputil_protocol ofputil_flow_dump_protocols[];
143 extern size_t ofputil_n_flow_dump_protocols;
145 enum ofputil_protocol ofputil_protocol_from_ofp_version(enum ofp_version);
146 enum ofputil_protocol ofputil_protocols_from_ofp_version(enum ofp_version);
147 enum ofp_version ofputil_protocol_to_ofp_version(enum ofputil_protocol);
149 bool ofputil_protocol_is_valid(enum ofputil_protocol);
150 enum ofputil_protocol ofputil_protocol_set_tid(enum ofputil_protocol,
152 enum ofputil_protocol ofputil_protocol_to_base(enum ofputil_protocol);
153 enum ofputil_protocol ofputil_protocol_set_base(
154 enum ofputil_protocol cur, enum ofputil_protocol new_base);
156 const char *ofputil_protocol_to_string(enum ofputil_protocol);
157 char *ofputil_protocols_to_string(enum ofputil_protocol);
158 enum ofputil_protocol ofputil_protocols_from_string(const char *);
160 void ofputil_format_version(struct ds *, enum ofp_version);
161 void ofputil_format_version_name(struct ds *, enum ofp_version);
163 /* A bitmap of version numbers
165 * Bit offsets correspond to ofp_version numbers which in turn correspond to
166 * wire-protocol numbers for Open Flow versions.. E.g. (1u << OFP11_VERSION)
167 * is the mask for Open Flow 1.1. If the bit for a version is set then it is
168 * allowed, otherwise it is disallowed. */
170 void ofputil_format_version_bitmap(struct ds *msg, uint32_t bitmap);
171 void ofputil_format_version_bitmap_names(struct ds *msg, uint32_t bitmap);
173 uint32_t ofputil_protocols_to_version_bitmap(enum ofputil_protocol);
174 enum ofputil_protocol ofputil_protocols_from_version_bitmap(uint32_t bitmap);
176 /* Bitmaps of OpenFlow versions that Open vSwitch supports, and that it enables
177 * by default. When Open vSwitch has experimental or incomplete support for
178 * newer versions of OpenFlow, those versions should not be supported by
179 * default and thus should be omitted from the latter bitmap. */
180 #define OFPUTIL_SUPPORTED_VERSIONS ((1u << OFP10_VERSION) | \
181 (1u << OFP11_VERSION) | \
182 (1u << OFP12_VERSION) | \
183 (1u << OFP13_VERSION))
184 #define OFPUTIL_DEFAULT_VERSIONS OFPUTIL_SUPPORTED_VERSIONS
186 enum ofputil_protocol ofputil_protocols_from_string(const char *s);
188 const char *ofputil_version_to_string(enum ofp_version ofp_version);
189 uint32_t ofputil_versions_from_string(const char *s);
190 uint32_t ofputil_versions_from_strings(char ** const s, size_t count);
192 bool ofputil_decode_hello(const struct ofp_header *,
193 uint32_t *allowed_versions);
194 struct ofpbuf *ofputil_encode_hello(uint32_t version_bitmap);
196 struct ofpbuf *ofputil_encode_set_protocol(enum ofputil_protocol current,
197 enum ofputil_protocol want,
198 enum ofputil_protocol *next);
201 struct ofpbuf *ofputil_encode_nx_set_flow_format(enum nx_flow_format);
202 enum ofputil_protocol ofputil_nx_flow_format_to_protocol(enum nx_flow_format);
203 bool ofputil_nx_flow_format_is_valid(enum nx_flow_format);
204 const char *ofputil_nx_flow_format_to_string(enum nx_flow_format);
206 /* Work with ofp10_match. */
207 void ofputil_wildcard_from_ofpfw10(uint32_t ofpfw, struct flow_wildcards *);
208 void ofputil_match_from_ofp10_match(const struct ofp10_match *,
210 void ofputil_normalize_match(struct match *);
211 void ofputil_normalize_match_quiet(struct match *);
212 void ofputil_match_to_ofp10_match(const struct match *, struct ofp10_match *);
214 /* Work with ofp11_match. */
215 enum ofperr ofputil_pull_ofp11_match(struct ofpbuf *, struct match *,
216 uint16_t *padded_match_len);
217 enum ofperr ofputil_match_from_ofp11_match(const struct ofp11_match *,
219 int ofputil_put_ofp11_match(struct ofpbuf *, const struct match *,
220 enum ofputil_protocol);
221 void ofputil_match_to_ofp11_match(const struct match *, struct ofp11_match *);
222 int ofputil_match_typical_len(enum ofputil_protocol);
224 /* dl_type translation between OpenFlow and 'struct flow' format. */
225 ovs_be16 ofputil_dl_type_to_openflow(ovs_be16 flow_dl_type);
226 ovs_be16 ofputil_dl_type_from_openflow(ovs_be16 ofp_dl_type);
229 bool ofputil_packet_in_format_is_valid(enum nx_packet_in_format);
230 int ofputil_packet_in_format_from_string(const char *);
231 const char *ofputil_packet_in_format_to_string(enum nx_packet_in_format);
232 struct ofpbuf *ofputil_make_set_packet_in_format(enum ofp_version,
233 enum nx_packet_in_format);
235 /* NXT_FLOW_MOD_TABLE_ID extension. */
236 struct ofpbuf *ofputil_make_flow_mod_table_id(bool flow_mod_table_id);
238 /* Protocol-independent flow_mod flags. */
239 enum ofputil_flow_mod_flags {
240 /* Flags that are maintained with a flow as part of its state.
242 * (OFPUTIL_FF_EMERG would be here too, if OVS supported it.) */
243 OFPUTIL_FF_SEND_FLOW_REM = 1 << 0, /* All versions. */
244 OFPUTIL_FF_NO_PKT_COUNTS = 1 << 1, /* OpenFlow 1.3+. */
245 OFPUTIL_FF_NO_BYT_COUNTS = 1 << 2, /* OpenFlow 1.3+. */
246 #define OFPUTIL_FF_STATE (OFPUTIL_FF_SEND_FLOW_REM \
247 | OFPUTIL_FF_NO_PKT_COUNTS \
248 | OFPUTIL_FF_NO_BYT_COUNTS)
250 /* Flags that affect flow_mod behavior but are not part of flow state. */
251 OFPUTIL_FF_CHECK_OVERLAP = 1 << 3, /* All versions. */
252 OFPUTIL_FF_EMERG = 1 << 4, /* OpenFlow 1.0 only. */
253 OFPUTIL_FF_RESET_COUNTS = 1 << 5, /* OpenFlow 1.2+. */
255 /* Flags that are only set by OVS for its internal use. Cannot be set via
257 OFPUTIL_FF_HIDDEN_FIELDS = 1 << 6, /* Allow hidden match fields to be
259 OFPUTIL_FF_NO_READONLY = 1 << 7, /* Allow rules within read only tables
263 /* Protocol-independent flow_mod.
265 * The handling of cookies across multiple versions of OpenFlow is a bit
266 * confusing. See DESIGN for the details. */
267 struct ofputil_flow_mod {
268 struct list list_node; /* For queuing flow_mods. */
271 unsigned int priority;
273 /* Cookie matching. The flow_mod affects only flows that have cookies that
274 * bitwise match 'cookie' bits in positions where 'cookie_mask has 1-bits.
276 * 'cookie_mask' should be zero for OFPFC_ADD flow_mods. */
277 ovs_be64 cookie; /* Cookie bits to match. */
278 ovs_be64 cookie_mask; /* 1-bit in each 'cookie' bit to match. */
282 * OFPFC_ADD uses 'new_cookie' as the new flow's cookie. 'new_cookie'
283 * should not be UINT64_MAX.
285 * OFPFC_MODIFY and OFPFC_MODIFY_STRICT have two cases:
287 * - If one or more matching flows exist and 'modify_cookie' is true,
288 * then the flow_mod changes the existing flows' cookies to
289 * 'new_cookie'. 'new_cookie' should not be UINT64_MAX.
291 * - If no matching flow exists, 'new_cookie' is not UINT64_MAX, and
292 * 'cookie_mask' is 0, then the flow_mod adds a new flow with
293 * 'new_cookie' as its cookie.
295 ovs_be64 new_cookie; /* New cookie to install or UINT64_MAX. */
296 bool modify_cookie; /* Set cookie of existing flow to 'new_cookie'? */
300 uint16_t idle_timeout;
301 uint16_t hard_timeout;
305 enum ofputil_flow_mod_flags flags;
306 struct ofpact *ofpacts; /* Series of "struct ofpact"s. */
307 size_t ofpacts_len; /* Length of ofpacts, in bytes. */
310 enum ofperr ofputil_decode_flow_mod(struct ofputil_flow_mod *,
311 const struct ofp_header *,
312 enum ofputil_protocol,
313 struct ofpbuf *ofpacts,
316 struct ofpbuf *ofputil_encode_flow_mod(const struct ofputil_flow_mod *,
317 enum ofputil_protocol);
319 /* Flow stats or aggregate stats request, independent of protocol. */
320 struct ofputil_flow_stats_request {
321 bool aggregate; /* Aggregate results? */
324 ovs_be64 cookie_mask;
330 enum ofperr ofputil_decode_flow_stats_request(
331 struct ofputil_flow_stats_request *, const struct ofp_header *);
332 struct ofpbuf *ofputil_encode_flow_stats_request(
333 const struct ofputil_flow_stats_request *, enum ofputil_protocol);
335 /* Flow stats reply, independent of protocol. */
336 struct ofputil_flow_stats {
341 uint16_t idle_timeout;
342 uint16_t hard_timeout;
343 uint32_t duration_sec;
344 uint32_t duration_nsec;
345 int idle_age; /* Seconds since last packet, -1 if unknown. */
346 int hard_age; /* Seconds since last change, -1 if unknown. */
347 uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */
348 uint64_t byte_count; /* Byte count, UINT64_MAX if unknown. */
349 const struct ofpact *ofpacts;
351 enum ofputil_flow_mod_flags flags;
354 int ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *,
356 bool flow_age_extension,
357 struct ofpbuf *ofpacts);
358 void ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *,
359 struct list *replies);
361 /* Aggregate stats reply, independent of protocol. */
362 struct ofputil_aggregate_stats {
363 uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */
364 uint64_t byte_count; /* Byte count, UINT64_MAX if unknown. */
368 struct ofpbuf *ofputil_encode_aggregate_stats_reply(
369 const struct ofputil_aggregate_stats *stats,
370 const struct ofp_header *request);
371 enum ofperr ofputil_decode_aggregate_stats_reply(
372 struct ofputil_aggregate_stats *,
373 const struct ofp_header *reply);
375 /* Flow removed message, independent of protocol. */
376 struct ofputil_flow_removed {
380 uint8_t reason; /* One of OFPRR_*. */
381 uint8_t table_id; /* 255 if message didn't include table ID. */
382 uint32_t duration_sec;
383 uint32_t duration_nsec;
384 uint16_t idle_timeout;
385 uint16_t hard_timeout;
386 uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */
387 uint64_t byte_count; /* Byte count, UINT64_MAX if unknown. */
390 enum ofperr ofputil_decode_flow_removed(struct ofputil_flow_removed *,
391 const struct ofp_header *);
392 struct ofpbuf *ofputil_encode_flow_removed(const struct ofputil_flow_removed *,
393 enum ofputil_protocol);
395 /* Abstract packet-in message. */
396 struct ofputil_packet_in {
397 /* Packet data and metadata.
399 * To save bandwidth, in some cases a switch may send only the first
400 * several bytes of a packet, indicated by 'packet_len < total_len'. When
401 * the full packet is included, 'packet_len == total_len'. */
403 size_t packet_len; /* Number of bytes in 'packet'. */
404 size_t total_len; /* Size of packet, pre-truncation. */
405 struct flow_metadata fmd;
407 /* Identifies a buffer in the switch that contains the full packet, to
408 * allow the controller to reference it later without having to send the
409 * entire packet back to the switch.
411 * UINT32_MAX indicates that the packet is not buffered in the switch. A
412 * switch should only use UINT32_MAX when it sends the entire packet. */
415 /* Reason that the packet-in is being sent. */
416 enum ofp_packet_in_reason reason; /* One of OFPR_*. */
418 /* Information about the OpenFlow flow that triggered the packet-in.
420 * A packet-in triggered by a flow table miss has no associated flow. In
421 * that case, 'cookie' is UINT64_MAX. */
422 uint8_t table_id; /* OpenFlow table ID. */
423 ovs_be64 cookie; /* Flow's cookie. */
426 enum ofperr ofputil_decode_packet_in(struct ofputil_packet_in *,
427 const struct ofp_header *);
428 struct ofpbuf *ofputil_encode_packet_in(const struct ofputil_packet_in *,
429 enum ofputil_protocol protocol,
430 enum nx_packet_in_format);
432 enum { OFPUTIL_PACKET_IN_REASON_BUFSIZE = INT_STRLEN(int) + 1 };
433 const char *ofputil_packet_in_reason_to_string(enum ofp_packet_in_reason,
436 bool ofputil_packet_in_reason_from_string(const char *,
437 enum ofp_packet_in_reason *);
439 /* Abstract packet-out message.
441 * ofputil_decode_packet_out() will ensure that 'in_port' is a physical port
442 * (OFPP_MAX or less) or one of OFPP_LOCAL, OFPP_NONE, or OFPP_CONTROLLER. */
443 struct ofputil_packet_out {
444 const void *packet; /* Packet data, if buffer_id == UINT32_MAX. */
445 size_t packet_len; /* Length of packet data in bytes. */
446 uint32_t buffer_id; /* Buffer id or UINT32_MAX if no buffer. */
447 ofp_port_t in_port; /* Packet's input port. */
448 struct ofpact *ofpacts; /* Actions. */
449 size_t ofpacts_len; /* Size of ofpacts in bytes. */
452 enum ofperr ofputil_decode_packet_out(struct ofputil_packet_out *,
453 const struct ofp_header *,
454 struct ofpbuf *ofpacts);
455 struct ofpbuf *ofputil_encode_packet_out(const struct ofputil_packet_out *,
456 enum ofputil_protocol protocol);
458 enum ofputil_port_config {
459 /* OpenFlow 1.0 and 1.1 share these values for these port config bits. */
460 OFPUTIL_PC_PORT_DOWN = 1 << 0, /* Port is administratively down. */
461 OFPUTIL_PC_NO_RECV = 1 << 2, /* Drop all packets received by port. */
462 OFPUTIL_PC_NO_FWD = 1 << 5, /* Drop packets forwarded to port. */
463 OFPUTIL_PC_NO_PACKET_IN = 1 << 6, /* No send packet-in msgs for port. */
464 /* OpenFlow 1.0 only. */
465 OFPUTIL_PC_NO_STP = 1 << 1, /* No 802.1D spanning tree for port. */
466 OFPUTIL_PC_NO_RECV_STP = 1 << 3, /* Drop received 802.1D STP packets. */
467 OFPUTIL_PC_NO_FLOOD = 1 << 4, /* Do not include port when flooding. */
468 /* There are no OpenFlow 1.1-only bits. */
471 enum ofputil_port_state {
472 /* OpenFlow 1.0 and 1.1 share this values for these port state bits. */
473 OFPUTIL_PS_LINK_DOWN = 1 << 0, /* No physical link present. */
474 /* OpenFlow 1.1 only. */
475 OFPUTIL_PS_BLOCKED = 1 << 1, /* Port is blocked */
476 OFPUTIL_PS_LIVE = 1 << 2, /* Live for Fast Failover Group. */
477 /* OpenFlow 1.0 only. */
478 OFPUTIL_PS_STP_LISTEN = 0 << 8, /* Not learning or relaying frames. */
479 OFPUTIL_PS_STP_LEARN = 1 << 8, /* Learning but not relaying frames. */
480 OFPUTIL_PS_STP_FORWARD = 2 << 8, /* Learning and relaying frames. */
481 OFPUTIL_PS_STP_BLOCK = 3 << 8, /* Not part of spanning tree. */
482 OFPUTIL_PS_STP_MASK = 3 << 8 /* Bit mask for OFPPS10_STP_* values. */
485 /* Abstract ofp10_phy_port or ofp11_port. */
486 struct ofputil_phy_port {
488 uint8_t hw_addr[OFP_ETH_ALEN];
489 char name[OFP_MAX_PORT_NAME_LEN];
490 enum ofputil_port_config config;
491 enum ofputil_port_state state;
493 /* NETDEV_F_* feature bitmasks. */
494 enum netdev_features curr; /* Current features. */
495 enum netdev_features advertised; /* Features advertised by the port. */
496 enum netdev_features supported; /* Features supported by the port. */
497 enum netdev_features peer; /* Features advertised by peer. */
500 uint32_t curr_speed; /* Current speed, in kbps. */
501 uint32_t max_speed; /* Maximum supported speed, in kbps. */
504 enum ofputil_capabilities {
505 /* OpenFlow 1.0, 1.1, 1.2, and 1.3 share these capability values. */
506 OFPUTIL_C_FLOW_STATS = 1 << 0, /* Flow statistics. */
507 OFPUTIL_C_TABLE_STATS = 1 << 1, /* Table statistics. */
508 OFPUTIL_C_PORT_STATS = 1 << 2, /* Port statistics. */
509 OFPUTIL_C_IP_REASM = 1 << 5, /* Can reassemble IP fragments. */
510 OFPUTIL_C_QUEUE_STATS = 1 << 6, /* Queue statistics. */
512 /* OpenFlow 1.0 and 1.1 share this capability. */
513 OFPUTIL_C_ARP_MATCH_IP = 1 << 7, /* Match IP addresses in ARP pkts. */
515 /* OpenFlow 1.0 only. */
516 OFPUTIL_C_STP = 1 << 3, /* 802.1d spanning tree. */
518 /* OpenFlow 1.1, 1.2, and 1.3 share this capability. */
519 OFPUTIL_C_GROUP_STATS = 1 << 4, /* Group statistics. */
521 /* OpenFlow 1.2 and 1.3 share this capability */
522 OFPUTIL_C_PORT_BLOCKED = 1 << 8, /* Switch will block looping ports */
525 enum ofputil_action_bitmap {
526 OFPUTIL_A_OUTPUT = 1 << 0,
527 OFPUTIL_A_SET_VLAN_VID = 1 << 1,
528 OFPUTIL_A_SET_VLAN_PCP = 1 << 2,
529 OFPUTIL_A_STRIP_VLAN = 1 << 3,
530 OFPUTIL_A_SET_DL_SRC = 1 << 4,
531 OFPUTIL_A_SET_DL_DST = 1 << 5,
532 OFPUTIL_A_SET_NW_SRC = 1 << 6,
533 OFPUTIL_A_SET_NW_DST = 1 << 7,
534 OFPUTIL_A_SET_NW_ECN = 1 << 8,
535 OFPUTIL_A_SET_NW_TOS = 1 << 9,
536 OFPUTIL_A_SET_TP_SRC = 1 << 10,
537 OFPUTIL_A_SET_TP_DST = 1 << 11,
538 OFPUTIL_A_ENQUEUE = 1 << 12,
539 OFPUTIL_A_COPY_TTL_OUT = 1 << 13,
540 OFPUTIL_A_COPY_TTL_IN = 1 << 14,
541 OFPUTIL_A_SET_MPLS_LABEL = 1 << 15,
542 OFPUTIL_A_SET_MPLS_TC = 1 << 16,
543 OFPUTIL_A_SET_MPLS_TTL = 1 << 17,
544 OFPUTIL_A_DEC_MPLS_TTL = 1 << 18,
545 OFPUTIL_A_PUSH_VLAN = 1 << 19,
546 OFPUTIL_A_POP_VLAN = 1 << 20,
547 OFPUTIL_A_PUSH_MPLS = 1 << 21,
548 OFPUTIL_A_POP_MPLS = 1 << 22,
549 OFPUTIL_A_SET_QUEUE = 1 << 23,
550 OFPUTIL_A_GROUP = 1 << 24,
551 OFPUTIL_A_SET_NW_TTL = 1 << 25,
552 OFPUTIL_A_DEC_NW_TTL = 1 << 26,
553 OFPUTIL_A_SET_FIELD = 1 << 27,
556 /* Abstract ofp_switch_features. */
557 struct ofputil_switch_features {
558 uint64_t datapath_id; /* Datapath unique ID. */
559 uint32_t n_buffers; /* Max packets buffered at once. */
560 uint8_t n_tables; /* Number of tables supported by datapath. */
561 uint8_t auxiliary_id; /* Identify auxiliary connections */
562 enum ofputil_capabilities capabilities;
563 enum ofputil_action_bitmap actions;
566 enum ofperr ofputil_decode_switch_features(const struct ofp_header *,
567 struct ofputil_switch_features *,
570 struct ofpbuf *ofputil_encode_switch_features(
571 const struct ofputil_switch_features *, enum ofputil_protocol,
573 void ofputil_put_switch_features_port(const struct ofputil_phy_port *,
575 bool ofputil_switch_features_has_ports(struct ofpbuf *b);
577 /* phy_port helper functions. */
578 int ofputil_pull_phy_port(enum ofp_version ofp_version, struct ofpbuf *,
579 struct ofputil_phy_port *);
581 /* Abstract ofp_port_status. */
582 struct ofputil_port_status {
583 enum ofp_port_reason reason;
584 struct ofputil_phy_port desc;
587 enum ofperr ofputil_decode_port_status(const struct ofp_header *,
588 struct ofputil_port_status *);
589 struct ofpbuf *ofputil_encode_port_status(const struct ofputil_port_status *,
590 enum ofputil_protocol);
592 /* Abstract ofp_port_mod. */
593 struct ofputil_port_mod {
595 uint8_t hw_addr[OFP_ETH_ALEN];
596 enum ofputil_port_config config;
597 enum ofputil_port_config mask;
598 enum netdev_features advertise;
601 enum ofperr ofputil_decode_port_mod(const struct ofp_header *,
602 struct ofputil_port_mod *, bool loose);
603 struct ofpbuf *ofputil_encode_port_mod(const struct ofputil_port_mod *,
604 enum ofputil_protocol);
606 /* Abstract ofp_table_mod. */
607 struct ofputil_table_mod {
608 uint8_t table_id; /* ID of the table, 0xff indicates all tables. */
609 enum ofp_table_config config;
612 enum ofperr ofputil_decode_table_mod(const struct ofp_header *,
613 struct ofputil_table_mod *);
614 struct ofpbuf *ofputil_encode_table_mod(const struct ofputil_table_mod *,
615 enum ofputil_protocol);
617 /* Abstract ofp_table_features. */
618 struct ofputil_table_features {
619 uint8_t table_id; /* Identifier of table. Lower numbered tables
620 are consulted first. */
621 char name[OFP_MAX_TABLE_NAME_LEN];
622 ovs_be64 metadata_match; /* Bits of metadata table can match. */
623 ovs_be64 metadata_write; /* Bits of metadata table can write. */
624 uint32_t config; /* Bitmap of OFPTC_* values */
625 uint32_t max_entries; /* Max number of entries supported. */
627 /* Table features related to instructions. There are two instances:
629 * - 'miss' reports features available in the table miss flow.
631 * - 'nonmiss' reports features available in other flows. */
632 struct ofputil_table_instruction_features {
633 /* Tables that "goto-table" may jump to. */
634 unsigned long int next[BITMAP_N_LONGS(255)];
636 /* Bitmap of OVSINST_* for supported instructions. */
637 uint32_t instructions;
639 /* Table features related to actions. There are two instances:
641 * - 'write' reports features available in a "write_actions"
644 * - 'apply' reports features available in an "apply_actions"
646 struct ofputil_table_action_features {
647 uint32_t actions; /* Bitmap of supported OFPAT*. */
648 uint64_t set_fields; /* Bitmap of MFF_* "set-field" supports. */
654 * For any given field the following combinations are valid:
656 * - match=0, wildcard=0, mask=0: Flows in this table cannot match on
659 * - match=1, wildcard=0, mask=0: Flows in this table must match on all
660 * the bits in this field.
662 * - match=1, wildcard=1, mask=0: Flows in this table must either match
663 * on all the bits in the field or wildcard the field entirely.
665 * - match=1, wildcard=1, mask=1: Flows in this table may arbitrarily
666 * mask this field (as special cases, they may match on all the bits
667 * or wildcard it entirely).
669 * Other combinations do not make sense.
671 uint64_t match; /* Fields that may be matched. */
672 uint64_t mask; /* Subset of 'match' that may have masks. */
673 uint64_t wildcard; /* Subset of 'match' that may be wildcarded. */
676 int ofputil_decode_table_features(struct ofpbuf *,
677 struct ofputil_table_features *, bool loose);
678 struct ofpbuf *ofputil_encode_table_features_request(
679 enum ofp_version ofp_version);
680 void ofputil_append_table_features_reply(
681 const struct ofputil_table_features *tf,
682 struct list *replies);
684 uint16_t table_feature_prop_get_size(enum ofp13_table_feature_prop_type type);
685 char *table_feature_prop_get_name(enum ofp13_table_feature_prop_type type);
687 /* Meter band configuration for all supported band types. */
688 struct ofputil_meter_band {
690 uint8_t prec_level; /* Non-zero if type == OFPMBT_DSCP_REMARK. */
695 struct ofputil_meter_band_stats {
696 uint64_t packet_count;
700 struct ofputil_meter_config {
704 struct ofputil_meter_band *bands;
707 /* Abstract ofp_meter_mod. */
708 struct ofputil_meter_mod {
710 struct ofputil_meter_config meter;
713 struct ofputil_meter_stats {
716 uint64_t packet_in_count;
717 uint64_t byte_in_count;
718 uint32_t duration_sec;
719 uint32_t duration_nsec;
721 struct ofputil_meter_band_stats *bands;
724 struct ofputil_meter_features {
725 uint32_t max_meters; /* Maximum number of meters. */
726 uint32_t band_types; /* Can support max 32 band types. */
727 uint32_t capabilities; /* Supported flags. */
732 enum ofperr ofputil_decode_meter_mod(const struct ofp_header *,
733 struct ofputil_meter_mod *,
734 struct ofpbuf *bands);
735 struct ofpbuf *ofputil_encode_meter_mod(enum ofp_version,
736 const struct ofputil_meter_mod *);
738 void ofputil_decode_meter_features(const struct ofp_header *,
739 struct ofputil_meter_features *);
740 struct ofpbuf *ofputil_encode_meter_features_reply(const struct
741 ofputil_meter_features *,
742 const struct ofp_header *
744 void ofputil_decode_meter_request(const struct ofp_header *,
747 void ofputil_append_meter_config(struct list *replies,
748 const struct ofputil_meter_config *);
750 void ofputil_append_meter_stats(struct list *replies,
751 const struct ofputil_meter_stats *);
753 enum ofputil_meter_request_type {
754 OFPUTIL_METER_FEATURES,
755 OFPUTIL_METER_CONFIG,
759 struct ofpbuf *ofputil_encode_meter_request(enum ofp_version,
760 enum ofputil_meter_request_type,
763 int ofputil_decode_meter_stats(struct ofpbuf *,
764 struct ofputil_meter_stats *,
765 struct ofpbuf *bands);
767 int ofputil_decode_meter_config(struct ofpbuf *,
768 struct ofputil_meter_config *,
769 struct ofpbuf *bands);
771 /* Type for meter_id in ofproto provider interface, UINT32_MAX if invalid. */
772 typedef struct { uint32_t uint32; } ofproto_meter_id;
774 /* Abstract ofp_role_request and reply. */
775 struct ofputil_role_request {
776 enum ofp12_controller_role role;
777 bool have_generation_id;
778 uint64_t generation_id;
781 struct ofputil_role_status {
782 enum ofp12_controller_role role;
783 enum ofp14_controller_role_reason reason;
784 uint64_t generation_id;
787 enum ofperr ofputil_decode_role_message(const struct ofp_header *,
788 struct ofputil_role_request *);
789 struct ofpbuf *ofputil_encode_role_reply(const struct ofp_header *,
790 const struct ofputil_role_request *);
792 struct ofpbuf *ofputil_encode_role_status(
793 const struct ofputil_role_status *status,
794 enum ofputil_protocol protocol);
796 enum ofperr ofputil_decode_role_status(const struct ofp_header *oh,
797 struct ofputil_role_status *rs);
798 /* Abstract table stats.
800 * For now we use ofp12_table_stats as a superset of the other protocol
801 * versions' table stats. */
803 struct ofpbuf *ofputil_encode_table_stats_reply(
804 const struct ofp12_table_stats[], int n,
805 const struct ofp_header *request);
807 /* Queue configuration request. */
808 struct ofpbuf *ofputil_encode_queue_get_config_request(enum ofp_version,
810 enum ofperr ofputil_decode_queue_get_config_request(const struct ofp_header *,
813 /* Queue configuration reply. */
814 struct ofputil_queue_config {
817 /* Each of these optional values is expressed in tenths of a percent.
818 * Values greater than 1000 indicate that the feature is disabled.
819 * UINT16_MAX indicates that the value is omitted. */
824 struct ofpbuf *ofputil_encode_queue_get_config_reply(
825 const struct ofp_header *request);
826 void ofputil_append_queue_get_config_reply(
827 struct ofpbuf *reply, const struct ofputil_queue_config *);
829 enum ofperr ofputil_decode_queue_get_config_reply(struct ofpbuf *reply,
831 int ofputil_pull_queue_get_config_reply(struct ofpbuf *reply,
832 struct ofputil_queue_config *);
835 /* Abstract nx_flow_monitor_request. */
836 struct ofputil_flow_monitor_request {
838 enum nx_flow_monitor_flags flags;
844 int ofputil_decode_flow_monitor_request(struct ofputil_flow_monitor_request *,
846 void ofputil_append_flow_monitor_request(
847 const struct ofputil_flow_monitor_request *, struct ofpbuf *msg);
849 /* Abstract nx_flow_update. */
850 struct ofputil_flow_update {
851 enum nx_flow_update_event event;
853 /* Used only for NXFME_ADDED, NXFME_DELETED, NXFME_MODIFIED. */
854 enum ofp_flow_removed_reason reason;
855 uint16_t idle_timeout;
856 uint16_t hard_timeout;
861 const struct ofpact *ofpacts;
864 /* Used only for NXFME_ABBREV. */
868 int ofputil_decode_flow_update(struct ofputil_flow_update *,
869 struct ofpbuf *msg, struct ofpbuf *ofpacts);
870 void ofputil_start_flow_update(struct list *replies);
871 void ofputil_append_flow_update(const struct ofputil_flow_update *,
872 struct list *replies);
874 /* Abstract nx_flow_monitor_cancel. */
875 uint32_t ofputil_decode_flow_monitor_cancel(const struct ofp_header *);
876 struct ofpbuf *ofputil_encode_flow_monitor_cancel(uint32_t id);
878 /* Port desc stats requests and replies. */
879 enum ofperr ofputil_decode_port_desc_stats_request(const struct ofp_header *,
881 struct ofpbuf *ofputil_encode_port_desc_stats_request(
882 enum ofp_version ofp_version, ofp_port_t);
884 void ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp,
885 struct list *replies);
887 /* Encoding simple OpenFlow messages. */
888 struct ofpbuf *make_echo_request(enum ofp_version);
889 struct ofpbuf *make_echo_reply(const struct ofp_header *rq);
891 struct ofpbuf *ofputil_encode_barrier_request(enum ofp_version);
893 const char *ofputil_frag_handling_to_string(enum ofp_config_flags);
894 bool ofputil_frag_handling_from_string(const char *, enum ofp_config_flags *);
899 /* The type of an action.
901 * For each implemented OFPAT10_* and NXAST_* action type, there is a
902 * corresponding constant prefixed with OFPUTIL_, e.g.:
904 * OFPUTIL_OFPAT10_OUTPUT
905 * OFPUTIL_OFPAT10_SET_VLAN_VID
906 * OFPUTIL_OFPAT10_SET_VLAN_PCP
907 * OFPUTIL_OFPAT10_STRIP_VLAN
908 * OFPUTIL_OFPAT10_SET_DL_SRC
909 * OFPUTIL_OFPAT10_SET_DL_DST
910 * OFPUTIL_OFPAT10_SET_NW_SRC
911 * OFPUTIL_OFPAT10_SET_NW_DST
912 * OFPUTIL_OFPAT10_SET_NW_TOS
913 * OFPUTIL_OFPAT10_SET_TP_SRC
914 * OFPUTIL_OFPAT10_SET_TP_DST
915 * OFPUTIL_OFPAT10_ENQUEUE
916 * OFPUTIL_NXAST_RESUBMIT
917 * OFPUTIL_NXAST_SET_TUNNEL
918 * OFPUTIL_NXAST_SET_METADATA
919 * OFPUTIL_NXAST_SET_QUEUE
920 * OFPUTIL_NXAST_POP_QUEUE
921 * OFPUTIL_NXAST_REG_MOVE
922 * OFPUTIL_NXAST_REG_LOAD
924 * OFPUTIL_NXAST_SET_TUNNEL64
925 * OFPUTIL_NXAST_MULTIPATH
926 * OFPUTIL_NXAST_BUNDLE
927 * OFPUTIL_NXAST_BUNDLE_LOAD
928 * OFPUTIL_NXAST_RESUBMIT_TABLE
929 * OFPUTIL_NXAST_OUTPUT_REG
930 * OFPUTIL_NXAST_LEARN
931 * OFPUTIL_NXAST_DEC_TTL
932 * OFPUTIL_NXAST_FIN_TIMEOUT
934 * (The above list helps developers who want to "grep" for these definitions.)
936 enum OVS_PACKED_ENUM ofputil_action_code {
937 OFPUTIL_ACTION_INVALID,
938 #define OFPAT10_ACTION(ENUM, STRUCT, NAME) OFPUTIL_##ENUM,
939 #define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM,
940 #define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM,
941 #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM,
942 #include "ofp-util.def"
945 /* The number of values of "enum ofputil_action_code". */
947 #define OFPAT10_ACTION(ENUM, STRUCT, NAME) + 1
948 #define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1
949 #define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1
950 #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1
951 OFPUTIL_N_ACTIONS = 1
952 #include "ofp-util.def"
955 int ofputil_action_code_from_name(const char *);
956 const char * ofputil_action_name_from_code(enum ofputil_action_code code);
957 enum ofputil_action_code ofputil_action_code_from_ofp13_action(
958 enum ofp13_action_type type);
960 void *ofputil_put_action(enum ofputil_action_code, struct ofpbuf *buf);
962 /* For each OpenFlow action <ENUM> that has a corresponding action structure
963 * struct <STRUCT>, this defines two functions:
965 * void ofputil_init_<ENUM>(struct <STRUCT> *action);
967 * Initializes the parts of 'action' that identify it as having type <ENUM>
968 * and length 'sizeof *action' and zeros the rest. For actions that have
969 * variable length, the length used and cleared is that of struct <STRUCT>.
971 * struct <STRUCT> *ofputil_put_<ENUM>(struct ofpbuf *buf);
973 * Appends a new 'action', of length 'sizeof(struct <STRUCT>)', to 'buf',
974 * initializes it with ofputil_init_<ENUM>(), and returns it.
976 #define OFPAT10_ACTION(ENUM, STRUCT, NAME) \
977 void ofputil_init_##ENUM(struct STRUCT *); \
978 struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
979 #define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \
980 void ofputil_init_##ENUM(struct STRUCT *); \
981 struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
982 #define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \
983 void ofputil_init_##ENUM(struct STRUCT *); \
984 struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
985 #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \
986 void ofputil_init_##ENUM(struct STRUCT *); \
987 struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
988 #include "ofp-util.def"
990 #define OFP_ACTION_ALIGN 8 /* Alignment of ofp_actions. */
992 bool action_outputs_to_port(const union ofp_action *, ovs_be16 port);
994 enum ofperr ofputil_pull_actions(struct ofpbuf *, unsigned int actions_len,
995 union ofp_action **, size_t *);
997 bool ofputil_actions_equal(const union ofp_action *a, size_t n_a,
998 const union ofp_action *b, size_t n_b);
999 union ofp_action *ofputil_actions_clone(const union ofp_action *, size_t n);
1001 /* Handy utility for parsing flows and actions. */
1002 bool ofputil_parse_key_value(char **stringp, char **keyp, char **valuep);
1004 struct ofputil_port_stats {
1006 struct netdev_stats stats;
1007 uint32_t duration_sec; /* UINT32_MAX if unknown. */
1008 uint32_t duration_nsec;
1011 struct ofpbuf *ofputil_encode_dump_ports_request(enum ofp_version ofp_version,
1013 void ofputil_append_port_stat(struct list *replies,
1014 const struct ofputil_port_stats *ops);
1015 size_t ofputil_count_port_stats(const struct ofp_header *);
1016 int ofputil_decode_port_stats(struct ofputil_port_stats *, struct ofpbuf *msg);
1017 enum ofperr ofputil_decode_port_stats_request(const struct ofp_header *request,
1018 ofp_port_t *ofp10_port);
1020 struct ofputil_queue_stats_request {
1021 ofp_port_t port_no; /* OFPP_ANY means "all ports". */
1026 ofputil_decode_queue_stats_request(const struct ofp_header *request,
1027 struct ofputil_queue_stats_request *oqsr);
1029 ofputil_encode_queue_stats_request(enum ofp_version ofp_version,
1030 const struct ofputil_queue_stats_request *oqsr);
1032 struct ofputil_queue_stats {
1036 /* Values of unsupported statistics are set to all-1-bits (UINT64_MAX). */
1038 uint64_t tx_packets;
1041 /* UINT32_MAX if unknown. */
1042 uint32_t duration_sec;
1043 uint32_t duration_nsec;
1046 size_t ofputil_count_queue_stats(const struct ofp_header *);
1047 int ofputil_decode_queue_stats(struct ofputil_queue_stats *qs, struct ofpbuf *msg);
1048 void ofputil_append_queue_stat(struct list *replies,
1049 const struct ofputil_queue_stats *oqs);
1051 /* Bucket for use in groups. */
1052 struct ofputil_bucket {
1053 struct list list_node;
1054 uint16_t weight; /* Relative weight, for "select" groups. */
1055 ofp_port_t watch_port; /* Port whose state affects whether this bucket
1056 * is live. Only required for fast failover
1058 uint32_t watch_group; /* Group whose state affects whether this
1059 * bucket is live. Only required for fast
1060 * failover groups. */
1061 struct ofpact *ofpacts; /* Series of "struct ofpact"s. */
1062 size_t ofpacts_len; /* Length of ofpacts, in bytes. */
1065 /* Protocol-independent group_mod. */
1066 struct ofputil_group_mod {
1067 uint16_t command; /* One of OFPGC11_*. */
1068 uint8_t type; /* One of OFPGT11_*. */
1069 uint32_t group_id; /* Group identifier. */
1070 struct list buckets; /* Contains "struct ofputil_bucket"s. */
1073 struct bucket_counter {
1074 uint64_t packet_count; /* Number of packets processed by bucket. */
1075 uint64_t byte_count; /* Number of bytes processed by bucket. */
1078 /* Group stats reply, independent of protocol. */
1079 struct ofputil_group_stats {
1080 uint32_t group_id; /* Group identifier. */
1082 uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */
1083 uint64_t byte_count; /* Byte count, UINT64_MAX if unknown. */
1084 uint32_t duration_sec; /* UINT32_MAX if unknown. */
1085 uint32_t duration_nsec;
1087 struct bucket_counter *bucket_stats;
1090 /* Group features reply, independent of protocol.
1092 * Only OF1.2 and later support group features replies. */
1093 struct ofputil_group_features {
1094 uint32_t types; /* Bitmap of OFPGT_* values supported. */
1095 uint32_t capabilities; /* Bitmap of OFPGFC12_* capability supported. */
1096 uint32_t max_groups[4]; /* Maximum number of groups for each type. */
1098 /* Bitmaps of OFPAT_* that are supported. OF1.2+ actions only. */
1099 uint32_t actions[4];
1102 /* Group desc reply, independent of protocol. */
1103 struct ofputil_group_desc {
1104 uint8_t type; /* One of OFPGT_*. */
1105 uint32_t group_id; /* Group identifier. */
1106 struct list buckets; /* Contains "struct ofputil_bucket"s. */
1109 void ofputil_bucket_list_destroy(struct list *buckets);
1112 ofputil_bucket_has_liveness(const struct ofputil_bucket *bucket)
1114 return (bucket->watch_port != OFPP_ANY ||
1115 bucket->watch_group != OFPG_ANY);
1118 struct ofpbuf *ofputil_encode_group_stats_request(enum ofp_version,
1120 enum ofperr ofputil_decode_group_stats_request(
1121 const struct ofp_header *request, uint32_t *group_id);
1122 void ofputil_append_group_stats(struct list *replies,
1123 const struct ofputil_group_stats *);
1124 struct ofpbuf *ofputil_encode_group_features_request(enum ofp_version);
1125 struct ofpbuf *ofputil_encode_group_features_reply(
1126 const struct ofputil_group_features *, const struct ofp_header *request);
1127 void ofputil_decode_group_features_reply(const struct ofp_header *,
1128 struct ofputil_group_features *);
1129 struct ofpbuf *ofputil_encode_group_mod(enum ofp_version ofp_version,
1130 const struct ofputil_group_mod *gm);
1132 enum ofperr ofputil_decode_group_mod(const struct ofp_header *,
1133 struct ofputil_group_mod *);
1135 int ofputil_decode_group_stats_reply(struct ofpbuf *,
1136 struct ofputil_group_stats *);
1138 uint32_t ofputil_decode_group_desc_request(const struct ofp_header *);
1139 struct ofpbuf *ofputil_encode_group_desc_request(enum ofp_version,
1142 int ofputil_decode_group_desc_reply(struct ofputil_group_desc *,
1143 struct ofpbuf *, enum ofp_version);
1145 void ofputil_append_group_desc_reply(const struct ofputil_group_desc *,
1146 struct list *buckets,
1147 struct list *replies);
1149 struct ofputil_bundle_ctrl_msg {
1155 struct ofputil_bundle_add_msg {
1158 const struct ofp_header *msg;
1161 enum ofperr ofputil_decode_bundle_ctrl(const struct ofp_header *,
1162 struct ofputil_bundle_ctrl_msg *);
1164 struct ofpbuf *ofputil_encode_bundle_ctrl_reply(const struct ofp_header *,
1165 struct ofputil_bundle_ctrl_msg *);
1167 struct ofpbuf *ofputil_encode_bundle_add(enum ofp_version ofp_version,
1168 struct ofputil_bundle_add_msg *msg);
1170 enum ofperr ofputil_decode_bundle_add(const struct ofp_header *,
1171 struct ofputil_bundle_add_msg *);
1172 #endif /* ofp-util.h */