Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v2.6.24-rc6 53 lines 1.1 kB view raw
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 8MODULE_LICENSE("GPL"); 9MODULE_ALIAS("ipt_TRACE"); 10MODULE_ALIAS("ip6t_TRACE"); 11 12static unsigned int 13target(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 24static 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 41static int __init xt_trace_init(void) 42{ 43 return xt_register_targets(xt_trace_target, 44 ARRAY_SIZE(xt_trace_target)); 45} 46 47static void __exit xt_trace_fini(void) 48{ 49 xt_unregister_targets(xt_trace_target, ARRAY_SIZE(xt_trace_target)); 50} 51 52module_init(xt_trace_init); 53module_exit(xt_trace_fini);