V4L/DVB: media/radio: fix copy_to_user to user handling
[linux-2.6/kvm.git] / include / net / netfilter / nf_tproxy_core.h
blob208b46f4d6d2b2bfbf9b2439b783dbfa6a7a7a46
1 #ifndef _NF_TPROXY_CORE_H
2 #define _NF_TPROXY_CORE_H
4 #include <linux/types.h>
5 #include <linux/in.h>
6 #include <linux/skbuff.h>
7 #include <net/sock.h>
8 #include <net/inet_sock.h>
9 #include <net/tcp.h>
11 /* look up and get a reference to a matching socket */
12 extern struct sock *
13 nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
14 const __be32 saddr, const __be32 daddr,
15 const __be16 sport, const __be16 dport,
16 const struct net_device *in, bool listening);
18 static inline void
19 nf_tproxy_put_sock(struct sock *sk)
21 /* TIME_WAIT inet sockets have to be handled differently */
22 if ((sk->sk_protocol == IPPROTO_TCP) && (sk->sk_state == TCP_TIME_WAIT))
23 inet_twsk_put(inet_twsk(sk));
24 else
25 sock_put(sk);
28 /* assign a socket to the skb -- consumes sk */
29 int
30 nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk);
32 #endif