1 diff -urN iptables.old/extensions/.IMQ-test iptables.dev/extensions/.IMQ-test
2 --- iptables.old/extensions/.IMQ-test 1970-01-01 01:00:00.000000000 +0100
3 +++ iptables.dev/extensions/.IMQ-test 2005-10-09 01:00:36.358959750 +0200
6 +# True if IMQ target patch is applied.
7 +[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
8 diff -urN iptables.old/extensions/.IMQ-test6 iptables.dev/extensions/.IMQ-test6
9 --- iptables.old/extensions/.IMQ-test6 1970-01-01 01:00:00.000000000 +0100
10 +++ iptables.dev/extensions/.IMQ-test6 2005-10-09 01:00:36.358959750 +0200
13 +# True if IMQ target patch is applied.
14 +[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ
15 diff -urN iptables.old/extensions/libip6t_IMQ.c iptables.dev/extensions/libip6t_IMQ.c
16 --- iptables.old/extensions/libip6t_IMQ.c 1970-01-01 01:00:00.000000000 +0100
17 +++ iptables.dev/extensions/libip6t_IMQ.c 2005-10-09 01:00:36.358959750 +0200
19 +/* Shared library add-on to iptables to add IMQ target support. */
25 +#include <ip6tables.h>
26 +#include <linux/netfilter_ipv6/ip6_tables.h>
27 +#include <linux/netfilter_ipv6/ip6t_IMQ.h>
29 +/* Function which prints out usage message. */
34 +"IMQ target v%s options:\n"
35 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
39 +static struct option opts[] = {
40 + { "todev", 1, 0, '1' },
44 +/* Initialize the target. */
46 +init(struct ip6t_entry_target *t, unsigned int *nfcache)
48 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
51 + *nfcache |= NFC_UNKNOWN;
54 +/* Function which parses command options; returns true if it
57 +parse(int c, char **argv, int invert, unsigned int *flags,
58 + const struct ip6t_entry *entry,
59 + struct ip6t_entry_target **target)
61 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
65 + if (check_inverse(optarg, &invert, NULL, 0))
66 + exit_error(PARAMETER_PROBLEM,
67 + "Unexpected `!' after --todev");
68 + mr->todev=atoi(optarg);
77 +final_check(unsigned int flags)
81 +/* Prints out the targinfo. */
83 +print(const struct ip6t_ip6 *ip,
84 + const struct ip6t_entry_target *target,
87 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
89 + printf("IMQ: todev %u ", mr->todev);
92 +/* Saves the union ipt_targinfo in parsable form to stdout. */
94 +save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
96 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
98 + printf("--todev %u", mr->todev);
101 +static struct ip6tables_target imq = {
104 + .version = IPTABLES_VERSION,
105 + .size = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
106 + .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
110 + .final_check = &final_check,
118 + register_target6(&imq);
120 diff -urN iptables.old/extensions/libipt_IMQ.c iptables.dev/extensions/libipt_IMQ.c
121 --- iptables.old/extensions/libipt_IMQ.c 1970-01-01 01:00:00.000000000 +0100
122 +++ iptables.dev/extensions/libipt_IMQ.c 2005-10-09 01:00:36.358959750 +0200
124 +/* Shared library add-on to iptables to add IMQ target support. */
130 +#include <iptables.h>
131 +#include <linux/netfilter_ipv4/ip_tables.h>
132 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
134 +/* Function which prints out usage message. */
139 +"IMQ target v%s options:\n"
140 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
144 +static struct option opts[] = {
145 + { "todev", 1, 0, '1' },
149 +/* Initialize the target. */
151 +init(struct ipt_entry_target *t, unsigned int *nfcache)
153 + struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
156 + *nfcache |= NFC_UNKNOWN;
159 +/* Function which parses command options; returns true if it
162 +parse(int c, char **argv, int invert, unsigned int *flags,
163 + const struct ipt_entry *entry,
164 + struct ipt_entry_target **target)
166 + struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
170 + if (check_inverse(optarg, &invert, NULL, 0))
171 + exit_error(PARAMETER_PROBLEM,
172 + "Unexpected `!' after --todev");
173 + mr->todev=atoi(optarg);
182 +final_check(unsigned int flags)
186 +/* Prints out the targinfo. */
188 +print(const struct ipt_ip *ip,
189 + const struct ipt_entry_target *target,
192 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
194 + printf("IMQ: todev %u ", mr->todev);
197 +/* Saves the union ipt_targinfo in parsable form to stdout. */
199 +save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
201 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
203 + printf("--todev %u", mr->todev);
206 +static struct iptables_target imq = {
209 + .version = IPTABLES_VERSION,
210 + .size = IPT_ALIGN(sizeof(struct ipt_imq_info)),
211 + .userspacesize = IPT_ALIGN(sizeof(struct ipt_imq_info)),
215 + .final_check = &final_check,
223 + register_target(&imq);