1 --- iptables-1.3.6.orig/extensions.orig/.IMQ-test6 Thu Jan 1 01:00:00 1970
2 +++ iptables-1.3.6/extensions/.IMQ-test6 Mon Jun 16 10:12:47 2003
5 +# True if IMQ target patch is applied.
6 +[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ
7 --- iptables-1.3.6.orig/extensions.orig/libip6t_IMQ.c Thu Jan 1 01:00:00 1970
8 +++ iptables-1.3.6/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 ip6t_entry_target *t, unsigned int *nfcache)
39 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
42 + *nfcache |= NFC_UNKNOWN;
45 +/* Function which parses command options; returns true if it
48 +parse(int c, char **argv, int invert, unsigned int *flags,
49 + const struct ip6t_entry *entry,
50 + struct ip6t_entry_target **target)
52 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
56 + if (check_inverse(optarg, &invert, NULL, 0))
57 + exit_error(PARAMETER_PROBLEM,
58 + "Unexpected `!' after --todev");
59 + mr->todev=atoi(optarg);
68 +final_check(unsigned int flags)
72 +/* Prints out the targinfo. */
74 +print(const struct ip6t_ip6 *ip,
75 + const struct ip6t_entry_target *target,
78 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
80 + printf("IMQ: todev %u ", mr->todev);
83 +/* Saves the union ipt_targinfo in parsable form to stdout. */
85 +save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
87 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
89 + printf("--todev %u", mr->todev);
92 +static struct ip6tables_target imq = {
95 + .version = IPTABLES_VERSION,
96 + .size = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
97 + .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
101 + .final_check = &final_check,
107 +static __attribute__((constructor)) void _init(void)
109 + register_target6(&imq);
111 --- iptables-1.3.6.orig/extensions.orig/.IMQ-test Thu Jan 1 01:00:00 1970
112 +++ iptables-1.3.6/extensions/.IMQ-test Mon Jun 16 10:12:47 2003
115 +# True if IMQ target patch is applied.
116 +[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
117 --- iptables-1.3.6.orig/extensions.orig/libipt_IMQ.c Thu Jan 1 01:00:00 1970
118 +++ iptables-1.3.6/extensions/libipt_IMQ.c Mon Jun 16 10:12:47 2003
120 +/* Shared library add-on to iptables to add IMQ target support. */
126 +#include <iptables.h>
127 +#include <linux/netfilter_ipv4/ip_tables.h>
128 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
130 +/* Function which prints out usage message. */
135 +"IMQ target v%s options:\n"
136 +" --todev <N> enqueue to imq<N>, defaults to 0\n",
140 +static struct option opts[] = {
141 + { "todev", 1, 0, '1' },
145 +/* Initialize the target. */
147 +init(struct ipt_entry_target *t, unsigned int *nfcache)
149 + struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
152 + *nfcache |= NFC_UNKNOWN;
155 +/* Function which parses command options; returns true if it
158 +parse(int c, char **argv, int invert, unsigned int *flags,
159 + const struct ipt_entry *entry,
160 + struct ipt_entry_target **target)
162 + struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
166 + if (check_inverse(optarg, &invert, NULL, 0))
167 + exit_error(PARAMETER_PROBLEM,
168 + "Unexpected `!' after --todev");
169 + mr->todev=atoi(optarg);
178 +final_check(unsigned int flags)
182 +/* Prints out the targinfo. */
184 +print(const struct ipt_ip *ip,
185 + const struct ipt_entry_target *target,
188 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
190 + printf("IMQ: todev %u ", mr->todev);
193 +/* Saves the union ipt_targinfo in parsable form to stdout. */
195 +save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
197 + struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
199 + printf("--todev %u", mr->todev);
202 +static struct iptables_target imq = {
205 + .version = IPTABLES_VERSION,
206 + .size = IPT_ALIGN(sizeof(struct ipt_imq_info)),
207 + .userspacesize = IPT_ALIGN(sizeof(struct ipt_imq_info)),
211 + .final_check = &final_check,
217 +static __attribute__((constructor)) void _init(void)
219 + register_target(&imq);