]> git.pld-linux.org Git - packages/kernel.git/blame - 2.6.x-patch-o-matic-ng-base-20040216.patch
- ported from linux-2.4.25-atmdd.patch
[packages/kernel.git] / 2.6.x-patch-o-matic-ng-base-20040216.patch
CommitLineData
2636a4be 1diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ip_pool.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ip_pool.h
2--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ip_pool.h 1970-01-01 01:00:00.000000000 +0100
3+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ip_pool.h 2004-02-16 11:07:21.518803072 +0100
4@@ -0,0 +1,64 @@
5+#ifndef _IP_POOL_H
6+#define _IP_POOL_H
7+
8+/***************************************************************************/
9+/* This program is free software; you can redistribute it and/or modify */
10+/* it under the terms of the GNU General Public License as published by */
11+/* the Free Software Foundation; either version 2 of the License, or */
12+/* (at your option) any later version. */
13+/* */
14+/* This program is distributed in the hope that it will be useful, */
15+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
16+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
17+/* GNU General Public License for more details. */
18+/* */
19+/* You should have received a copy of the GNU General Public License */
20+/* along with this program; if not, write to the Free Software */
21+/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
22+/***************************************************************************/
23+
24+/* A sockopt of such quality has hardly ever been seen before on the open
25+ * market! This little beauty, hardly ever used: above 64, so it's
26+ * traditionally used for firewalling, not touched (even once!) by the
27+ * 2.0, 2.2 and 2.4 kernels!
28+ *
29+ * Comes with its own certificate of authenticity, valid anywhere in the
30+ * Free world!
31+ *
32+ * Rusty, 19.4.2000
33+ */
34+#define SO_IP_POOL 81
35+
36+typedef int ip_pool_t; /* pool index */
37+#define IP_POOL_NONE ((ip_pool_t)-1)
38+
39+struct ip_pool_request {
40+ int op;
41+ ip_pool_t index;
42+ u_int32_t addr;
43+ u_int32_t addr2;
44+};
45+
46+/* NOTE: I deliberately break the first cut ippool utility. Nobody uses it. */
47+
48+#define IP_POOL_BAD001 0x00000010
49+
50+#define IP_POOL_FLUSH 0x00000011 /* req.index, no arguments */
51+#define IP_POOL_INIT 0x00000012 /* from addr to addr2 incl. */
52+#define IP_POOL_DESTROY 0x00000013 /* req.index, no arguments */
53+#define IP_POOL_ADD_ADDR 0x00000014 /* add addr to pool */
54+#define IP_POOL_DEL_ADDR 0x00000015 /* del addr from pool */
55+#define IP_POOL_HIGH_NR 0x00000016 /* result in req.index */
56+#define IP_POOL_LOOKUP 0x00000017 /* result in addr and addr2 */
57+#define IP_POOL_USAGE 0x00000018 /* result in addr */
58+#define IP_POOL_TEST_ADDR 0x00000019 /* result (0/1) returned */
59+
60+#ifdef __KERNEL__
61+
62+/* NOTE: ip_pool_match() and ip_pool_mod() expect ADDR to be host byte order */
63+extern int ip_pool_match(ip_pool_t pool, u_int32_t addr);
64+extern int ip_pool_mod(ip_pool_t pool, u_int32_t addr, int isdel);
65+
66+#endif
67+
68+#endif /*_IP_POOL_H*/
69diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_NETLINK.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_NETLINK.h
70--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_NETLINK.h 1970-01-01 01:00:00.000000000 +0100
71+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_NETLINK.h 2004-02-16 11:07:05.880548139 +0100
72@@ -0,0 +1,27 @@
73+#ifndef _IPT_FWMON_H
74+#define _IPT_FWMON_H
75+
76+/* Bitmask macros */
77+#define MASK(x,y) (x & y)
78+#define MASK_SET(x,y) x |= y
79+#define MASK_UNSET(x,y) x &= ~y
80+
81+#define USE_MARK 0x00000001
82+#define USE_DROP 0x00000002
83+#define USE_SIZE 0x00000004
84+
85+struct ipt_nldata
86+{
87+ unsigned int flags;
88+ unsigned int mark;
89+ unsigned int size;
90+};
91+
92+/* Old header */
93+struct netlink_t {
94+ unsigned int len;
95+ unsigned int mark;
96+ char iface[IFNAMSIZ];
97+};
98+
99+#endif /*_IPT_FWMON_H*/
100diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_TTL.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_TTL.h
101--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_TTL.h 1970-01-01 01:00:00.000000000 +0100
102+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_TTL.h 2004-02-16 11:07:09.253740328 +0100
103@@ -0,0 +1,21 @@
104+/* TTL modification module for IP tables
105+ * (C) 2000 by Harald Welte <laforge@gnumonks.org> */
106+
107+#ifndef _IPT_TTL_H
108+#define _IPT_TTL_H
109+
110+enum {
111+ IPT_TTL_SET = 0,
112+ IPT_TTL_INC,
113+ IPT_TTL_DEC
114+};
115+
116+#define IPT_TTL_MAXMODE IPT_TTL_DEC
117+
118+struct ipt_TTL_info {
119+ u_int8_t mode;
120+ u_int8_t ttl;
121+};
122+
123+
124+#endif
125diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_connlimit.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_connlimit.h
126--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_connlimit.h 1970-01-01 01:00:00.000000000 +0100
127+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_connlimit.h 2004-02-16 11:07:11.549190614 +0100
128@@ -0,0 +1,12 @@
129+#ifndef _IPT_CONNLIMIT_H
130+#define _IPT_CONNLIMIT_H
131+
132+struct ipt_connlimit_data;
133+
134+struct ipt_connlimit_info {
135+ int limit;
136+ int inverse;
137+ u_int32_t mask;
138+ struct ipt_connlimit_data *data;
139+};
140+#endif /* _IPT_CONNLIMIT_H */
141diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_dstlimit.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_dstlimit.h
142--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_dstlimit.h 1970-01-01 01:00:00.000000000 +0100
143+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_dstlimit.h 2004-02-16 11:07:13.230787904 +0100
144@@ -0,0 +1,36 @@
145+#ifndef _IPT_DSTLIMIT_H
146+#define _IPT_DSTLIMIT_H
147+
148+/* timings are in milliseconds. */
149+#define IPT_DSTLIMIT_SCALE 10000
150+/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
151+ seconds, or one every 59 hours. */
152+
153+/* details of this structure hidden by the implementation */
154+struct ipt_dstlimit_htable;
155+
156+#define IPT_DSTLIMIT_HASH_DIP 0x0001
157+#define IPT_DSTLIMIT_HASH_DPT 0x0002
158+#define IPT_DSTLIMIT_HASH_SIP 0x0004
159+
160+struct ipt_dstlimit_info {
161+ u_int32_t mode; /* bitmask of IPT_DSTLIMIT_HASH_* */
162+ u_int32_t avg; /* Average secs between packets * scale */
163+ u_int32_t burst; /* Period multiplier for upper limit. */
164+
165+ /* user specified */
166+ unsigned int size; /* how many buckets */
167+ unsigned int max; /* max number of entries */
168+ unsigned int gc_interval; /* gc interval */
169+ unsigned int expire; /* when do entries expire? */
170+ char name [IFNAMSIZ]; /* name */
171+
172+ struct ipt_dstlimit_htable *hinfo;
173+
174+ /* Used internally by the kernel */
175+ union {
176+ void *ptr;
177+ struct ipt_dstlimit_info *master;
178+ } u;
179+};
180+#endif /*_IPT_DSTLIMIT_H*/
181diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_fuzzy.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_fuzzy.h
182--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_fuzzy.h 1970-01-01 01:00:00.000000000 +0100
183+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_fuzzy.h 2004-02-16 11:07:14.925382080 +0100
184@@ -0,0 +1,21 @@
185+#ifndef _IPT_FUZZY_H
186+#define _IPT_FUZZY_H
187+
188+#include <linux/param.h>
189+#include <linux/types.h>
190+
191+#define MAXFUZZYRATE 10000000
192+#define MINFUZZYRATE 3
193+
194+struct ipt_fuzzy_info {
195+ u_int32_t minimum_rate;
196+ u_int32_t maximum_rate;
197+ u_int32_t packets_total;
198+ u_int32_t bytes_total;
199+ u_int32_t previous_time;
200+ u_int32_t present_time;
201+ u_int32_t mean_rate;
202+ u_int8_t acceptance_rate;
203+};
204+
205+#endif /*_IPT_FUZZY_H*/
206diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_ipv4options.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_ipv4options.h
207--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_ipv4options.h 1970-01-01 01:00:00.000000000 +0100
208+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_ipv4options.h 2004-02-16 11:07:16.164085433 +0100
209@@ -0,0 +1,21 @@
210+#ifndef __ipt_ipv4options_h_included__
211+#define __ipt_ipv4options_h_included__
212+
213+#define IPT_IPV4OPTION_MATCH_SSRR 0x01 /* For strict source routing */
214+#define IPT_IPV4OPTION_MATCH_LSRR 0x02 /* For loose source routing */
215+#define IPT_IPV4OPTION_DONT_MATCH_SRR 0x04 /* any source routing */
216+#define IPT_IPV4OPTION_MATCH_RR 0x08 /* For Record route */
217+#define IPT_IPV4OPTION_DONT_MATCH_RR 0x10
218+#define IPT_IPV4OPTION_MATCH_TIMESTAMP 0x20 /* For timestamp request */
219+#define IPT_IPV4OPTION_DONT_MATCH_TIMESTAMP 0x40
220+#define IPT_IPV4OPTION_MATCH_ROUTER_ALERT 0x80 /* For router-alert */
221+#define IPT_IPV4OPTION_DONT_MATCH_ROUTER_ALERT 0x100
222+#define IPT_IPV4OPTION_MATCH_ANY_OPT 0x200 /* match packet with any option */
223+#define IPT_IPV4OPTION_DONT_MATCH_ANY_OPT 0x400 /* match packet with no option */
224+
225+struct ipt_ipv4options_info {
226+ u_int16_t options;
227+};
228+
229+
230+#endif /* __ipt_ipv4options_h_included__ */
231diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_mport.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_mport.h
232--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_mport.h 1970-01-01 01:00:00.000000000 +0100
233+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_mport.h 2004-02-16 11:07:17.665725817 +0100
234@@ -0,0 +1,24 @@
235+#ifndef _IPT_MPORT_H
236+#define _IPT_MPORT_H
237+#include <linux/netfilter_ipv4/ip_tables.h>
238+
239+#define IPT_MPORT_SOURCE (1<<0)
240+#define IPT_MPORT_DESTINATION (1<<1)
241+#define IPT_MPORT_EITHER (IPT_MPORT_SOURCE|IPT_MPORT_DESTINATION)
242+
243+#define IPT_MULTI_PORTS 15
244+
245+/* Must fit inside union ipt_matchinfo: 32 bytes */
246+/* every entry in ports[] except for the last one has one bit in pflags
247+ * associated with it. If this bit is set, the port is the first port of
248+ * a portrange, with the next entry being the last.
249+ * End of list is marked with pflags bit set and port=65535.
250+ * If 14 ports are used (last one does not have a pflag), the last port
251+ * is repeated to fill the last entry in ports[] */
252+struct ipt_mport
253+{
254+ u_int8_t flags:2; /* Type of comparison */
255+ u_int16_t pflags:14; /* Port flags */
256+ u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */
257+};
258+#endif /*_IPT_MPORT_H*/
259diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_nth.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_nth.h
260--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_nth.h 1970-01-01 01:00:00.000000000 +0100
261+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_nth.h 2004-02-16 11:07:18.796455028 +0100
262@@ -0,0 +1,19 @@
263+#ifndef _IPT_NTH_H
264+#define _IPT_NTH_H
265+
266+#include <linux/param.h>
267+#include <linux/types.h>
268+
269+#ifndef IPT_NTH_NUM_COUNTERS
270+#define IPT_NTH_NUM_COUNTERS 16
271+#endif
272+
273+struct ipt_nth_info {
274+ u_int8_t every;
275+ u_int8_t not;
276+ u_int8_t startat;
277+ u_int8_t counter;
278+ u_int8_t packet;
279+};
280+
281+#endif /*_IPT_NTH_H*/
282diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_osf.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_osf.h
283--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_osf.h 1970-01-01 01:00:00.000000000 +0100
284+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_osf.h 2004-02-16 11:07:19.917186632 +0100
285@@ -0,0 +1,130 @@
286+/*
287+ * ipt_osf.h
288+ *
289+ * Copyright (c) 2003 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
290+ *
291+ *
292+ * This program is free software; you can redistribute it and/or modify
293+ * it under the terms of the GNU General Public License as published by
294+ * the Free Software Foundation; either version 2 of the License, or
295+ * (at your option) any later version.
296+ *
297+ * This program is distributed in the hope that it will be useful,
298+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
299+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
300+ * GNU General Public License for more details.
301+ *
302+ * You should have received a copy of the GNU General Public License
303+ * along with this program; if not, write to the Free Software
304+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
305+ */
306+
307+#ifndef _IPT_OSF_H
308+#define _IPT_OSF_H
309+
310+#define MAXGENRELEN 32
311+#define MAXDETLEN 64
312+
313+#define IPT_OSF_GENRE 1
314+#define IPT_OSF_SMART 2
315+#define IPT_OSF_LOG 4
316+
317+#define IPT_OSF_LOGLEVEL_ALL 0
318+#define IPT_OSF_LOGLEVEL_FIRST 1
319+
320+#include <linux/list.h>
321+
322+struct ipt_osf_info
323+{
324+ char genre[MAXGENRELEN];
325+ int len;
326+ unsigned long flags;
327+ int loglevel;
328+ int invert; /* UNSUPPORTED */
329+};
330+
331+struct osf_wc
332+{
333+ char wc;
334+ unsigned long val;
335+};
336+
337+/* This struct represents IANA options
338+ * http://www.iana.org/assignments/tcp-parameters
339+ */
340+struct osf_opt
341+{
342+ unsigned char kind;
343+ unsigned char length;
344+ struct osf_wc wc;
345+};
346+
347+#ifdef __KERNEL__
348+
349+struct osf_finger
350+{
351+ struct list_head flist;
352+ struct osf_wc wss;
353+ unsigned char ttl;
354+ unsigned char df;
355+ unsigned long ss;
356+ char genre[MAXGENRELEN];
357+ char version[MAXGENRELEN], subtype[MAXGENRELEN];
358+
359+ /* Not needed, but for consistency with original table from Michal Zalewski */
360+ char details[MAXDETLEN];
361+
362+ int opt_num;
363+ struct osf_opt opt[MAX_IPOPTLEN]; /* In case it is all NOP or EOL */
364+
365+};
366+
367+/* Defines for IANA option kinds */
368+
369+#define OSFOPT_EOL 0 /* End of options */
370+#define OSFOPT_NOP 1 /* NOP */
371+#define OSFOPT_MSS 2 /* Maximum segment size */
372+#define OSFOPT_WSO 3 /* Window scale option */
373+#define OSFOPT_SACKP 4 /* SACK permitted */
374+#define OSFOPT_SACK 5 /* SACK */
375+#define OSFOPT_ECHO 6
376+#define OSFOPT_ECHOREPLY 7
377+#define OSFOPT_TS 8 /* Timestamp option */
378+#define OSFOPT_POCP 9 /* Partial Order Connection Permitted */
379+#define OSFOPT_POSP 10 /* Partial Order Service Profile */
380+/* Others are not used in current OSF */
381+
382+static struct osf_opt IANA_opts[] =
383+{
384+ {0, 1,},
385+ {1, 1,},
386+ {2, 4,},
387+ {3, 3,},
388+ {4, 2,},
389+ {5, 1 ,}, /* SACK length is not defined */
390+ {6, 6,},
391+ {7, 6,},
392+ {8, 10,},
393+ {9, 2,},
394+ {10, 3,},
395+ {11, 1,}, /* CC: Suppose 1 */
396+ {12, 1,}, /* the same */
397+ {13, 1,}, /* and here too */
398+ {14, 3,},
399+ {15, 1,}, /* TCP Alternate Checksum Data. Length is not defined */
400+ {16, 1,},
401+ {17, 1,},
402+ {18, 3,},
403+ {19, 18,},
404+ {20, 1,},
405+ {21, 1,},
406+ {22, 1,},
407+ {23, 1,},
408+ {24, 1,},
409+ {25, 1,},
410+ {26, 1,},
411+};
412+
413+#endif /* __KERNEL__ */
414+
415+#endif /* _IPT_OSF_H */
416diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_pool.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_pool.h
417--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_pool.h 1970-01-01 01:00:00.000000000 +0100
418+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_pool.h 2004-02-16 11:07:21.518803072 +0100
419@@ -0,0 +1,25 @@
420+#ifndef _IPT_POOL_H
421+#define _IPT_POOL_H
422+
423+#include <linux/netfilter_ipv4/ip_pool.h>
424+
425+#define IPT_POOL_INV_SRC 0x00000001
426+#define IPT_POOL_INV_DST 0x00000002
427+#define IPT_POOL_DEL_SRC 0x00000004
428+#define IPT_POOL_DEL_DST 0x00000008
429+#define IPT_POOL_INV_MOD_SRC 0x00000010
430+#define IPT_POOL_INV_MOD_DST 0x00000020
431+#define IPT_POOL_MOD_SRC_ACCEPT 0x00000040
432+#define IPT_POOL_MOD_DST_ACCEPT 0x00000080
433+#define IPT_POOL_MOD_SRC_DROP 0x00000100
434+#define IPT_POOL_MOD_DST_DROP 0x00000200
435+
436+/* match info */
437+struct ipt_pool_info
438+{
439+ ip_pool_t src;
440+ ip_pool_t dst;
441+ unsigned flags;
442+};
443+
444+#endif /*_IPT_POOL_H*/
445diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_psd.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_psd.h
446--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_psd.h 1970-01-01 01:00:00.000000000 +0100
447+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_psd.h 2004-02-16 11:07:22.387595011 +0100
448@@ -0,0 +1,40 @@
449+#ifndef _IPT_PSD_H
450+#define _IPT_PSD_H
451+
452+#include <linux/param.h>
453+#include <linux/types.h>
454+
455+/*
456+ * High port numbers have a lower weight to reduce the frequency of false
457+ * positives, such as from passive mode FTP transfers.
458+ */
459+#define PORT_WEIGHT_PRIV 3
460+#define PORT_WEIGHT_HIGH 1
461+
462+/*
463+ * Port scan detection thresholds: at least COUNT ports need to be scanned
464+ * from the same source, with no longer than DELAY ticks between ports.
465+ */
466+#define SCAN_MIN_COUNT 7
467+#define SCAN_MAX_COUNT (SCAN_MIN_COUNT * PORT_WEIGHT_PRIV)
468+#define SCAN_WEIGHT_THRESHOLD SCAN_MAX_COUNT
469+#define SCAN_DELAY_THRESHOLD (HZ * 3)
470+
471+/*
472+ * Keep track of up to LIST_SIZE source addresses, using a hash table of
473+ * HASH_SIZE entries for faster lookups, but limiting hash collisions to
474+ * HASH_MAX source addresses per the same hash value.
475+ */
476+#define LIST_SIZE 0x100
477+#define HASH_LOG 9
478+#define HASH_SIZE (1 << HASH_LOG)
479+#define HASH_MAX 0x10
480+
481+struct ipt_psd_info {
482+ unsigned int weight_threshold;
483+ unsigned int delay_threshold;
484+ unsigned short lo_ports_weight;
485+ unsigned short hi_ports_weight;
486+};
487+
488+#endif /*_IPT_PSD_H*/
489diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_quota.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_quota.h
490--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_quota.h 1970-01-01 01:00:00.000000000 +0100
491+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_quota.h 2004-02-16 11:07:23.219395809 +0100
492@@ -0,0 +1,11 @@
493+#ifndef _IPT_QUOTA_H
494+#define _IPT_QUOTA_H
495+
496+/* print debug info in both kernel/netfilter module & iptable library */
497+//#define DEBUG_IPT_QUOTA
498+
499+struct ipt_quota_info {
500+ u_int64_t quota;
501+};
502+
503+#endif /*_IPT_QUOTA_H*/
504diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_random.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_random.h
505--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_random.h 1970-01-01 01:00:00.000000000 +0100
506+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_random.h 2004-02-16 11:07:24.378118313 +0100
507@@ -0,0 +1,11 @@
508+#ifndef _IPT_RAND_H
509+#define _IPT_RAND_H
510+
511+#include <linux/param.h>
512+#include <linux/types.h>
513+
514+struct ipt_rand_info {
515+ u_int8_t average;
516+};
517+
518+#endif /*_IPT_RAND_H*/
519diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_realm.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_realm.h
520--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_realm.h 1970-01-01 01:00:00.000000000 +0100
521+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_realm.h 2004-02-16 11:07:26.369641375 +0100
522@@ -0,0 +1,9 @@
523+#ifndef _IPT_REALM_H
524+#define _IPT_REALM_H
525+
526+struct ipt_realm_info {
527+ u_int32_t id;
528+ u_int32_t mask;
529+ u_int8_t invert;
530+};
531+#endif /*_IPT_REALM_H*/
532diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_time.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_time.h
533--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_time.h 1970-01-01 01:00:00.000000000 +0100
534+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_time.h 2004-02-16 11:07:27.150454383 +0100
535@@ -0,0 +1,13 @@
536+#ifndef __ipt_time_h_included__
537+#define __ipt_time_h_included__
538+
539+
540+struct ipt_time_info {
541+ u_int8_t days_match; /* 1 bit per day. -SMTWTFS */
542+ u_int16_t time_start; /* 0 < time_start < 23*60+59 = 1439 */
543+ u_int16_t time_stop; /* 0:0 < time_stat < 23:59 */
544+ u_int8_t kerneltime; /* ignore skb time (and use kerneltime) or not. */
545+};
546+
547+
548+#endif /* __ipt_time_h_included__ */
549diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_u32.h linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_u32.h
550--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv4/ipt_u32.h 1970-01-01 01:00:00.000000000 +0100
551+++ linux-2.6.3-rc3/include/linux/netfilter_ipv4/ipt_u32.h 2004-02-16 11:07:28.175208970 +0100
552@@ -0,0 +1,40 @@
553+#ifndef _IPT_U32_H
554+#define _IPT_U32_H
555+#include <linux/netfilter_ipv4/ip_tables.h>
556+
557+enum ipt_u32_ops
558+{
559+ IPT_U32_AND,
560+ IPT_U32_LEFTSH,
561+ IPT_U32_RIGHTSH,
562+ IPT_U32_AT
563+};
564+
565+struct ipt_u32_location_element
566+{
567+ u_int32_t number;
568+ u_int8_t nextop;
569+};
570+struct ipt_u32_value_element
571+{
572+ u_int32_t min;
573+ u_int32_t max;
574+};
575+/* *** any way to allow for an arbitrary number of elements?
576+ for now I settle for a limit of 10 of each */
577+#define U32MAXSIZE 10
578+struct ipt_u32_test
579+{
580+ u_int8_t nnums;
581+ struct ipt_u32_location_element location[U32MAXSIZE+1];
582+ u_int8_t nvalues;
583+ struct ipt_u32_value_element value[U32MAXSIZE+1];
584+};
585+
586+struct ipt_u32
587+{
588+ u_int8_t ntests;
589+ struct ipt_u32_test tests[U32MAXSIZE+1];
590+};
591+
592+#endif /*_IPT_U32_H*/
593diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_HL.h linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_HL.h
594--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_HL.h 1970-01-01 01:00:00.000000000 +0100
595+++ linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_HL.h 2004-02-16 11:06:53.521507853 +0100
596@@ -0,0 +1,22 @@
597+/* Hop Limit modification module for ip6tables
598+ * Maciej Soltysiak <solt@dns.toxicfilms.tv>
599+ * Based on HW's TTL module */
600+
601+#ifndef _IP6T_HOPLIMIT_H
602+#define _IP6T_HOPLIMIT_H
603+
604+enum {
605+ IP6T_HOPLIMIT_SET = 0,
606+ IP6T_HOPLIMIT_INC,
607+ IP6T_HOPLIMIT_DEC
608+};
609+
610+#define IP6T_HOPLIMIT_MAXMODE IP6T_HOPLIMIT_DEC
611+
612+struct ip6t_HOPLIMIT_info {
613+ u_int8_t mode;
614+ u_int8_t hop_limit;
615+};
616+
617+
618+#endif
619diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_REJECT.h linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_REJECT.h
620--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_REJECT.h 2004-02-15 03:44:09.000000000 +0100
621+++ linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_REJECT.h 2004-02-16 11:07:07.812085576 +0100
622@@ -2,15 +2,17 @@
623 #define _IP6T_REJECT_H
624
625 enum ip6t_reject_with {
626- IP6T_ICMP_NET_UNREACHABLE,
627- IP6T_ICMP_HOST_UNREACHABLE,
628- IP6T_ICMP_PROT_UNREACHABLE,
629- IP6T_ICMP_PORT_UNREACHABLE,
630- IP6T_ICMP_ECHOREPLY
631+ IP6T_ICMP6_NO_ROUTE,
632+ IP6T_ICMP6_ADM_PROHIBITED,
633+ IP6T_ICMP6_NOT_NEIGHBOUR,
634+ IP6T_ICMP6_ADDR_UNREACH,
635+ IP6T_ICMP6_PORT_UNREACH,
636+ IP6T_ICMP6_ECHOREPLY,
637+ IP6T_TCP_RESET
638 };
639
640 struct ip6t_reject_info {
641 enum ip6t_reject_with with; /* reject type */
642 };
643
644-#endif /*_IPT_REJECT_H*/
645+#endif /*_IP6T_REJECT_H*/
646diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_fuzzy.h linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_fuzzy.h
647--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_fuzzy.h 1970-01-01 01:00:00.000000000 +0100
648+++ linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_fuzzy.h 2004-02-16 11:07:14.925382080 +0100
649@@ -0,0 +1,21 @@
650+#ifndef _IP6T_FUZZY_H
651+#define _IP6T_FUZZY_H
652+
653+#include <linux/param.h>
654+#include <linux/types.h>
655+
656+#define MAXFUZZYRATE 10000000
657+#define MINFUZZYRATE 3
658+
659+struct ip6t_fuzzy_info {
660+ u_int32_t minimum_rate;
661+ u_int32_t maximum_rate;
662+ u_int32_t packets_total;
663+ u_int32_t bytes_total;
664+ u_int32_t previous_time;
665+ u_int32_t present_time;
666+ u_int32_t mean_rate;
667+ u_int8_t acceptance_rate;
668+};
669+
670+#endif /*_IP6T_FUZZY_H*/
671diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_nth.h linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_nth.h
672--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_nth.h 1970-01-01 01:00:00.000000000 +0100
673+++ linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_nth.h 2004-02-16 11:07:18.796455028 +0100
674@@ -0,0 +1,19 @@
675+#ifndef _IP6T_NTH_H
676+#define _IP6T_NTH_H
677+
678+#include <linux/param.h>
679+#include <linux/types.h>
680+
681+#ifndef IP6T_NTH_NUM_COUNTERS
682+#define IP6T_NTH_NUM_COUNTERS 16
683+#endif
684+
685+struct ip6t_nth_info {
686+ u_int8_t every;
687+ u_int8_t not;
688+ u_int8_t startat;
689+ u_int8_t counter;
690+ u_int8_t packet;
691+};
692+
693+#endif /*_IP6T_NTH_H*/
694diff -Nur linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_random.h linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_random.h
695--- linux-2.6.3-rc3.org/include/linux/netfilter_ipv6/ip6t_random.h 1970-01-01 01:00:00.000000000 +0100
696+++ linux-2.6.3-rc3/include/linux/netfilter_ipv6/ip6t_random.h 2004-02-16 11:07:24.378118313 +0100
697@@ -0,0 +1,11 @@
698+#ifndef _IP6T_RAND_H
699+#define _IP6T_RAND_H
700+
701+#include <linux/param.h>
702+#include <linux/types.h>
703+
704+struct ip6t_rand_info {
705+ u_int8_t average;
706+};
707+
708+#endif /*_IP6T_RAND_H*/
709diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/Kconfig linux-2.6.3-rc3/net/ipv4/netfilter/Kconfig
710--- linux-2.6.3-rc3.org/net/ipv4/netfilter/Kconfig 2004-02-16 10:08:59.000000000 +0100
711+++ linux-2.6.3-rc3/net/ipv4/netfilter/Kconfig 2004-02-16 11:07:28.178208252 +0100
712@@ -588,5 +588,384 @@
713
714 To compile it as a module, choose M here. If unsure, say N.
715
716+config IP_NF_TARGET_IPV4OPTSSTRIP
717+ tristate 'IPV4OPTSSTRIP target support'
718+ depends on IP_NF_MANGLE
719+ help
720+ This option adds CONFIG_IP_NF_TARGET_IPV4OPTSSTRIP, which supplies a target
721+ module that will allow you to strip all the IP options from a packet.
722+
723+ The target doesn't take any option, and therefore is extremly easy to use :
724+
725+ # iptables -t mangle -A PREROUTING -j IPV4OPTSSTRIP
726+ # iptables -t mangle --list -n
727+ Chain PREROUTING (policy ACCEPT)
728+ target prot opt source destination
729+ IPV4OPTSSTRIP all -- 0.0.0.0/0 0.0.0.0/0
730+
731+ Chain OUTPUT (policy ACCEPT)
732+ target prot opt source destination
733+
734+config IP_NF_TARGET_NETLINK
735+ tristate 'NETLINK target support'
736+ depends on IP_NF_FILTER
737+ help
738+ CONFIG_IP_NF_TARGET_NETLINK adds a NETLINK target that sends dropped packets to
739+ userspace via a netlink socket. Apps such as fwmon
740+ (http://firestorm.geek-ware.co.uk) can then recieve and dislpay these packets.
741+ This option is basically a re-implementation of the ipchains -o option.
742+
743+config IP_NF_TARGET_TTL
744+ tristate 'TTL target support'
745+ depends on IP_NF_MANGLE
746+ help
747+ This adds an iptables TTL manipulation target, which enables the user
748+ to set the TTL value of an IP packet or to increment / decrement it
749+ by a given value.
750+
751+config IP_NF_MATCH_CONNLIMIT
752+ tristate 'Connections/IP limit match support'
753+ depends on IP_NF_IPTABLES
754+ help
755+ This adds an iptables match which allows you to restrict the
756+ number of parallel TCP connections to a server per client IP address
757+ (or address block).
758+
759+ Examples:
760+
761+ # allow 2 telnet connections per client host
762+ iptables -p tcp --syn --dport 23 -m connlimit --connlimit-above 2 -j REJECT
763+
764+ # you can also match the other way around:
765+ iptables -p tcp --syn --dport 23 -m connlimit ! --connlimit-above 2 -j ACCEPT
766+
767+ # limit the nr of parallel http requests to 16 per class C sized
768+ # network (24 bit netmask)
769+ iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 16 \
770+ --connlimit-mask 24 -j REJECT
771+
772+config IP_NF_MATCH_DSTLIMIT
773+ tristate 'dstlimit match support'
774+ depends on IP_NF_IPTABLES
775+ help
776+
777+ This patch adds a new match called 'dstlimit'.
778+ The idea is to have something like 'limit', but either per
779+ destination-ip or per (destip,destport) tuple.
780+
781+ It gives you the ability to say
782+ '1000 packets per second for every host in 192.168.0.0/16'
783+ '100 packets per second for every service of 192.168.1.1'
784+
785+ Parameters are:
786+ --dstlimit <rate>
787+ A rate just like the limit match
788+ --dstlimit-burst <num>
789+ Burst value, just like limit match
790+ --dstlimit-mode destip | destip-destport
791+ Limit per IP or per port
792+ --dstlimit-name foo
793+ The name for the /proc/net/ipt_dstlimit/foo entry
794+ --dstlimit-htable-size <num>
795+ The number of buckets of the hash table
796+ --dstlimit-htable-max <num>
797+ Maximum entries in the hash
798+ --dstlimit-htable-expire <num>
799+ After how many miliseconds do hash entries expire
800+ --dstlimit-htable-gcinterval <num>
801+ How many miliseconds between garbage collection intervals
802+
803+
804+config IP_NF_MATCH_FUZZY
805+ tristate 'fuzzy match support'
806+ depends on IP_NF_IPTABLES
807+ help
808+ This option adds a `fuzzy' match which allows you to match packets according to
809+ a dynamic profile implemented by means of a simple Fuzzy Logic Controller (FLC)
810+
811+config IP_NF_MATCH_IPV4OPTIONS
812+ tristate 'IPV4OPTIONS match support'
813+ depends on IP_NF_IPTABLES
814+ help
815+ This option adds an iptables 'ipv4options' match, which allows you to
816+ match on IPv4 header options like source routing, record route, timestamp and
817+ router-alert.
818+
819+ Suppported options are:
820+ --ssrr
821+ To match packets with the flag strict source routing.
822+ --lsrr
823+ To match packets with the flag loose source routing.
824+ --no-srr
825+ To match packets with no flag for source routing.
826+ [!] --rr
827+ To match packets with the RR flag.
828+ [!] --ts
829+ To match packets with the TS flag.
830+ [!] --ra
831+ To match packets with the router-alert option.
832+ [!] --any-opt
833+ To match a packet with at least one IP option, or no IP option
834+ at all if ! is chosen.
835+
836+ Example:
837+ $ iptables -A input -m ipv4options --rr -j DROP
838+ will drop packets with the record-route flag.
839+
840+ $ iptables -A input -m ipv4options --ts -j DROP
841+ will drop packets with the timestamp flag.
842+
843+config IP_NF_MATCH_MPORT
844+ tristate 'Multiple port with ranges match support'
845+ depends on IP_NF_IPTABLES
846+ help
847+ This module is an enhanced multiport match. It has support for byte
848+ ranges as well as for single ports.
849+ Up to 15 ports are allowed. Note that a portrange uses up 2 port values.
850+
851+ Examples:
852+ # iptables -A FORWARD -p tcp -m mport --ports 23:42,65
853+
854+config IP_NF_MATCH_NTH
855+ tristate 'Nth match support'
856+ depends on IP_NF_IPTABLES
857+ help
858+ This option adds an iptables `Nth' match, which allows you to match every Nth
859+ packet encountered. By default there are 16 different counters that can be
860+ used.
861+
862+ This match functions in one of two ways
863+ 1) Match ever Nth packet, and only the Nth packet.
864+ example:
865+ iptables -t mangle -A PREROUTING -m nth --every 10 -j DROP
866+ This rule will drop every 10th packet.
867+ 2) Unique rule for every packet. This is an easy and quick
868+ method to produce load-balancing for both inbound and outbound.
869+ example:
870+ iptables -t nat -A POSTROUTING -o eth0 -m nth --counter 7 \
871+ --every 3 --packet 0 -j SNAT --to-source 10.0.0.5
872+ iptables -t nat -A POSTROUTING -o eth0 -m nth --counter 7 \
873+ --every 3 --packet 1 -j SNAT --to-source 10.0.0.6
874+ iptables -t nat -A POSTROUTING -o eth0 -m nth --counter 7 \
875+ --every 3 --packet 2 -j SNAT --to-source 10.0.0.7
876+ This example evenly splits connections between the three SNAT
877+ addresses.
878+
879+ By using the mangle table and iproute2, you can setup complex
880+ load-balanced routing. There's lot of other uses. Be creative!
881+
882+ Suppported options are:
883+ --every Nth Match every Nth packet
884+ [--counter] num Use counter 0-15 (default:0)
885+ [--start] num Initialize the counter at the number 'num'
886+ instead of 0. Must be between 0 and Nth-1
887+ [--packet] num Match on 'num' packet. Must be between 0
888+ and Nth-1.
889+ If --packet is used for a counter than
890+ there must be Nth number of --packet
891+ rules, covering all values between 0 and
892+ Nth-1 inclusively.
893+
894+config IP_NF_MATCH_OSF
895+ tristate 'OSF match support'
896+ depends on IP_NF_IPTABLES
897+ help
898+ The idea of passive OS fingerprint matching exists for quite a long time,
899+ but was created as extension fo OpenBSD pf only some weeks ago.
900+ Original idea was lurked in some OpenBSD mailing list (thanks
901+ grange@open...) and than adopted for Linux netfilter in form of this code.
902+
903+ Original table was created by Michal Zalewski <lcamtuf@coredump.cx> for
904+ his excellent p0f and than changed a bit for more convenience.
905+
906+ This module compares some data(WS, MSS, options and it's order, ttl,
907+ df and others) from first SYN packet (actually from packets with SYN
908+ bit set) with hardcoded in fingers[] table ones.
909+
910+ Example: (Of course this only an example, do not get inspired by this)
911+
912+ # iptables -N LINUX
913+ # iptables -A LINUX -j LOG --log-prefix "Linux"
914+
915+ # iptables -A INPUT -p tcp -m osf --genre Linux -j LINUX
916+ # iptables -A INPUT -p tcp -m osf --genre FreeBSD -j REJECT
917+
918+ NOTE: -p tcp is obviously required as it is a TCP match.
919+
920+ OSF also has:
921+ --log 1/0.
922+ If present, OSF will log determined genres even if they don't match
923+ desired one.
924+ 0 - log all determined entries,
925+ 1 - only first one.
926+
927+ Example:
928+ #iptables -I INPUT -j ACCEPT -p tcp -m osf --genre Linux --log 1 --smart
929+
930+ In syslog you find something like this:
931+ ipt_osf: Windows [Windows XP Pro SP1, 2000 SP3]: 11.22.33.55:4024 -> 11.22.33.44:139
932+ ipt_osf: Unknown: 16384:106:1:48:020405B401010402 44.33.22.11:1239 -> 11.22.33.44:80
933+
934+ --smart
935+ if present, OSF will use some smartness to determine remote OS.
936+ Now only not use TTL( with it far remote machines can be determined).
937+
938+ Fingerprints can be loaded through /proc/sys/net/ipv4/osf file.
939+ Only one fingerprint per open/close.
940+
941+ Fingerprints can be downloaded from http://www.openbsd.org/cgi-bin/cvsweb/src/etc/pf.os
942+
943+config IP_POOL_STATISTICS
944+ bool 'enable statistics on pool usage'
945+ depends on IP_NF_POOL!=n
946+
947+config IP_NF_POOL
948+ tristate 'IP address pool support'
949+ depends on IP_NF_IPTABLES
950+ help
951+ CONFIG_IP_NF_POOL provides a match which lets you use bitmaps with one bit per
952+ address from some range of IP addresses; the match depends on whether a checked
953+ source or destination address has its bit set in the pool. It also provides a
954+ POOL target, which can be used to add or remove the addresses of a packet
955+ to/from a pool.
956+
957+ There is also a POOL netfilter target, which can be used to set or remove the
958+ addresses of a packet from a pool.
959+
960+ To define and use pools, you need userlevel utilities: a patched iptables, and
961+ the program ippool(8), which defines the pools and their bounds. The current
962+ release of pool matching is ippool-0.0.2, and can be found in the archives of
963+ the netfilter mailing list at http://lists.netfilter.org/.
964+
965+config IP_NF_MATCH_PSD
966+ tristate 'psd match support'
967+ depends on IP_NF_IPTABLES
968+ help
969+ This option adds a `psd' match, which supplies portscan
970+ detection match (psd). This match will attempt to detect TCP and UDP
971+ port scans. This match was derived from Solar Designer's scanlogd.
972+
973+ Suppported options are:
974+
975+ --psd-weight-threshold <threshold>
976+
977+ Total weight of the latest TCP/UDP packets with different
978+ destination ports coming from the same host to be treated as port
979+ scan sequence.
980+
981+ --psd-delay-threshold <delay>
982+
983+ Delay (in hundredths of second) for the packets with different
984+ destination ports coming from the same host to be treated as
985+ possible port scan subsequence.
986+
987+ --psd-lo-ports-weight <weight>
988+
989+ Weight of the packet with privileged (<=1024) destination port.
990+
991+ --psd-hi-ports-weight <weight>
992+
993+ Weight of the packet with non-priviliged destination port.
994+
995+config IP_NF_MATCH_QUOTA
996+ tristate 'quota match support'
997+ depends on IP_NF_IPTABLES
998+ help
999+ This option adds CONFIG_IP_NF_MATCH_QUOTA, which implements network
1000+ quotas by decrementing a byte counter with each packet.
1001+
1002+ Supported options are:
1003+ --quota <bytes>
1004+ The quota in bytes.
1005+
1006+ KNOWN BUGS: this does not work on SMP systems.
1007+
1008+
1009+config IP_NF_MATCH_RANDOM
1010+ tristate 'random match support'
1011+ depends on IP_NF_IPTABLES
1012+ help
1013+ This option adds a `random' match,
1014+ which allow you to match packets randomly
1015+ following a given probability.
1016+
1017+ Suppported options are:
1018+
1019+ [--average] percent will match randomly packets with a probability of
1020+ 'percent'. default is 50%
1021+
1022+config IP_NF_MATCH_REALM
1023+ tristate 'realm match support'
1024+ depends on IP_NF_IPTABLES
1025+ help
1026+ realm match: uses realm key from routing as match criteria similiar to
1027+ one in packet classifier
1028+
1029+ /** snip from packet classifier documentation */
1030+ Routing tables based classifier
1031+ CONFIG_NET_CLS_ROUTE4
1032+ If you say Y here, you will be able to classify outgoing packets
1033+ according to the route table entry they matched. If unsure, say Y.
1034+ /** end snip **/
1035+
1036+
1037+ # Example
1038+ # add route
1039+ /sbin/ip route add 194.29.194.0/24 via 194.29.192.1 realm 10
1040+
1041+ # source realm is in realm with mask 0xFFFF0000,
1042+ # destination is in realm with mask 0x0000FFFF
1043+
1044+ # match destination realm
1045+ /usr/local/sbin/iptables -A OUTPUT -m realm --realm 10 -j LOG
1046+
1047+ # match realm of source, this is also determinated by routing,
1048+ /usr/local/sbin/iptables -A INPUT -m realm --realm 655360 -j LOG
1049+
1050+ THIS PATCH REQUIRES CONFIG_NET_CLS_ROUTE TO BE SET
1051+
1052+config IP_NF_MATCH_TIME
1053+ tristate 'TIME match support'
1054+ depends on IP_NF_IPTABLES
1055+ help
1056+
1057+ This option adds CONFIG_IP_NF_MATCH_TIME, which supplies a time match module.
1058+ This match allows you to filter based on the packet arrival time
1059+ (arrival time at the machine which the netfilter is running on) or
1060+ departure time (for locally generated packets).
1061+
1062+ Supported options are:
1063+ --timestart HH:MM
1064+ The starting point of the time match frame.
1065+
1066+ --timestop HH:MM
1067+ The stopping point of the time match frame
1068+
1069+ --days Tue,Mon...
1070+ Days of the week to match separated by a coma, no space
1071+ (one of Sun,Mon,Tue,Wed,Thu,Fri,Sat)
1072+
1073+ Example:
1074+ -A INPUT -m time --timestart 8:00 --timestop 18:00 --days Mon,Tue,Wed,Thu,Fri
1075+ will match packets that have an arrival timestamp in the range 8:00->18:00 from Monday
1076+ to Friday.
1077+
1078+ -A OUTPUT -m time --timestart 8:00 --timestop 18:00 --Days Mon
1079+ will match the packets (locally generated) that have a departure timestamp
1080+ in the range 8:00->18:00 on Monday only.
1081+
1082+config IP_NF_MATCH_U32
1083+ tristate 'U32 match support'
1084+ depends on IP_NF_IPTABLES
1085+ help
1086+
1087+ U32 allows you to extract quantities of up to 4 bytes from a packet,
1088+ AND them with specified masks, shift them by specified amounts and
1089+ test whether the results are in any of a set of specified ranges.
1090+ The specification of what to extract is general enough to skip over
1091+ headers with lengths stored in the packet, as in IP or TCP header
1092+ lengths.
1093+ Details and examples are in the kernel module source.
1094+
1095 endmenu
1096
1097diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/Makefile linux-2.6.3-rc3/net/ipv4/netfilter/Makefile
1098--- linux-2.6.3-rc3.org/net/ipv4/netfilter/Makefile 2004-02-16 10:08:59.000000000 +0100
1099+++ linux-2.6.3-rc3/net/ipv4/netfilter/Makefile 2004-02-16 11:07:28.178208252 +0100
1100@@ -42,15 +42,38 @@
1101 # matches
1102 obj-$(CONFIG_IP_NF_MATCH_HELPER) += ipt_helper.o
1103 obj-$(CONFIG_IP_NF_MATCH_LIMIT) += ipt_limit.o
1104+obj-$(CONFIG_IP_NF_MATCH_QUOTA) += ipt_quota.o
1105+obj-$(CONFIG_IP_NF_MATCH_DSTLIMIT) += ipt_dstlimit.o
1106 obj-$(CONFIG_IP_NF_MATCH_MARK) += ipt_mark.o
1107+obj-$(CONFIG_IP_NF_POOL) += ipt_pool.o ipt_POOL.o ip_pool.o
1108 obj-$(CONFIG_IP_NF_MATCH_MAC) += ipt_mac.o
1109 obj-$(CONFIG_IP_NF_MATCH_IPRANGE) += ipt_iprange.o
1110
1111 obj-$(CONFIG_IP_NF_MATCH_PKTTYPE) += ipt_pkttype.o
1112 obj-$(CONFIG_IP_NF_MATCH_MULTIPORT) += ipt_multiport.o
1113+
1114+obj-$(CONFIG_IP_NF_MATCH_MPORT) += ipt_mport.o
1115+
1116 obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o
1117 obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
1118
1119+obj-$(CONFIG_IP_NF_MATCH_TIME) += ipt_time.o
1120+
1121+
1122+obj-$(CONFIG_IP_NF_MATCH_RANDOM) += ipt_random.o
1123+
1124+obj-$(CONFIG_IP_NF_MATCH_PSD) += ipt_psd.o
1125+
1126+obj-$(CONFIG_IP_NF_MATCH_OSF) += ipt_osf.o
1127+
1128+
1129+obj-$(CONFIG_IP_NF_MATCH_NTH) += ipt_nth.o
1130+
1131+obj-$(CONFIG_IP_NF_MATCH_IPV4OPTIONS) += ipt_ipv4options.o
1132+
1133+
1134+obj-$(CONFIG_IP_NF_MATCH_FUZZY) += ipt_fuzzy.o
1135+
1136 obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o
1137
1138 obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o
1139@@ -59,10 +82,15 @@
1140
1141 obj-$(CONFIG_IP_NF_MATCH_LENGTH) += ipt_length.o
1142
1143+obj-$(CONFIG_IP_NF_MATCH_U32) += ipt_u32.o
1144+
1145+
1146 obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
1147 obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
1148+obj-$(CONFIG_IP_NF_MATCH_CONNLIMIT) += ipt_connlimit.o
1149 obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += ipt_conntrack.o
1150 obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
1151+obj-$(CONFIG_IP_NF_MATCH_REALM) += ipt_realm.o
1152
1153 obj-$(CONFIG_IP_NF_MATCH_PHYSDEV) += ipt_physdev.o
1154
1155@@ -80,6 +108,9 @@
1156 obj-$(CONFIG_IP_NF_TARGET_CLASSIFY) += ipt_CLASSIFY.o
1157 obj-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += ip_nat_snmp_basic.o
1158 obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
1159+obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
1160+obj-$(CONFIG_IP_NF_TARGET_NETLINK) += ipt_NETLINK.o
1161+obj-$(CONFIG_IP_NF_TARGET_IPV4OPTSSTRIP) += ipt_IPV4OPTSSTRIP.o
1162 obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
1163 obj-$(CONFIG_IP_NF_TARGET_TCPMSS) += ipt_TCPMSS.o
1164
1165diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/ip_pool.c linux-2.6.3-rc3/net/ipv4/netfilter/ip_pool.c
1166--- linux-2.6.3-rc3.org/net/ipv4/netfilter/ip_pool.c 1970-01-01 01:00:00.000000000 +0100
1167+++ linux-2.6.3-rc3/net/ipv4/netfilter/ip_pool.c 2004-02-16 11:07:21.518803072 +0100
1168@@ -0,0 +1,332 @@
1169+/* Kernel module for IP pool management */
1170+
1171+#include <linux/module.h>
1172+#include <linux/ip.h>
1173+#include <linux/skbuff.h>
1174+#include <linux/netfilter_ipv4/ip_tables.h>
1175+#include <linux/netfilter_ipv4/ip_pool.h>
1176+#include <linux/errno.h>
1177+#include <asm/uaccess.h>
1178+#include <asm/bitops.h>
1179+#include <linux/interrupt.h>
1180+#include <linux/spinlock.h>
1181+
1182+#if 0
1183+#define DP printk
1184+#else
1185+#define DP(format, args...)
1186+#endif
1187+
1188+MODULE_LICENSE("GPL");
1189+
1190+#define NR_POOL 16
1191+static int nr_pool = NR_POOL;/* overwrite this when loading module */
1192+
1193+struct ip_pool {
1194+ u_int32_t first_ip; /* host byte order, included in range */
1195+ u_int32_t last_ip; /* host byte order, included in range */
1196+ void *members; /* the bitmap proper */
1197+ int nr_use; /* total nr. of tests through this */
1198+ int nr_match; /* total nr. of matches through this */
1199+ rwlock_t lock;
1200+};
1201+
1202+static struct ip_pool *POOL;
1203+
1204+static inline struct ip_pool *lookup(ip_pool_t index)
1205+{
1206+ if (index < 0 || index >= nr_pool) {
1207+ DP("ip_pool:lookup: bad index %d\n", index);
1208+ return 0;
1209+ }
1210+ return POOL+index;
1211+}
1212+
1213+int ip_pool_match(ip_pool_t index, u_int32_t addr)
1214+{
1215+ struct ip_pool *pool = lookup(index);
1216+ int res = 0;
1217+
1218+ if (!pool || !pool->members)
1219+ return 0;
1220+ read_lock_bh(&pool->lock);
1221+ if (pool->members) {
1222+ if (addr >= pool->first_ip && addr <= pool->last_ip) {
1223+ addr -= pool->first_ip;
1224+ if (test_bit(addr, pool->members)) {
1225+ res = 1;
1226+#ifdef CONFIG_IP_POOL_STATISTICS
1227+ pool->nr_match++;
1228+#endif
1229+ }
1230+ }
1231+#ifdef CONFIG_IP_POOL_STATISTICS
1232+ pool->nr_use++;
1233+#endif
1234+ }
1235+ read_unlock_bh(&pool->lock);
1236+ return res;
1237+}
1238+
1239+static int pool_change(ip_pool_t index, u_int32_t addr, int isdel)
1240+{
1241+ struct ip_pool *pool;
1242+ int res = -1;
1243+
1244+ pool = lookup(index);
1245+ if ( !pool || !pool->members
1246+ || addr < pool->first_ip || addr > pool->last_ip)
1247+ return -1;
1248+ read_lock_bh(&pool->lock);
1249+ if (pool->members && addr >= pool->first_ip && addr <= pool->last_ip) {
1250+ addr -= pool->first_ip;
1251+ res = isdel
1252+ ? (0 != test_and_clear_bit(addr, pool->members))
1253+ : (0 != test_and_set_bit(addr, pool->members));
1254+ }
1255+ read_unlock_bh(&pool->lock);
1256+ return res;
1257+}
1258+
1259+int ip_pool_mod(ip_pool_t index, u_int32_t addr, int isdel)
1260+{
1261+ int res = pool_change(index,addr,isdel);
1262+
1263+ if (!isdel) res = !res;
1264+ return res;
1265+}
1266+
1267+static inline int bitmap_bytes(u_int32_t a, u_int32_t b)
1268+{
1269+ return 4*((((b-a+8)/8)+3)/4);
1270+}
1271+
1272+static inline int poolbytes(ip_pool_t index)
1273+{
1274+ struct ip_pool *pool = lookup(index);
1275+
1276+ return pool ? bitmap_bytes(pool->first_ip, pool->last_ip) : 0;
1277+}
1278+
1279+static int setpool(
1280+ struct sock *sk,
1281+ int optval,
1282+ void *user,
1283+ unsigned int len
1284+) {
1285+ struct ip_pool_request req;
1286+
1287+ DP("ip_pool:setpool: optval=%d, user=%p, len=%d\n", optval, user, len);
1288+ if (!capable(CAP_NET_ADMIN))
1289+ return -EPERM;
1290+ if (optval != SO_IP_POOL)
1291+ return -EBADF;
1292+ if (len != sizeof(req))
1293+ return -EINVAL;
1294+ if (copy_from_user(&req, user, sizeof(req)) != 0)
1295+ return -EFAULT;
1296+ printk("obsolete op - upgrade your ippool(8) utility.\n");
1297+ return -EINVAL;
1298+}
1299+
1300+static int getpool(
1301+ struct sock *sk,
1302+ int optval,
1303+ void *user,
1304+ int *len
1305+) {
1306+ struct ip_pool_request req;
1307+ struct ip_pool *pool;
1308+ ip_pool_t i;
1309+ int newbytes;
1310+ void *newmembers;
1311+ int res;
1312+
1313+ DP("ip_pool:getpool: optval=%d, user=%p\n", optval, user);
1314+ if (!capable(CAP_NET_ADMIN))
1315+ return -EINVAL;
1316+ if (optval != SO_IP_POOL)
1317+ return -EINVAL;
1318+ if (*len != sizeof(req)) {
1319+ return -EFAULT;
1320+ }
1321+ if (copy_from_user(&req, user, sizeof(req)) != 0)
1322+ return -EFAULT;
1323+ DP("ip_pool:getpool op=%d, index=%d\n", req.op, req.index);
1324+ if (req.op < IP_POOL_BAD001) {
1325+ printk("obsolete op - upgrade your ippool(8) utility.\n");
1326+ return -EFAULT;
1327+ }
1328+ switch(req.op) {
1329+ case IP_POOL_HIGH_NR:
1330+ DP("ip_pool HIGH_NR\n");
1331+ req.index = IP_POOL_NONE;
1332+ for (i=0; i<nr_pool; i++)
1333+ if (POOL[i].members)
1334+ req.index = i;
1335+ return copy_to_user(user, &req, sizeof(req));
1336+ case IP_POOL_LOOKUP:
1337+ DP("ip_pool LOOKUP\n");
1338+ pool = lookup(req.index);
1339+ if (!pool)
1340+ return -EINVAL;
1341+ if (!pool->members)
1342+ return -EBADF;
1343+ req.addr = htonl(pool->first_ip);
1344+ req.addr2 = htonl(pool->last_ip);
1345+ return copy_to_user(user, &req, sizeof(req));
1346+ case IP_POOL_USAGE:
1347+ DP("ip_pool USE\n");
1348+ pool = lookup(req.index);
1349+ if (!pool)
1350+ return -EINVAL;
1351+ if (!pool->members)
1352+ return -EBADF;
1353+ req.addr = pool->nr_use;
1354+ req.addr2 = pool->nr_match;
1355+ return copy_to_user(user, &req, sizeof(req));
1356+ case IP_POOL_TEST_ADDR:
1357+ DP("ip_pool TEST 0x%08x\n", req.addr);
1358+ pool = lookup(req.index);
1359+ if (!pool)
1360+ return -EINVAL;
1361+ res = 0;
1362+ read_lock_bh(&pool->lock);
1363+ if (!pool->members) {
1364+ DP("ip_pool TEST_ADDR no members in pool\n");
1365+ res = -EBADF;
1366+ goto unlock_and_return_res;
1367+ }
1368+ req.addr = ntohl(req.addr);
1369+ if (req.addr < pool->first_ip) {
1370+ DP("ip_pool TEST_ADDR address < pool bounds\n");
1371+ res = -ERANGE;
1372+ goto unlock_and_return_res;
1373+ }
1374+ if (req.addr > pool->last_ip) {
1375+ DP("ip_pool TEST_ADDR address > pool bounds\n");
1376+ res = -ERANGE;
1377+ goto unlock_and_return_res;
1378+ }
1379+ req.addr = (0 != test_bit((req.addr - pool->first_ip),
1380+ pool->members));
1381+ read_unlock_bh(&pool->lock);
1382+ return copy_to_user(user, &req, sizeof(req));
1383+ case IP_POOL_FLUSH:
1384+ DP("ip_pool FLUSH not yet implemented.\n");
1385+ return -EBUSY;
1386+ case IP_POOL_DESTROY:
1387+ DP("ip_pool DESTROY not yet implemented.\n");
1388+ return -EBUSY;
1389+ case IP_POOL_INIT:
1390+ DP("ip_pool INIT 0x%08x-0x%08x\n", req.addr, req.addr2);
1391+ pool = lookup(req.index);
1392+ if (!pool)
1393+ return -EINVAL;
1394+ req.addr = ntohl(req.addr);
1395+ req.addr2 = ntohl(req.addr2);
1396+ if (req.addr > req.addr2) {
1397+ DP("ip_pool INIT bad ip range\n");
1398+ return -EINVAL;
1399+ }
1400+ newbytes = bitmap_bytes(req.addr, req.addr2);
1401+ newmembers = kmalloc(newbytes, GFP_KERNEL);
1402+ if (!newmembers) {
1403+ DP("ip_pool INIT out of mem for %d bytes\n", newbytes);
1404+ return -ENOMEM;
1405+ }
1406+ memset(newmembers, 0, newbytes);
1407+ write_lock_bh(&pool->lock);
1408+ if (pool->members) {
1409+ DP("ip_pool INIT pool %d exists\n", req.index);
1410+ kfree(newmembers);
1411+ res = -EBUSY;
1412+ goto unlock_and_return_res;
1413+ }
1414+ pool->first_ip = req.addr;
1415+ pool->last_ip = req.addr2;
1416+ pool->nr_use = 0;
1417+ pool->nr_match = 0;
1418+ pool->members = newmembers;
1419+ write_unlock_bh(&pool->lock);
1420+ return 0;
1421+ case IP_POOL_ADD_ADDR:
1422+ DP("ip_pool ADD_ADDR 0x%08x\n", req.addr);
1423+ req.addr = pool_change(req.index, ntohl(req.addr), 0);
1424+ return copy_to_user(user, &req, sizeof(req));
1425+ case IP_POOL_DEL_ADDR:
1426+ DP("ip_pool DEL_ADDR 0x%08x\n", req.addr);
1427+ req.addr = pool_change(req.index, ntohl(req.addr), 1);
1428+ return copy_to_user(user, &req, sizeof(req));
1429+ default:
1430+ DP("ip_pool:getpool bad op %d\n", req.op);
1431+ return -EINVAL;
1432+ }
1433+ return -EINVAL;
1434+
1435+unlock_and_return_res:
1436+ if (pool)
1437+ read_unlock_bh(&pool->lock);
1438+ return res;
1439+}
1440+
1441+static struct nf_sockopt_ops so_pool
1442+= { { NULL, NULL }, PF_INET,
1443+ SO_IP_POOL, SO_IP_POOL+1, &setpool,
1444+ SO_IP_POOL, SO_IP_POOL+1, &getpool,
1445+ 0, NULL };
1446+
1447+MODULE_PARM(nr_pool, "i");
1448+
1449+static int __init init(void)
1450+{
1451+ ip_pool_t i;
1452+ int res;
1453+
1454+ if (nr_pool < 1) {
1455+ printk("ip_pool module init: bad nr_pool %d\n", nr_pool);
1456+ return -EINVAL;
1457+ }
1458+ POOL = kmalloc(nr_pool * sizeof(*POOL), GFP_KERNEL);
1459+ if (!POOL) {
1460+ printk("ip_pool module init: out of memory for nr_pool %d\n",
1461+ nr_pool);
1462+ return -ENOMEM;
1463+ }
1464+ for (i=0; i<nr_pool; i++) {
1465+ POOL[i].first_ip = 0;
1466+ POOL[i].last_ip = 0;
1467+ POOL[i].members = 0;
1468+ POOL[i].nr_use = 0;
1469+ POOL[i].nr_match = 0;
1470+ POOL[i].lock = RW_LOCK_UNLOCKED;
1471+ }
1472+ res = nf_register_sockopt(&so_pool);
1473+ DP("ip_pool:init %d pools, result %d\n", nr_pool, res);
1474+ if (res != 0) {
1475+ kfree(POOL);
1476+ POOL = 0;
1477+ }
1478+ return res;
1479+}
1480+
1481+static void __exit fini(void)
1482+{
1483+ ip_pool_t i;
1484+
1485+ DP("ip_pool:fini BYEBYE\n");
1486+ nf_unregister_sockopt(&so_pool);
1487+ for (i=0; i<nr_pool; i++) {
1488+ if (POOL[i].members) {
1489+ kfree(POOL[i].members);
1490+ POOL[i].members = 0;
1491+ }
1492+ }
1493+ kfree(POOL);
1494+ POOL = 0;
1495+ DP("ip_pool:fini these are the famous last words\n");
1496+ return;
1497+}
1498+
1499+module_init(init);
1500+module_exit(fini);
1501diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_IPV4OPTSSTRIP.c linux-2.6.3-rc3/net/ipv4/netfilter/ipt_IPV4OPTSSTRIP.c
1502--- linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_IPV4OPTSSTRIP.c 1970-01-01 01:00:00.000000000 +0100
1503+++ linux-2.6.3-rc3/net/ipv4/netfilter/ipt_IPV4OPTSSTRIP.c 2004-02-16 11:06:57.518550655 +0100
1504@@ -0,0 +1,84 @@
1505+/**
1506+ * Strip all IP options in the IP packet header.
1507+ *
1508+ * (C) 2001 by Fabrice MARIE <fabrice@netfilter.org>
1509+ * This software is distributed under GNU GPL v2, 1991
1510+ */
1511+
1512+#include <linux/module.h>
1513+#include <linux/skbuff.h>
1514+#include <linux/ip.h>
1515+#include <net/checksum.h>
1516+
1517+#include <linux/netfilter_ipv4/ip_tables.h>
1518+
1519+MODULE_AUTHOR("Fabrice MARIE <fabrice@netfilter.org>");
1520+MODULE_DESCRIPTION("Strip all options in IPv4 packets");
1521+MODULE_LICENSE("GPL");
1522+
1523+static unsigned int
1524+target(struct sk_buff **pskb,
1525+ unsigned int hooknum,
1526+ const struct net_device *in,
1527+ const struct net_device *out,
1528+ const void *targinfo,
1529+ void *userinfo)
1530+{
1531+ struct iphdr *iph = (*pskb)->nh.iph;
1532+ struct sk_buff *skb = (*pskb);
1533+ struct ip_options * opt;
1534+ unsigned char * optiph = skb->nh.raw;
1535+ int l = ((struct ip_options *)(&(IPCB(skb)->opt)))->optlen;
1536+
1537+
1538+ /* if no options in packet then nothing to clear. */
1539+ if (iph->ihl * 4 == sizeof(struct iphdr))
1540+ return IPT_CONTINUE;
1541+
1542+ /* else clear all options */
1543+ memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
1544+ memset(optiph+sizeof(struct iphdr), IPOPT_NOOP, l);
1545+ opt = &(IPCB(skb)->opt);
1546+ opt->is_data = 0;
1547+ opt->optlen = l;
1548+
1549+ skb->nfcache |= NFC_ALTERED;
1550+
1551+ return IPT_CONTINUE;
1552+}
1553+
1554+static int
1555+checkentry(const char *tablename,
1556+ const struct ipt_entry *e,
1557+ void *targinfo,
1558+ unsigned int targinfosize,
1559+ unsigned int hook_mask)
1560+{
1561+ if (strcmp(tablename, "mangle")) {
1562+ printk(KERN_WARNING "IPV4OPTSSTRIP: can only be called from \"mangle\" table, not \"%s\"\n", tablename);
1563+ return 0;
1564+ }
1565+ /* nothing else to check because no parameters */
1566+ return 1;
1567+}
1568+
1569+static struct ipt_target ipt_ipv4optsstrip_reg
1570+= { { NULL, NULL }, "IPV4OPTSSTRIP", target, checkentry, NULL, THIS_MODULE };
1571+
1572+static int __init init(void)
1573+{
1574+ if (ipt_register_target(&ipt_ipv4optsstrip_reg))
1575+ return -EINVAL;
1576+ printk("ipt_IPV4OPTSSTRIP loaded\n");
1577+
1578+ return 0;
1579+}
1580+
1581+static void __exit fini(void)
1582+{
1583+ ipt_unregister_target(&ipt_ipv4optsstrip_reg);
1584+ printk("ipt_IPV4OPTSSTRIP unloaded\n");
1585+}
1586+
1587+module_init(init);
1588+module_exit(fini);
1589diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_NETLINK.c linux-2.6.3-rc3/net/ipv4/netfilter/ipt_NETLINK.c
1590--- linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_NETLINK.c 1970-01-01 01:00:00.000000000 +0100
1591+++ linux-2.6.3-rc3/net/ipv4/netfilter/ipt_NETLINK.c 2004-02-16 11:07:05.880548139 +0100
1592@@ -0,0 +1,119 @@
1593+#include <linux/module.h>
1594+#include <linux/version.h>
1595+#include <linux/config.h>
1596+#include <linux/socket.h>
1597+#include <linux/skbuff.h>
1598+#include <linux/kernel.h>
1599+#include <linux/netlink.h>
1600+#include <linux/netdevice.h>
1601+#include <linux/mm.h>
1602+#include <linux/socket.h>
1603+#include <linux/netfilter_ipv4/ip_tables.h>
1604+#include <linux/netfilter_ipv4/ipt_NETLINK.h>
1605+#include <net/sock.h>
1606+
1607+MODULE_AUTHOR("Gianni Tedesco <gianni@ecsc.co.uk>");
1608+MODULE_DESCRIPTION("Provides iptables NETLINK target similar to ipchains -o");
1609+MODULE_LICENSE("GPL");
1610+
1611+#if 0
1612+#define DEBUGP printk
1613+#else
1614+#define DEBUGP(format, args...)
1615+#endif
1616+
1617+static struct sock *ipfwsk;
1618+
1619+static unsigned int ipt_netlink_target(struct sk_buff **pskb,
1620+ unsigned int hooknum,
1621+ const struct net_device *in,
1622+ const struct net_device *out,
1623+ const void *targinfo, void *userinfo)
1624+{
1625+ struct ipt_nldata *nld = (struct ipt_nldata *)targinfo;
1626+ struct iphdr *ip = (*pskb)->nh.iph;
1627+ struct sk_buff *outskb;
1628+ struct netlink_t nlhdr;
1629+ size_t len=0;
1630+
1631+ /* Allocate a socket buffer */
1632+ if ( MASK(nld->flags, USE_SIZE) )
1633+ len = nld->size+sizeof(nlhdr);
1634+ else
1635+ len = ntohs(ip->tot_len)+sizeof(nlhdr);
1636+
1637+ outskb=alloc_skb(len, GFP_ATOMIC);
1638+
1639+ if (outskb) {
1640+ nlhdr.len=len;
1641+
1642+ if ( MASK(nld->flags, USE_MARK) )
1643+ nlhdr.mark=(*pskb)->nfmark=nld->mark;
1644+ else
1645+ nlhdr.mark=(*pskb)->nfmark;
1646+
1647+ if ( in && in->name ) {
1648+ strncpy((char *)&nlhdr.iface, in->name, IFNAMSIZ);
1649+ }else if ( out && out->name ){
1650+ strncpy((char *)&nlhdr.iface, out->name, IFNAMSIZ);
1651+ }
1652+
1653+ skb_put(outskb, len);
1654+ memcpy(outskb->data, &nlhdr, sizeof(nlhdr));
1655+ memcpy((outskb->data)+sizeof(nlhdr), ip, len-sizeof(nlhdr));
1656+ netlink_broadcast(ipfwsk, outskb, 0, ~0, GFP_ATOMIC);
1657+ }else{
1658+ if (net_ratelimit())
1659+ printk(KERN_WARNING "ipt_NETLINK: packet drop due to netlink failure\n");
1660+ }
1661+
1662+ if ( MASK(nld->flags, USE_DROP) )
1663+ return NF_DROP;
1664+
1665+ return IPT_CONTINUE;
1666+}
1667+
1668+static int ipt_netlink_checkentry(const char *tablename,
1669+ const struct ipt_entry *e,
1670+ void *targinfo,
1671+ unsigned int targinfosize,
1672+ unsigned int hookmask)
1673+{
1674+ //struct ipt_nldata *nld = (struct ipt_nldata *)targinfo;
1675+
1676+ return 1;
1677+}
1678+
1679+static struct ipt_target ipt_netlink_reg = {
1680+ {NULL, NULL},
1681+ "NETLINK",
1682+ ipt_netlink_target,
1683+ ipt_netlink_checkentry,
1684+ NULL,
1685+ THIS_MODULE
1686+};
1687+
1688+static int __init init(void)
1689+{
1690+ DEBUGP("ipt_NETLINK: init module\n");
1691+
1692+ if (ipt_register_target(&ipt_netlink_reg) != 0) {
1693+ return -EINVAL;
1694+ }
1695+
1696+ if ( !(ipfwsk=netlink_kernel_create(NETLINK_FIREWALL, NULL)) ){
1697+ return -EINVAL;
1698+ }
1699+
1700+ return 0;
1701+}
1702+
1703+static void __exit fini(void)
1704+{
1705+ DEBUGP("ipt_NETLINK: cleanup_module\n");
1706+ ipt_unregister_target(&ipt_netlink_reg);
1707+// if(ipfwsk->socket) sock_release(ipfwsk->socket);
1708+}
1709+
1710+module_init(init);
1711+module_exit(fini);
1712diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_POOL.c linux-2.6.3-rc3/net/ipv4/netfilter/ipt_POOL.c
1713--- linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_POOL.c 1970-01-01 01:00:00.000000000 +0100
1714+++ linux-2.6.3-rc3/net/ipv4/netfilter/ipt_POOL.c 2004-02-16 11:07:21.518803072 +0100
1715@@ -0,0 +1,116 @@
1716+/* ipt_POOL.c - netfilter target to manipulate IP pools
1717+ *
1718+ * This target can be used almost everywhere. It acts on some specified
1719+ * IP pool, adding or deleting some IP address in the pool. The address
1720+ * can be either the source (--addsrc, --delsrc), or destination (--add/deldst)
1721+ * of the packet under inspection.
1722+ *
1723+ * The target normally returns IPT_CONTINUE.
1724+ */
1725+
1726+#include <linux/types.h>
1727+#include <linux/ip.h>
1728+#include <linux/timer.h>
1729+#include <linux/module.h>
1730+#include <linux/netfilter.h>
1731+#include <linux/netdevice.h>
1732+#include <linux/if.h>
1733+#include <linux/inetdevice.h>
1734+#include <net/protocol.h>
1735+#include <net/checksum.h>
1736+#include <linux/netfilter_ipv4.h>
1737+#include <linux/netfilter_ipv4/ip_nat_rule.h>
1738+#include <linux/netfilter_ipv4/ipt_pool.h>
1739+
1740+#if 0
1741+#define DEBUGP printk
1742+#else
1743+#define DEBUGP(format, args...)
1744+#endif
1745+
1746+/*** NOTE NOTE NOTE NOTE ***
1747+**
1748+** By sheer luck, I get away with using the "struct ipt_pool_info", as defined
1749+** in <linux/netfilter_ipv4/ipt_pool.h>, both as the match and target info.
1750+** Here, in the target implementation, ipt_pool_info.src, if not IP_POOL_NONE,
1751+** is modified for the source IP address of the packet under inspection.
1752+** The same way, the ipt_pool_info.dst pool is modified for the destination.
1753+**
1754+** The address is added to the pool normally. However, if IPT_POOL_DEL_dir
1755+** flag is set in ipt_pool_info.flags, the address is deleted from the pool.
1756+**
1757+** If a modification was done to the pool, we possibly return ACCEPT or DROP,
1758+** if the right IPT_POOL_MOD_dir_ACCEPT or _MOD_dir_DROP flags are set.
1759+** The IPT_POOL_INV_MOD_dir flag inverts the sense of the check (i.e. the
1760+** ACCEPT and DROP flags are evaluated when the pool was not modified.)
1761+*/
1762+
1763+static int
1764+do_check(const char *tablename,
1765+ const struct ipt_entry *e,
1766+ void *targinfo,
1767+ unsigned int targinfosize,
1768+ unsigned int hook_mask)
1769+{
1770+ const struct ipt_pool_info *ipi = targinfo;
1771+
1772+ if (targinfosize != IPT_ALIGN(sizeof(*ipi))) {
1773+ DEBUGP("POOL_check: size %u.\n", targinfosize);
1774+ return 0;
1775+ }
1776+ DEBUGP("ipt_POOL:do_check(%d,%d,%d)\n",ipi->src,ipi->dst,ipi->flags);
1777+ return 1;
1778+}
1779+
1780+static unsigned int
1781+do_target(struct sk_buff **pskb,
1782+ unsigned int hooknum,
1783+ const struct net_device *in,
1784+ const struct net_device *out,
1785+ const void *targinfo,
1786+ void *userinfo)
1787+{
1788+ const struct ipt_pool_info *ipi = targinfo;
1789+ int modified;
1790+ unsigned int verdict = IPT_CONTINUE;
1791+
1792+ if (ipi->src != IP_POOL_NONE) {
1793+ modified = ip_pool_mod(ipi->src, ntohl((*pskb)->nh.iph->saddr),
1794+ ipi->flags & IPT_POOL_DEL_SRC);
1795+ if (!!modified ^ !!(ipi->flags & IPT_POOL_INV_MOD_SRC)) {
1796+ if (ipi->flags & IPT_POOL_MOD_SRC_ACCEPT)
1797+ verdict = NF_ACCEPT;
1798+ else if (ipi->flags & IPT_POOL_MOD_SRC_DROP)
1799+ verdict = NF_DROP;
1800+ }
1801+ }
1802+ if (verdict == IPT_CONTINUE && ipi->dst != IP_POOL_NONE) {
1803+ modified = ip_pool_mod(ipi->dst, ntohl((*pskb)->nh.iph->daddr),
1804+ ipi->flags & IPT_POOL_DEL_DST);
1805+ if (!!modified ^ !!(ipi->flags & IPT_POOL_INV_MOD_DST)) {
1806+ if (ipi->flags & IPT_POOL_MOD_DST_ACCEPT)
1807+ verdict = NF_ACCEPT;
1808+ else if (ipi->flags & IPT_POOL_MOD_DST_DROP)
1809+ verdict = NF_DROP;
1810+ }
1811+ }
1812+ return verdict;
1813+}
1814+
1815+static struct ipt_target pool_reg
1816+= { { NULL, NULL }, "POOL", do_target, do_check, NULL, THIS_MODULE };
1817+
1818+static int __init init(void)
1819+{
1820+ DEBUGP("init ipt_POOL\n");
1821+ return ipt_register_target(&pool_reg);
1822+}
1823+
1824+static void __exit fini(void)
1825+{
1826+ DEBUGP("fini ipt_POOL\n");
1827+ ipt_unregister_target(&pool_reg);
1828+}
1829+
1830+module_init(init);
1831+module_exit(fini);
1832diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_TTL.c linux-2.6.3-rc3/net/ipv4/netfilter/ipt_TTL.c
1833--- linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_TTL.c 1970-01-01 01:00:00.000000000 +0100
1834+++ linux-2.6.3-rc3/net/ipv4/netfilter/ipt_TTL.c 2004-02-16 11:07:09.253740328 +0100
1835@@ -0,0 +1,110 @@
1836+/* TTL modification target for IP tables
1837+ * (C) 2000 by Harald Welte <laforge@gnumonks.org>
1838+ *
1839+ * Version: 1.8
1840+ *
1841+ * This software is distributed under the terms of GNU GPL
1842+ */
1843+
1844+#include <linux/module.h>
1845+#include <linux/skbuff.h>
1846+#include <linux/ip.h>
1847+#include <net/checksum.h>
1848+
1849+#include <linux/netfilter_ipv4/ip_tables.h>
1850+#include <linux/netfilter_ipv4/ipt_TTL.h>
1851+
1852+MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
1853+MODULE_DESCRIPTION("IP tables TTL modification module");
1854+MODULE_LICENSE("GPL");
1855+
1856+static unsigned int ipt_ttl_target(struct sk_buff **pskb, unsigned int hooknum,
1857+ const struct net_device *in, const struct net_device *out,
1858+ const void *targinfo, void *userinfo)
1859+{
1860+ struct iphdr *iph = (*pskb)->nh.iph;
1861+ const struct ipt_TTL_info *info = targinfo;
1862+ u_int16_t diffs[2];
1863+ int new_ttl;
1864+
1865+ switch (info->mode) {
1866+ case IPT_TTL_SET:
1867+ new_ttl = info->ttl;
1868+ break;
1869+ case IPT_TTL_INC:
1870+ new_ttl = iph->ttl + info->ttl;
1871+ if (new_ttl > 255)
1872+ new_ttl = 255;
1873+ break;
1874+ case IPT_TTL_DEC:
1875+ new_ttl = iph->ttl + info->ttl;
1876+ if (new_ttl < 0)
1877+ new_ttl = 0;
1878+ break;
1879+ default:
1880+ new_ttl = iph->ttl;
1881+ break;
1882+ }
1883+
1884+ if (new_ttl != iph->ttl) {
1885+ diffs[0] = htons(((unsigned)iph->ttl) << 8) ^ 0xFFFF;
1886+ iph->ttl = new_ttl;
1887+ diffs[1] = htons(((unsigned)iph->ttl) << 8);
1888+ iph->check = csum_fold(csum_partial((char *)diffs,
1889+ sizeof(diffs),
1890+ iph->check^0xFFFF));
1891+ (*pskb)->nfcache |= NFC_ALTERED;
1892+ }
1893+
1894+ return IPT_CONTINUE;
1895+}
1896+
1897+static int ipt_ttl_checkentry(const char *tablename,
1898+ const struct ipt_entry *e,
1899+ void *targinfo,
1900+ unsigned int targinfosize,
1901+ unsigned int hook_mask)
1902+{
1903+ struct ipt_TTL_info *info = targinfo;
1904+
1905+ if (targinfosize != IPT_ALIGN(sizeof(struct ipt_TTL_info))) {
1906+ printk(KERN_WARNING "TTL: targinfosize %u != %Zu\n",
1907+ targinfosize,
1908+ IPT_ALIGN(sizeof(struct ipt_TTL_info)));
1909+ return 0;
1910+ }
1911+
1912+ if (strcmp(tablename, "mangle")) {
1913+ printk(KERN_WARNING "TTL: can only be called from \"mangle\" table, not \"%s\"\n", tablename);
1914+ return 0;
1915+ }
1916+
1917+ if (info->mode > IPT_TTL_MAXMODE) {
1918+ printk(KERN_WARNING "TTL: invalid or unknown Mode %u\n",
1919+ info->mode);
1920+ return 0;
1921+ }
1922+
1923+ if ((info->mode != IPT_TTL_SET) && (info->ttl == 0)) {
1924+ printk(KERN_WARNING "TTL: increment/decrement doesn't make sense with value 0\n");
1925+ return 0;
1926+ }
1927+
1928+ return 1;
1929+}
1930+
1931+static struct ipt_target ipt_TTL = { { NULL, NULL }, "TTL",
1932+ ipt_ttl_target, ipt_ttl_checkentry, NULL, THIS_MODULE };
1933+
1934+static int __init init(void)
1935+{
1936+ return ipt_register_target(&ipt_TTL);
1937+}
1938+
1939+static void __exit fini(void)
1940+{
1941+ ipt_unregister_target(&ipt_TTL);
1942+}
1943+
1944+module_init(init);
1945+module_exit(fini);
1946diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_connlimit.c linux-2.6.3-rc3/net/ipv4/netfilter/ipt_connlimit.c
1947--- linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_connlimit.c 1970-01-01 01:00:00.000000000 +0100
1948+++ linux-2.6.3-rc3/net/ipv4/netfilter/ipt_connlimit.c 2004-02-16 11:07:11.549190614 +0100
1949@@ -0,0 +1,227 @@
1950+/*
1951+ * netfilter module to limit the number of parallel tcp
1952+ * connections per IP address.
1953+ * (c) 2000 Gerd Knorr <kraxel@bytesex.org>
1954+ * Nov 2002: Martin Bene <martin.bene@icomedias.com>:
1955+ * only ignore TIME_WAIT or gone connections
1956+ *
1957+ * based on ...
1958+ *
1959+ * Kernel module to match connection tracking information.
1960+ * GPL (C) 1999 Rusty Russell (rusty@rustcorp.com.au).
1961+ */
1962+#include <linux/module.h>
1963+#include <linux/skbuff.h>
1964+#include <linux/list.h>
1965+#include <linux/netfilter_ipv4/ip_conntrack.h>
1966+#include <linux/netfilter_ipv4/ip_conntrack_core.h>
1967+#include <linux/netfilter_ipv4/ip_conntrack_tcp.h>
1968+#include <linux/netfilter_ipv4/ip_tables.h>
1969+#include <linux/netfilter_ipv4/ipt_connlimit.h>
1970+
1971+#define DEBUG 0
1972+
1973+MODULE_LICENSE("GPL");
1974+
1975+/* we'll save the tuples of all connections we care about */
1976+struct ipt_connlimit_conn
1977+{
1978+ struct list_head list;
1979+ struct ip_conntrack_tuple tuple;
1980+};
1981+
1982+struct ipt_connlimit_data {
1983+ spinlock_t lock;
1984+ struct list_head iphash[256];
1985+};
1986+
1987+static int ipt_iphash(u_int32_t addr)
1988+{
1989+ int hash;
1990+
1991+ hash = addr & 0xff;
1992+ hash ^= (addr >> 8) & 0xff;
1993+ hash ^= (addr >> 16) & 0xff;
1994+ hash ^= (addr >> 24) & 0xff;
1995+ return hash;
1996+}
1997+
1998+static int count_them(struct ipt_connlimit_data *data,
1999+ u_int32_t addr, u_int32_t mask,
2000+ struct ip_conntrack *ct)
2001+{
2002+#if DEBUG
2003+ const static char *tcp[] = { "none", "established", "syn_sent", "syn_recv",
2004+ "fin_wait", "time_wait", "close", "close_wait",
2005+ "last_ack", "listen" };
2006+#endif
2007+ int addit = 1, matches = 0;
2008+ struct ip_conntrack_tuple tuple;
2009+ struct ip_conntrack_tuple_hash *found;
2010+ struct ipt_connlimit_conn *conn;
2011+ struct list_head *hash,*lh;
2012+
2013+ spin_lock(&data->lock);
2014+ tuple = ct->tuplehash[0].tuple;
2015+ hash = &data->iphash[ipt_iphash(addr & mask)];
2016+
2017+ /* check the saved connections */
2018+ for (lh = hash->next; lh != hash; lh = lh->next) {
2019+ conn = list_entry(lh,struct ipt_connlimit_conn,list);
2020+ found = ip_conntrack_find_get(&conn->tuple,ct);
2021+ if (0 == memcmp(&conn->tuple,&tuple,sizeof(tuple)) &&
2022+ found != NULL &&
2023+ found->ctrack->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
2024+ /* Just to be sure we have it only once in the list.
2025+ We should'nt see tuples twice unless someone hooks this
2026+ into a table without "-p tcp --syn" */
2027+ addit = 0;
2028+ }
2029+#if DEBUG
2030+ printk("ipt_connlimit [%d]: src=%u.%u.%u.%u:%d dst=%u.%u.%u.%u:%d %s\n",
2031+ ipt_iphash(addr & mask),
2032+ NIPQUAD(conn->tuple.src.ip), ntohs(conn->tuple.src.u.tcp.port),
2033+ NIPQUAD(conn->tuple.dst.ip), ntohs(conn->tuple.dst.u.tcp.port),
2034+ (NULL != found) ? tcp[found->ctrack->proto.tcp.state] : "gone");
2035+#endif
2036+ if (NULL == found) {
2037+ /* this one is gone */
2038+ lh = lh->prev;
2039+ list_del(lh->next);
2040+ kfree(conn);
2041+ continue;
2042+ }
2043+ if (found->ctrack->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT) {
2044+ /* we don't care about connections which are
2045+ closed already -> ditch it */
2046+ lh = lh->prev;
2047+ list_del(lh->next);
2048+ kfree(conn);
2049+ nf_conntrack_put(&found->ctrack->infos[0]);
2050+ continue;
2051+ }
2052+ if ((addr & mask) == (conn->tuple.src.ip & mask)) {
2053+ /* same source IP address -> be counted! */
2054+ matches++;
2055+ }
2056+ nf_conntrack_put(&found->ctrack->infos[0]);
2057+ }
2058+ if (addit) {
2059+ /* save the new connection in our list */
2060+#if DEBUG
2061+ printk("ipt_connlimit [%d]: src=%u.%u.%u.%u:%d dst=%u.%u.%u.%u:%d new\n",
2062+ ipt_iphash(addr & mask),
2063+ NIPQUAD(tuple.src.ip), ntohs(tuple.src.u.tcp.port),
2064+ NIPQUAD(tuple.dst.ip), ntohs(tuple.dst.u.tcp.port));
2065+#endif
2066+ conn = kmalloc(sizeof(*conn),GFP_ATOMIC);
2067+ if (NULL == conn)
2068+ return -1;
2069+ memset(conn,0,sizeof(*conn));
2070+ INIT_LIST_HEAD(&conn->list);
2071+ conn->tuple = tuple;
2072+ list_add(&conn->list,hash);
2073+ matches++;
2074+ }
2075+ spin_unlock(&data->lock);
2076+ return matches;
2077+}
2078+
2079+static int
2080+match(const struct sk_buff *skb,
2081+ const struct net_device *in,
2082+ const struct net_device *out,
2083+ const void *matchinfo,
2084+ int offset,
2085+ const void *hdr,
2086+ u_int16_t datalen,
2087+ int *hotdrop)
2088+{
2089+ const struct ipt_connlimit_info *info = matchinfo;
2090+ int connections, match;
2091+ struct ip_conntrack *ct;
2092+ enum ip_conntrack_info ctinfo;
2093+
2094+ ct = ip_conntrack_get((struct sk_buff *)skb, &ctinfo);
2095+ if (NULL == ct) {
2096+ printk("ipt_connlimit: Oops: invalid ct state ?\n");
2097+ *hotdrop = 1;
2098+ return 0;
2099+ }
2100+ connections = count_them(info->data,skb->nh.iph->saddr,info->mask,ct);
2101+ if (-1 == connections) {
2102+ printk("ipt_connlimit: Hmm, kmalloc failed :-(\n");
2103+ *hotdrop = 1; /* let's free some memory :-) */
2104+ return 0;
2105+ }
2106+ match = (info->inverse) ? (connections <= info->limit) : (connections > info->limit);
2107+#if DEBUG
2108+ printk("ipt_connlimit: src=%u.%u.%u.%u mask=%u.%u.%u.%u "
2109+ "connections=%d limit=%d match=%s\n",
2110+ NIPQUAD(skb->nh.iph->saddr), NIPQUAD(info->mask),
2111+ connections, info->limit, match ? "yes" : "no");
2112+#endif
2113+
2114+ return match;
2115+}
2116+
2117+static int check(const char *tablename,
2118+ const struct ipt_ip *ip,
2119+ void *matchinfo,
2120+ unsigned int matchsize,
2121+ unsigned int hook_mask)
2122+{
2123+ struct ipt_connlimit_info *info = matchinfo;
2124+ int i;
2125+
2126+ /* verify size */
2127+ if (matchsize != IPT_ALIGN(sizeof(struct ipt_connlimit_info)))
2128+ return 0;
2129+
2130+ /* refuse anything but tcp */
2131+ if (ip->proto != IPPROTO_TCP)
2132+ return 0;
2133+
2134+ /* init private data */
2135+ info->data = kmalloc(sizeof(struct ipt_connlimit_data),GFP_KERNEL);
2136+ spin_lock_init(&(info->data->lock));
2137+ for (i = 0; i < 256; i++)
2138+ INIT_LIST_HEAD(&(info->data->iphash[i]));
2139+
2140+ return 1;
2141+}
2142+
2143+static void destroy(void *matchinfo, unsigned int matchinfosize)
2144+{
2145+ struct ipt_connlimit_info *info = matchinfo;
2146+ struct ipt_connlimit_conn *conn;
2147+ struct list_head *hash;
2148+ int i;
2149+
2150+ /* cleanup */
2151+ for (i = 0; i < 256; i++) {
2152+ hash = &(info->data->iphash[i]);
2153+ while (hash != hash->next) {
2154+ conn = list_entry(hash->next,struct ipt_connlimit_conn,list);
2155+ list_del(hash->next);
2156+ kfree(conn);
2157+ }
2158+ }
2159+ kfree(info->data);
2160+}
2161+
2162+static struct ipt_match connlimit_match
2163+= { { NULL, NULL }, "connlimit", &match, &check, &destroy, THIS_MODULE };
2164+
2165+static int __init init(void)
2166+{
2167+ return ipt_register_match(&connlimit_match);
2168+}
2169+
2170+static void __exit fini(void)
2171+{
2172+ ipt_unregister_match(&connlimit_match);
2173+}
2174+
2175+module_init(init);
2176+module_exit(fini);
2177diff -Nur linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_dstlimit.c linux-2.6.3-rc3/net/ipv4/netfilter/ipt_dstlimit.c
2178--- linux-2.6.3-rc3.org/net/ipv4/netfilter/ipt_dstlimit.c 1970-01-01 01:00:00.000000000 +0100
2179+++ linux-2.6.3-rc3/net/ipv4/netfilter/ipt_dstlimit.c 2004-02-16 11:07:13.230787904 +0100
2180@@ -0,0 +1,623 @@
2181+/* iptables match extension to limit the number of packets per second
2182+ * seperately for each destination.
2183+ *
2184+ * (C) 2003 by Harald Welte <laforge@netfilter.org>
2185+ *
2186+ * Development of this code was funded by Astaro AG, http://www.astaro.com/
2187+ *
2188+ * based on ipt_limit.c by:
2189