[ovs-dev] [tunnel 06/11] packets: Create global helper is_ip_any().

Ethan Jackson ethan at nicira.com
Mon Jan 28 00:58:07 UTC 2013


Used outside of meta-flow in future patches.

Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
 lib/meta-flow.c |    7 -------
 lib/packets.h   |    8 +++++++-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/meta-flow.c b/lib/meta-flow.c
index 87887a8..e25103d 100644
--- a/lib/meta-flow.c
+++ b/lib/meta-flow.c
@@ -761,13 +761,6 @@ mf_is_mask_valid(const struct mf_field *mf, const union mf_value *mask)
 }
 
 static bool
-is_ip_any(const struct flow *flow)
-{
-    return (flow->dl_type == htons(ETH_TYPE_IP) ||
-            flow->dl_type == htons(ETH_TYPE_IPV6));
-}
-
-static bool
 is_icmpv4(const struct flow *flow)
 {
     return (flow->dl_type == htons(ETH_TYPE_IP)
diff --git a/lib/packets.h b/lib/packets.h
index 7e2d4e9..8dd3ebf 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -23,13 +23,13 @@
 #include <stdint.h>
 #include <string.h>
 #include "compiler.h"
+#include "flow.h"
 #include "openvswitch/types.h"
 #include "random.h"
 #include "util.h"
 
 struct ofpbuf;
 struct ds;
-struct flow;
 
 bool dpid_from_string(const char *s, uint64_t *dpidp);
 
@@ -468,6 +468,12 @@ static inline bool ipv6_mask_is_exact(const struct in6_addr *mask) {
     return ipv6_addr_equals(mask, &in6addr_exact);
 }
 
+static inline bool is_ip_any(const struct flow *flow)
+{
+    return flow->dl_type == htons(ETH_TYPE_IP)
+        || flow->dl_type == htons(ETH_TYPE_IPV6);
+}
+
 void format_ipv6_addr(char *addr_str, const struct in6_addr *addr);
 void print_ipv6_addr(struct ds *string, const struct in6_addr *addr);
 void print_ipv6_masked(struct ds *string, const struct in6_addr *addr,
-- 
1.7.9.5




More information about the dev mailing list