1 --- iptables-1.4.0.orig/extensions.orig/.IMQ-test6 Thu Jan 1 01:00:00 1970
2 +++ iptables-1.4.0/extensions/.IMQ-test6 Mon Jun 16 10:12:47 2003
5 +# True if IMQ target patch is applied.
6 +[ -f $KERNEL_DIR/include/linux/netfilter_ipv6/ip6t_IMQ.h ] && echo IMQ
7 --- iptables-1.4.0.orig/extensions.orig/libip6t_IMQ.c Thu Jan 1 01:00:00 1970
8 +++ iptables-1.4.0/extensions/libip6t_IMQ.c Mon Jun 16 10:12:47 2003
10 +/* Shared library add-on to iptables to add IMQ target support. */
16 +#include <ip6tables.h>
17 +#include <linux/netfilter_ipv6/ip6_tables.h>
18 +#include <linux/netfilter_ipv6/ip6t_IMQ.h>
20 +/* Function which prints out usage message. */
25 +"IMQ target v%s options:\n"
26 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
30 +static struct option opts[] = {
31 + { "todev", 1, 0, '1' },
35 +/* Initialize the target. */
37 +init(struct xt_entry_target *t)
39 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
44 +/* Function which parses command options; returns true if it
47 +parse(int c, char **argv, int invert, unsigned int *flags,
49 + struct xt_entry_target **target)
51 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
55 + if (check_inverse(optarg, &invert, NULL, 0))
56 + exit_error(PARAMETER_PROBLEM,
57 + "Unexpected `!' after --todev");
58 + mr->todev=atoi(optarg);
67 +final_check(unsigned int flags)
71 +/* Prints out the targinfo. */
73 +print(const void *ip,
74 + const struct xt_entry_target *target,
77 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
79 + printf("IMQ: todev %u ", mr->todev);
82 +/* Saves the union ipt_targinfo in parsable form to stdout. */
84 +save(const void *ip, const struct xt_entry_target *target)
86 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
88 + printf("--todev %u", mr->todev);
91 +static struct ip6tables_target imq = {
94 + .version = IPTABLES_VERSION,
95 + .size = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
96 + .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
100 + .final_check = &final_check,
106 +static __attribute__((constructor)) void _init(void)
108 + register_target6(&imq);
110 --- iptables-1.4.0.orig/extensions.orig/.IMQ-test Thu Jan 1 01:00:00 1970
111 +++ iptables-1.4.0/extensions/.IMQ-test Mon Jun 16 10:12:47 2003
114 +# True if IMQ target patch is applied.
115 +[ -f $KERNEL_DIR/include/linux/netfilter_ipv4/ipt_IMQ.h ] && echo IMQ
116 --- iptables-1.4.0.orig/extensions.orig/libipt_IMQ.c Thu Jan 1 01:00:00 1970
117 +++ iptables-1.4.0/extensions/libipt_IMQ.c Mon Jun 16 10:12:47 2003
119 +/* Shared library add-on to iptables to add IMQ target support. */
125 +#include <iptables.h>
126 +#include <linux/netfilter_ipv4/ip_tables.h>
127 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
129 +/* Function which prints out usage message. */
134 +"IMQ target v%s options:\n"
135 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
139 +static struct option opts[] = {
140 + { "todev", 1, 0, '1' },
144 +/* Initialize the target. */
146 +init(struct xt_entry_target *t)
148 + struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
153 +/* Function which parses command options; returns true if it
156 +parse(int c, char **argv, int invert, unsigned int *flags,
158 + struct xt_entry_target **target)
160 + struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
164 + if (check_inverse(optarg, &invert, NULL, 0))
165 + exit_error(PARAMETER_PROBLEM,
166 + "Unexpected `!' after --todev");
167 + mr->todev=atoi(optarg);
176 +final_check(unsigned int flags)
180 +/* Prints out the targinfo. */
182 +print(const void *ip,
183 + const struct xt_entry_target *target,
186 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
188 + printf("IMQ: todev %u ", mr->todev);
191 +/* Saves the union ipt_targinfo in parsable form to stdout. */
193 +save(const void *ip, const struct xt_entry_target *target)
195 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
197 + printf("--todev %u", mr->todev);
200 +static struct iptables_target imq = {
203 + .version = IPTABLES_VERSION,
204 + .size = IPT_ALIGN(sizeof(struct ipt_imq_info)),
205 + .userspacesize = IPT_ALIGN(sizeof(struct ipt_imq_info)),
209 + .final_check = &final_check,
215 +static __attribute__((constructor)) void _init(void)
217 + register_target(&imq);