1 --- iptables-1.4.1-rc3.orig/extensions/.IMQ-test 1970-01-01 10:00:00.000000000 +1000
2 +++ iptables-1.4.1-rc3/extensions/.IMQ-test 2008-06-08 22:41:49.000000000 +1000
5 +# True if IMQ target patch is applied.
6 +[ -f $KERNEL_DIR/include/linux/netfilter_ipv4/ipt_IMQ.h ] && echo IMQ
7 diff -pruN iptables-1.4.1-rc3.orig/extensions/.IMQ-test6 iptables-1.4.1-rc3/extensions/.IMQ-test6
8 --- iptables-1.4.1-rc3.orig/extensions/.IMQ-test6 1970-01-01 10:00:00.000000000 +1000
9 +++ iptables-1.4.1-rc3/extensions/.IMQ-test6 2008-06-08 22:41:49.000000000 +1000
12 +# True if IMQ target patch is applied.
13 +[ -f $KERNEL_DIR/include/linux/netfilter_ipv6/ip6t_IMQ.h ] && echo IMQ
14 diff -pruN iptables-1.4.1-rc3.orig/extensions/libip6t_IMQ.c iptables-1.4.1-rc3/extensions/libip6t_IMQ.c
15 --- iptables-1.4.1-rc3.orig/extensions/libip6t_IMQ.c 1970-01-01 10:00:00.000000000 +1000
16 +++ iptables-1.4.1-rc3/extensions/libip6t_IMQ.c 2008-06-08 22:46:57.000000000 +1000
18 +/* Shared library add-on to iptables to add IMQ target support. */
24 +#include <ip6tables.h>
25 +#include <linux/netfilter_ipv6/ip6_tables.h>
26 +#include <linux/netfilter_ipv6/ip6t_IMQ.h>
28 +/* Function which prints out usage message. */
29 +static void IMQ_help(void)
32 +"IMQ target v%s options:\n"
33 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
37 +static struct option IMQ_opts[] = {
38 + { "todev", 1, 0, '1' },
42 +/* Initialize the target. */
43 +static void IMQ_init(struct xt_entry_target *t)
45 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
50 +/* Function which parses command options; returns true if it
52 +static int IMQ_parse(int c, char **argv, int invert, unsigned int *flags,
54 + struct xt_entry_target **target)
56 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
60 + if (check_inverse(optarg, &invert, NULL, 0))
61 + exit_error(PARAMETER_PROBLEM,
62 + "Unexpected `!' after --todev");
63 + mr->todev=atoi(optarg);
71 +/* Prints out the targinfo. */
72 +static void IMQ_print(const void *ip,
73 + const struct xt_entry_target *target,
76 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
78 + printf("IMQ: todev %u ", mr->todev);
81 +/* Saves the union ipt_targinfo in parsable form to stdout. */
82 +static void IMQ_save(const void *ip, const struct xt_entry_target *target)
84 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
86 + printf("--todev %u", mr->todev);
89 +static struct xtables_target imq = {
91 + .version = XTABLES_VERSION,
93 + .size = XT_ALIGN(sizeof(struct ip6t_imq_info)),
94 + .userspacesize = XT_ALIGN(sizeof(struct ip6t_imq_info)),
100 + .extra_opts = IMQ_opts,
105 + xtables_register_target(&imq);
107 diff -pruN iptables-1.4.1-rc3.orig/extensions/libipt_IMQ.c iptables-1.4.1-rc3/extensions/libipt_IMQ.c
108 --- iptables-1.4.1-rc3.orig/extensions/libipt_IMQ.c 1970-01-01 10:00:00.000000000 +1000
109 +++ iptables-1.4.1-rc3/extensions/libipt_IMQ.c 2008-06-08 22:46:25.000000000 +1000
111 +/* Shared library add-on to iptables to add IMQ target support. */
117 +#include <iptables.h>
118 +#include <linux/netfilter_ipv4/ip_tables.h>
119 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
121 +/* Function which prints out usage message. */
122 +static void IMQ_help(void)
125 +"IMQ target v%s options:\n"
126 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
130 +static struct option IMQ_opts[] = {
131 + { "todev", 1, 0, '1' },
135 +/* Initialize the target. */
136 +static void IMQ_init(struct xt_entry_target *t)
138 + struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
143 +/* Function which parses command options; returns true if it
145 +static int IMQ_parse(int c, char **argv, int invert, unsigned int *flags,
146 + const void *entry, struct xt_entry_target **target)
148 + struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
152 + if (check_inverse(optarg, &invert, NULL, 0))
153 + exit_error(PARAMETER_PROBLEM,
154 + "Unexpected `!' after --todev");
155 + mr->todev=atoi(optarg);
163 +/* Prints out the targinfo. */
164 +static void IMQ_print(const void *ip,
165 + const struct xt_entry_target *target,
168 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
170 + printf("IMQ: todev %u ", mr->todev);
173 +/* Saves the union ipt_targinfo in parsable form to stdout. */
174 +static void IMQ_save(const void *ip, const struct xt_entry_target *target)
176 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
178 + printf("--todev %u", mr->todev);
181 +static struct xtables_target imq = {
183 + .version = XTABLES_VERSION,
185 + .size = XT_ALIGN(sizeof(struct ipt_imq_info)),
186 + .userspacesize = XT_ALIGN(sizeof(struct ipt_imq_info)),
189 + .parse = IMQ_parse,
190 + .print = IMQ_print,
192 + .extra_opts = IMQ_opts,
197 + xtables_register_target(&imq);