2 * This target marks packets to be enqueued to an imq device
4 #include <linux/module.h>
5 #include <linux/skbuff.h>
6 #include <linux/netfilter/x_tables.h>
7 #include <linux/netfilter/xt_IMQ.h>
10 static unsigned int imq_target(struct sk_buff
*skb
,
11 const struct net_device
*in
,
12 const struct net_device
*out
,
14 const struct xt_target
*target
,
17 struct xt_imq_info
*mr
= (struct xt_imq_info
*)targinfo
;
19 skb
->imq_flags
= mr
->todev
| IMQ_F_ENQUEUE
;
24 static int imq_checkentry(const char *tablename
,
26 const struct xt_target
*target
,
28 unsigned int hook_mask
)
30 struct xt_imq_info
*mr
= (struct xt_imq_info
*)targinfo
;
32 if (mr
->todev
> IMQ_MAX_DEVS
) {
34 "IMQ: invalid device specified, highest is %u\n",
42 static struct xt_target xt_imq_reg
[] __read_mostly
= {
47 .targetsize
= sizeof(struct xt_imq_info
),
48 .checkentry
= imq_checkentry
,
56 .targetsize
= sizeof(struct xt_imq_info
),
58 .checkentry
= imq_checkentry
,
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
));
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");