1 #ifndef _NF_TPROXY_CORE_H
2 #define _NF_TPROXY_CORE_H
4 #include <linux/types.h>
6 #include <linux/skbuff.h>
8 #include <net/inet_sock.h>
11 /* look up and get a reference to a matching socket */
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
);
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
));
28 /* assign a socket to the skb -- consumes sk */
30 nf_tproxy_assign_sock(struct sk_buff
*skb
, struct sock
*sk
);