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.
11 #include <linux/module.h>
12 #include <linux/skbuff.h>
14 #include <linux/netfilter.h>
15 #include <linux/netfilter_ipv4/ip_tables.h>
16 #include <linux/netfilter_ipv4/ipt_NFQUEUE.h>
18 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
19 MODULE_DESCRIPTION("iptables NFQUEUE target");
20 MODULE_LICENSE("GPL");
23 target(struct sk_buff **pskb,
24 const struct net_device *in,
25 const struct net_device *out,
30 const struct ipt_NFQ_info *tinfo = targinfo;
32 return NF_QUEUE_NR(tinfo->queuenum);
36 checkentry(const char *tablename,
37 const struct ipt_entry *e,
39 unsigned int targinfosize,
40 unsigned int hook_mask)
42 if (targinfosize != IPT_ALIGN(sizeof(struct ipt_NFQ_info))) {
43 printk(KERN_WARNING "NFQUEUE: targinfosize %u != %Zu\n",
45 IPT_ALIGN(sizeof(struct ipt_NFQ_info)));
52 static struct ipt_target ipt_NFQ_reg = {
55 .checkentry = checkentry,
59 static int __init init(void)
61 return ipt_register_target(&ipt_NFQ_reg);
64 static void __exit fini(void)
66 ipt_unregister_target(&ipt_NFQ_reg);