Add ability to restrict flow mods and flow stats requests to cookies.
[sliver-openvswitch.git] / lib / ofp-util.h
index a658df1..8fa729e 100644 (file)
@@ -90,6 +90,8 @@ enum ofputil_msg_code {
 struct ofputil_msg_type;
 int ofputil_decode_msg_type(const struct ofp_header *,
                             const struct ofputil_msg_type **);
+int ofputil_decode_msg_type_partial(const struct ofp_header *, size_t length,
+                                    const struct ofputil_msg_type **);
 enum ofputil_msg_code ofputil_msg_type_code(const struct ofputil_msg_type *);
 const char *ofputil_msg_type_name(const struct ofputil_msg_type *);
 
@@ -129,6 +131,7 @@ struct ofpbuf *ofputil_make_flow_mod_table_id(bool flow_mod_table_id);
 struct ofputil_flow_mod {
     struct cls_rule cr;
     ovs_be64 cookie;
+    ovs_be64 cookie_mask;
     uint8_t table_id;
     uint16_t command;
     uint16_t idle_timeout;
@@ -150,6 +153,8 @@ struct ofpbuf *ofputil_encode_flow_mod(const struct ofputil_flow_mod *,
 struct ofputil_flow_stats_request {
     bool aggregate;             /* Aggregate results? */
     struct cls_rule match;
+    ovs_be64 cookie;
+    ovs_be64 cookie_mask;
     uint16_t out_port;
     uint8_t table_id;
 };
@@ -277,6 +282,9 @@ struct ofpbuf *make_unbuffered_packet_out(const struct ofpbuf *packet,
                                           uint16_t in_port, uint16_t out_port);
 struct ofpbuf *make_echo_request(void);
 struct ofpbuf *make_echo_reply(const struct ofp_header *rq);
+
+const char *ofputil_frag_handling_to_string(enum ofp_config_flags);
+bool ofputil_frag_handling_from_string(const char *, enum ofp_config_flags *);
 \f
 /* Actions. */
 
@@ -547,4 +555,7 @@ int ofputil_decode_error_msg(const struct ofp_header *, size_t *payload_ofs);
 void ofputil_format_error(struct ds *, int error);
 char *ofputil_error_to_string(int error);
 
+/* Handy utility for parsing flows and actions. */
+bool ofputil_parse_key_value(char **stringp, char **keyp, char **valuep);
+
 #endif /* ofp-util.h */