2 * Transparent proxy support for Linux/iptables
4 * Copyright (c) 2006-2007 BalaBit IT Ltd.
5 * Author: Balazs Scheidler, Krisztian Kovacs
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
13 #include <linux/module.h>
15 #include <linux/net.h>
17 #include <linux/netdevice.h>
19 #include <net/netfilter/nf_tproxy_core.h>
23 nf_tproxy_destructor(struct sk_buff
*skb
)
25 struct sock
*sk
= skb
->sk
;
28 skb
->destructor
= NULL
;
31 nf_tproxy_put_sock(sk
);
36 nf_tproxy_assign_sock(struct sk_buff
*skb
, struct sock
*sk
)
38 bool transparent
= (sk
->sk_state
== TCP_TIME_WAIT
) ?
39 inet_twsk(sk
)->tw_transparent
:
40 inet_sk(sk
)->transparent
;
45 skb
->destructor
= nf_tproxy_destructor
;
48 nf_tproxy_put_sock(sk
);
52 EXPORT_SYMBOL_GPL(nf_tproxy_assign_sock
);
54 static int __init
nf_tproxy_init(void)
56 pr_info("NF_TPROXY: Transparent proxy support initialized, version 4.1.0\n");
57 pr_info("NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.\n");
61 module_init(nf_tproxy_init
);
63 MODULE_LICENSE("GPL");
64 MODULE_AUTHOR("Krisztian Kovacs");
65 MODULE_DESCRIPTION("Transparent proxy support core routines");