From: Ben Warren <[email protected]>
Signed-off-by: Ben Warren <[email protected]>
---
include/openvswitch/automake.mk | 1 +
include/openvswitch/ofp-msgs.h | 752 ++++++++++++++++++++++++++++++++++++++++
lib/automake.mk | 5 +-
lib/learning-switch.c | 14 +-
lib/ofp-errors.c | 7 +-
lib/ofp-msgs.c | 8 +-
lib/ofp-msgs.h | 752 ----------------------------------------
lib/ofp-print.c | 12 +-
lib/ofp-util.c | 14 +-
lib/rconn.c | 8 +-
lib/vconn.c | 12 +-
ofproto/bundles.c | 8 +-
ofproto/bundles.h | 4 +-
ofproto/connmgr.c | 10 +-
ofproto/ofproto.c | 14 +-
ovn/controller/ofctrl.c | 8 +-
ovn/controller/pinctrl.c | 9 +-
tests/test-vconn.c | 8 +-
utilities/ovs-ofctl.c | 20 +-
19 files changed, 833 insertions(+), 833 deletions(-)
create mode 100644 include/openvswitch/ofp-msgs.h
delete mode 100644 lib/ofp-msgs.h
diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk
index 6d943f4..e04092b 100644
--- a/include/openvswitch/automake.mk
+++ b/include/openvswitch/automake.mk
@@ -10,6 +10,7 @@ openvswitchinclude_HEADERS = \
include/openvswitch/netdev.h \
include/openvswitch/ofpbuf.h \
include/openvswitch/ofp-errors.h \
+ include/openvswitch/ofp-msgs.h \
include/openvswitch/ofp-parse.h \
include/openvswitch/ofp-util.h \
include/openvswitch/packets.h \
diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
new file mode 100644
index 0000000..560cbe0
--- /dev/null
+++ b/include/openvswitch/ofp-msgs.h
@@ -0,0 +1,752 @@
+/*
+ * Copyright (c) 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENVSWITCH_OFP_MSGS_H
+#define OPENVSWITCH_OFP_MSGS_H 1
+
+/* OpenFlow message headers abstraction.
+ *
+ * OpenFlow headers are unnecessarily complicated:
+ *
+ * - Some messages with the same meaning were renumbered between 1.0 and 1.1.
+ *
+ * - "Statistics" (aka multipart) messages have a different format from other
+ * messages.
+ *
+ * - The 1.0 header for statistics messages is an odd number of 32-bit words
+ * long, leaving 64-bit quantities in the body misaligned. The 1.1 header
+ * for statistics added a padding word to fix this misalignment, although
+ * many statistic message bodies did not change.
+ *
+ * - Vendor-defined messages have an additional header but no standard way to
+ * distinguish individual types of message within a given vendor.
+ *
+ * This file attempts to abstract out the differences between the various forms
+ * of headers.
+ */
+
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/types.h"
+#include "util.h"
+
+struct ovs_list;
+
+/* Raw identifiers for OpenFlow messages.
+ *
+ * Some OpenFlow messages with similar meanings have multiple variants across
+ * OpenFlow versions or vendor extensions. Each variant has a different
+ * OFPRAW_* enumeration constant. More specifically, if two messages have
+ * different types, different numbers, or different arguments, then they must
+ * have different OFPRAW_* values.
+ *
+ * The comments here must follow a stylized form because the "extract-ofp-msgs"
+ * program parses them at build time to generate data tables. The syntax of
+ * each comment is:
+ *
+ * type versions (number): arguments.
+ *
+ * where the syntax of each part is:
+ *
+ * - type: One of the following:
+ *
+ * * OFPT: standard OpenFlow message.
+ * * OFPST: standard OpenFlow statistics or multipart message.
+ * * NXT: Nicira extension message.
+ * * NXST: Nicira extension statistics or multipart message.
+ * * ONFT: Open Networking Foundation extension message.
+ * * ONFST: Open Networking Foundation multipart message.
+ *
+ * As new vendors implement extensions it will make sense to expand the
+ * dictionary of possible types.
+ *
+ * - versions: The OpenFlow version or versions in which this message is
+ * supported, e.g. "1.0" or "1.1" or "1.0+".
+ *
+ * - number:
+ * For OFPT, the 'type' in struct ofp_header.
+ * For OFPST, the 'type' in struct ofp_stats_msg or ofp11_stats_msg.
+ * For NXT or ONFT, the 'subtype' in struct ofp_vendor_header.
+ * For NXST or ONFST, the 'subtype' in an appropriate vendor stats
+ * struct.
+ *
+ * - arguments: The types of data that follow the OpenFlow headers (the
+ * message "body"). This can be "void" if the message has no body.
+ * Otherwise, it should be a comma-separated sequence of C types. The
+ * last type in the sequence can end with [] if the body ends in a
+ * variable-length sequence.
+ *
+ * The arguments are used to validate the lengths of messages when a
+ * header is parsed. Any message whose length isn't valid as a length of
+ * the specified types will be rejected with OFPERR_OFPBRC_BAD_LEN.
+ *
+ * A few OpenFlow messages, such as OFPT_PACKET_IN, intentionally end with
+ * only part of a structure, up to some specified member. The syntax "up
+ * to <member>" indicates this, e.g. "struct ofp11_packet_in up to data".
+ */
+enum ofpraw {
+/* Immutable standard messages.
+ *
+ * The OpenFlow standard promises to preserve these messages and their numbers
+ * in future versions, so we mark them as <all>, which covers every OpenFlow
+ * version numbered 0x01...0xff, rather than as OF1.0+, which covers only
+ * OpenFlow versions that we otherwise implement.
+ *
+ * Without <all> here, then we would fail to decode "hello" messages that
+ * announce a version higher than we understand, even though there still could
+ * be a version in common with the peer that we do understand. The <all>
+ * keyword is less useful for the other messages, because our OpenFlow channels
+ * accept only OpenFlow messages with a previously negotiated version.
+ */
+
+ /* OFPT <all> (0): uint8_t[]. */
+ OFPRAW_OFPT_HELLO,
+
+ /* OFPT <all> (1): struct ofp_error_msg, uint8_t[]. */
+ OFPRAW_OFPT_ERROR,
+
+ /* OFPT <all> (2): uint8_t[]. */
+ OFPRAW_OFPT_ECHO_REQUEST,
+
+ /* OFPT <all> (3): uint8_t[]. */
+ OFPRAW_OFPT_ECHO_REPLY,
+
+/* Other standard messages.
+ *
+ * The meanings of these messages can (and often do) change from one version
+ * of OpenFlow to another. */
+
+ /* OFPT 1.0+ (5): void. */
+ OFPRAW_OFPT_FEATURES_REQUEST,
+
+ /* OFPT 1.0 (6): struct ofp_switch_features, struct ofp10_phy_port[]. */
+ OFPRAW_OFPT10_FEATURES_REPLY,
+ /* OFPT 1.1-1.2 (6): struct ofp_switch_features, struct ofp11_port[]. */
+ OFPRAW_OFPT11_FEATURES_REPLY,
+ /* OFPT 1.3+ (6): struct ofp_switch_features. */
+ OFPRAW_OFPT13_FEATURES_REPLY,
+
+ /* OFPT 1.0+ (7): void. */
+ OFPRAW_OFPT_GET_CONFIG_REQUEST,
+
+ /* OFPT 1.0+ (8): struct ofp_switch_config. */
+ OFPRAW_OFPT_GET_CONFIG_REPLY,
+
+ /* OFPT 1.0+ (9): struct ofp_switch_config. */
+ OFPRAW_OFPT_SET_CONFIG,
+
+ /* OFPT 1.0 (10): struct ofp10_packet_in up to data, uint8_t[]. */
+ OFPRAW_OFPT10_PACKET_IN,
+ /* OFPT 1.1 (10): struct ofp11_packet_in, uint8_t[]. */
+ OFPRAW_OFPT11_PACKET_IN,
+ /* OFPT 1.2 (10): struct ofp12_packet_in, uint8_t[]. */
+ OFPRAW_OFPT12_PACKET_IN,
+ /* OFPT 1.3+ (10): struct ofp12_packet_in, ovs_be64, uint8_t[]. */
+ OFPRAW_OFPT13_PACKET_IN,
+ /* NXT 1.0+ (17): struct nx_packet_in, uint8_t[]. */
+ OFPRAW_NXT_PACKET_IN,
+ /* NXT 1.0+ (30): uint8_t[8][]. */
+ OFPRAW_NXT_PACKET_IN2,
+
+ /* OFPT 1.0 (11): struct ofp10_flow_removed. */
+ OFPRAW_OFPT10_FLOW_REMOVED,
+ /* OFPT 1.1+ (11): struct ofp11_flow_removed, uint8_t[8][]. */
+ OFPRAW_OFPT11_FLOW_REMOVED,
+ /* NXT 1.0+ (14): struct nx_flow_removed, uint8_t[8][]. */
+ OFPRAW_NXT_FLOW_REMOVED,
+
+ /* OFPT 1.0 (12): struct ofp_port_status, struct ofp10_phy_port. */
+ OFPRAW_OFPT10_PORT_STATUS,
+ /* OFPT 1.1-1.3 (12): struct ofp_port_status, struct ofp11_port. */
+ OFPRAW_OFPT11_PORT_STATUS,
+ /* OFPT 1.4+ (12): struct ofp_port_status, struct ofp14_port,
uint8_t[8][]. */
+ OFPRAW_OFPT14_PORT_STATUS,
+
+ /* OFPT 1.0 (13): struct ofp10_packet_out, uint8_t[]. */
+ OFPRAW_OFPT10_PACKET_OUT,
+ /* OFPT 1.1+ (13): struct ofp11_packet_out, uint8_t[]. */
+ OFPRAW_OFPT11_PACKET_OUT,
+
+ /* OFPT 1.0 (14): struct ofp10_flow_mod, uint8_t[8][]. */
+ OFPRAW_OFPT10_FLOW_MOD,
+ /* OFPT 1.1+ (14): struct ofp11_flow_mod, struct ofp11_instruction[]. */
+ OFPRAW_OFPT11_FLOW_MOD,
+ /* NXT 1.0+ (13): struct nx_flow_mod, uint8_t[8][]. */
+ OFPRAW_NXT_FLOW_MOD,
+
+ /* OFPT 1.1-1.4 (15): struct ofp11_group_mod, uint8_t[8][]. */
+ OFPRAW_OFPT11_GROUP_MOD,
+ /* OFPT 1.5+ (15): struct ofp15_group_mod, uint8_t[8][]. */
+ OFPRAW_OFPT15_GROUP_MOD,
+
+ /* OFPT 1.0 (15): struct ofp10_port_mod. */
+ OFPRAW_OFPT10_PORT_MOD,
+ /* OFPT 1.1-1.3 (16): struct ofp11_port_mod. */
+ OFPRAW_OFPT11_PORT_MOD,
+ /* OFPT 1.4+ (16): struct ofp14_port_mod, uint8_t[8][]. */
+ OFPRAW_OFPT14_PORT_MOD,
+
+ /* OFPT 1.1-1.3 (17): struct ofp11_table_mod. */
+ OFPRAW_OFPT11_TABLE_MOD,
+ /* OFPT 1.4+ (17): struct ofp14_table_mod, uint8_t[8][]. */
+ OFPRAW_OFPT14_TABLE_MOD,
+
+ /* OFPT 1.0 (18): void. */
+ OFPRAW_OFPT10_BARRIER_REQUEST,
+ /* OFPT 1.1+ (20): void. */
+ OFPRAW_OFPT11_BARRIER_REQUEST,
+
+ /* OFPT 1.0 (19): void. */
+ OFPRAW_OFPT10_BARRIER_REPLY,
+ /* OFPT 1.1+ (21): void. */
+ OFPRAW_OFPT11_BARRIER_REPLY,
+
+ /* OFPT 1.0 (20): struct ofp10_queue_get_config_request. */
+ OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST,
+ /* OFPT 1.1-1.3 (22): struct ofp11_queue_get_config_request. */
+ OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST,
+
+ /* OFPT 1.0 (21): struct ofp10_queue_get_config_reply, uint8_t[8][]. */
+ OFPRAW_OFPT10_QUEUE_GET_CONFIG_REPLY,
+ /* OFPT 1.1-1.3 (23): struct ofp11_queue_get_config_reply, uint8_t[8][]. */
+ OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY,
+
+ /* OFPT 1.2+ (24): struct ofp12_role_request. */
+ OFPRAW_OFPT12_ROLE_REQUEST,
+ /* NXT 1.0+ (10): struct nx_role_request. */
+ OFPRAW_NXT_ROLE_REQUEST,
+
+ /* OFPT 1.2+ (25): struct ofp12_role_request. */
+ OFPRAW_OFPT12_ROLE_REPLY,
+ /* NXT 1.0+ (11): struct nx_role_request. */
+ OFPRAW_NXT_ROLE_REPLY,
+
+ /* OFPT 1.3 (26): void. */
+ OFPRAW_OFPT13_GET_ASYNC_REQUEST,
+ /* OFPT 1.4+ (26): void. */
+ OFPRAW_OFPT14_GET_ASYNC_REQUEST,
+ /* OFPT 1.3 (27): struct ofp13_async_config. */
+ OFPRAW_OFPT13_GET_ASYNC_REPLY,
+ /* OFPT 1.4+ (27): uint8_t[8][]. */
+ OFPRAW_OFPT14_GET_ASYNC_REPLY,
+ /* OFPT 1.3 (28): struct ofp13_async_config. */
+ OFPRAW_OFPT13_SET_ASYNC,
+ /* NXT 1.0+ (19): struct nx_async_config. */
+ OFPRAW_NXT_SET_ASYNC_CONFIG,
+ /* NXT 1.0-1.3 (27): uint8_t[8][]. */
+ OFPRAW_NXT_SET_ASYNC_CONFIG2,
+ /* OFPT 1.4+ (28): uint8_t[8][]. */
+ OFPRAW_OFPT14_SET_ASYNC,
+
+ /* OFPT 1.3+ (29): struct ofp13_meter_mod, uint8_t[8][]. */
+ OFPRAW_OFPT13_METER_MOD,
+
+ /* OFPT 1.4+ (30): struct ofp14_role_status, uint8_t[8][]. */
+ OFPRAW_OFPT14_ROLE_STATUS,
+
+ /* OFPT 1.4+ (31): struct ofp14_table_status, uint8_t[8][]. */
+ OFPRAW_OFPT14_TABLE_STATUS,
+
+ /* OFPT 1.4+ (32): struct ofp14_requestforward, uint8_t[8][]. */
+ OFPRAW_OFPT14_REQUESTFORWARD,
+
+ /* OFPT 1.4+ (33): struct ofp14_bundle_ctrl_msg, uint8_t[8][]. */
+ OFPRAW_OFPT14_BUNDLE_CONTROL,
+ /* ONFT 1.3 (2300): struct ofp14_bundle_ctrl_msg, uint8_t[8][]. */
+ OFPRAW_ONFT13_BUNDLE_CONTROL,
+
+ /* OFPT 1.4+ (34): struct ofp14_bundle_ctrl_msg, uint8_t[]. */
+ OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE,
+ /* ONFT 1.3 (2301): struct ofp14_bundle_ctrl_msg, uint8_t[]. */
+ OFPRAW_ONFT13_BUNDLE_ADD_MESSAGE,
+
+/* Standard statistics. */
+
+ /* OFPST 1.0+ (0): void. */
+ OFPRAW_OFPST_DESC_REQUEST,
+
+ /* OFPST 1.0+ (0): struct ofp_desc_stats. */
+ OFPRAW_OFPST_DESC_REPLY,
+
+ /* OFPST 1.0 (1): struct ofp10_flow_stats_request. */
+ OFPRAW_OFPST10_FLOW_REQUEST,
+ /* OFPST 1.1+ (1): struct ofp11_flow_stats_request, uint8_t[8][]. */
+ OFPRAW_OFPST11_FLOW_REQUEST,
+ /* NXST 1.0 (0): struct nx_flow_stats_request, uint8_t[8][]. */
+ OFPRAW_NXST_FLOW_REQUEST,
+
+ /* OFPST 1.0 (1): uint8_t[]. */
+ OFPRAW_OFPST10_FLOW_REPLY,
+ /* OFPST 1.1-1.2 (1): uint8_t[]. */
+ OFPRAW_OFPST11_FLOW_REPLY,
+ /* OFPST 1.3+ (1): uint8_t[]. */
+ OFPRAW_OFPST13_FLOW_REPLY,
+ /* NXST 1.0 (0): uint8_t[]. */
+ OFPRAW_NXST_FLOW_REPLY,
+
+ /* OFPST 1.0 (2): struct ofp10_flow_stats_request. */
+ OFPRAW_OFPST10_AGGREGATE_REQUEST,
+ /* OFPST 1.1+ (2): struct ofp11_flow_stats_request, uint8_t[8][]. */
+ OFPRAW_OFPST11_AGGREGATE_REQUEST,
+ /* NXST 1.0 (1): struct nx_flow_stats_request, uint8_t[8][]. */
+ OFPRAW_NXST_AGGREGATE_REQUEST,
+
+ /* OFPST 1.0+ (2): struct ofp_aggregate_stats_reply. */
+ OFPRAW_OFPST_AGGREGATE_REPLY,
+ /* NXST 1.0 (1): struct ofp_aggregate_stats_reply. */
+ OFPRAW_NXST_AGGREGATE_REPLY,
+
+ /* OFPST 1.0+ (3): void. */
+ OFPRAW_OFPST_TABLE_REQUEST,
+
+ /* OFPST 1.0 (3): struct ofp10_table_stats[]. */
+ OFPRAW_OFPST10_TABLE_REPLY,
+ /* OFPST 1.1 (3): struct ofp11_table_stats[]. */
+ OFPRAW_OFPST11_TABLE_REPLY,
+ /* OFPST 1.2 (3): struct ofp12_table_stats[]. */
+ OFPRAW_OFPST12_TABLE_REPLY,
+ /* OFPST 1.3+ (3): struct ofp13_table_stats[]. */
+ OFPRAW_OFPST13_TABLE_REPLY,
+
+ /* OFPST 1.0 (4): struct ofp10_port_stats_request. */
+ OFPRAW_OFPST10_PORT_REQUEST,
+ /* OFPST 1.1+ (4): struct ofp11_port_stats_request. */
+ OFPRAW_OFPST11_PORT_REQUEST,
+
+ /* OFPST 1.0 (4): struct ofp10_port_stats[]. */
+ OFPRAW_OFPST10_PORT_REPLY,
+ /* OFPST 1.1-1.2 (4): struct ofp11_port_stats[]. */
+ OFPRAW_OFPST11_PORT_REPLY,
+ /* OFPST 1.3 (4): struct ofp13_port_stats[]. */
+ OFPRAW_OFPST13_PORT_REPLY,
+ /* OFPST 1.4+ (4): uint8_t[8][]. */
+ OFPRAW_OFPST14_PORT_REPLY,
+
+ /* OFPST 1.0 (5): struct ofp10_queue_stats_request. */
+ OFPRAW_OFPST10_QUEUE_REQUEST,
+ /* OFPST 1.1+ (5): struct ofp11_queue_stats_request. */
+ OFPRAW_OFPST11_QUEUE_REQUEST,
+
+ /* OFPST 1.0 (5): struct ofp10_queue_stats[]. */
+ OFPRAW_OFPST10_QUEUE_REPLY,
+ /* OFPST 1.1-1.2 (5): struct ofp11_queue_stats[]. */
+ OFPRAW_OFPST11_QUEUE_REPLY,
+ /* OFPST 1.3 (5): struct ofp13_queue_stats[]. */
+ OFPRAW_OFPST13_QUEUE_REPLY,
+ /* OFPST 1.4+ (5): uint8_t[8][]. */
+ OFPRAW_OFPST14_QUEUE_REPLY,
+
+ /* OFPST 1.1+ (6): struct ofp11_group_stats_request. */
+ OFPRAW_OFPST11_GROUP_REQUEST,
+
+ /* OFPST 1.1-1.2 (6): uint8_t[8][]. */
+ OFPRAW_OFPST11_GROUP_REPLY,
+ /* OFPST 1.3+ (6): uint8_t[8][]. */
+ OFPRAW_OFPST13_GROUP_REPLY,
+
+ /* OFPST 1.1-1.4 (7): void. */
+ OFPRAW_OFPST11_GROUP_DESC_REQUEST,
+ /* OFPST 1.5+ (7): struct ofp15_group_desc_request. */
+ OFPRAW_OFPST15_GROUP_DESC_REQUEST,
+
+ /* OFPST 1.1+ (7): uint8_t[8][]. */
+ OFPRAW_OFPST11_GROUP_DESC_REPLY,
+
+ /* OFPST 1.2+ (8): void. */
+ OFPRAW_OFPST12_GROUP_FEATURES_REQUEST,
+
+ /* OFPST 1.2+ (8): struct ofp12_group_features_stats. */
+ OFPRAW_OFPST12_GROUP_FEATURES_REPLY,
+
+ /* OFPST 1.3+ (9): struct ofp13_meter_multipart_request. */
+ OFPRAW_OFPST13_METER_REQUEST,
+
+ /* OFPST 1.3+ (9): uint8_t[8][]. */
+ OFPRAW_OFPST13_METER_REPLY,
+
+ /* OFPST 1.3+ (10): struct ofp13_meter_multipart_request. */
+ OFPRAW_OFPST13_METER_CONFIG_REQUEST,
+
+ /* OFPST 1.3+ (10): uint8_t[8][]. */
+ OFPRAW_OFPST13_METER_CONFIG_REPLY,
+
+ /* OFPST 1.3+ (11): void. */
+ OFPRAW_OFPST13_METER_FEATURES_REQUEST,
+
+ /* OFPST 1.3+ (11): struct ofp13_meter_features. */
+ OFPRAW_OFPST13_METER_FEATURES_REPLY,
+
+ /* OFPST 1.3+ (12): void. */
+ OFPRAW_OFPST13_TABLE_FEATURES_REQUEST,
+
+ /* OFPST 1.3+ (12): struct ofp13_table_features, uint8_t[8][]. */
+ OFPRAW_OFPST13_TABLE_FEATURES_REPLY,
+
+ /* OFPST 1.4+ (14): void. */
+ OFPRAW_OFPST14_TABLE_DESC_REQUEST,
+
+ /* OFPST 1.4+ (14): struct ofp14_table_desc, uint8_t[8][]. */
+ OFPRAW_OFPST14_TABLE_DESC_REPLY,
+
+ /* OFPST 1.0-1.4 (13): void. */
+ OFPRAW_OFPST10_PORT_DESC_REQUEST,
+ /* OFPST 1.5+ (13): struct ofp15_port_desc_request. */
+ OFPRAW_OFPST15_PORT_DESC_REQUEST,
+
+ /* OFPST 1.0 (13): struct ofp10_phy_port[]. */
+ OFPRAW_OFPST10_PORT_DESC_REPLY,
+ /* OFPST 1.1-1.3 (13): struct ofp11_port[]. */
+ OFPRAW_OFPST11_PORT_DESC_REPLY,
+ /* OFPST 1.4+ (13): uint8_t[8][]. */
+ OFPRAW_OFPST14_PORT_DESC_REPLY,
+
+ /* OFPST 1.4+ (15): struct ofp14_queue_desc_request. */
+ OFPRAW_OFPST14_QUEUE_DESC_REQUEST,
+ /* OFPST 1.4+ (15): uint8_t[8][]. */
+ OFPRAW_OFPST14_QUEUE_DESC_REPLY,
+
+ /* OFPST 1.4+ (16): uint8_t[8][]. */
+ OFPRAW_OFPST14_FLOW_MONITOR_REQUEST,
+ /* NXST 1.0 (2): uint8_t[8][]. */
+ OFPRAW_NXST_FLOW_MONITOR_REQUEST,
+
+ /* OFPST 1.4+ (16): uint8_t[8][]. */
+ OFPRAW_OFPST14_FLOW_MONITOR_REPLY,
+ /* NXST 1.0 (2): uint8_t[8][]. */
+ OFPRAW_NXST_FLOW_MONITOR_REPLY,
+
+/* Nicira extension messages.
+ *
+ * Nicira extensions that correspond to standard OpenFlow messages are listed
+ * alongside the standard versions above. */
+
+ /* NXT 1.0 (12): struct nx_set_flow_format. */
+ OFPRAW_NXT_SET_FLOW_FORMAT,
+
+ /* NXT 1.0+ (15): struct nx_flow_mod_table_id. */
+ OFPRAW_NXT_FLOW_MOD_TABLE_ID,
+
+ /* NXT 1.0+ (16): struct nx_set_packet_in_format. */
+ OFPRAW_NXT_SET_PACKET_IN_FORMAT,
+
+ /* NXT 1.0+ (18): void. */
+ OFPRAW_NXT_FLOW_AGE,
+
+ /* NXT 1.0+ (20): struct nx_controller_id. */
+ OFPRAW_NXT_SET_CONTROLLER_ID,
+
+ /* NXT 1.0+ (21): struct nx_flow_monitor_cancel. */
+ OFPRAW_NXT_FLOW_MONITOR_CANCEL,
+
+ /* NXT 1.0+ (22): void. */
+ OFPRAW_NXT_FLOW_MONITOR_PAUSED,
+
+ /* NXT 1.0+ (23): void. */
+ OFPRAW_NXT_FLOW_MONITOR_RESUMED,
+
+ /* NXT 1.0+ (24): struct nx_tlv_table_mod, struct nx_tlv_map[]. */
+ OFPRAW_NXT_TLV_TABLE_MOD,
+
+ /* NXT 1.0+ (25): void. */
+ OFPRAW_NXT_TLV_TABLE_REQUEST,
+
+ /* NXT 1.0+ (26): struct nx_tlv_table_reply, struct nx_tlv_map[]. */
+ OFPRAW_NXT_TLV_TABLE_REPLY,
+
+ /* NXT 1.0+ (28): uint8_t[8][]. */
+ OFPRAW_NXT_RESUME,
+};
+
+/* Decoding messages into OFPRAW_* values. */
+enum ofperr ofpraw_decode(enum ofpraw *, const struct ofp_header *);
+enum ofpraw ofpraw_decode_assert(const struct ofp_header *);
+enum ofperr ofpraw_pull(enum ofpraw *, struct ofpbuf *);
+enum ofpraw ofpraw_pull_assert(struct ofpbuf *);
+
+enum ofperr ofpraw_decode_partial(enum ofpraw *,
+ const struct ofp_header *, size_t length);
+
+/* Encoding messages using OFPRAW_* values. */
+struct ofpbuf *ofpraw_alloc(enum ofpraw, uint8_t ofp_version,
+ size_t extra_tailroom);
+struct ofpbuf *ofpraw_alloc_xid(enum ofpraw, uint8_t ofp_version,
+ ovs_be32 xid, size_t extra_tailroom);
+struct ofpbuf *ofpraw_alloc_reply(enum ofpraw,
+ const struct ofp_header *request,
+ size_t extra_tailroom);
+struct ofpbuf *ofpraw_alloc_stats_reply(const struct ofp_header *request,
+ size_t extra_tailroom);
+
+void ofpraw_put(enum ofpraw, uint8_t ofp_version, struct ofpbuf *);
+void ofpraw_put_xid(enum ofpraw, uint8_t ofp_version, ovs_be32 xid,
+ struct ofpbuf *);
+void ofpraw_put_reply(enum ofpraw, const struct ofp_header *request,
+ struct ofpbuf *);
+void ofpraw_put_stats_reply(const struct ofp_header *request, struct ofpbuf *);
+
+/* Information about OFPRAW_* values. */
+const char *ofpraw_get_name(enum ofpraw);
+enum ofpraw ofpraw_stats_request_to_reply(enum ofpraw, uint8_t version);
+
+/* Semantic identifiers for OpenFlow messages.
+ *
+ * Each OFPTYPE_* enumeration constant represents one or more concrete format
+ * of OpenFlow message. When two variants of a message have essentially the
+ * same meaning, they are assigned a single OFPTYPE_* value.
+ *
+ * The comments here must follow a stylized form because the "extract-ofp-msgs"
+ * program parses them at build time to generate data tables. The format is
+ * simply to list each OFPRAW_* enumeration constant for a given OFPTYPE_*,
+ * each followed by a period. */
+enum ofptype {
+ /* Immutable messages. */
+ OFPTYPE_HELLO, /* OFPRAW_OFPT_HELLO. */
+ OFPTYPE_ERROR, /* OFPRAW_OFPT_ERROR. */
+ OFPTYPE_ECHO_REQUEST, /* OFPRAW_OFPT_ECHO_REQUEST. */
+ OFPTYPE_ECHO_REPLY, /* OFPRAW_OFPT_ECHO_REPLY. */
+
+ /* Switch configuration messages. */
+ OFPTYPE_FEATURES_REQUEST, /* OFPRAW_OFPT_FEATURES_REQUEST. */
+ OFPTYPE_FEATURES_REPLY, /* OFPRAW_OFPT10_FEATURES_REPLY.
+ * OFPRAW_OFPT11_FEATURES_REPLY.
+ * OFPRAW_OFPT13_FEATURES_REPLY. */
+ OFPTYPE_GET_CONFIG_REQUEST, /* OFPRAW_OFPT_GET_CONFIG_REQUEST. */
+ OFPTYPE_GET_CONFIG_REPLY, /* OFPRAW_OFPT_GET_CONFIG_REPLY. */
+ OFPTYPE_SET_CONFIG, /* OFPRAW_OFPT_SET_CONFIG. */
+
+ /* Asynchronous messages. */
+ OFPTYPE_PACKET_IN, /* OFPRAW_OFPT10_PACKET_IN.
+ * OFPRAW_OFPT11_PACKET_IN.
+ * OFPRAW_OFPT12_PACKET_IN.
+ * OFPRAW_OFPT13_PACKET_IN.
+ * OFPRAW_NXT_PACKET_IN2.
+ * OFPRAW_NXT_PACKET_IN. */
+ OFPTYPE_FLOW_REMOVED, /* OFPRAW_OFPT10_FLOW_REMOVED.
+ * OFPRAW_OFPT11_FLOW_REMOVED.
+ * OFPRAW_NXT_FLOW_REMOVED. */
+ OFPTYPE_PORT_STATUS, /* OFPRAW_OFPT10_PORT_STATUS.
+ * OFPRAW_OFPT11_PORT_STATUS.
+ * OFPRAW_OFPT14_PORT_STATUS. */
+
+ /* Controller command messages. */
+ OFPTYPE_PACKET_OUT, /* OFPRAW_OFPT10_PACKET_OUT.
+ * OFPRAW_OFPT11_PACKET_OUT. */
+ OFPTYPE_FLOW_MOD, /* OFPRAW_OFPT10_FLOW_MOD.
+ * OFPRAW_OFPT11_FLOW_MOD.
+ * OFPRAW_NXT_FLOW_MOD. */
+ OFPTYPE_GROUP_MOD, /* OFPRAW_OFPT11_GROUP_MOD.
+ * OFPRAW_OFPT15_GROUP_MOD. */
+ OFPTYPE_PORT_MOD, /* OFPRAW_OFPT10_PORT_MOD.
+ * OFPRAW_OFPT11_PORT_MOD.
+ * OFPRAW_OFPT14_PORT_MOD. */
+ OFPTYPE_TABLE_MOD, /* OFPRAW_OFPT11_TABLE_MOD.
+ * OFPRAW_OFPT14_TABLE_MOD. */
+
+ /* Barrier messages. */
+ OFPTYPE_BARRIER_REQUEST, /* OFPRAW_OFPT10_BARRIER_REQUEST.
+ * OFPRAW_OFPT11_BARRIER_REQUEST. */
+ OFPTYPE_BARRIER_REPLY, /* OFPRAW_OFPT10_BARRIER_REPLY.
+ * OFPRAW_OFPT11_BARRIER_REPLY. */
+
+ /* Queue Configuration messages. */
+ OFPTYPE_QUEUE_GET_CONFIG_REQUEST, /*
OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST.
+ *
OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST.
+ * OFPRAW_OFPST14_QUEUE_DESC_REQUEST. */
+ OFPTYPE_QUEUE_GET_CONFIG_REPLY, /* OFPRAW_OFPT10_QUEUE_GET_CONFIG_REPLY.
+ * OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY.
+ * OFPRAW_OFPST14_QUEUE_DESC_REPLY. */
+
+ /* Controller role change request messages. */
+ OFPTYPE_ROLE_REQUEST, /* OFPRAW_OFPT12_ROLE_REQUEST.
+ * OFPRAW_NXT_ROLE_REQUEST. */
+ OFPTYPE_ROLE_REPLY, /* OFPRAW_OFPT12_ROLE_REPLY.
+ * OFPRAW_NXT_ROLE_REPLY. */
+
+ /* Asynchronous message configuration. */
+ OFPTYPE_GET_ASYNC_REQUEST, /* OFPRAW_OFPT13_GET_ASYNC_REQUEST.
+ * OFPRAW_OFPT14_GET_ASYNC_REQUEST. */
+ OFPTYPE_GET_ASYNC_REPLY, /* OFPRAW_OFPT13_GET_ASYNC_REPLY.
+ * OFPRAW_OFPT14_GET_ASYNC_REPLY. */
+ OFPTYPE_SET_ASYNC_CONFIG, /* OFPRAW_NXT_SET_ASYNC_CONFIG.
+ * OFPRAW_NXT_SET_ASYNC_CONFIG2.
+ * OFPRAW_OFPT13_SET_ASYNC.
+ * OFPRAW_OFPT14_SET_ASYNC. */
+
+ /* Meters and rate limiters configuration messages. */
+ OFPTYPE_METER_MOD, /* OFPRAW_OFPT13_METER_MOD. */
+
+ /* Controller role change event messages. */
+ OFPTYPE_ROLE_STATUS, /* OFPRAW_OFPT14_ROLE_STATUS. */
+
+ /* Request forwarding by the switch. */
+ OFPTYPE_REQUESTFORWARD, /* OFPRAW_OFPT14_REQUESTFORWARD. */
+
+ /* Asynchronous messages. */
+ OFPTYPE_TABLE_STATUS, /* OFPRAW_OFPT14_TABLE_STATUS. */
+
+ OFPTYPE_BUNDLE_CONTROL, /* OFPRAW_OFPT14_BUNDLE_CONTROL.
+ * OFPRAW_ONFT13_BUNDLE_CONTROL. */
+
+ OFPTYPE_BUNDLE_ADD_MESSAGE, /* OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE.
+ * OFPRAW_ONFT13_BUNDLE_ADD_MESSAGE. */
+
+ /* Statistics. */
+ OFPTYPE_DESC_STATS_REQUEST, /* OFPRAW_OFPST_DESC_REQUEST. */
+ OFPTYPE_DESC_STATS_REPLY, /* OFPRAW_OFPST_DESC_REPLY. */
+ OFPTYPE_FLOW_STATS_REQUEST, /* OFPRAW_OFPST10_FLOW_REQUEST.
+ * OFPRAW_OFPST11_FLOW_REQUEST.
+ * OFPRAW_NXST_FLOW_REQUEST. */
+ OFPTYPE_FLOW_STATS_REPLY, /* OFPRAW_OFPST10_FLOW_REPLY.
+ * OFPRAW_OFPST11_FLOW_REPLY.
+ * OFPRAW_OFPST13_FLOW_REPLY.
+ * OFPRAW_NXST_FLOW_REPLY. */
+ OFPTYPE_AGGREGATE_STATS_REQUEST, /* OFPRAW_OFPST10_AGGREGATE_REQUEST.
+ * OFPRAW_OFPST11_AGGREGATE_REQUEST.
+ * OFPRAW_NXST_AGGREGATE_REQUEST. */
+ OFPTYPE_AGGREGATE_STATS_REPLY, /* OFPRAW_OFPST_AGGREGATE_REPLY.
+ * OFPRAW_NXST_AGGREGATE_REPLY. */
+ OFPTYPE_TABLE_STATS_REQUEST, /* OFPRAW_OFPST_TABLE_REQUEST. */
+ OFPTYPE_TABLE_STATS_REPLY, /* OFPRAW_OFPST10_TABLE_REPLY.
+ * OFPRAW_OFPST11_TABLE_REPLY.
+ * OFPRAW_OFPST12_TABLE_REPLY.
+ * OFPRAW_OFPST13_TABLE_REPLY. */
+ OFPTYPE_PORT_STATS_REQUEST, /* OFPRAW_OFPST10_PORT_REQUEST.
+ * OFPRAW_OFPST11_PORT_REQUEST. */
+ OFPTYPE_PORT_STATS_REPLY, /* OFPRAW_OFPST10_PORT_REPLY.
+ * OFPRAW_OFPST11_PORT_REPLY.
+ * OFPRAW_OFPST13_PORT_REPLY.
+ * OFPRAW_OFPST14_PORT_REPLY. */
+ OFPTYPE_QUEUE_STATS_REQUEST, /* OFPRAW_OFPST10_QUEUE_REQUEST.
+ * OFPRAW_OFPST11_QUEUE_REQUEST. */
+ OFPTYPE_QUEUE_STATS_REPLY, /* OFPRAW_OFPST10_QUEUE_REPLY.
+ * OFPRAW_OFPST11_QUEUE_REPLY.
+ * OFPRAW_OFPST13_QUEUE_REPLY.
+ * OFPRAW_OFPST14_QUEUE_REPLY. */
+
+ OFPTYPE_GROUP_STATS_REQUEST, /* OFPRAW_OFPST11_GROUP_REQUEST. */
+
+ OFPTYPE_GROUP_STATS_REPLY, /* OFPRAW_OFPST11_GROUP_REPLY.
+ * OFPRAW_OFPST13_GROUP_REPLY. */
+
+ OFPTYPE_GROUP_DESC_STATS_REQUEST, /* OFPRAW_OFPST11_GROUP_DESC_REQUEST.
+ * OFPRAW_OFPST15_GROUP_DESC_REQUEST. */
+
+ OFPTYPE_GROUP_DESC_STATS_REPLY, /* OFPRAW_OFPST11_GROUP_DESC_REPLY. */
+
+ OFPTYPE_GROUP_FEATURES_STATS_REQUEST, /*
OFPRAW_OFPST12_GROUP_FEATURES_REQUEST. */
+
+ OFPTYPE_GROUP_FEATURES_STATS_REPLY, /*
OFPRAW_OFPST12_GROUP_FEATURES_REPLY. */
+
+ OFPTYPE_METER_STATS_REQUEST, /* OFPRAW_OFPST13_METER_REQUEST. */
+
+ OFPTYPE_METER_STATS_REPLY, /* OFPRAW_OFPST13_METER_REPLY. */
+
+ OFPTYPE_METER_CONFIG_STATS_REQUEST, /*
OFPRAW_OFPST13_METER_CONFIG_REQUEST. */
+
+ OFPTYPE_METER_CONFIG_STATS_REPLY, /* OFPRAW_OFPST13_METER_CONFIG_REPLY. */
+
+ OFPTYPE_METER_FEATURES_STATS_REQUEST, /*
OFPRAW_OFPST13_METER_FEATURES_REQUEST. */
+
+ OFPTYPE_METER_FEATURES_STATS_REPLY, /*
OFPRAW_OFPST13_METER_FEATURES_REPLY. */
+
+ OFPTYPE_TABLE_FEATURES_STATS_REQUEST, /*
OFPRAW_OFPST13_TABLE_FEATURES_REQUEST. */
+
+ OFPTYPE_TABLE_FEATURES_STATS_REPLY, /*
OFPRAW_OFPST13_TABLE_FEATURES_REPLY. */
+
+ OFPTYPE_TABLE_DESC_REQUEST, /* OFPRAW_OFPST14_TABLE_DESC_REQUEST. */
+
+ OFPTYPE_TABLE_DESC_REPLY, /* OFPRAW_OFPST14_TABLE_DESC_REPLY. */
+
+ OFPTYPE_PORT_DESC_STATS_REQUEST, /* OFPRAW_OFPST10_PORT_DESC_REQUEST.
+ * OFPRAW_OFPST15_PORT_DESC_REQUEST. */
+
+ OFPTYPE_PORT_DESC_STATS_REPLY, /* OFPRAW_OFPST10_PORT_DESC_REPLY.
+ * OFPRAW_OFPST11_PORT_DESC_REPLY.
+ * OFPRAW_OFPST14_PORT_DESC_REPLY. */
+
+ OFPTYPE_FLOW_MONITOR_STATS_REQUEST, /* OFPRAW_OFPST14_FLOW_MONITOR_REQUEST.
+ * OFPRAW_NXST_FLOW_MONITOR_REQUEST. */
+ OFPTYPE_FLOW_MONITOR_STATS_REPLY, /* OFPRAW_OFPST14_FLOW_MONITOR_REPLY.
+ * OFPRAW_NXST_FLOW_MONITOR_REPLY. */
+
+ /* Nicira extensions. */
+ OFPTYPE_SET_FLOW_FORMAT, /* OFPRAW_NXT_SET_FLOW_FORMAT. */
+ OFPTYPE_FLOW_MOD_TABLE_ID, /* OFPRAW_NXT_FLOW_MOD_TABLE_ID. */
+ OFPTYPE_SET_PACKET_IN_FORMAT, /* OFPRAW_NXT_SET_PACKET_IN_FORMAT. */
+ OFPTYPE_FLOW_AGE, /* OFPRAW_NXT_FLOW_AGE. */
+ OFPTYPE_SET_CONTROLLER_ID, /* OFPRAW_NXT_SET_CONTROLLER_ID. */
+ OFPTYPE_NXT_TLV_TABLE_MOD, /* OFPRAW_NXT_TLV_TABLE_MOD. */
+ OFPTYPE_NXT_TLV_TABLE_REQUEST, /* OFPRAW_NXT_TLV_TABLE_REQUEST. */
+ OFPTYPE_NXT_TLV_TABLE_REPLY, /* OFPRAW_NXT_TLV_TABLE_REPLY. */
+ OFPTYPE_NXT_RESUME, /* OFPRAW_NXT_RESUME. */
+
+ /* Flow monitor extension. */
+ OFPTYPE_FLOW_MONITOR_CANCEL, /* OFPRAW_NXT_FLOW_MONITOR_CANCEL. */
+ OFPTYPE_FLOW_MONITOR_PAUSED, /* OFPRAW_NXT_FLOW_MONITOR_PAUSED. */
+ OFPTYPE_FLOW_MONITOR_RESUMED, /* OFPRAW_NXT_FLOW_MONITOR_RESUMED. */
+};
+
+/* Decoding messages into OFPTYPE_* values. */
+enum ofperr ofptype_decode(enum ofptype *, const struct ofp_header *);
+enum ofperr ofptype_pull(enum ofptype *, struct ofpbuf *);
+enum ofptype ofptype_from_ofpraw(enum ofpraw);
+
+/* Information about OFTYPE_* values. */
+const char *ofptype_get_name(enum ofptype);
+
+/* OpenFlow message properties. */
+void ofpmsg_update_length(struct ofpbuf *);
+const void *ofpmsg_body(const struct ofp_header *);
+bool ofpmsg_is_stat_request(const struct ofp_header *);
+
+/* Multipart messages (aka "statistics").
+ *
+ * Individual OpenFlow messages are limited to 64 kB in size, but some messages
+ * need to be longer. Therefore, multipart messages allow a longer message to
+ * be divided into multiple parts at some convenient boundary. For example,
+ * limiting the response to a "flow dump" request to 64 kB would unreasonably
+ * limit the maximum number of flows in an OpenFlow switch, so a "flow dump" is
+ * expressed as a multipart request/reply pair, with the reply broken into
+ * pieces between flows.
+ *
+ * Multipart messages always consist of a request/reply pair.
+ *
+ * In OpenFlow 1.0, 1.1, and 1.2, requests must always fit in a single message,
+ * that is, only a multipart reply may have more than one part. OpenFlow 1.3
+ * adds one multipart request. This code does not yet support multipart
+ * requests. */
+
+/* Encoding multipart replies.
+ *
+ * These functions are useful for multipart replies that might really require
+ * more than one message. A multipart message that is known in advance to fit
+ * within 64 kB doesn't need any special treatment, so you might as well use
+ * the ofpraw_alloc_*() functions.
+ *
+ * These functions work with a "struct ovs_list" of "struct ofpbuf"s, each of
+ * which represents one part of a multipart message. */
+void ofpmp_init(struct ovs_list *, const struct ofp_header *request);
+struct ofpbuf *ofpmp_reserve(struct ovs_list *, size_t len);
+void *ofpmp_append(struct ovs_list *, size_t len);
+void ofpmp_postappend(struct ovs_list *, size_t start_ofs);
+
+enum ofp_version ofpmp_version(struct ovs_list *);
+enum ofpraw ofpmp_decode_raw(struct ovs_list *);
+
+/* Decoding multipart replies. */
+uint16_t ofpmp_flags(const struct ofp_header *);
+bool ofpmp_more(const struct ofp_header *);
+
+#endif /* ofp-msgs.h */
diff --git a/lib/automake.mk b/lib/automake.mk
index 541fe54..bc8b3f4 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -141,7 +141,6 @@ lib_libopenvswitch_la_SOURCES = \
lib/ofp-actions.h \
lib/ofp-errors.c \
lib/ofp-msgs.c \
- lib/ofp-msgs.h \
lib/ofp-parse.c \
lib/ofp-print.c \
lib/ofp-print.h \
@@ -495,9 +494,9 @@ lib/ofp-errors.lo: lib/ofp-errors.inc
CLEANFILES += lib/ofp-errors.inc
EXTRA_DIST += build-aux/extract-ofp-errors
-lib/ofp-msgs.inc: lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
+lib/ofp-msgs.inc: include/openvswitch/ofp-msgs.h
$(srcdir)/build-aux/extract-ofp-msgs
$(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
- $(srcdir)/lib/ofp-msgs.h $@ > [email protected] && mv [email protected] $@
+ $(srcdir)/include/openvswitch/ofp-msgs.h $@ > [email protected] && mv
[email protected] $@
lib/ofp-msgs.lo: lib/ofp-msgs.inc
CLEANFILES += lib/ofp-msgs.inc
EXTRA_DIST += build-aux/extract-ofp-msgs
diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index 9317983..0dc093a 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -29,21 +29,21 @@
#include "flow.h"
#include "hmap.h"
#include "mac-learning.h"
-#include "openvswitch/ofpbuf.h"
#include "ofp-actions.h"
-#include "ofp-msgs.h"
#include "ofp-print.h"
-#include "openvswitch/ofp-util.h"
#include "openflow/openflow.h"
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofp-parse.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vconn.h"
+#include "openvswitch/vlog.h"
#include "poll-loop.h"
#include "rconn.h"
#include "shash.h"
#include "simap.h"
#include "timeval.h"
-#include "openvswitch/ofp-errors.h"
-#include "openvswitch/ofp-parse.h"
-#include "openvswitch/vconn.h"
-#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(learning_switch);
diff --git a/lib/ofp-errors.c b/lib/ofp-errors.c
index c6a92e2..4f7bf80 100644
--- a/lib/ofp-errors.c
+++ b/lib/ofp-errors.c
@@ -17,13 +17,14 @@
#include <config.h>
#include <errno.h>
#include "byte-order.h"
+#include "openflow/openflow.h"
#include "openvswitch/dynamic-string.h"
-#include "ofp-msgs.h"
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
-#include "openflow/openflow.h"
-#include "openvswitch/ofp-errors.h"
#include "openvswitch/vlog.h"
+#include "util.h"
VLOG_DEFINE_THIS_MODULE(ofp_errors);
diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c
index 0cfea4f..76d3511 100644
--- a/lib/ofp-msgs.c
+++ b/lib/ofp-msgs.c
@@ -15,16 +15,16 @@
*/
#include <config.h>
-#include "ofp-msgs.h"
#include "byte-order.h"
-#include "openvswitch/dynamic-string.h"
#include "hash.h"
#include "hmap.h"
-#include "openvswitch/ofpbuf.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
-#include "ovs-thread.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofpbuf.h"
#include "openvswitch/vlog.h"
+#include "ovs-thread.h"
VLOG_DEFINE_THIS_MODULE(ofp_msgs);
diff --git a/lib/ofp-msgs.h b/lib/ofp-msgs.h
deleted file mode 100644
index 462a255..0000000
--- a/lib/ofp-msgs.h
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OFP_MSGS_H
-#define OFP_MSGS_H 1
-
-/* OpenFlow message headers abstraction.
- *
- * OpenFlow headers are unnecessarily complicated:
- *
- * - Some messages with the same meaning were renumbered between 1.0 and 1.1.
- *
- * - "Statistics" (aka multipart) messages have a different format from other
- * messages.
- *
- * - The 1.0 header for statistics messages is an odd number of 32-bit words
- * long, leaving 64-bit quantities in the body misaligned. The 1.1 header
- * for statistics added a padding word to fix this misalignment, although
- * many statistic message bodies did not change.
- *
- * - Vendor-defined messages have an additional header but no standard way to
- * distinguish individual types of message within a given vendor.
- *
- * This file attempts to abstract out the differences between the various forms
- * of headers.
- */
-
-#include "openvswitch/ofp-errors.h"
-#include "openvswitch/types.h"
-#include "util.h"
-
-struct ovs_list;
-
-/* Raw identifiers for OpenFlow messages.
- *
- * Some OpenFlow messages with similar meanings have multiple variants across
- * OpenFlow versions or vendor extensions. Each variant has a different
- * OFPRAW_* enumeration constant. More specifically, if two messages have
- * different types, different numbers, or different arguments, then they must
- * have different OFPRAW_* values.
- *
- * The comments here must follow a stylized form because the "extract-ofp-msgs"
- * program parses them at build time to generate data tables. The syntax of
- * each comment is:
- *
- * type versions (number): arguments.
- *
- * where the syntax of each part is:
- *
- * - type: One of the following:
- *
- * * OFPT: standard OpenFlow message.
- * * OFPST: standard OpenFlow statistics or multipart message.
- * * NXT: Nicira extension message.
- * * NXST: Nicira extension statistics or multipart message.
- * * ONFT: Open Networking Foundation extension message.
- * * ONFST: Open Networking Foundation multipart message.
- *
- * As new vendors implement extensions it will make sense to expand the
- * dictionary of possible types.
- *
- * - versions: The OpenFlow version or versions in which this message is
- * supported, e.g. "1.0" or "1.1" or "1.0+".
- *
- * - number:
- * For OFPT, the 'type' in struct ofp_header.
- * For OFPST, the 'type' in struct ofp_stats_msg or ofp11_stats_msg.
- * For NXT or ONFT, the 'subtype' in struct ofp_vendor_header.
- * For NXST or ONFST, the 'subtype' in an appropriate vendor stats
- * struct.
- *
- * - arguments: The types of data that follow the OpenFlow headers (the
- * message "body"). This can be "void" if the message has no body.
- * Otherwise, it should be a comma-separated sequence of C types. The
- * last type in the sequence can end with [] if the body ends in a
- * variable-length sequence.
- *
- * The arguments are used to validate the lengths of messages when a
- * header is parsed. Any message whose length isn't valid as a length of
- * the specified types will be rejected with OFPERR_OFPBRC_BAD_LEN.
- *
- * A few OpenFlow messages, such as OFPT_PACKET_IN, intentionally end with
- * only part of a structure, up to some specified member. The syntax "up
- * to <member>" indicates this, e.g. "struct ofp11_packet_in up to data".
- */
-enum ofpraw {
-/* Immutable standard messages.
- *
- * The OpenFlow standard promises to preserve these messages and their numbers
- * in future versions, so we mark them as <all>, which covers every OpenFlow
- * version numbered 0x01...0xff, rather than as OF1.0+, which covers only
- * OpenFlow versions that we otherwise implement.
- *
- * Without <all> here, then we would fail to decode "hello" messages that
- * announce a version higher than we understand, even though there still could
- * be a version in common with the peer that we do understand. The <all>
- * keyword is less useful for the other messages, because our OpenFlow channels
- * accept only OpenFlow messages with a previously negotiated version.
- */
-
- /* OFPT <all> (0): uint8_t[]. */
- OFPRAW_OFPT_HELLO,
-
- /* OFPT <all> (1): struct ofp_error_msg, uint8_t[]. */
- OFPRAW_OFPT_ERROR,
-
- /* OFPT <all> (2): uint8_t[]. */
- OFPRAW_OFPT_ECHO_REQUEST,
-
- /* OFPT <all> (3): uint8_t[]. */
- OFPRAW_OFPT_ECHO_REPLY,
-
-/* Other standard messages.
- *
- * The meanings of these messages can (and often do) change from one version
- * of OpenFlow to another. */
-
- /* OFPT 1.0+ (5): void. */
- OFPRAW_OFPT_FEATURES_REQUEST,
-
- /* OFPT 1.0 (6): struct ofp_switch_features, struct ofp10_phy_port[]. */
- OFPRAW_OFPT10_FEATURES_REPLY,
- /* OFPT 1.1-1.2 (6): struct ofp_switch_features, struct ofp11_port[]. */
- OFPRAW_OFPT11_FEATURES_REPLY,
- /* OFPT 1.3+ (6): struct ofp_switch_features. */
- OFPRAW_OFPT13_FEATURES_REPLY,
-
- /* OFPT 1.0+ (7): void. */
- OFPRAW_OFPT_GET_CONFIG_REQUEST,
-
- /* OFPT 1.0+ (8): struct ofp_switch_config. */
- OFPRAW_OFPT_GET_CONFIG_REPLY,
-
- /* OFPT 1.0+ (9): struct ofp_switch_config. */
- OFPRAW_OFPT_SET_CONFIG,
-
- /* OFPT 1.0 (10): struct ofp10_packet_in up to data, uint8_t[]. */
- OFPRAW_OFPT10_PACKET_IN,
- /* OFPT 1.1 (10): struct ofp11_packet_in, uint8_t[]. */
- OFPRAW_OFPT11_PACKET_IN,
- /* OFPT 1.2 (10): struct ofp12_packet_in, uint8_t[]. */
- OFPRAW_OFPT12_PACKET_IN,
- /* OFPT 1.3+ (10): struct ofp12_packet_in, ovs_be64, uint8_t[]. */
- OFPRAW_OFPT13_PACKET_IN,
- /* NXT 1.0+ (17): struct nx_packet_in, uint8_t[]. */
- OFPRAW_NXT_PACKET_IN,
- /* NXT 1.0+ (30): uint8_t[8][]. */
- OFPRAW_NXT_PACKET_IN2,
-
- /* OFPT 1.0 (11): struct ofp10_flow_removed. */
- OFPRAW_OFPT10_FLOW_REMOVED,
- /* OFPT 1.1+ (11): struct ofp11_flow_removed, uint8_t[8][]. */
- OFPRAW_OFPT11_FLOW_REMOVED,
- /* NXT 1.0+ (14): struct nx_flow_removed, uint8_t[8][]. */
- OFPRAW_NXT_FLOW_REMOVED,
-
- /* OFPT 1.0 (12): struct ofp_port_status, struct ofp10_phy_port. */
- OFPRAW_OFPT10_PORT_STATUS,
- /* OFPT 1.1-1.3 (12): struct ofp_port_status, struct ofp11_port. */
- OFPRAW_OFPT11_PORT_STATUS,
- /* OFPT 1.4+ (12): struct ofp_port_status, struct ofp14_port,
uint8_t[8][]. */
- OFPRAW_OFPT14_PORT_STATUS,
-
- /* OFPT 1.0 (13): struct ofp10_packet_out, uint8_t[]. */
- OFPRAW_OFPT10_PACKET_OUT,
- /* OFPT 1.1+ (13): struct ofp11_packet_out, uint8_t[]. */
- OFPRAW_OFPT11_PACKET_OUT,
-
- /* OFPT 1.0 (14): struct ofp10_flow_mod, uint8_t[8][]. */
- OFPRAW_OFPT10_FLOW_MOD,
- /* OFPT 1.1+ (14): struct ofp11_flow_mod, struct ofp11_instruction[]. */
- OFPRAW_OFPT11_FLOW_MOD,
- /* NXT 1.0+ (13): struct nx_flow_mod, uint8_t[8][]. */
- OFPRAW_NXT_FLOW_MOD,
-
- /* OFPT 1.1-1.4 (15): struct ofp11_group_mod, uint8_t[8][]. */
- OFPRAW_OFPT11_GROUP_MOD,
- /* OFPT 1.5+ (15): struct ofp15_group_mod, uint8_t[8][]. */
- OFPRAW_OFPT15_GROUP_MOD,
-
- /* OFPT 1.0 (15): struct ofp10_port_mod. */
- OFPRAW_OFPT10_PORT_MOD,
- /* OFPT 1.1-1.3 (16): struct ofp11_port_mod. */
- OFPRAW_OFPT11_PORT_MOD,
- /* OFPT 1.4+ (16): struct ofp14_port_mod, uint8_t[8][]. */
- OFPRAW_OFPT14_PORT_MOD,
-
- /* OFPT 1.1-1.3 (17): struct ofp11_table_mod. */
- OFPRAW_OFPT11_TABLE_MOD,
- /* OFPT 1.4+ (17): struct ofp14_table_mod, uint8_t[8][]. */
- OFPRAW_OFPT14_TABLE_MOD,
-
- /* OFPT 1.0 (18): void. */
- OFPRAW_OFPT10_BARRIER_REQUEST,
- /* OFPT 1.1+ (20): void. */
- OFPRAW_OFPT11_BARRIER_REQUEST,
-
- /* OFPT 1.0 (19): void. */
- OFPRAW_OFPT10_BARRIER_REPLY,
- /* OFPT 1.1+ (21): void. */
- OFPRAW_OFPT11_BARRIER_REPLY,
-
- /* OFPT 1.0 (20): struct ofp10_queue_get_config_request. */
- OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST,
- /* OFPT 1.1-1.3 (22): struct ofp11_queue_get_config_request. */
- OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST,
-
- /* OFPT 1.0 (21): struct ofp10_queue_get_config_reply, uint8_t[8][]. */
- OFPRAW_OFPT10_QUEUE_GET_CONFIG_REPLY,
- /* OFPT 1.1-1.3 (23): struct ofp11_queue_get_config_reply, uint8_t[8][]. */
- OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY,
-
- /* OFPT 1.2+ (24): struct ofp12_role_request. */
- OFPRAW_OFPT12_ROLE_REQUEST,
- /* NXT 1.0+ (10): struct nx_role_request. */
- OFPRAW_NXT_ROLE_REQUEST,
-
- /* OFPT 1.2+ (25): struct ofp12_role_request. */
- OFPRAW_OFPT12_ROLE_REPLY,
- /* NXT 1.0+ (11): struct nx_role_request. */
- OFPRAW_NXT_ROLE_REPLY,
-
- /* OFPT 1.3 (26): void. */
- OFPRAW_OFPT13_GET_ASYNC_REQUEST,
- /* OFPT 1.4+ (26): void. */
- OFPRAW_OFPT14_GET_ASYNC_REQUEST,
- /* OFPT 1.3 (27): struct ofp13_async_config. */
- OFPRAW_OFPT13_GET_ASYNC_REPLY,
- /* OFPT 1.4+ (27): uint8_t[8][]. */
- OFPRAW_OFPT14_GET_ASYNC_REPLY,
- /* OFPT 1.3 (28): struct ofp13_async_config. */
- OFPRAW_OFPT13_SET_ASYNC,
- /* NXT 1.0+ (19): struct nx_async_config. */
- OFPRAW_NXT_SET_ASYNC_CONFIG,
- /* NXT 1.0-1.3 (27): uint8_t[8][]. */
- OFPRAW_NXT_SET_ASYNC_CONFIG2,
- /* OFPT 1.4+ (28): uint8_t[8][]. */
- OFPRAW_OFPT14_SET_ASYNC,
-
- /* OFPT 1.3+ (29): struct ofp13_meter_mod, uint8_t[8][]. */
- OFPRAW_OFPT13_METER_MOD,
-
- /* OFPT 1.4+ (30): struct ofp14_role_status, uint8_t[8][]. */
- OFPRAW_OFPT14_ROLE_STATUS,
-
- /* OFPT 1.4+ (31): struct ofp14_table_status, uint8_t[8][]. */
- OFPRAW_OFPT14_TABLE_STATUS,
-
- /* OFPT 1.4+ (32): struct ofp14_requestforward, uint8_t[8][]. */
- OFPRAW_OFPT14_REQUESTFORWARD,
-
- /* OFPT 1.4+ (33): struct ofp14_bundle_ctrl_msg, uint8_t[8][]. */
- OFPRAW_OFPT14_BUNDLE_CONTROL,
- /* ONFT 1.3 (2300): struct ofp14_bundle_ctrl_msg, uint8_t[8][]. */
- OFPRAW_ONFT13_BUNDLE_CONTROL,
-
- /* OFPT 1.4+ (34): struct ofp14_bundle_ctrl_msg, uint8_t[]. */
- OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE,
- /* ONFT 1.3 (2301): struct ofp14_bundle_ctrl_msg, uint8_t[]. */
- OFPRAW_ONFT13_BUNDLE_ADD_MESSAGE,
-
-/* Standard statistics. */
-
- /* OFPST 1.0+ (0): void. */
- OFPRAW_OFPST_DESC_REQUEST,
-
- /* OFPST 1.0+ (0): struct ofp_desc_stats. */
- OFPRAW_OFPST_DESC_REPLY,
-
- /* OFPST 1.0 (1): struct ofp10_flow_stats_request. */
- OFPRAW_OFPST10_FLOW_REQUEST,
- /* OFPST 1.1+ (1): struct ofp11_flow_stats_request, uint8_t[8][]. */
- OFPRAW_OFPST11_FLOW_REQUEST,
- /* NXST 1.0 (0): struct nx_flow_stats_request, uint8_t[8][]. */
- OFPRAW_NXST_FLOW_REQUEST,
-
- /* OFPST 1.0 (1): uint8_t[]. */
- OFPRAW_OFPST10_FLOW_REPLY,
- /* OFPST 1.1-1.2 (1): uint8_t[]. */
- OFPRAW_OFPST11_FLOW_REPLY,
- /* OFPST 1.3+ (1): uint8_t[]. */
- OFPRAW_OFPST13_FLOW_REPLY,
- /* NXST 1.0 (0): uint8_t[]. */
- OFPRAW_NXST_FLOW_REPLY,
-
- /* OFPST 1.0 (2): struct ofp10_flow_stats_request. */
- OFPRAW_OFPST10_AGGREGATE_REQUEST,
- /* OFPST 1.1+ (2): struct ofp11_flow_stats_request, uint8_t[8][]. */
- OFPRAW_OFPST11_AGGREGATE_REQUEST,
- /* NXST 1.0 (1): struct nx_flow_stats_request, uint8_t[8][]. */
- OFPRAW_NXST_AGGREGATE_REQUEST,
-
- /* OFPST 1.0+ (2): struct ofp_aggregate_stats_reply. */
- OFPRAW_OFPST_AGGREGATE_REPLY,
- /* NXST 1.0 (1): struct ofp_aggregate_stats_reply. */
- OFPRAW_NXST_AGGREGATE_REPLY,
-
- /* OFPST 1.0+ (3): void. */
- OFPRAW_OFPST_TABLE_REQUEST,
-
- /* OFPST 1.0 (3): struct ofp10_table_stats[]. */
- OFPRAW_OFPST10_TABLE_REPLY,
- /* OFPST 1.1 (3): struct ofp11_table_stats[]. */
- OFPRAW_OFPST11_TABLE_REPLY,
- /* OFPST 1.2 (3): struct ofp12_table_stats[]. */
- OFPRAW_OFPST12_TABLE_REPLY,
- /* OFPST 1.3+ (3): struct ofp13_table_stats[]. */
- OFPRAW_OFPST13_TABLE_REPLY,
-
- /* OFPST 1.0 (4): struct ofp10_port_stats_request. */
- OFPRAW_OFPST10_PORT_REQUEST,
- /* OFPST 1.1+ (4): struct ofp11_port_stats_request. */
- OFPRAW_OFPST11_PORT_REQUEST,
-
- /* OFPST 1.0 (4): struct ofp10_port_stats[]. */
- OFPRAW_OFPST10_PORT_REPLY,
- /* OFPST 1.1-1.2 (4): struct ofp11_port_stats[]. */
- OFPRAW_OFPST11_PORT_REPLY,
- /* OFPST 1.3 (4): struct ofp13_port_stats[]. */
- OFPRAW_OFPST13_PORT_REPLY,
- /* OFPST 1.4+ (4): uint8_t[8][]. */
- OFPRAW_OFPST14_PORT_REPLY,
-
- /* OFPST 1.0 (5): struct ofp10_queue_stats_request. */
- OFPRAW_OFPST10_QUEUE_REQUEST,
- /* OFPST 1.1+ (5): struct ofp11_queue_stats_request. */
- OFPRAW_OFPST11_QUEUE_REQUEST,
-
- /* OFPST 1.0 (5): struct ofp10_queue_stats[]. */
- OFPRAW_OFPST10_QUEUE_REPLY,
- /* OFPST 1.1-1.2 (5): struct ofp11_queue_stats[]. */
- OFPRAW_OFPST11_QUEUE_REPLY,
- /* OFPST 1.3 (5): struct ofp13_queue_stats[]. */
- OFPRAW_OFPST13_QUEUE_REPLY,
- /* OFPST 1.4+ (5): uint8_t[8][]. */
- OFPRAW_OFPST14_QUEUE_REPLY,
-
- /* OFPST 1.1+ (6): struct ofp11_group_stats_request. */
- OFPRAW_OFPST11_GROUP_REQUEST,
-
- /* OFPST 1.1-1.2 (6): uint8_t[8][]. */
- OFPRAW_OFPST11_GROUP_REPLY,
- /* OFPST 1.3+ (6): uint8_t[8][]. */
- OFPRAW_OFPST13_GROUP_REPLY,
-
- /* OFPST 1.1-1.4 (7): void. */
- OFPRAW_OFPST11_GROUP_DESC_REQUEST,
- /* OFPST 1.5+ (7): struct ofp15_group_desc_request. */
- OFPRAW_OFPST15_GROUP_DESC_REQUEST,
-
- /* OFPST 1.1+ (7): uint8_t[8][]. */
- OFPRAW_OFPST11_GROUP_DESC_REPLY,
-
- /* OFPST 1.2+ (8): void. */
- OFPRAW_OFPST12_GROUP_FEATURES_REQUEST,
-
- /* OFPST 1.2+ (8): struct ofp12_group_features_stats. */
- OFPRAW_OFPST12_GROUP_FEATURES_REPLY,
-
- /* OFPST 1.3+ (9): struct ofp13_meter_multipart_request. */
- OFPRAW_OFPST13_METER_REQUEST,
-
- /* OFPST 1.3+ (9): uint8_t[8][]. */
- OFPRAW_OFPST13_METER_REPLY,
-
- /* OFPST 1.3+ (10): struct ofp13_meter_multipart_request. */
- OFPRAW_OFPST13_METER_CONFIG_REQUEST,
-
- /* OFPST 1.3+ (10): uint8_t[8][]. */
- OFPRAW_OFPST13_METER_CONFIG_REPLY,
-
- /* OFPST 1.3+ (11): void. */
- OFPRAW_OFPST13_METER_FEATURES_REQUEST,
-
- /* OFPST 1.3+ (11): struct ofp13_meter_features. */
- OFPRAW_OFPST13_METER_FEATURES_REPLY,
-
- /* OFPST 1.3+ (12): void. */
- OFPRAW_OFPST13_TABLE_FEATURES_REQUEST,
-
- /* OFPST 1.3+ (12): struct ofp13_table_features, uint8_t[8][]. */
- OFPRAW_OFPST13_TABLE_FEATURES_REPLY,
-
- /* OFPST 1.4+ (14): void. */
- OFPRAW_OFPST14_TABLE_DESC_REQUEST,
-
- /* OFPST 1.4+ (14): struct ofp14_table_desc, uint8_t[8][]. */
- OFPRAW_OFPST14_TABLE_DESC_REPLY,
-
- /* OFPST 1.0-1.4 (13): void. */
- OFPRAW_OFPST10_PORT_DESC_REQUEST,
- /* OFPST 1.5+ (13): struct ofp15_port_desc_request. */
- OFPRAW_OFPST15_PORT_DESC_REQUEST,
-
- /* OFPST 1.0 (13): struct ofp10_phy_port[]. */
- OFPRAW_OFPST10_PORT_DESC_REPLY,
- /* OFPST 1.1-1.3 (13): struct ofp11_port[]. */
- OFPRAW_OFPST11_PORT_DESC_REPLY,
- /* OFPST 1.4+ (13): uint8_t[8][]. */
- OFPRAW_OFPST14_PORT_DESC_REPLY,
-
- /* OFPST 1.4+ (15): struct ofp14_queue_desc_request. */
- OFPRAW_OFPST14_QUEUE_DESC_REQUEST,
- /* OFPST 1.4+ (15): uint8_t[8][]. */
- OFPRAW_OFPST14_QUEUE_DESC_REPLY,
-
- /* OFPST 1.4+ (16): uint8_t[8][]. */
- OFPRAW_OFPST14_FLOW_MONITOR_REQUEST,
- /* NXST 1.0 (2): uint8_t[8][]. */
- OFPRAW_NXST_FLOW_MONITOR_REQUEST,
-
- /* OFPST 1.4+ (16): uint8_t[8][]. */
- OFPRAW_OFPST14_FLOW_MONITOR_REPLY,
- /* NXST 1.0 (2): uint8_t[8][]. */
- OFPRAW_NXST_FLOW_MONITOR_REPLY,
-
-/* Nicira extension messages.
- *
- * Nicira extensions that correspond to standard OpenFlow messages are listed
- * alongside the standard versions above. */
-
- /* NXT 1.0 (12): struct nx_set_flow_format. */
- OFPRAW_NXT_SET_FLOW_FORMAT,
-
- /* NXT 1.0+ (15): struct nx_flow_mod_table_id. */
- OFPRAW_NXT_FLOW_MOD_TABLE_ID,
-
- /* NXT 1.0+ (16): struct nx_set_packet_in_format. */
- OFPRAW_NXT_SET_PACKET_IN_FORMAT,
-
- /* NXT 1.0+ (18): void. */
- OFPRAW_NXT_FLOW_AGE,
-
- /* NXT 1.0+ (20): struct nx_controller_id. */
- OFPRAW_NXT_SET_CONTROLLER_ID,
-
- /* NXT 1.0+ (21): struct nx_flow_monitor_cancel. */
- OFPRAW_NXT_FLOW_MONITOR_CANCEL,
-
- /* NXT 1.0+ (22): void. */
- OFPRAW_NXT_FLOW_MONITOR_PAUSED,
-
- /* NXT 1.0+ (23): void. */
- OFPRAW_NXT_FLOW_MONITOR_RESUMED,
-
- /* NXT 1.0+ (24): struct nx_tlv_table_mod, struct nx_tlv_map[]. */
- OFPRAW_NXT_TLV_TABLE_MOD,
-
- /* NXT 1.0+ (25): void. */
- OFPRAW_NXT_TLV_TABLE_REQUEST,
-
- /* NXT 1.0+ (26): struct nx_tlv_table_reply, struct nx_tlv_map[]. */
- OFPRAW_NXT_TLV_TABLE_REPLY,
-
- /* NXT 1.0+ (28): uint8_t[8][]. */
- OFPRAW_NXT_RESUME,
-};
-
-/* Decoding messages into OFPRAW_* values. */
-enum ofperr ofpraw_decode(enum ofpraw *, const struct ofp_header *);
-enum ofpraw ofpraw_decode_assert(const struct ofp_header *);
-enum ofperr ofpraw_pull(enum ofpraw *, struct ofpbuf *);
-enum ofpraw ofpraw_pull_assert(struct ofpbuf *);
-
-enum ofperr ofpraw_decode_partial(enum ofpraw *,
- const struct ofp_header *, size_t length);
-
-/* Encoding messages using OFPRAW_* values. */
-struct ofpbuf *ofpraw_alloc(enum ofpraw, uint8_t ofp_version,
- size_t extra_tailroom);
-struct ofpbuf *ofpraw_alloc_xid(enum ofpraw, uint8_t ofp_version,
- ovs_be32 xid, size_t extra_tailroom);
-struct ofpbuf *ofpraw_alloc_reply(enum ofpraw,
- const struct ofp_header *request,
- size_t extra_tailroom);
-struct ofpbuf *ofpraw_alloc_stats_reply(const struct ofp_header *request,
- size_t extra_tailroom);
-
-void ofpraw_put(enum ofpraw, uint8_t ofp_version, struct ofpbuf *);
-void ofpraw_put_xid(enum ofpraw, uint8_t ofp_version, ovs_be32 xid,
- struct ofpbuf *);
-void ofpraw_put_reply(enum ofpraw, const struct ofp_header *request,
- struct ofpbuf *);
-void ofpraw_put_stats_reply(const struct ofp_header *request, struct ofpbuf *);
-
-/* Information about OFPRAW_* values. */
-const char *ofpraw_get_name(enum ofpraw);
-enum ofpraw ofpraw_stats_request_to_reply(enum ofpraw, uint8_t version);
-
-/* Semantic identifiers for OpenFlow messages.
- *
- * Each OFPTYPE_* enumeration constant represents one or more concrete format
- * of OpenFlow message. When two variants of a message have essentially the
- * same meaning, they are assigned a single OFPTYPE_* value.
- *
- * The comments here must follow a stylized form because the "extract-ofp-msgs"
- * program parses them at build time to generate data tables. The format is
- * simply to list each OFPRAW_* enumeration constant for a given OFPTYPE_*,
- * each followed by a period. */
-enum ofptype {
- /* Immutable messages. */
- OFPTYPE_HELLO, /* OFPRAW_OFPT_HELLO. */
- OFPTYPE_ERROR, /* OFPRAW_OFPT_ERROR. */
- OFPTYPE_ECHO_REQUEST, /* OFPRAW_OFPT_ECHO_REQUEST. */
- OFPTYPE_ECHO_REPLY, /* OFPRAW_OFPT_ECHO_REPLY. */
-
- /* Switch configuration messages. */
- OFPTYPE_FEATURES_REQUEST, /* OFPRAW_OFPT_FEATURES_REQUEST. */
- OFPTYPE_FEATURES_REPLY, /* OFPRAW_OFPT10_FEATURES_REPLY.
- * OFPRAW_OFPT11_FEATURES_REPLY.
- * OFPRAW_OFPT13_FEATURES_REPLY. */
- OFPTYPE_GET_CONFIG_REQUEST, /* OFPRAW_OFPT_GET_CONFIG_REQUEST. */
- OFPTYPE_GET_CONFIG_REPLY, /* OFPRAW_OFPT_GET_CONFIG_REPLY. */
- OFPTYPE_SET_CONFIG, /* OFPRAW_OFPT_SET_CONFIG. */
-
- /* Asynchronous messages. */
- OFPTYPE_PACKET_IN, /* OFPRAW_OFPT10_PACKET_IN.
- * OFPRAW_OFPT11_PACKET_IN.
- * OFPRAW_OFPT12_PACKET_IN.
- * OFPRAW_OFPT13_PACKET_IN.
- * OFPRAW_NXT_PACKET_IN2.
- * OFPRAW_NXT_PACKET_IN. */
- OFPTYPE_FLOW_REMOVED, /* OFPRAW_OFPT10_FLOW_REMOVED.
- * OFPRAW_OFPT11_FLOW_REMOVED.
- * OFPRAW_NXT_FLOW_REMOVED. */
- OFPTYPE_PORT_STATUS, /* OFPRAW_OFPT10_PORT_STATUS.
- * OFPRAW_OFPT11_PORT_STATUS.
- * OFPRAW_OFPT14_PORT_STATUS. */
-
- /* Controller command messages. */
- OFPTYPE_PACKET_OUT, /* OFPRAW_OFPT10_PACKET_OUT.
- * OFPRAW_OFPT11_PACKET_OUT. */
- OFPTYPE_FLOW_MOD, /* OFPRAW_OFPT10_FLOW_MOD.
- * OFPRAW_OFPT11_FLOW_MOD.
- * OFPRAW_NXT_FLOW_MOD. */
- OFPTYPE_GROUP_MOD, /* OFPRAW_OFPT11_GROUP_MOD.
- * OFPRAW_OFPT15_GROUP_MOD. */
- OFPTYPE_PORT_MOD, /* OFPRAW_OFPT10_PORT_MOD.
- * OFPRAW_OFPT11_PORT_MOD.
- * OFPRAW_OFPT14_PORT_MOD. */
- OFPTYPE_TABLE_MOD, /* OFPRAW_OFPT11_TABLE_MOD.
- * OFPRAW_OFPT14_TABLE_MOD. */
-
- /* Barrier messages. */
- OFPTYPE_BARRIER_REQUEST, /* OFPRAW_OFPT10_BARRIER_REQUEST.
- * OFPRAW_OFPT11_BARRIER_REQUEST. */
- OFPTYPE_BARRIER_REPLY, /* OFPRAW_OFPT10_BARRIER_REPLY.
- * OFPRAW_OFPT11_BARRIER_REPLY. */
-
- /* Queue Configuration messages. */
- OFPTYPE_QUEUE_GET_CONFIG_REQUEST, /*
OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST.
- *
OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST.
- * OFPRAW_OFPST14_QUEUE_DESC_REQUEST. */
- OFPTYPE_QUEUE_GET_CONFIG_REPLY, /* OFPRAW_OFPT10_QUEUE_GET_CONFIG_REPLY.
- * OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY.
- * OFPRAW_OFPST14_QUEUE_DESC_REPLY. */
-
- /* Controller role change request messages. */
- OFPTYPE_ROLE_REQUEST, /* OFPRAW_OFPT12_ROLE_REQUEST.
- * OFPRAW_NXT_ROLE_REQUEST. */
- OFPTYPE_ROLE_REPLY, /* OFPRAW_OFPT12_ROLE_REPLY.
- * OFPRAW_NXT_ROLE_REPLY. */
-
- /* Asynchronous message configuration. */
- OFPTYPE_GET_ASYNC_REQUEST, /* OFPRAW_OFPT13_GET_ASYNC_REQUEST.
- * OFPRAW_OFPT14_GET_ASYNC_REQUEST. */
- OFPTYPE_GET_ASYNC_REPLY, /* OFPRAW_OFPT13_GET_ASYNC_REPLY.
- * OFPRAW_OFPT14_GET_ASYNC_REPLY. */
- OFPTYPE_SET_ASYNC_CONFIG, /* OFPRAW_NXT_SET_ASYNC_CONFIG.
- * OFPRAW_NXT_SET_ASYNC_CONFIG2.
- * OFPRAW_OFPT13_SET_ASYNC.
- * OFPRAW_OFPT14_SET_ASYNC. */
-
- /* Meters and rate limiters configuration messages. */
- OFPTYPE_METER_MOD, /* OFPRAW_OFPT13_METER_MOD. */
-
- /* Controller role change event messages. */
- OFPTYPE_ROLE_STATUS, /* OFPRAW_OFPT14_ROLE_STATUS. */
-
- /* Request forwarding by the switch. */
- OFPTYPE_REQUESTFORWARD, /* OFPRAW_OFPT14_REQUESTFORWARD. */
-
- /* Asynchronous messages. */
- OFPTYPE_TABLE_STATUS, /* OFPRAW_OFPT14_TABLE_STATUS. */
-
- OFPTYPE_BUNDLE_CONTROL, /* OFPRAW_OFPT14_BUNDLE_CONTROL.
- * OFPRAW_ONFT13_BUNDLE_CONTROL. */
-
- OFPTYPE_BUNDLE_ADD_MESSAGE, /* OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE.
- * OFPRAW_ONFT13_BUNDLE_ADD_MESSAGE. */
-
- /* Statistics. */
- OFPTYPE_DESC_STATS_REQUEST, /* OFPRAW_OFPST_DESC_REQUEST. */
- OFPTYPE_DESC_STATS_REPLY, /* OFPRAW_OFPST_DESC_REPLY. */
- OFPTYPE_FLOW_STATS_REQUEST, /* OFPRAW_OFPST10_FLOW_REQUEST.
- * OFPRAW_OFPST11_FLOW_REQUEST.
- * OFPRAW_NXST_FLOW_REQUEST. */
- OFPTYPE_FLOW_STATS_REPLY, /* OFPRAW_OFPST10_FLOW_REPLY.
- * OFPRAW_OFPST11_FLOW_REPLY.
- * OFPRAW_OFPST13_FLOW_REPLY.
- * OFPRAW_NXST_FLOW_REPLY. */
- OFPTYPE_AGGREGATE_STATS_REQUEST, /* OFPRAW_OFPST10_AGGREGATE_REQUEST.
- * OFPRAW_OFPST11_AGGREGATE_REQUEST.
- * OFPRAW_NXST_AGGREGATE_REQUEST. */
- OFPTYPE_AGGREGATE_STATS_REPLY, /* OFPRAW_OFPST_AGGREGATE_REPLY.
- * OFPRAW_NXST_AGGREGATE_REPLY. */
- OFPTYPE_TABLE_STATS_REQUEST, /* OFPRAW_OFPST_TABLE_REQUEST. */
- OFPTYPE_TABLE_STATS_REPLY, /* OFPRAW_OFPST10_TABLE_REPLY.
- * OFPRAW_OFPST11_TABLE_REPLY.
- * OFPRAW_OFPST12_TABLE_REPLY.
- * OFPRAW_OFPST13_TABLE_REPLY. */
- OFPTYPE_PORT_STATS_REQUEST, /* OFPRAW_OFPST10_PORT_REQUEST.
- * OFPRAW_OFPST11_PORT_REQUEST. */
- OFPTYPE_PORT_STATS_REPLY, /* OFPRAW_OFPST10_PORT_REPLY.
- * OFPRAW_OFPST11_PORT_REPLY.
- * OFPRAW_OFPST13_PORT_REPLY.
- * OFPRAW_OFPST14_PORT_REPLY. */
- OFPTYPE_QUEUE_STATS_REQUEST, /* OFPRAW_OFPST10_QUEUE_REQUEST.
- * OFPRAW_OFPST11_QUEUE_REQUEST. */
- OFPTYPE_QUEUE_STATS_REPLY, /* OFPRAW_OFPST10_QUEUE_REPLY.
- * OFPRAW_OFPST11_QUEUE_REPLY.
- * OFPRAW_OFPST13_QUEUE_REPLY.
- * OFPRAW_OFPST14_QUEUE_REPLY. */
-
- OFPTYPE_GROUP_STATS_REQUEST, /* OFPRAW_OFPST11_GROUP_REQUEST. */
-
- OFPTYPE_GROUP_STATS_REPLY, /* OFPRAW_OFPST11_GROUP_REPLY.
- * OFPRAW_OFPST13_GROUP_REPLY. */
-
- OFPTYPE_GROUP_DESC_STATS_REQUEST, /* OFPRAW_OFPST11_GROUP_DESC_REQUEST.
- * OFPRAW_OFPST15_GROUP_DESC_REQUEST. */
-
- OFPTYPE_GROUP_DESC_STATS_REPLY, /* OFPRAW_OFPST11_GROUP_DESC_REPLY. */
-
- OFPTYPE_GROUP_FEATURES_STATS_REQUEST, /*
OFPRAW_OFPST12_GROUP_FEATURES_REQUEST. */
-
- OFPTYPE_GROUP_FEATURES_STATS_REPLY, /*
OFPRAW_OFPST12_GROUP_FEATURES_REPLY. */
-
- OFPTYPE_METER_STATS_REQUEST, /* OFPRAW_OFPST13_METER_REQUEST. */
-
- OFPTYPE_METER_STATS_REPLY, /* OFPRAW_OFPST13_METER_REPLY. */
-
- OFPTYPE_METER_CONFIG_STATS_REQUEST, /*
OFPRAW_OFPST13_METER_CONFIG_REQUEST. */
-
- OFPTYPE_METER_CONFIG_STATS_REPLY, /* OFPRAW_OFPST13_METER_CONFIG_REPLY. */
-
- OFPTYPE_METER_FEATURES_STATS_REQUEST, /*
OFPRAW_OFPST13_METER_FEATURES_REQUEST. */
-
- OFPTYPE_METER_FEATURES_STATS_REPLY, /*
OFPRAW_OFPST13_METER_FEATURES_REPLY. */
-
- OFPTYPE_TABLE_FEATURES_STATS_REQUEST, /*
OFPRAW_OFPST13_TABLE_FEATURES_REQUEST. */
-
- OFPTYPE_TABLE_FEATURES_STATS_REPLY, /*
OFPRAW_OFPST13_TABLE_FEATURES_REPLY. */
-
- OFPTYPE_TABLE_DESC_REQUEST, /* OFPRAW_OFPST14_TABLE_DESC_REQUEST. */
-
- OFPTYPE_TABLE_DESC_REPLY, /* OFPRAW_OFPST14_TABLE_DESC_REPLY. */
-
- OFPTYPE_PORT_DESC_STATS_REQUEST, /* OFPRAW_OFPST10_PORT_DESC_REQUEST.
- * OFPRAW_OFPST15_PORT_DESC_REQUEST. */
-
- OFPTYPE_PORT_DESC_STATS_REPLY, /* OFPRAW_OFPST10_PORT_DESC_REPLY.
- * OFPRAW_OFPST11_PORT_DESC_REPLY.
- * OFPRAW_OFPST14_PORT_DESC_REPLY. */
-
- OFPTYPE_FLOW_MONITOR_STATS_REQUEST, /* OFPRAW_OFPST14_FLOW_MONITOR_REQUEST.
- * OFPRAW_NXST_FLOW_MONITOR_REQUEST. */
- OFPTYPE_FLOW_MONITOR_STATS_REPLY, /* OFPRAW_OFPST14_FLOW_MONITOR_REPLY.
- * OFPRAW_NXST_FLOW_MONITOR_REPLY. */
-
- /* Nicira extensions. */
- OFPTYPE_SET_FLOW_FORMAT, /* OFPRAW_NXT_SET_FLOW_FORMAT. */
- OFPTYPE_FLOW_MOD_TABLE_ID, /* OFPRAW_NXT_FLOW_MOD_TABLE_ID. */
- OFPTYPE_SET_PACKET_IN_FORMAT, /* OFPRAW_NXT_SET_PACKET_IN_FORMAT. */
- OFPTYPE_FLOW_AGE, /* OFPRAW_NXT_FLOW_AGE. */
- OFPTYPE_SET_CONTROLLER_ID, /* OFPRAW_NXT_SET_CONTROLLER_ID. */
- OFPTYPE_NXT_TLV_TABLE_MOD, /* OFPRAW_NXT_TLV_TABLE_MOD. */
- OFPTYPE_NXT_TLV_TABLE_REQUEST, /* OFPRAW_NXT_TLV_TABLE_REQUEST. */
- OFPTYPE_NXT_TLV_TABLE_REPLY, /* OFPRAW_NXT_TLV_TABLE_REPLY. */
- OFPTYPE_NXT_RESUME, /* OFPRAW_NXT_RESUME. */
-
- /* Flow monitor extension. */
- OFPTYPE_FLOW_MONITOR_CANCEL, /* OFPRAW_NXT_FLOW_MONITOR_CANCEL. */
- OFPTYPE_FLOW_MONITOR_PAUSED, /* OFPRAW_NXT_FLOW_MONITOR_PAUSED. */
- OFPTYPE_FLOW_MONITOR_RESUMED, /* OFPRAW_NXT_FLOW_MONITOR_RESUMED. */
-};
-
-/* Decoding messages into OFPTYPE_* values. */
-enum ofperr ofptype_decode(enum ofptype *, const struct ofp_header *);
-enum ofperr ofptype_pull(enum ofptype *, struct ofpbuf *);
-enum ofptype ofptype_from_ofpraw(enum ofpraw);
-
-/* Information about OFTYPE_* values. */
-const char *ofptype_get_name(enum ofptype);
-
-/* OpenFlow message properties. */
-void ofpmsg_update_length(struct ofpbuf *);
-const void *ofpmsg_body(const struct ofp_header *);
-bool ofpmsg_is_stat_request(const struct ofp_header *);
-
-/* Multipart messages (aka "statistics").
- *
- * Individual OpenFlow messages are limited to 64 kB in size, but some messages
- * need to be longer. Therefore, multipart messages allow a longer message to
- * be divided into multiple parts at some convenient boundary. For example,
- * limiting the response to a "flow dump" request to 64 kB would unreasonably
- * limit the maximum number of flows in an OpenFlow switch, so a "flow dump" is
- * expressed as a multipart request/reply pair, with the reply broken into
- * pieces between flows.
- *
- * Multipart messages always consist of a request/reply pair.
- *
- * In OpenFlow 1.0, 1.1, and 1.2, requests must always fit in a single message,
- * that is, only a multipart reply may have more than one part. OpenFlow 1.3
- * adds one multipart request. This code does not yet support multipart
- * requests. */
-
-/* Encoding multipart replies.
- *
- * These functions are useful for multipart replies that might really require
- * more than one message. A multipart message that is known in advance to fit
- * within 64 kB doesn't need any special treatment, so you might as well use
- * the ofpraw_alloc_*() functions.
- *
- * These functions work with a "struct ovs_list" of "struct ofpbuf"s, each of
- * which represents one part of a multipart message. */
-void ofpmp_init(struct ovs_list *, const struct ofp_header *request);
-struct ofpbuf *ofpmp_reserve(struct ovs_list *, size_t len);
-void *ofpmp_append(struct ovs_list *, size_t len);
-void ofpmp_postappend(struct ovs_list *, size_t start_ofs);
-
-enum ofp_version ofpmp_version(struct ovs_list *);
-enum ofpraw ofpmp_decode_raw(struct ovs_list *);
-
-/* Decoding multipart replies. */
-uint16_t ofpmp_flags(const struct ofp_header *);
-bool ofpmp_more(const struct ofp_header *);
-
-#endif /* ofp-msgs.h */
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 16a0751..543a4e2 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -30,23 +30,23 @@
#include "byte-order.h"
#include "colors.h"
#include "compiler.h"
-#include "openvswitch/dynamic-string.h"
#include "flow.h"
#include "learn.h"
#include "multipath.h"
-#include "openvswitch/meta-flow.h"
#include "netdev.h"
#include "nx-match.h"
#include "ofp-actions.h"
-#include "openvswitch/ofpbuf.h"
-#include "ofp-msgs.h"
-#include "openvswitch/ofp-util.h"
#include "openflow/openflow.h"
#include "openflow/nicira-ext.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/meta-flow.h"
#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/type-props.h"
#include "packets.h"
#include "dp-packet.h"
-#include "openvswitch/type-props.h"
#include "unaligned.h"
#include "odp-util.h"
#include "util.h"
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 1bf7a27..0612695 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -26,27 +26,27 @@
#include "bundle.h"
#include "byte-order.h"
#include "classifier.h"
-#include "openvswitch/dynamic-string.h"
#include "learn.h"
-#include "openvswitch/meta-flow.h"
#include "multipath.h"
#include "netdev.h"
#include "nx-match.h"
#include "id-pool.h"
#include "ofp-actions.h"
-#include "ofp-msgs.h"
#include "ofp-prop.h"
+#include "openflow/netronome-ext.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/meta-flow.h"
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
-#include "openflow/netronome-ext.h"
+#include "openvswitch/type-props.h"
+#include "openvswitch/vlog.h"
#include "packets.h"
#include "pktbuf.h"
#include "random.h"
#include "tun-metadata.h"
#include "unaligned.h"
-#include "openvswitch/type-props.h"
-#include "openvswitch/ofp-errors.h"
-#include "openvswitch/vlog.h"
#include "bitmap.h"
#include "uuid.h"
diff --git a/lib/rconn.c b/lib/rconn.c
index b765111..063eda8 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -21,16 +21,16 @@
#include <stdlib.h>
#include <string.h>
#include "coverage.h"
-#include "ofp-msgs.h"
+#include "openflow/openflow.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
-#include "openflow/openflow.h"
+#include "openvswitch/vconn.h"
+#include "openvswitch/vlog.h"
#include "poll-loop.h"
#include "sat-math.h"
#include "timeval.h"
#include "util.h"
-#include "openvswitch/vconn.h"
-#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(rconn);
diff --git a/lib/vconn.c b/lib/vconn.c
index d406bf3..97d71da 100644
--- a/lib/vconn.c
+++ b/lib/vconn.c
@@ -23,21 +23,21 @@
#include <stdlib.h>
#include <string.h>
#include "coverage.h"
-#include "openvswitch/dynamic-string.h"
#include "fatal-signal.h"
#include "flow.h"
-#include "ofp-msgs.h"
#include "ofp-print.h"
-#include "openvswitch/ofp-util.h"
-#include "openvswitch/ofpbuf.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
#include "packets.h"
#include "poll-loop.h"
#include "random.h"
#include "util.h"
-#include "openvswitch/ofp-errors.h"
-#include "openvswitch/vlog.h"
#include "socket-util.h"
VLOG_DEFINE_THIS_MODULE(vconn);
diff --git a/ofproto/bundles.c b/ofproto/bundles.c
index e55918c..5996c01 100644
--- a/ofproto/bundles.c
+++ b/ofproto/bundles.c
@@ -23,10 +23,12 @@
#include "in-band.h"
#include "odp-util.h"
#include "ofp-actions.h"
-#include "ofp-msgs.h"
+#include "ofproto-provider.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
-#include "ofproto-provider.h"
+#include "openvswitch/vconn.h"
+#include "openvswitch/vlog.h"
#include "pinsched.h"
#include "poll-loop.h"
#include "pktbuf.h"
@@ -35,8 +37,6 @@
#include "simap.h"
#include "stream.h"
#include "timeval.h"
-#include "openvswitch/vconn.h"
-#include "openvswitch/vlog.h"
#include "bundles.h"
diff --git a/ofproto/bundles.h b/ofproto/bundles.h
index 7e412d7..d045031 100644
--- a/ofproto/bundles.h
+++ b/ofproto/bundles.h
@@ -22,9 +22,9 @@
#include <sys/types.h>
#include "connmgr.h"
-#include "ofp-msgs.h"
-#include "openvswitch/ofp-util.h"
#include "ofproto-provider.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-util.h"
#include "util.h"
#ifdef __cplusplus
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 5c13ac3..2649d44 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -22,15 +22,17 @@
#include <stdlib.h>
#include "coverage.h"
-#include "openvswitch/dynamic-string.h"
#include "fail-open.h"
#include "in-band.h"
#include "odp-util.h"
#include "ofp-actions.h"
-#include "ofp-msgs.h"
+#include "ofproto-provider.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
-#include "ofproto-provider.h"
+#include "openvswitch/vconn.h"
+#include "openvswitch/vlog.h"
#include "pinsched.h"
#include "poll-loop.h"
#include "pktbuf.h"
@@ -39,8 +41,6 @@
#include "simap.h"
#include "stream.h"
#include "timeval.h"
-#include "openvswitch/vconn.h"
-#include "openvswitch/vlog.h"
#include "bundles.h"
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 1ce765d..f6c0203 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -28,20 +28,22 @@
#include "connectivity.h"
#include "connmgr.h"
#include "coverage.h"
-#include "openvswitch/dynamic-string.h"
#include "hash.h"
#include "hmap.h"
-#include "openvswitch/meta-flow.h"
#include "netdev.h"
#include "nx-match.h"
#include "ofp-actions.h"
-#include "ofp-msgs.h"
#include "ofp-print.h"
-#include "openvswitch/ofp-util.h"
-#include "openvswitch/ofpbuf.h"
#include "ofproto-provider.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/meta-flow.h"
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
#include "ovs-rcu.h"
#include "dp-packet.h"
#include "packets.h"
@@ -58,8 +60,6 @@
#include "tun-metadata.h"
#include "unaligned.h"
#include "unixctl.h"
-#include "openvswitch/ofp-errors.h"
-#include "openvswitch/vlog.h"
#include "bundles.h"
VLOG_DEFINE_THIS_MODULE(ofproto);
diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index 77c8b4a..e42d958 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -18,15 +18,15 @@
#include "ofctrl.h"
#include "dirs.h"
#include "hash.h"
-#include "openvswitch/dynamic-string.h"
#include "hmap.h"
-#include "openvswitch/match.h"
#include "ofp-actions.h"
-#include "ofp-msgs.h"
#include "ofp-print.h"
+#include "openflow/openflow.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/match.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
-#include "openflow/openflow.h"
#include "openvswitch/vlog.h"
#include "ovn-controller.h"
#include "physical.h"
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index e440a88..6555acf 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -23,16 +23,15 @@
#include "flow.h"
#include "lport.h"
#include "ofp-actions.h"
-#include "ovn/lib/actions.h"
-#include "ovn/lib/logical-fields.h"
-#include "ofp-msgs.h"
#include "ofp-print.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
-#include "ovn/lib/actions.h"
-#include "rconn.h"
#include "openvswitch/vlog.h"
#include "ovn-controller.h"
+#include "ovn/lib/actions.h"
+#include "ovn/lib/logical-fields.h"
#include "poll-loop.h"
+#include "rconn.h"
#include "socket-util.h"
#include "timeval.h"
#include "vswitch-idl.h"
diff --git a/tests/test-vconn.c b/tests/test-vconn.c
index be53c3d..faa824a 100644
--- a/tests/test-vconn.c
+++ b/tests/test-vconn.c
@@ -16,7 +16,6 @@
#include <config.h>
#undef NDEBUG
-#include "openvswitch/vconn.h"
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
@@ -25,10 +24,12 @@
#include <unistd.h>
#include "command-line.h"
#include "fatal-signal.h"
-#include "ofp-msgs.h"
+#include "openflow/openflow.h"
+#include "openvswitch/ofp-msgs.h"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
-#include "openflow/openflow.h"
+#include "openvswitch/vconn.h"
+#include "openvswitch/vlog.h"
#include "ovstest.h"
#include "poll-loop.h"
#include "socket-util.h"
@@ -36,7 +37,6 @@
#include "stream-ssl.h"
#include "timeval.h"
#include "util.h"
-#include "openvswitch/vlog.h"
struct fake_pvconn {
const char *type;
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 52405d0..b50a4c4 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -36,20 +36,25 @@
#include "colors.h"
#include "compiler.h"
#include "dirs.h"
-#include "openvswitch/dynamic-string.h"
+#include "dp-packet.h"
#include "fatal-signal.h"
#include "nx-match.h"
#include "odp-util.h"
#include "ofp-actions.h"
-#include "ofp-msgs.h"
#include "ofp-print.h"
-#include "openvswitch/ofp-util.h"
#include "ofp-version-opt.h"
-#include "openvswitch/ofpbuf.h"
#include "ofproto/ofproto.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
-#include "dp-packet.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/meta-flow.h"
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofp-parse.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vconn.h"
+#include "openvswitch/vlog.h"
#include "packets.h"
#include "pcap-file.h"
#include "poll-loop.h"
@@ -59,11 +64,6 @@
#include "timeval.h"
#include "unixctl.h"
#include "util.h"
-#include "openvswitch/ofp-errors.h"
-#include "openvswitch/ofp-parse.h"
-#include "openvswitch/vconn.h"
-#include "openvswitch/vlog.h"
-#include "openvswitch/meta-flow.h"
#include "sort.h"
VLOG_DEFINE_THIS_MODULE(ofctl);
--
2.5.0
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev