1 diff -uNr iptables-1.2.9_20040308.orig/extensions/.IMQ-test iptables-1.2.9_20040308/extensions/.IMQ-test
2 --- iptables-1.2.9_20040308.orig/extensions/.IMQ-test 1970-01-01 01:00:00.000000000 +0100
3 +++ iptables-1.2.9_20040308/extensions/.IMQ-test 2004-03-14 14:55:14.623395152 +0100
6 +# True if IMQ target patch is applied.
7 +[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
8 diff -uNr iptables-1.2.9_20040308.orig/extensions/libipt_IMQ.c iptables-1.2.9_20040308/extensions/libipt_IMQ.c
9 --- iptables-1.2.9_20040308.orig/extensions/libipt_IMQ.c 1970-01-01 01:00:00.000000000 +0100
10 +++ iptables-1.2.9_20040308/extensions/libipt_IMQ.c 2004-03-14 14:56:05.363681456 +0100
12 +/* Shared library add-on to iptables to add IMQ target support. */
18 +#include <iptables.h>
19 +#include <linux/netfilter_ipv4/ip_tables.h>
20 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
22 +/* Function which prints out usage message. */
27 +"IMQ target v%s options:\n"
28 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
32 +static struct option opts[] = {
33 + { "todev", 1, 0, '1' },
37 +/* Initialize the target. */
39 +init(struct ipt_entry_target *t, unsigned int *nfcache)
41 + struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
44 + *nfcache |= NFC_UNKNOWN;
47 +/* Function which parses command options; returns true if it
50 +parse(int c, char **argv, int invert, unsigned int *flags,
51 + const struct ipt_entry *entry,
52 + struct ipt_entry_target **target)
54 + struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
58 + if (check_inverse(optarg, &invert, NULL, 0))
59 + exit_error(PARAMETER_PROBLEM,
60 + "Unexpected `!' after --todev");
61 + mr->todev=atoi(optarg);
70 +final_check(unsigned int flags)
74 +/* Prints out the targinfo. */
76 +print(const struct ipt_ip *ip,
77 + const struct ipt_entry_target *target,
80 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
82 + printf("IMQ: todev %u ", mr->todev);
85 +/* Saves the union ipt_targinfo in parsable form to stdout. */
87 +save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
89 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
91 + printf("--todev %u", mr->todev);
95 +struct iptables_target imq
99 + IPT_ALIGN(sizeof(struct ipt_imq_info)),
100 + IPT_ALIGN(sizeof(struct ipt_imq_info)),
112 + register_target(&imq);