Use helpers to obtain task pid in printks (arch code)
[wrt350n-kernel.git] / net / netfilter / xt_TRACE.c
blob26c5d08ab2c27f48903d74dbd2744acc72fb027b
1 /* This is a module which is used to mark packets for tracing.
2 */
3 #include <linux/module.h>
4 #include <linux/skbuff.h>
6 #include <linux/netfilter/x_tables.h>
8 MODULE_LICENSE("GPL");
9 MODULE_ALIAS("ipt_TRACE");
10 MODULE_ALIAS("ip6t_TRACE");
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)
20 skb->nf_trace = 1;
21 return XT_CONTINUE;
24 static struct xt_target xt_trace_target[] __read_mostly = {
26 .name = "TRACE",
27 .family = AF_INET,
28 .target = target,
29 .table = "raw",
30 .me = THIS_MODULE,
33 .name = "TRACE",
34 .family = AF_INET6,
35 .target = target,
36 .table = "raw",
37 .me = THIS_MODULE,
41 static int __init xt_trace_init(void)
43 return xt_register_targets(xt_trace_target,
44 ARRAY_SIZE(xt_trace_target));
47 static void __exit xt_trace_fini(void)
49 xt_unregister_targets(xt_trace_target, ARRAY_SIZE(xt_trace_target));
52 module_init(xt_trace_init);
53 module_exit(xt_trace_fini);