IP_ARGS(&flow->nw_src), IP_ARGS(&flow->nw_dst),
ntohs(flow->tp_src), ntohs(flow->tp_dst));
}
-
-int
-flow_compare(const struct flow *a, const struct flow *b)
-{
- return memcmp(a, b, sizeof *a);
-}
-
-size_t
-flow_hash(const struct flow *flow, uint32_t basis)
-{
- BUILD_ASSERT_DECL(!(sizeof *flow % sizeof(uint32_t)));
- return hash_lookup3((const uint32_t *) flow,
- sizeof *flow / sizeof(uint32_t), basis);
-}
-
#include <stdbool.h>
#include <stdint.h>
+#include <string.h>
+#include "hash.h"
#include "util.h"
struct ofpbuf;
int flow_extract(struct ofpbuf *, uint16_t in_port, struct flow *);
void flow_print(FILE *, const struct flow *);
-int flow_compare(const struct flow *, const struct flow *);
-size_t flow_hash(const struct flow *, uint32_t basis);
+static inline int flow_compare(const struct flow *, const struct flow *);
+static inline size_t flow_hash(const struct flow *, uint32_t basis);
+
+static inline int
+flow_compare(const struct flow *a, const struct flow *b)
+{
+ return memcmp(a, b, sizeof *a);
+}
+
+static inline size_t
+flow_hash(const struct flow *flow, uint32_t basis)
+{
+ BUILD_ASSERT_DECL(!(sizeof *flow % sizeof(uint32_t)));
+ return hash_lookup3((const uint32_t *) flow,
+ sizeof *flow / sizeof(uint32_t), basis);
+}
#endif /* flow.h */