1 diff -urN iptables-1.2.6a-clean/extensions/.IMQ-test iptables-1.2.6a-imq/extensions/.IMQ-test
2 --- iptables-1.2.6a-clean/extensions/.IMQ-test Thu Jan 1 01:00:00 1970
3 +++ iptables-1.2.6a-imq/extensions/.IMQ-test Mon Apr 29 01:34:33 2002
6 +# True if IMQ target patch is applied.
7 +[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
8 diff -urN iptables-1.2.6a-clean/extensions/.IMQ-test6 iptables-1.2.6a-imq/extensions/.IMQ-test6
9 --- iptables-1.2.6a-clean/extensions/.IMQ-test6 Thu Jan 1 01:00:00 1970
10 +++ iptables-1.2.6a-imq/extensions/.IMQ-test6 Mon Apr 29 01:34:33 2002
13 +# True if IMQ target patch is applied.
14 +[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ
15 diff -urN iptables-1.2.6a-clean/extensions/libip6t_IMQ.c iptables-1.2.6a-imq/extensions/libip6t_IMQ.c
16 --- iptables-1.2.6a-clean/extensions/libip6t_IMQ.c Thu Jan 1 01:00:00 1970
17 +++ iptables-1.2.6a-imq/extensions/libip6t_IMQ.c Mon Apr 29 01:34:33 2002
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);
102 +struct ip6tables_target imq
106 + IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
107 + IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
119 + register_target6(&imq);
121 diff -urN iptables-1.2.6a-clean/extensions/libipt_IMQ.c iptables-1.2.6a-imq/extensions/libipt_IMQ.c
122 --- iptables-1.2.6a-clean/extensions/libipt_IMQ.c Thu Jan 1 01:00:00 1970
123 +++ iptables-1.2.6a-imq/extensions/libipt_IMQ.c Mon Apr 29 01:34:33 2002
125 +/* Shared library add-on to iptables to add IMQ target support. */
131 +#include <iptables.h>
132 +#include <linux/netfilter_ipv4/ip_tables.h>
133 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
135 +/* Function which prints out usage message. */
140 +"IMQ target v%s options:\n"
141 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
145 +static struct option opts[] = {
146 + { "todev", 1, 0, '1' },
150 +/* Initialize the target. */
152 +init(struct ipt_entry_target *t, unsigned int *nfcache)
154 + struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
157 + *nfcache |= NFC_UNKNOWN;
160 +/* Function which parses command options; returns true if it
163 +parse(int c, char **argv, int invert, unsigned int *flags,
164 + const struct ipt_entry *entry,
165 + struct ipt_entry_target **target)
167 + struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
171 + if (check_inverse(optarg, &invert, NULL, 0))
172 + exit_error(PARAMETER_PROBLEM,
173 + "Unexpected `!' after --todev");
174 + mr->todev=atoi(optarg);
183 +final_check(unsigned int flags)
187 +/* Prints out the targinfo. */
189 +print(const struct ipt_ip *ip,
190 + const struct ipt_entry_target *target,
193 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
195 + printf("IMQ: todev %u ", mr->todev);
198 +/* Saves the union ipt_targinfo in parsable form to stdout. */
200 +save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
202 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
204 + printf("--todev %u", mr->todev);
208 +struct iptables_target imq
212 + IPT_ALIGN(sizeof(struct ipt_imq_info)),
213 + IPT_ALIGN(sizeof(struct ipt_imq_info)),
225 + register_target(&imq);
227 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch
228 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch Thu Jan 1 01:00:00 1970
229 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch Mon Apr 29 01:34:33 2002
231 +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
232 +--- linux-2.4.18-clean/include/linux/netfilter_ipv4/ipt_IMQ.h Thu Jan 1 01:00:00 1970
233 ++++ linux-2.4.18-imq-nf/include/linux/netfilter_ipv4/ipt_IMQ.h Tue Apr 2 21:35:20 2002
238 ++struct ipt_imq_info {
239 ++ unsigned int todev; /* target imq device */
242 ++#endif /* _IPT_IMQ_H */
243 +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
244 +--- linux-2.4.18-clean/net/ipv4/netfilter/ipt_IMQ.c Thu Jan 1 01:00:00 1970
245 ++++ linux-2.4.18-imq-nf/net/ipv4/netfilter/ipt_IMQ.c Tue Apr 2 21:34:15 2002
247 ++/* This target marks packets to be enqueued to an imq device */
248 ++#include <linux/module.h>
249 ++#include <linux/skbuff.h>
250 ++#include <linux/netfilter_ipv4/ip_tables.h>
251 ++#include <linux/netfilter_ipv4/ipt_IMQ.h>
252 ++#include <linux/imq.h>
254 ++static unsigned int imq_target(struct sk_buff **pskb,
255 ++ unsigned int hooknum,
256 ++ const struct net_device *in,
257 ++ const struct net_device *out,
258 ++ const void *targinfo,
261 ++ struct ipt_imq_info *mr = (struct ipt_imq_info*)targinfo;
263 ++ (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
264 ++ (*pskb)->nfcache |= NFC_ALTERED;
266 ++ return IPT_CONTINUE;
269 ++static int imq_checkentry(const char *tablename,
270 ++ const struct ipt_entry *e,
272 ++ unsigned int targinfosize,
273 ++ unsigned int hook_mask)
275 ++ struct ipt_imq_info *mr;
277 ++ if (targinfosize != IPT_ALIGN(sizeof(struct ipt_imq_info))) {
278 ++ printk(KERN_WARNING "IMQ: invalid targinfosize\n");
281 ++ mr = (struct ipt_imq_info*)targinfo;
283 ++ if (strcmp(tablename, "mangle") != 0) {
284 ++ printk(KERN_WARNING
285 ++ "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
290 ++ if (mr->todev > IMQ_MAX_DEVS) {
291 ++ printk(KERN_WARNING
292 ++ "IMQ: invalid device specified, highest is %u\n",
300 ++static struct ipt_target ipt_imq_reg = {
309 ++static int __init init(void)
311 ++ if (ipt_register_target(&ipt_imq_reg))
317 ++static void __exit fini(void)
319 ++ ipt_unregister_target(&ipt_imq_reg);
324 ++MODULE_LICENSE("GPL");
325 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.config.in iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.config.in
326 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.config.in Thu Jan 1 01:00:00 1970
327 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.config.in Mon Apr 29 01:34:33 2002
329 + dep_tristate ' MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
330 + dep_tristate ' IMQ target support' CONFIG_IP_NF_TARGET_IMQ $CONFIG_IP_NF_MANGLE
331 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.configure.help iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.configure.help
332 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.configure.help Thu Jan 1 01:00:00 1970
333 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.configure.help Mon Apr 29 01:34:33 2002
335 +CONFIG_IP_NF_TARGET_MARK
337 +CONFIG_IP_NF_TARGET_IMQ
338 + This option adds a `IMQ' target which is used to specify if and
339 + to which imq device packets should get enqueued/dequeued.
341 + If you want to compile it as a module, say M here and read
342 + <file:Documentation/modules.txt>. If unsure, say `N'.
343 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.help iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.help
344 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.help Thu Jan 1 01:00:00 1970
345 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.help Mon Apr 29 01:34:33 2002
347 +Author: Patrick McHardy <kaber@trash.net>
350 + This patch adds a new target 'IMQ' which is required
351 + to direct packets through an imq device.
352 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6 iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6
353 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6 Thu Jan 1 01:00:00 1970
354 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6 Mon Apr 29 01:34:33 2002
356 +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
357 +--- linux-2.4.18-clean/include/linux/netfilter_ipv6/ip6t_IMQ.h Thu Jan 1 01:00:00 1970
358 ++++ linux-2.4.18-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h Sun Apr 28 23:34:53 2002
360 ++#ifndef _IP6T_IMQ_H
361 ++#define _IP6T_IMQ_H
363 ++struct ip6t_imq_info {
364 ++ unsigned int todev; /* target imq device */
367 ++#endif /* _IP6T_IMQ_H */
368 +diff -urN linux-2.4.18-clean/net/ipv6/netfilter/ip6t_IMQ.c linux-2.4.18-imq/net/ipv6/netfilter/ip6t_IMQ.c
369 +--- linux-2.4.18-clean/net/ipv6/netfilter/ip6t_IMQ.c Thu Jan 1 01:00:00 1970
370 ++++ linux-2.4.18-imq/net/ipv6/netfilter/ip6t_IMQ.c Sun Apr 28 23:34:11 2002
372 ++/* This target marks packets to be enqueued to an imq device */
373 ++#include <linux/module.h>
374 ++#include <linux/skbuff.h>
375 ++#include <linux/netfilter_ipv6/ip6_tables.h>
376 ++#include <linux/netfilter_ipv6/ip6t_IMQ.h>
377 ++#include <linux/imq.h>
379 ++static unsigned int imq_target(struct sk_buff **pskb,
380 ++ unsigned int hooknum,
381 ++ const struct net_device *in,
382 ++ const struct net_device *out,
383 ++ const void *targinfo,
386 ++ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)targinfo;
388 ++ (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
389 ++ (*pskb)->nfcache |= NFC_ALTERED;
391 ++ return IP6T_CONTINUE;
394 ++static int imq_checkentry(const char *tablename,
395 ++ const struct ip6t_entry *e,
397 ++ unsigned int targinfosize,
398 ++ unsigned int hook_mask)
400 ++ struct ip6t_imq_info *mr;
402 ++ if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_imq_info))) {
403 ++ printk(KERN_WARNING "IMQ: invalid targinfosize\n");
406 ++ mr = (struct ip6t_imq_info*)targinfo;
408 ++ if (strcmp(tablename, "mangle") != 0) {
409 ++ printk(KERN_WARNING
410 ++ "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
415 ++ if (mr->todev > IMQ_MAX_DEVS) {
416 ++ printk(KERN_WARNING
417 ++ "IMQ: invalid device specified, highest is %u\n",
425 ++static struct ip6t_target ip6t_imq_reg = {
434 ++static int __init init(void)
436 ++ if (ip6t_register_target(&ip6t_imq_reg))
442 ++static void __exit fini(void)
444 ++ ip6t_unregister_target(&ip6t_imq_reg);
449 ++MODULE_LICENSE("GPL");
450 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.config.in iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.config.in
451 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.config.in Thu Jan 1 01:00:00 1970
452 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.config.in Mon Apr 29 01:34:33 2002
454 + dep_tristate ' MARK target support' CONFIG_IP6_NF_TARGET_MARK $CONFIG_IP6_NF_MANGLE
455 + dep_tristate ' IMQ target support' CONFIG_IP6_NF_TARGET_IMQ $CONFIG_IP6_NF_MANGLE
456 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.configure.help iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.configure.help
457 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.configure.help Thu Jan 1 01:00:00 1970
458 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.configure.help Mon Apr 29 01:34:33 2002
460 +CONFIG_IP6_NF_TARGET_MARK
462 +CONFIG_IP6_NF_TARGET_IMQ
463 + This option adds a `IMQ' target which is used to specify if and
464 + to which imq device packets should get enqueued/dequeued.
466 + If you want to compile it as a module, say M here and read
467 + <file:Documentation/modules.txt>. If unsure, say `N'.
468 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.help iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.help
469 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.help Thu Jan 1 01:00:00 1970
470 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.help Mon Apr 29 01:34:33 2002
472 +Author: Patrick McHardy <kaber@trash.net>
475 + This patch adds a new target 'IMQ' which is required
476 + to direct packets through an imq device.
477 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.makefile iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.makefile
478 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.ipv6.makefile Thu Jan 1 01:00:00 1970
479 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.ipv6.makefile Mon Apr 29 01:34:33 2002
481 +obj-$(CONFIG_IP6_NF_TARGET_MARK) += ip6t_MARK.o
482 +obj-$(CONFIG_IP6_NF_TARGET_IMQ) += ip6t_IMQ.o
483 diff -urN iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.makefile iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.makefile
484 --- iptables-1.2.6a-clean/patch-o-matic/extra/IMQ.patch.makefile Thu Jan 1 01:00:00 1970
485 +++ iptables-1.2.6a-imq/patch-o-matic/extra/IMQ.patch.makefile Mon Apr 29 01:34:33 2002
487 +obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o
488 +obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o