meta-flow: Remove circular dependency on enum ofputil_protocol.
authorJarno Rajahalme <jrajahalme@nicira.com>
Sat, 10 Oct 2015 00:24:00 +0000 (17:24 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Sat, 10 Oct 2015 00:24:00 +0000 (17:24 -0700)
enum ofputil_protocol is defined in lib/ofp-util.h, which also
includes lib/meta-flow.h.  We have already replaced the sets of usable
protocols in struct mf_field with uint32_t for this reason.  Do the
same for the return value of mf_set().

Suggested-by: John Reumann <nofutznetworks@gmail.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
lib/meta-flow.c
lib/meta-flow.h

index 224ba53..9778bff 100644 (file)
@@ -1615,8 +1615,12 @@ mf_set_wild(const struct mf_field *mf, struct match *match, char **err_str)
  *
  * If non-NULL, 'err_str' returns a malloc'ed string describing any errors
  * with the request or NULL if there is no error. The caller is reponsible
- * for freeing the string.*/
-enum ofputil_protocol
+ * for freeing the string.
+ *
+ * Return a set of enum ofputil_protocol bits (as an uint32_t to avoid circular
+ * dependency on enum ofputil_protocol definition) indicating which OpenFlow
+ * protocol versions can support this functionality. */
+uint32_t
 mf_set(const struct mf_field *mf,
        const union mf_value *value, const union mf_value *mask,
        struct match *match, char **err_str)
index 02272ef..920093f 100644 (file)
@@ -1861,10 +1861,8 @@ void mf_get(const struct mf_field *, const struct match *,
             union mf_value *value, union mf_value *mask);
 
 /* Returns the set of usable protocols. */
-enum ofputil_protocol mf_set(const struct mf_field *,
-                             const union mf_value *value,
-                             const union mf_value *mask,
-                             struct match *, char **err_str);
+uint32_t mf_set(const struct mf_field *, const union mf_value *value,
+                const union mf_value *mask, struct match *, char **err_str);
 
 void mf_set_wild(const struct mf_field *, struct match *, char **err_str);