2007-07-08 05:21:23 +00:00
|
|
|
/* This is a module which is used to mark packets for tracing.
|
|
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/skbuff.h>
|
|
|
|
|
|
|
|
#include <linux/netfilter/x_tables.h>
|
|
|
|
|
2008-01-15 07:42:28 +00:00
|
|
|
MODULE_DESCRIPTION("Xtables: packet flow tracing");
|
2007-07-08 05:21:23 +00:00
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_ALIAS("ipt_TRACE");
|
|
|
|
MODULE_ALIAS("ip6t_TRACE");
|
|
|
|
|
|
|
|
static unsigned int
|
2008-10-08 09:35:19 +00:00
|
|
|
trace_tg(struct sk_buff *skb, const struct xt_target_param *par)
|
2007-07-08 05:21:23 +00:00
|
|
|
{
|
2007-10-15 07:53:15 +00:00
|
|
|
skb->nf_trace = 1;
|
2007-07-08 05:21:23 +00:00
|
|
|
return XT_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2008-10-08 09:35:01 +00:00
|
|
|
static struct xt_target trace_tg_reg __read_mostly = {
|
|
|
|
.name = "TRACE",
|
|
|
|
.revision = 0,
|
|
|
|
.family = NFPROTO_UNSPEC,
|
|
|
|
.table = "raw",
|
|
|
|
.target = trace_tg,
|
|
|
|
.me = THIS_MODULE,
|
2007-07-08 05:21:23 +00:00
|
|
|
};
|
|
|
|
|
2007-12-05 07:24:03 +00:00
|
|
|
static int __init trace_tg_init(void)
|
2007-07-08 05:21:23 +00:00
|
|
|
{
|
2008-10-08 09:35:01 +00:00
|
|
|
return xt_register_target(&trace_tg_reg);
|
2007-07-08 05:21:23 +00:00
|
|
|
}
|
|
|
|
|
2007-12-05 07:24:03 +00:00
|
|
|
static void __exit trace_tg_exit(void)
|
2007-07-08 05:21:23 +00:00
|
|
|
{
|
2008-10-08 09:35:01 +00:00
|
|
|
xt_unregister_target(&trace_tg_reg);
|
2007-07-08 05:21:23 +00:00
|
|
|
}
|
|
|
|
|
2007-12-05 07:24:03 +00:00
|
|
|
module_init(trace_tg_init);
|
|
|
|
module_exit(trace_tg_exit);
|