allow coexistance of N build and AC build.
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / net / netfilter / xt_IMQ.c
blob0494674b64602c00055db9356578661f8c0fd9a5
1 /*
2 * This target marks packets to be enqueued to an imq device
3 */
4 #include <linux/module.h>
5 #include <linux/skbuff.h>
6 #include <linux/netfilter/x_tables.h>
7 #include <linux/netfilter/xt_IMQ.h>
8 #include <linux/imq.h>
10 static unsigned int imq_target(struct sk_buff *skb,
11 const struct net_device *in,
12 const struct net_device *out,
13 unsigned int hooknum,
14 const struct xt_target *target,
15 const void *targinfo)
17 struct xt_imq_info *mr = (struct xt_imq_info*)targinfo;
19 skb->imq_flags = mr->todev | IMQ_F_ENQUEUE;
21 return XT_CONTINUE;
24 static int imq_checkentry(const char *tablename,
25 const void *e,
26 const struct xt_target *target,
27 void *targinfo,
28 unsigned int hook_mask)
30 struct xt_imq_info *mr = (struct xt_imq_info*)targinfo;
32 if (mr->todev > IMQ_MAX_DEVS) {
33 printk(KERN_WARNING
34 "IMQ: invalid device specified, highest is %u\n",
35 IMQ_MAX_DEVS);
36 return 0;
39 return 1;
42 static struct xt_target xt_imq_reg[] __read_mostly = {
44 .name = "IMQ",
45 .family = AF_INET,
46 .target = imq_target,
47 .targetsize = sizeof(struct xt_imq_info),
48 .checkentry = imq_checkentry,
49 .me = THIS_MODULE,
50 .table = "mangle"
53 .name = "IMQ",
54 .family = AF_INET6,
55 .target = imq_target,
56 .targetsize = sizeof(struct xt_imq_info),
57 .table = "mangle",
58 .checkentry = imq_checkentry,
59 .me = THIS_MODULE
63 static int __init init(void)
65 return xt_register_targets(xt_imq_reg, ARRAY_SIZE(xt_imq_reg));
68 static void __exit fini(void)
70 xt_unregister_targets(xt_imq_reg, ARRAY_SIZE(xt_imq_reg));
73 module_init(init);
74 module_exit(fini);
76 MODULE_ALIAS("ipt_IMQ");
77 MODULE_ALIAS("ip6t_IMQ");
78 MODULE_AUTHOR("http://www.linuximq.net");
79 MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information.");
80 MODULE_LICENSE("GPL");