summaryrefslogtreecommitdiff
path: root/include/openvswitch
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-02-15 14:38:28 -0800
committerBen Pfaff <blp@ovn.org>2018-03-14 11:29:19 -0700
commit225c33ba64a4de1aa30b05f8549c0628fe7fe6e3 (patch)
tree1822c7bcd2e3421e5f819ecc25f5fd8e9a605fbf /include/openvswitch
parent62bba609351a8c71319f80a59731a3810c873d27 (diff)
downloadopenvswitch-225c33ba64a4de1aa30b05f8549c0628fe7fe6e3.tar.gz
ofp-protocol: Better abstract changing the protocol used for flow matches.
The previous interface here required the client to understand, to some extent, the low-level NXFF_* values and the encoding format for the NXT_SET_FLOW_FORMAT and NXT_SET_FLOW_MOD_TABLE_ID messages. This commit changes the interface so that the client only has to understand the ofputil_protocol type used elsewhere and none of the encoding otherwise. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'include/openvswitch')
-rw-r--r--include/openvswitch/ofp-flow.h9
-rw-r--r--include/openvswitch/ofp-msgs.h4
-rw-r--r--include/openvswitch/ofp-protocol.h11
3 files changed, 13 insertions, 11 deletions
diff --git a/include/openvswitch/ofp-flow.h b/include/openvswitch/ofp-flow.h
index abaf4a87a..28aa77bad 100644
--- a/include/openvswitch/ofp-flow.h
+++ b/include/openvswitch/ofp-flow.h
@@ -31,15 +31,6 @@ struct ofputil_table_map;
extern "C" {
#endif
-/* nx_flow_format */
-struct ofpbuf *ofputil_encode_nx_set_flow_format(enum nx_flow_format);
-enum ofputil_protocol ofputil_nx_flow_format_to_protocol(enum nx_flow_format);
-bool ofputil_nx_flow_format_is_valid(enum nx_flow_format);
-const char *ofputil_nx_flow_format_to_string(enum nx_flow_format);
-
-/* NXT_FLOW_MOD_TABLE_ID extension. */
-struct ofpbuf *ofputil_make_flow_mod_table_id(bool flow_mod_table_id);
-
/* Protocol-independent flow_mod flags. */
enum ofputil_flow_mod_flags {
/* Flags that are maintained with a flow as part of its state.
diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
index 3f92f2a67..23f3015ae 100644
--- a/include/openvswitch/ofp-msgs.h
+++ b/include/openvswitch/ofp-msgs.h
@@ -443,10 +443,10 @@ enum ofpraw {
* Nicira extensions that correspond to standard OpenFlow messages are listed
* alongside the standard versions above. */
- /* NXT 1.0 (12): struct nx_set_flow_format. */
+ /* NXT 1.0 (12): ovs_be32. */
OFPRAW_NXT_SET_FLOW_FORMAT,
- /* NXT 1.0+ (15): struct nx_flow_mod_table_id. */
+ /* NXT 1.0+ (15): uint8_t[8]. */
OFPRAW_NXT_FLOW_MOD_TABLE_ID,
/* NXT 1.0+ (16): struct nx_set_packet_in_format. */
diff --git a/include/openvswitch/ofp-protocol.h b/include/openvswitch/ofp-protocol.h
index bd1bedf32..a351660ac 100644
--- a/include/openvswitch/ofp-protocol.h
+++ b/include/openvswitch/ofp-protocol.h
@@ -162,11 +162,22 @@ enum ofputil_protocol ofputil_protocols_from_string(const char *s);
const char *ofputil_version_to_string(enum ofp_version ofp_version);
uint32_t ofputil_versions_from_string(const char *s);
uint32_t ofputil_versions_from_strings(char ** const s, size_t count);
+
+/* Messages for changing the protocol. */
+/* Changing the protocol at a high level. */
struct ofpbuf *ofputil_encode_set_protocol(enum ofputil_protocol current,
enum ofputil_protocol want,
enum ofputil_protocol *next);
+/* Changing the protocol at a low level. */
+struct ofpbuf *ofputil_encode_nx_set_flow_format(enum ofputil_protocol);
+enum ofputil_protocol ofputil_decode_nx_set_flow_format(
+ const struct ofp_header *);
+
+struct ofpbuf *ofputil_encode_nx_flow_mod_table_id(bool enable);
+bool ofputil_decode_nx_flow_mod_table_id(const struct ofp_header *);
+
#ifdef __cplusplus
}
#endif