1 diff -Naur iptables-1.4.2/extensions/.IMQ-test iptables/extensions/.IMQ-test
2 --- iptables-1.4.2/extensions/.IMQ-test 1970-01-01 10:00:00.000000000 +1000
3 +++ iptables/extensions/.IMQ-test 2008-06-08 22:41:49.000000000 +1000
6 +# True if IMQ target patch is applied.
7 +[ -f $KERNEL_DIR/include/linux/netfilter/xt_IMQ.h ] && echo IMQ
8 diff -Naur iptables-1.4.2/extensions/libipt_IMQ.c iptables/extensions/libipt_IMQ.c
9 --- iptables-1.4.2/extensions/libipt_IMQ.c 1970-01-01 10:00:00.000000000 +1000
10 +++ iptables/extensions/libipt_IMQ.c 2008-06-08 22:46:25.000000000 +1000
12 +/* Shared library add-on to iptables to add IMQ target support. */
19 +#include <linux/netfilter/x_tables.h>
20 +#include <linux/netfilter/xt_IMQ.h>
22 +/* Function which prints out usage message. */
23 +static void IMQ_help(void)
26 +"IMQ target v%s options:\n"
27 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
31 +static struct option IMQ_opts[] = {
32 + { "todev", 1, 0, '1' },
36 +/* Initialize the target. */
37 +static void IMQ_init(struct xt_entry_target *t)
39 + struct xt_imq_info *mr = (struct xt_imq_info*)t->data;
44 +/* Function which parses command options; returns true if it
46 +static int IMQ_parse(int c, char **argv, int invert, unsigned int *flags,
47 + const void *entry, struct xt_entry_target **target)
49 + struct xt_imq_info *mr = (struct xt_imq_info*)(*target)->data;
53 + if (check_inverse(optarg, &invert, NULL, 0))
54 + exit_error(PARAMETER_PROBLEM,
55 + "Unexpected `!' after --todev");
56 + mr->todev=atoi(optarg);
64 +/* Prints out the targinfo. */
65 +static void IMQ_print(const void *ip,
66 + const struct xt_entry_target *target,
69 + struct xt_imq_info *mr = (struct xt_imq_info*)target->data;
71 + printf("IMQ: todev %u ", mr->todev);
74 +/* Saves the union ipt_targinfo in parsable form to stdout. */
75 +static void IMQ_save(const void *ip, const struct xt_entry_target *target)
77 + struct xt_imq_info *mr = (struct xt_imq_info*)target->data;
79 + printf("--todev %u", mr->todev);
82 +static struct xtables_target imq = {
84 + .version = XTABLES_VERSION,
86 + .size = XT_ALIGN(sizeof(struct xt_imq_info)),
87 + .userspacesize = XT_ALIGN(sizeof(struct xt_imq_info)),
93 + .extra_opts = IMQ_opts,
98 + xtables_register_target(&imq);