Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / net / netfilter / xt_TRACE.c
1 /* This is a module which is used to mark packets for tracing.
2  */
3 #include <linux/module.h>
4 #include <linux/skbuff.h>
5
6 #include <linux/netfilter/x_tables.h>
7
8 MODULE_LICENSE("GPL");
9 MODULE_ALIAS("ipt_TRACE");
10 MODULE_ALIAS("ip6t_TRACE");
11
12 static unsigned int
13 target(struct sk_buff *skb,
14        const struct net_device *in,
15        const struct net_device *out,
16        unsigned int hooknum,
17        const struct xt_target *target,
18        const void *targinfo)
19 {
20         skb->nf_trace = 1;
21         return XT_CONTINUE;
22 }
23
24 static struct xt_target xt_trace_target[] __read_mostly = {
25         {
26                 .name           = "TRACE",
27                 .family         = AF_INET,
28                 .target         = target,
29                 .table          = "raw",
30                 .me             = THIS_MODULE,
31         },
32         {
33                 .name           = "TRACE",
34                 .family         = AF_INET6,
35                 .target         = target,
36                 .table          = "raw",
37                 .me             = THIS_MODULE,
38         },
39 };
40
41 static int __init xt_trace_init(void)
42 {
43         return xt_register_targets(xt_trace_target,
44                                    ARRAY_SIZE(xt_trace_target));
45 }
46
47 static void __exit xt_trace_fini(void)
48 {
49         xt_unregister_targets(xt_trace_target, ARRAY_SIZE(xt_trace_target));
50 }
51
52 module_init(xt_trace_init);
53 module_exit(xt_trace_fini);