[NETFILTER]: x_tables: consistent and unique symbol names
[safe/jmp/linux-2.6] / net / netfilter / xt_NOTRACK.c
1 /* This is a module which is used for setting up fake conntracks
2  * on packets so that they are not seen by the conntrack/NAT code.
3  */
4 #include <linux/module.h>
5 #include <linux/skbuff.h>
6
7 #include <linux/netfilter/x_tables.h>
8 #include <net/netfilter/nf_conntrack.h>
9
10 MODULE_LICENSE("GPL");
11 MODULE_ALIAS("ipt_NOTRACK");
12 MODULE_ALIAS("ip6t_NOTRACK");
13
14 static unsigned int
15 notrack_tg(struct sk_buff *skb, const struct net_device *in,
16            const struct net_device *out, unsigned int hooknum,
17            const struct xt_target *target, const void *targinfo)
18 {
19         /* Previously seen (loopback)? Ignore. */
20         if (skb->nfct != NULL)
21                 return XT_CONTINUE;
22
23         /* Attach fake conntrack entry.
24            If there is a real ct entry correspondig to this packet,
25            it'll hang aroun till timing out. We don't deal with it
26            for performance reasons. JK */
27         skb->nfct = &nf_conntrack_untracked.ct_general;
28         skb->nfctinfo = IP_CT_NEW;
29         nf_conntrack_get(skb->nfct);
30
31         return XT_CONTINUE;
32 }
33
34 static struct xt_target notrack_tg_reg[] __read_mostly = {
35         {
36                 .name           = "NOTRACK",
37                 .family         = AF_INET,
38                 .target         = notrack_tg,
39                 .table          = "raw",
40                 .me             = THIS_MODULE,
41         },
42         {
43                 .name           = "NOTRACK",
44                 .family         = AF_INET6,
45                 .target         = notrack_tg,
46                 .table          = "raw",
47                 .me             = THIS_MODULE,
48         },
49 };
50
51 static int __init notrack_tg_init(void)
52 {
53         return xt_register_targets(notrack_tg_reg, ARRAY_SIZE(notrack_tg_reg));
54 }
55
56 static void __exit notrack_tg_exit(void)
57 {
58         xt_unregister_targets(notrack_tg_reg, ARRAY_SIZE(notrack_tg_reg));
59 }
60
61 module_init(notrack_tg_init);
62 module_exit(notrack_tg_exit);