1 diff -urN a/userspace/IMQ.patch b/userspace/IMQ.patch
2 --- a/userspace/IMQ.patch 1970-01-01 01:00:00.000000000 +0100
3 +++ b/userspace/IMQ.patch 2003-06-16 22:00:04.000000000 +0200
5 +diff -urN linux-2.4.18-clean/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.4.18-imq-nf/include/linux/netfilter_ipv4/ipt_IMQ.h
6 +--- linux-2.4.18-clean/include/linux/netfilter_ipv4/ipt_IMQ.h Thu Jan 1 01:00:00 1970
7 ++++ linux-2.4.18-imq-nf/include/linux/netfilter_ipv4/ipt_IMQ.h Tue Apr 2 21:35:20 2002
12 ++struct ipt_imq_info {
13 ++ unsigned int todev; /* target imq device */
16 ++#endif /* _IPT_IMQ_H */
17 +diff -urN linux-2.4.18-clean/net/ipv4/netfilter/ipt_IMQ.c linux-2.4.18-imq-nf/net/ipv4/netfilter/ipt_IMQ.c
18 +--- linux-2.4.18-clean/net/ipv4/netfilter/ipt_IMQ.c Thu Jan 1 01:00:00 1970
19 ++++ linux-2.4.18-imq-nf/net/ipv4/netfilter/ipt_IMQ.c Tue Apr 2 21:34:15 2002
21 ++/* This target marks packets to be enqueued to an imq device */
22 ++#include <linux/module.h>
23 ++#include <linux/skbuff.h>
24 ++#include <linux/netfilter_ipv4/ip_tables.h>
25 ++#include <linux/netfilter_ipv4/ipt_IMQ.h>
26 ++#include <linux/imq.h>
28 ++static unsigned int imq_target(struct sk_buff **pskb,
29 ++ unsigned int hooknum,
30 ++ const struct net_device *in,
31 ++ const struct net_device *out,
32 ++ const void *targinfo,
35 ++ struct ipt_imq_info *mr = (struct ipt_imq_info*)targinfo;
37 ++ (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
38 ++ (*pskb)->nfcache |= NFC_ALTERED;
40 ++ return IPT_CONTINUE;
43 ++static int imq_checkentry(const char *tablename,
44 ++ const struct ipt_entry *e,
46 ++ unsigned int targinfosize,
47 ++ unsigned int hook_mask)
49 ++ struct ipt_imq_info *mr;
51 ++ if (targinfosize != IPT_ALIGN(sizeof(struct ipt_imq_info))) {
52 ++ printk(KERN_WARNING "IMQ: invalid targinfosize\n");
55 ++ mr = (struct ipt_imq_info*)targinfo;
57 ++ if (strcmp(tablename, "mangle") != 0) {
58 ++ printk(KERN_WARNING
59 ++ "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
64 ++ if (mr->todev > IMQ_MAX_DEVS) {
65 ++ printk(KERN_WARNING
66 ++ "IMQ: invalid device specified, highest is %u\n",
74 ++static struct ipt_target ipt_imq_reg = {
83 ++static int __init init(void)
85 ++ if (ipt_register_target(&ipt_imq_reg))
91 ++static void __exit fini(void)
93 ++ ipt_unregister_target(&ipt_imq_reg);
98 ++MODULE_LICENSE("GPL");
99 diff -urN a/userspace/IMQ.patch.config.in b/userspace/IMQ.patch.config.in
100 --- a/userspace/IMQ.patch.config.in 1970-01-01 01:00:00.000000000 +0100
101 +++ b/userspace/IMQ.patch.config.in 2003-06-16 22:00:04.000000000 +0200
103 + dep_tristate ' MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
104 + dep_tristate ' IMQ target support' CONFIG_IP_NF_TARGET_IMQ $CONFIG_IP_NF_MANGLE
105 diff -urN a/userspace/IMQ.patch.configure.help b/userspace/IMQ.patch.configure.help
106 --- a/userspace/IMQ.patch.configure.help 1970-01-01 01:00:00.000000000 +0100
107 +++ b/userspace/IMQ.patch.configure.help 2003-06-16 22:00:04.000000000 +0200
109 +CONFIG_IP_NF_TARGET_MARK
111 +CONFIG_IP_NF_TARGET_IMQ
112 + This option adds a `IMQ' target which is used to specify if and
113 + to which imq device packets should get enqueued/dequeued.
115 + If you want to compile it as a module, say M here and read
116 + <file:Documentation/modules.txt>. If unsure, say `N'.
117 diff -urN a/userspace/IMQ.patch.help b/userspace/IMQ.patch.help
118 --- a/userspace/IMQ.patch.help 1970-01-01 01:00:00.000000000 +0100
119 +++ b/userspace/IMQ.patch.help 2003-06-16 22:00:04.000000000 +0200
121 +Author: Patrick McHardy <kaber@trash.net>
124 + This patch adds a new target 'IMQ' which is required
125 + to direct packets through an imq device.
126 diff -urN a/userspace/IMQ.patch.ipv6 b/userspace/IMQ.patch.ipv6
127 --- a/userspace/IMQ.patch.ipv6 1970-01-01 01:00:00.000000000 +0100
128 +++ b/userspace/IMQ.patch.ipv6 2003-06-16 22:00:04.000000000 +0200
130 +diff -urN linux-2.4.18-clean/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.4.18-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h
131 +--- linux-2.4.18-clean/include/linux/netfilter_ipv6/ip6t_IMQ.h Thu Jan 1 01:00:00 1970
132 ++++ linux-2.4.18-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h Sun Apr 28 23:34:53 2002
134 ++#ifndef _IP6T_IMQ_H
135 ++#define _IP6T_IMQ_H
137 ++struct ip6t_imq_info {
138 ++ unsigned int todev; /* target imq device */
141 ++#endif /* _IP6T_IMQ_H */
142 +diff -urN linux-2.4.18-clean/net/ipv6/netfilter/ip6t_IMQ.c linux-2.4.18-imq/net/ipv6/netfilter/ip6t_IMQ.c
143 +--- linux-2.4.18-clean/net/ipv6/netfilter/ip6t_IMQ.c Thu Jan 1 01:00:00 1970
144 ++++ linux-2.4.18-imq/net/ipv6/netfilter/ip6t_IMQ.c Sun Apr 28 23:34:11 2002
146 ++/* This target marks packets to be enqueued to an imq device */
147 ++#include <linux/module.h>
148 ++#include <linux/skbuff.h>
149 ++#include <linux/netfilter_ipv6/ip6_tables.h>
150 ++#include <linux/netfilter_ipv6/ip6t_IMQ.h>
151 ++#include <linux/imq.h>
153 ++static unsigned int imq_target(struct sk_buff **pskb,
154 ++ unsigned int hooknum,
155 ++ const struct net_device *in,
156 ++ const struct net_device *out,
157 ++ const void *targinfo,
160 ++ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)targinfo;
162 ++ (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
163 ++ (*pskb)->nfcache |= NFC_ALTERED;
165 ++ return IP6T_CONTINUE;
168 ++static int imq_checkentry(const char *tablename,
169 ++ const struct ip6t_entry *e,
171 ++ unsigned int targinfosize,
172 ++ unsigned int hook_mask)
174 ++ struct ip6t_imq_info *mr;
176 ++ if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_imq_info))) {
177 ++ printk(KERN_WARNING "IMQ: invalid targinfosize\n");
180 ++ mr = (struct ip6t_imq_info*)targinfo;
182 ++ if (strcmp(tablename, "mangle") != 0) {
183 ++ printk(KERN_WARNING
184 ++ "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
189 ++ if (mr->todev > IMQ_MAX_DEVS) {
190 ++ printk(KERN_WARNING
191 ++ "IMQ: invalid device specified, highest is %u\n",
199 ++static struct ip6t_target ip6t_imq_reg = {
208 ++static int __init init(void)
210 ++ if (ip6t_register_target(&ip6t_imq_reg))
216 ++static void __exit fini(void)
218 ++ ip6t_unregister_target(&ip6t_imq_reg);
223 ++MODULE_LICENSE("GPL");
224 diff -urN a/userspace/IMQ.patch.ipv6.config.in b/userspace/IMQ.patch.ipv6.config.in
225 --- a/userspace/IMQ.patch.ipv6.config.in 1970-01-01 01:00:00.000000000 +0100
226 +++ b/userspace/IMQ.patch.ipv6.config.in 2003-06-16 22:00:04.000000000 +0200
228 + dep_tristate ' MARK target support' CONFIG_IP6_NF_TARGET_MARK $CONFIG_IP6_NF_MANGLE
229 + dep_tristate ' IMQ target support' CONFIG_IP6_NF_TARGET_IMQ $CONFIG_IP6_NF_MANGLE
230 diff -urN a/userspace/IMQ.patch.ipv6.configure.help b/userspace/IMQ.patch.ipv6.configure.help
231 --- a/userspace/IMQ.patch.ipv6.configure.help 1970-01-01 01:00:00.000000000 +0100
232 +++ b/userspace/IMQ.patch.ipv6.configure.help 2003-06-16 22:00:04.000000000 +0200
234 +CONFIG_IP6_NF_TARGET_MARK
236 +CONFIG_IP6_NF_TARGET_IMQ
237 + This option adds a `IMQ' target which is used to specify if and
238 + to which imq device packets should get enqueued/dequeued.
240 + If you want to compile it as a module, say M here and read
241 + <file:Documentation/modules.txt>. If unsure, say `N'.
242 diff -urN a/userspace/IMQ.patch.ipv6.help b/userspace/IMQ.patch.ipv6.help
243 --- a/userspace/IMQ.patch.ipv6.help 1970-01-01 01:00:00.000000000 +0100
244 +++ b/userspace/IMQ.patch.ipv6.help 2003-06-16 22:00:04.000000000 +0200
246 +Author: Patrick McHardy <kaber@trash.net>
249 + This patch adds a new target 'IMQ' which is required
250 + to direct packets through an imq device.
251 diff -urN a/userspace/IMQ.patch.ipv6.makefile b/userspace/IMQ.patch.ipv6.makefile
252 --- a/userspace/IMQ.patch.ipv6.makefile 1970-01-01 01:00:00.000000000 +0100
253 +++ b/userspace/IMQ.patch.ipv6.makefile 2003-06-16 22:00:04.000000000 +0200
255 +obj-$(CONFIG_IP6_NF_TARGET_MARK) += ip6t_MARK.o
256 +obj-$(CONFIG_IP6_NF_TARGET_IMQ) += ip6t_IMQ.o
257 diff -urN a/userspace/IMQ.patch.ipv6.userspace b/userspace/IMQ.patch.ipv6.userspace
258 --- a/userspace/IMQ.patch.ipv6.userspace 1970-01-01 01:00:00.000000000 +0100
259 +++ b/userspace/IMQ.patch.ipv6.userspace 2003-06-16 22:00:00.000000000 +0200
261 +--- userspace/extensions.orig/.IMQ-test6 Thu Jan 1 01:00:00 1970
262 ++++ userspace/extensions/.IMQ-test6 Mon Jun 16 10:12:47 2003
265 ++# True if IMQ target patch is applied.
266 ++[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ
267 +--- userspace/extensions.orig/libip6t_IMQ.c Thu Jan 1 01:00:00 1970
268 ++++ userspace/extensions/libip6t_IMQ.c Mon Jun 16 10:12:47 2003
270 ++/* Shared library add-on to iptables to add IMQ target support. */
272 ++#include <string.h>
273 ++#include <stdlib.h>
274 ++#include <getopt.h>
276 ++#include <ip6tables.h>
277 ++#include <linux/netfilter_ipv6/ip6_tables.h>
278 ++#include <linux/netfilter_ipv6/ip6t_IMQ.h>
280 ++/* Function which prints out usage message. */
285 ++"IMQ target v%s options:\n"
286 ++" --todev <N> enqueue to imq<N>, defaults to 0\n",
290 ++static struct option opts[] = {
291 ++ { "todev", 1, 0, '1' },
295 ++/* Initialize the target. */
297 ++init(struct ip6t_entry_target *t, unsigned int *nfcache)
299 ++ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
302 ++ *nfcache |= NFC_UNKNOWN;
305 ++/* Function which parses command options; returns true if it
308 ++parse(int c, char **argv, int invert, unsigned int *flags,
309 ++ const struct ip6t_entry *entry,
310 ++ struct ip6t_entry_target **target)
312 ++ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
316 ++ if (check_inverse(optarg, &invert, NULL, 0))
317 ++ exit_error(PARAMETER_PROBLEM,
318 ++ "Unexpected `!' after --todev");
319 ++ mr->todev=atoi(optarg);
328 ++final_check(unsigned int flags)
332 ++/* Prints out the targinfo. */
334 ++print(const struct ip6t_ip6 *ip,
335 ++ const struct ip6t_entry_target *target,
338 ++ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
340 ++ printf("IMQ: todev %u ", mr->todev);
343 ++/* Saves the union ipt_targinfo in parsable form to stdout. */
345 ++save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
347 ++ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
349 ++ printf("--todev %u", mr->todev);
353 ++struct ip6tables_target imq
357 ++ IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
358 ++ IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
370 ++ register_target6(&imq);
372 diff -urN a/userspace/IMQ.patch.makefile b/userspace/IMQ.patch.makefile
373 --- a/userspace/IMQ.patch.makefile 1970-01-01 01:00:00.000000000 +0100
374 +++ b/userspace/IMQ.patch.makefile 2003-06-16 22:00:04.000000000 +0200
376 +obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o
377 +obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o
378 diff -urN a/userspace/IMQ.patch.userspace b/userspace/IMQ.patch.userspace
379 --- a/userspace/IMQ.patch.userspace 1970-01-01 01:00:00.000000000 +0100
380 +++ b/userspace/IMQ.patch.userspace 2003-06-16 22:00:00.000000000 +0200
382 +--- userspace/extensions.orig/.IMQ-test Thu Jan 1 01:00:00 1970
383 ++++ userspace/extensions/.IMQ-test Mon Jun 16 10:12:47 2003
386 ++# True if IMQ target patch is applied.
387 ++[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
388 +--- userspace/extensions.orig/libipt_IMQ.c Thu Jan 1 01:00:00 1970
389 ++++ userspace/extensions/libipt_IMQ.c Mon Jun 16 10:12:47 2003
391 ++/* Shared library add-on to iptables to add IMQ target support. */
393 ++#include <string.h>
394 ++#include <stdlib.h>
395 ++#include <getopt.h>
397 ++#include <iptables.h>
398 ++#include <linux/netfilter_ipv4/ip_tables.h>
399 ++#include <linux/netfilter_ipv4/ipt_IMQ.h>
401 ++/* Function which prints out usage message. */
406 ++"IMQ target v%s options:\n"
407 ++" --todev <N> enqueue to imq<N>, defaults to 0\n",
411 ++static struct option opts[] = {
412 ++ { "todev", 1, 0, '1' },
416 ++/* Initialize the target. */
418 ++init(struct ipt_entry_target *t, unsigned int *nfcache)
420 ++ struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
423 ++ *nfcache |= NFC_UNKNOWN;
426 ++/* Function which parses command options; returns true if it
429 ++parse(int c, char **argv, int invert, unsigned int *flags,
430 ++ const struct ipt_entry *entry,
431 ++ struct ipt_entry_target **target)
433 ++ struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
437 ++ if (check_inverse(optarg, &invert, NULL, 0))
438 ++ exit_error(PARAMETER_PROBLEM,
439 ++ "Unexpected `!' after --todev");
440 ++ mr->todev=atoi(optarg);
449 ++final_check(unsigned int flags)
453 ++/* Prints out the targinfo. */
455 ++print(const struct ipt_ip *ip,
456 ++ const struct ipt_entry_target *target,
459 ++ struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
461 ++ printf("IMQ: todev %u ", mr->todev);
464 ++/* Saves the union ipt_targinfo in parsable form to stdout. */
466 ++save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
468 ++ struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
470 ++ printf("--todev %u", mr->todev);
474 ++struct iptables_target imq
478 ++ IPT_ALIGN(sizeof(struct ipt_imq_info)),
479 ++ IPT_ALIGN(sizeof(struct ipt_imq_info)),
491 ++ register_target(&imq);