1 diff -urN linux-2.4.23.org/Documentation/Configure.help linux-2.4.23/Documentation/Configure.help
2 --- linux-2.4.23.org/Documentation/Configure.help 2003-12-01 23:06:42.851544654 +0100
3 +++ linux-2.4.23/Documentation/Configure.help 2003-12-01 23:09:21.073624835 +0100
9 +CONFIG_IP_NF_TARGET_IMQ
10 + This option adds a `IMQ' target which is used to specify if and
11 + to which imq device packets should get enqueued/dequeued.
13 + If you want to compile it as a module, say M here and read
14 + <file:Documentation/modules.txt>. If unsure, say `N'.
17 CONFIG_IP_NF_TARGET_MARK
18 This option adds a `MARK' target, which allows you to create rules
19 @@ -3870,6 +3878,14 @@
20 Not working as a module.
24 +CONFIG_IP6_NF_TARGET_IMQ
25 + This option adds a `IMQ' target which is used to specify if and
26 + to which imq device packets should get enqueued/dequeued.
28 + If you want to compile it as a module, say M here and read
29 + <file:Documentation/modules.txt>. If unsure, say `N'.
32 CONFIG_IP6_NF_TARGET_MARK
33 This option adds a `MARK' target, which allows you to create rules
34 diff -urN linux-2.4.23.org/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.4.23/include/linux/netfilter_ipv4/ipt_IMQ.h
35 --- linux-2.4.23.org/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 01:00:00.000000000 +0100
36 +++ linux-2.4.23/include/linux/netfilter_ipv4/ipt_IMQ.h 2003-12-01 23:09:00.853831794 +0100
41 +struct ipt_imq_info {
42 + unsigned int todev; /* target imq device */
45 +#endif /* _IPT_IMQ_H */
46 diff -urN linux-2.4.23.org/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.4.23/include/linux/netfilter_ipv6/ip6t_IMQ.h
47 --- linux-2.4.23.org/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 01:00:00.000000000 +0100
48 +++ linux-2.4.23/include/linux/netfilter_ipv6/ip6t_IMQ.h 2003-12-01 23:09:20.860669143 +0100
53 +struct ip6t_imq_info {
54 + unsigned int todev; /* target imq device */
57 +#endif /* _IP6T_IMQ_H */
58 diff -urN linux-2.4.23.org/net/ipv4/netfilter/Config.in linux-2.4.23/net/ipv4/netfilter/Config.in
59 --- linux-2.4.23.org/net/ipv4/netfilter/Config.in 2003-12-01 23:04:11.215094025 +0100
60 +++ linux-2.4.23/net/ipv4/netfilter/Config.in 2003-12-01 23:09:00.904821185 +0100
62 dep_tristate ' DSCP target support' CONFIG_IP_NF_TARGET_DSCP $CONFIG_IP_NF_MANGLE
64 dep_tristate ' MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
65 + dep_tristate ' IMQ target support' CONFIG_IP_NF_TARGET_IMQ $CONFIG_IP_NF_MANGLE
66 dep_tristate ' ROUTE target support' CONFIG_IP_NF_TARGET_ROUTE $CONFIG_IP_NF_MANGLE
68 dep_tristate ' IPMARK target support' CONFIG_IP_NF_TARGET_IPMARK $CONFIG_IP_NF_MANGLE
69 diff -urN linux-2.4.23.org/net/ipv4/netfilter/ipt_IMQ.c linux-2.4.23/net/ipv4/netfilter/ipt_IMQ.c
70 --- linux-2.4.23.org/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 01:00:00.000000000 +0100
71 +++ linux-2.4.23/net/ipv4/netfilter/ipt_IMQ.c 2003-12-01 23:09:00.855831378 +0100
73 +/* This target marks packets to be enqueued to an imq device */
74 +#include <linux/module.h>
75 +#include <linux/skbuff.h>
76 +#include <linux/netfilter_ipv4/ip_tables.h>
77 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
78 +#include <linux/imq.h>
80 +static unsigned int imq_target(struct sk_buff **pskb,
81 + unsigned int hooknum,
82 + const struct net_device *in,
83 + const struct net_device *out,
84 + const void *targinfo,
87 + struct ipt_imq_info *mr = (struct ipt_imq_info*)targinfo;
89 + (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
90 + (*pskb)->nfcache |= NFC_ALTERED;
92 + return IPT_CONTINUE;
95 +static int imq_checkentry(const char *tablename,
96 + const struct ipt_entry *e,
98 + unsigned int targinfosize,
99 + unsigned int hook_mask)
101 + struct ipt_imq_info *mr;
103 + if (targinfosize != IPT_ALIGN(sizeof(struct ipt_imq_info))) {
104 + printk(KERN_WARNING "IMQ: invalid targinfosize\n");
107 + mr = (struct ipt_imq_info*)targinfo;
109 + if (strcmp(tablename, "mangle") != 0) {
110 + printk(KERN_WARNING
111 + "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
116 + if (mr->todev > IMQ_MAX_DEVS) {
117 + printk(KERN_WARNING
118 + "IMQ: invalid device specified, highest is %u\n",
126 +static struct ipt_target ipt_imq_reg = {
135 +static int __init init(void)
137 + if (ipt_register_target(&ipt_imq_reg))
143 +static void __exit fini(void)
145 + ipt_unregister_target(&ipt_imq_reg);
150 +MODULE_LICENSE("GPL");
151 diff -urN linux-2.4.23.org/net/ipv4/netfilter/Makefile linux-2.4.23/net/ipv4/netfilter/Makefile
152 --- linux-2.4.23.org/net/ipv4/netfilter/Makefile 2003-12-01 23:04:11.173102762 +0100
153 +++ linux-2.4.23/net/ipv4/netfilter/Makefile 2003-12-01 23:09:01.130774173 +0100
155 obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
156 obj-$(CONFIG_IP_NF_TARGET_DSCP) += ipt_DSCP.o
157 obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o
158 +obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o
159 obj-$(CONFIG_IP_NF_TARGET_IPMARK) += ipt_IPMARK.o
160 obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
161 obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
162 diff -urN linux-2.4.23.org/net/ipv6/netfilter/Config.in linux-2.4.23/net/ipv6/netfilter/Config.in
163 --- linux-2.4.23.org/net/ipv6/netfilter/Config.in 2003-12-01 23:04:12.073915340 +0100
164 +++ linux-2.4.23/net/ipv6/netfilter/Config.in 2003-12-01 23:09:20.915657702 +0100
166 if [ "$CONFIG_IP6_NF_MANGLE" != "n" ]; then
167 # dep_tristate ' TOS target support' CONFIG_IP6_NF_TARGET_TOS $CONFIG_IP_NF_MANGLE
168 dep_tristate ' MARK target support' CONFIG_IP6_NF_TARGET_MARK $CONFIG_IP6_NF_MANGLE
169 + dep_tristate ' IMQ target support' CONFIG_IP6_NF_TARGET_IMQ $CONFIG_IP6_NF_MANGLE
170 dep_mbool ' ROUTE target support' CONFIG_IP6_NF_TARGET_ROUTE $CONFIG_IP6_NF_MANGLE
172 #dep_tristate ' LOG target support' CONFIG_IP6_NF_TARGET_LOG $CONFIG_IP6_NF_IPTABLES
173 diff -urN linux-2.4.23.org/net/ipv6/netfilter/ip6t_IMQ.c linux-2.4.23/net/ipv6/netfilter/ip6t_IMQ.c
174 --- linux-2.4.23.org/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 01:00:00.000000000 +0100
175 +++ linux-2.4.23/net/ipv6/netfilter/ip6t_IMQ.c 2003-12-01 23:09:20.862668727 +0100
177 +/* This target marks packets to be enqueued to an imq device */
178 +#include <linux/module.h>
179 +#include <linux/skbuff.h>
180 +#include <linux/netfilter_ipv6/ip6_tables.h>
181 +#include <linux/netfilter_ipv6/ip6t_IMQ.h>
182 +#include <linux/imq.h>
184 +static unsigned int imq_target(struct sk_buff **pskb,
185 + unsigned int hooknum,
186 + const struct net_device *in,
187 + const struct net_device *out,
188 + const void *targinfo,
191 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)targinfo;
193 + (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
194 + (*pskb)->nfcache |= NFC_ALTERED;
196 + return IP6T_CONTINUE;
199 +static int imq_checkentry(const char *tablename,
200 + const struct ip6t_entry *e,
202 + unsigned int targinfosize,
203 + unsigned int hook_mask)
205 + struct ip6t_imq_info *mr;
207 + if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_imq_info))) {
208 + printk(KERN_WARNING "IMQ: invalid targinfosize\n");
211 + mr = (struct ip6t_imq_info*)targinfo;
213 + if (strcmp(tablename, "mangle") != 0) {
214 + printk(KERN_WARNING
215 + "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
220 + if (mr->todev > IMQ_MAX_DEVS) {
221 + printk(KERN_WARNING
222 + "IMQ: invalid device specified, highest is %u\n",
230 +static struct ip6t_target ip6t_imq_reg = {
239 +static int __init init(void)
241 + if (ip6t_register_target(&ip6t_imq_reg))
247 +static void __exit fini(void)
249 + ip6t_unregister_target(&ip6t_imq_reg);
254 +MODULE_LICENSE("GPL");
255 diff -urN linux-2.4.23.org/net/ipv6/netfilter/Makefile linux-2.4.23/net/ipv6/netfilter/Makefile
256 --- linux-2.4.23.org/net/ipv6/netfilter/Makefile 2003-12-01 23:04:12.067916588 +0100
257 +++ linux-2.4.23/net/ipv6/netfilter/Makefile 2003-12-01 23:09:21.138611314 +0100
259 obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
260 obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
261 obj-$(CONFIG_IP6_NF_TARGET_MARK) += ip6t_MARK.o
262 +obj-$(CONFIG_IP6_NF_TARGET_IMQ) += ip6t_IMQ.o
263 obj-$(CONFIG_IP6_NF_TARGET_ROUTE) += ip6t_ROUTE.o
264 obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o
265 obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o