i386: Reserve the right performance counter for the Intel PerfMon NMI watchdog
[usb.git] / net / netfilter / xt_NFQUEUE.c
blob13f59f3e8c3814db0f820720794146ffdda74366
1 /* iptables module for using new netfilter netlink queue
3 * (C) 2005 by Harald Welte <laforge@netfilter.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 */
11 #include <linux/module.h>
12 #include <linux/skbuff.h>
14 #include <linux/netfilter.h>
15 #include <linux/netfilter_arp.h>
16 #include <linux/netfilter/x_tables.h>
17 #include <linux/netfilter/xt_NFQUEUE.h>
19 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
20 MODULE_DESCRIPTION("[ip,ip6,arp]_tables NFQUEUE target");
21 MODULE_LICENSE("GPL");
22 MODULE_ALIAS("ipt_NFQUEUE");
23 MODULE_ALIAS("ip6t_NFQUEUE");
24 MODULE_ALIAS("arpt_NFQUEUE");
26 static unsigned int
27 target(struct sk_buff **pskb,
28 const struct net_device *in,
29 const struct net_device *out,
30 unsigned int hooknum,
31 const struct xt_target *target,
32 const void *targinfo)
34 const struct xt_NFQ_info *tinfo = targinfo;
36 return NF_QUEUE_NR(tinfo->queuenum);
39 static struct xt_target xt_nfqueue_target[] __read_mostly = {
41 .name = "NFQUEUE",
42 .family = AF_INET,
43 .target = target,
44 .targetsize = sizeof(struct xt_NFQ_info),
45 .me = THIS_MODULE,
48 .name = "NFQUEUE",
49 .family = AF_INET6,
50 .target = target,
51 .targetsize = sizeof(struct xt_NFQ_info),
52 .me = THIS_MODULE,
55 .name = "NFQUEUE",
56 .family = NF_ARP,
57 .target = target,
58 .targetsize = sizeof(struct xt_NFQ_info),
59 .me = THIS_MODULE,
63 static int __init xt_nfqueue_init(void)
65 return xt_register_targets(xt_nfqueue_target,
66 ARRAY_SIZE(xt_nfqueue_target));
69 static void __exit xt_nfqueue_fini(void)
71 xt_unregister_targets(xt_nfqueue_target, ARRAY_SIZE(xt_nfqueue_target));
74 module_init(xt_nfqueue_init);
75 module_exit(xt_nfqueue_fini);