From 0744dd00c1b1be99a25b62b1b48df440e82e57e0 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Mon, 28 Nov 2011 05:22:18 +0000 Subject: net: introduce skb_flow_dissect() We use at least two flow dissectors in network stack, with known limitations and code duplication. Introduce skb_flow_dissect() to factorize this, highly inspired from existing dissector from __skb_get_rxhash() Note : We extensively use skb_header_pointer(), this permits us to not touch skb at all. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- include/net/flow_keys.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/net/flow_keys.h (limited to 'include/net/flow_keys.h') diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h new file mode 100644 index 000000000000..e4cb28526563 --- /dev/null +++ b/include/net/flow_keys.h @@ -0,0 +1,15 @@ +#ifndef _NET_FLOW_KEYS_H +#define _NET_FLOW_KEYS_H + +struct flow_keys { + __be32 src; + __be32 dst; + union { + __be32 ports; + __be16 port16[2]; + }; + u8 ip_proto; +}; + +extern bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow); +#endif -- cgit v1.2.3