Import IPFilter 4.1.20

This commit is contained in:
martti 2007-05-01 19:00:58 +00:00
parent 003de8d3d1
commit 68eb121d73
4 changed files with 155 additions and 71 deletions

27
dist/ipf/ip_scan.c vendored
View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_scan.c,v 1.1.1.5 2007/04/14 20:17:24 martin Exp $ */
/* $NetBSD: ip_scan.c,v 1.1.1.6 2007/05/01 19:00:58 martti Exp $ */
/*
* Copyright (C) 1995-2001 by Darren Reed.
@ -60,7 +60,7 @@ struct file;
#if !defined(lint)
static const char sccsid[] = "@(#)ip_state.c 1.8 6/5/96 (C) 1993-2000 Darren Reed";
static const char rcsid[] = "@(#)Id: ip_scan.c,v 2.40.2.8 2007/01/16 02:25:20 darrenr Exp";
static const char rcsid[] = "@(#)Id: ip_scan.c,v 2.40.2.9 2007/03/13 09:42:05 darrenr Exp";
#endif
#ifdef IPFILTER_SCAN /* endif at bottom of file */
@ -234,20 +234,17 @@ struct ipstate *is;
fr = is->is_rule;
if (fr) {
i = fr->fr_isc;
if (!i || (i != (ipscan_t *)-1)) {
if ((i != NULL) && (i != (ipscan_t *)-1)) {
is->is_isc = i;
if (i) {
ATOMIC_INC32(i->ipsc_sref);
if (i->ipsc_clen)
is->is_flags |= IS_SC_CLIENT;
else
is->is_flags |= IS_SC_MATCHC;
if (i->ipsc_slen)
is->is_flags |= IS_SC_SERVER;
else
is->is_flags |= IS_SC_MATCHS;
} else
is->is_flags |= (IS_SC_CLIENT|IS_SC_SERVER);
ATOMIC_INC32(i->ipsc_sref);
if (i->ipsc_clen)
is->is_flags |= IS_SC_CLIENT;
else
is->is_flags |= IS_SC_MATCHC;
if (i->ipsc_slen)
is->is_flags |= IS_SC_SERVER;
else
is->is_flags |= IS_SC_MATCHS;
}
}
RWLOCK_EXIT(&ipsc_rwlock);

View File

@ -12,7 +12,7 @@ RDR 2.2.2.2 4500 <- -> 1.1.2.3 4500 [3.3.3.1 6700]
Hostmap table:
3.3.3.1,2.2.2.2 -> 4.4.4.4 (use = 1 hv = 0)
List of active state sessions:
3.3.3.1 -> 2.2.2.2 pass 0x40008402 pr 17 state 0/0 bkt 1294
3.3.3.1 -> 2.2.2.2 pass 0x40008402 pr 17 state 0/0
tag 0 ttl 24 6700 -> 4500
forward: pkts in 1 bytes in 28 pkts out 1 bytes out 28
backward: pkts in 1 bytes in 28 pkts out 1 bytes out 28

View File

@ -12,7 +12,7 @@ RDR 2.2.2.2 4500 <- -> 1.1.2.3 4500 [3.3.3.1 6700]
Hostmap table:
3.3.3.1,2.2.2.2 -> 4.4.4.4 (use = 1 hv = 0)
List of active state sessions:
3.3.3.1 -> 2.2.2.2 pass 0x40008402 pr 17 state 0/0 bkt 1294
3.3.3.1 -> 2.2.2.2 pass 0x40008402 pr 17 state 0/0
tag 0 ttl 24 6700 -> 4500
forward: pkts in 1 bytes in 28 pkts out 1 bytes out 28
backward: pkts in 1 bytes in 28 pkts out 1 bytes out 28

View File

@ -1,18 +1,22 @@
# 32818,21 SYN
[out,ppp0]
4500 002c 10c9 4000 ff06 3289 c0a8 0103
96cb e002 8032 0015 bd6b c9c8 0000 0000
6002 2238 35f9 0000 0204 05b4
# 21,32818 SYN+ACK
[in,ppp0]
4500 002c ffdd 4000 ef06 131e 96cb e002
0101 0101 0015 8032 3786 76c4 bd6b c9c9
6012 269c 4313 0000 0204 0584
# 32818,21 ACK
[out,ppp0]
4500 0028 10ca 4000 ff06 328c c0a8 0103
96cb e002 8032 0015 bd6b c9c9 3786 76c5
5010 269c 9af6 0000
# ACK+PUSH "[220-coombs.anu.edu.au NcFTPd Server (free educational license) ready.\r\n"
[in,ppp0]
4500 006f ffde 4000 ef06 12da 96cb e002
0101 0101 0015 8032 3786 76c5 bd6b c9c9
@ -22,11 +26,16 @@
6520 6564 7563 6174 696f 6e61 6c20 6c69
6365 6e73 6529 2072 6561 6479 2e0d 0a
# 32818,21 ACK
[out,ppp0]
4500 0028 10cb 4000 ff06 328b c0a8 0103
96cb e002 8032 0015 bd6b c9c9 3786 770c
5010 269c 9aaf 0000
# 21,32818 ACK+PUSH
# "220-Maintained by RSSS and RSPAS IT Staff (previously known as Coombs Computing Unit)\r\n
# "220-Any problems contact ftpmaster@coombs.anu.edu.au\r\n"
# "220-\r\n220 \r\n"
[in,ppp0]
4500 00c7 ffdf 4000 ef06 1281 96cb e002
0101 0101 0015 8032 3786 770c bd6b c9c9
@ -42,22 +51,26 @@
6e75 2e65 6475 2e61 750d 0a32 3230 2d0d
0a32 3230 200d 0a
# 32818,21 ACK
[out,ppp0]
4500 0028 10cc 4000 ff06 328a c0a8 0103
96cb e002 8032 0015 bd6b c9c9 3786 77ab
5010 269c 9a10 0000
# 32818,21 ACK+PUSH "USER anonymous\r\n"
[out,ppp0]
4500 0038 10cd 4000 ff06 3279 c0a8 0103
96cb e002 8032 0015 bd6b c9c9 3786 77ab
5018 269c 121c 0000 5553 4552 2061 6e6f
6e79 6d6f 7573 0d0a
# 21,32818 ACK
[in,ppp0]
4500 0028 ffe0 4000 ef06 131f 96cb e002
0101 0101 0015 8032 3786 77ab bd6b c9d9
5010 269c 59aa 0000
# 21,32818 ACK+PUSH "331 Guest login ok, send your complete e-mail address as password.\r\n"
[in,ppp0]
4500 006c ffe1 4000 ef06 12da 96cb e002
0101 0101 0015 8032 3786 77ab bd6b c9d9
@ -67,17 +80,21 @@
2d6d 6169 6c20 6164 6472 6573 7320 6173
2070 6173 7377 6f72 642e 0d0a
# 32818,21 ACK
[out,ppp0]
4500 0028 10ce 4000 ff06 3288 c0a8 0103
96cb e002 8032 0015 bd6b c9d9 3786 77ef
5010 269c 99bc 0000
# 32818,21 ACK+PUSH "PASS avalon@\r\n"
[out,ppp0]
4500 0036 10cf 4000 ff06 3279 c0a8 0103
96cb e002 8032 0015 bd6b c9d9 3786 77ef
5018 269c 7795 0000 5041 5353 2061 7661
6c6f 6e40 0d0a
# 21,32818 ACK+PUSH
# "230-You are user #4 of 50 simultaneous users allowed.\r\n"
[in,ppp0]
4500 005f ffe2 4000 ef06 12e6 96cb e002
0101 0101 0015 8032 3786 77ef bd6b c9e7
@ -86,11 +103,16 @@
3020 7369 6d75 6c74 616e 656f 7573 2075
7365 7273 2061 6c6c 6f77 6564 2e0d 0a
# 32818,21 ACK
[out,ppp0]
4500 0028 10d0 4000 ff06 3286 c0a8 0103
96cb e002 8032 0015 bd6b c9e7 3786 7826
5010 269c 9977 0000
# 21,32818 ACK+PUSH
# "230-\r\n230-\r\n"
# "230-Hi. We're cleaning up. Any feedback most welcome. 10 Aug 00\r\n"
# "230-\r\n230 Logged in anonymously.\r\n"
[in,ppp0]
4500 0099 ffe3 4000 ef06 12ab 96cb e002
0101 0101 0015 8032 3786 7826 bd6b c9e7
@ -103,27 +125,32 @@
204c 6f67 6765 6420 696e 2061 6e6f 6e79
6d6f 7573 6c79 2e0d 0a
# 32818,21 ACK
[out,ppp0]
4500 0028 10d1 4000 ff06 3285 c0a8 0103
96cb e002 8032 0015 bd6b c9e7 3786 7897
5010 269c 9906 0000
# 32818,21 ACK "TYPE I\r\n"
[out,ppp0]
4500 0030 10d2 4000 ff06 327c c0a8 0103
96cb e002 8032 0015 bd6b c9e7 3786 7897
5018 269c c704 0000 5459 5045 2049 0d0a
# 21,32818 "200 Type okay.\r\n"
[in,ppp0]
4500 0038 ffe4 4000 ef06 130b 96cb e002
0101 0101 0015 8032 3786 7897 bd6b c9ef
5018 269c 1f58 0000 3230 3020 5479 7065
206f 6b61 792e 0d0a
# 32818,21 ACK
[out,ppp0]
4500 0028 10d3 4000 ff06 3283 c0a8 0103
96cb e002 8032 0015 bd6b c9ef 3786 78a7
5010 269c 98ee 0000
# 32818,21 ACK "PORT 192,158,1,3,128,51\r\n"
[out,ppp0]
4500 0041 10d4 4000 ff06 3269 c0a8 0103
96cb e002 8032 0015 bd6b c9ef 3786 78a7
@ -131,6 +158,7 @@
2c31 3638 2c31 2c33 2c31 3238 2c35 310d
0a
# 32818,21 ACK "200 PORT command successful.\r\n"
[in,ppp0]
4500 0046 ffe5 4000 ef06 12fc 96cb e002
0101 0101 0015 8032 3786 78a7 bd6b ca08
@ -138,37 +166,44 @@
2063 6f6d 6d61 6e64 2073 7563 6365 7373
6675 6c2e 0d0a
# 32818,21 "TYPE A\r\n"
[out,ppp0]
4500 0030 10d5 4000 ff06 3279 c0a8 0103
96cb e002 8032 0015 bd6b ca08 3786 78c5
5018 269c c6bd 0000 5459 5045 2041 0d0a
# 21,32818 "200 Type okay.\r\n"
[in,ppp0]
4500 0038 ffe6 4000 ef06 1309 96cb e002
0101 0101 0015 8032 3786 78c5 bd6b ca10
5018 269c 1f09 0000 3230 3020 5479 7065
206f 6b61 792e 0d0a
# 32818,21 "NLST\r\n"
[out,ppp0]
4500 002e 10d6 4000 ff06 327a c0a8 0103
96cb e002 8032 0015 bd6b ca10 3786 78d5
5018 269c e9e6 0000 4e4c 5354 0d0a
# 20,32819 SYN
[in,ppp0]
4500 002c ffe7 4000 ef06 1314 96cb e002
0101 0101 0014 8033 d9f8 11d4 0000 0000
6002 2238 913a 0000 0204 0584
# 32819,20 SYN+ACK
[out,ppp0]
4500 002c 10d7 4000 ff06 327b c0a8 0103
96cb e002 8033 0014 bd78 5c12 d9f8 11d5
6012 02f8 d734 0000 0204 0584
# 20,32819 ACK
[in,ppp0]
4500 0028 ffe8 4000 ef06 1317 96cb e002
0101 0101 0014 8033 d9f8 11d5 bd78 5c13
5010 269c 8ac7 0000
# 21,32819 ACK "150 Opening ASCII mode data connection for /bin/ls.\r\n"
[in,ppp0]
4500 005d ffe9 4000 ef06 12e1 96cb e002
0101 0101 0015 8032 3786 78d5 bd6b ca16
@ -177,13 +212,68 @@
6174 6120 636f 6e6e 6563 7469 6f6e 2066
6f72 202f 6269 6e2f 6c73 2e0d 0a
# 32819,20 ACK
[out,ppp0]
4500 0028 10d8 4000 ff06 327e c0a8 0103
96cb e002 8033 0014 bd78 5c13 d9f8 11d5
5010 6348 8e71 0000
# 32818,21 ACK+PUSH "PORT 192,158,1,3,128,52\r\n"
[out,ppp0]
4500 0041 10d9 4000 ff06 3264 c0a8 0103
96cb e002 8032 0015 bd6b ca16 3786 78d5
5018 269c 1af8 0000 504f 5254 2031 3932
2c31 3638 2c31 2c33 2c31 3238 2c35 320d
0a
# 21,32818 ACK+PUSH "200 PORT command successful\r\n"
[in,ppp0]
4500 0063 ffea 4000 ef06 12da 96cb e002
4500 0046 ffea 4000 ef06 12f7 96cb e002
0101 0101 0015 8032 3786 78d5 bd6b ca2f
5018 269c 9b1c 0000 3230 3020 504f 5254
2063 6f6d 6d61 6e64 2073 7563 6365 7373
6675 6c2e 0d0a
# 32818,21 ACK+PUSH "TYPE A\r\n"
[out,ppp0]
4500 0030 10da 4000 ff06 3274 c0a8 0103
96cb e002 8032 0015 bd6b ca2f 3786 78f3
5018 269c c668 0000 5459 5045 2041 0d0a
# 21,32818 "200 Type okay.\r\n"
[in,ppp0]
4500 0038 ffeb 4000 ef06 1304 96cb e002
0101 0101 0015 8032 3786 78f3 bd6b ca37
5018 269c 1ea4 0000 3230 3020 5479 7065
206f 6b61 793e 0d0a
# 32818,21 ACK+PUSH "NLST\r\n"
[out,ppp0]
4500 002e 10db 4000 ff06 3275 c0a8 0103
96cb e002 8032 0015 bd6b ca37 3786 7903
5018 269c e991 0000 4e4c 5354 0d0a
# 20,32820 2nd connection SYN
[in,ppp0]
4500 002c ffec 4000 ef06 130f 96cb e002
0101 0101 0014 8034 d9f8 11d4 0000 0000
6002 2238 9139 0000 0204 0584
# 32820,20 SYN+ACK
[out,ppp0]
4500 002c 10d7 4000 ff06 327b c0a8 0103
96cb e002 8034 0014 bd78 5c12 d9f8 11d5
6012 02f8 d733 0000 0204 0584
# 20,32820 ACK
[in,ppp0]
4500 0028 ffec 4000 ef06 1313 96cb e002
0101 0101 0014 8034 d9f8 11d4 0000 0000
5010 2238 a8b7 0000
# 20,32819 ACK+PUSH
[in,ppp0]
4500 0063 ffed 4000 ef06 12d7 96cb e002
0101 0101 0014 8033 d9f8 11d5 bd78 5c13
5018 269c 62bf 0000 636f 6f6d 6273 7061
7065 7273 0d0a 6465 7074 730d 0a66 6f75
@ -191,86 +281,83 @@
6e67 0d0a 6e6c 632d 7465 7374 0d0a 7075
620d 0a
# 32819,20 ACK
[out,ppp0]
4500 0028 10d9 4000 ff06 327d c0a8 0103
4500 0028 10dc 4000 ff06 327a c0a8 0103
96cb e002 8033 0014 bd78 5c13 d9f8 1210
5010 6348 8e36 0000
# 20,32819 FIN+ACK
[in,ppp0]
4500 0028 ffeb 4000 ef06 1314 96cb e002
4500 0028 ffee 4000 ef06 1311 96cb e002
0101 0101 0014 8033 d9f8 1210 bd78 5c13
5011 269c 8a8b 0000
# 32819,20 ACK
[out,ppp0]
4500 0028 10da 4000 ff06 327c c0a8 0103
4500 0028 10dd 4000 ff06 3279 c0a8 0103
96cb e002 8033 0014 bd78 5c13 d9f8 1211
5010 6348 8e35 0000
# 32819,20 FIN+ACK
[out,ppp0]
4500 0028 10db 4000 ff06 327b c0a8 0103
4500 0028 10dd 4000 ff06 3279 c0a8 0103
96cb e002 8033 0014 bd78 5c13 d9f8 1211
5011 6348 8e34 0000
# 20,32819 ACK
[in,ppp0]
4500 0028 ffec 4000 ef06 1313 96cb e002
4500 0028 ffef 4000 ef06 1310 96cb e002
0101 0101 0014 8033 d9f8 1211 bd78 5c14
5010 269c 8a8a 0000
[out,ppp0]
4500 0028 10dc 4000 ff06 327a c0a8 0103
96cb e002 8032 0015 bd6b ca16 3786 790a
5010 269c 9864 0000
# 21,32818 220 "226 Listing completed.\r\n"
[in,ppp0]
4500 0040 ffed 4000 ef06 12fa 96cb e002
0101 0101 0015 8032 3786 790a bd6b ca16
5018 269c 3c4c 0000 3232 3620 4c69 7374
4500 0040 fff0 4000 ef06 12f7 96cb e002
0101 0101 0015 8032 3786 7903 bd6b ca37
5018 269c 3c32 0000 3232 3620 4c69 7374
696e 6720 636f 6d70 6c65 7465 642e 0d0a
[out,ppp0]
4500 0030 10dd 4000 ff06 3271 c0a8 0103
96cb e002 8032 0015 bd6b ca16 3786 7922
5018 269c c64a 0000 5459 5045 2049 0d0a
[in,ppp0]
4500 0038 ffee 4000 ef06 1301 96cb e002
0101 0101 0015 8032 3786 7922 bd6b ca1e
5018 269c 1e9e 0000 3230 3020 5479 7065
206f 6b61 792e 0d0a
[out,ppp0]
4500 0028 10de 4000 ff06 3278 c0a8 0103
96cb e002 8032 0015 bd6b ca1e 3786 7932
5010 269c 9834 0000
[out,ppp0]
4500 002e 10df 4000 ff06 3271 c0a8 0103
96cb e002 8032 0015 bd6b ca1e 3786 7932
5018 269c f072 0000 5155 4954 0d0a
[in,ppp0]
4500 0036 ffef 4000 ef06 1302 96cb e002
0101 0101 0015 8032 3786 7932 bd6b ca24
5018 269c 68ea 0000 3232 3120 476f 6f64
6279 652e 0d0a
# 32818,21 ACK
[out,ppp0]
4500 0028 10e0 4000 ff06 3276 c0a8 0103
96cb e002 8032 0015 bd6b ca24 3786 7940
5011 269c 981f 0000
[in,ppp0]
4500 0028 fff0 4000 ef06 130f 96cb e002
0101 0101 0015 8032 3786 7940 bd6b ca24
5011 269c 57c9 0000
96cb e002 8032 0015 bd6b ca37 3786 791b
5010 269c 9832 0000
# 32818,21 "QUIT\r\n"
[out,ppp0]
4500 0028 10e1 4000 ff06 3275 c0a8 0103
96cb e002 8032 0015 bd6b ca25 3786 7941
5010 269c 981e 0000
4500 002e 10e1 4000 ff06 326f c0a8 0103
96cb e002 8032 0015 bd6b ca37 3786 791b
5018 269c f070 0000 5155 4954 0d0a
# 21,32818 "221 Goodbye."
[in,ppp0]
4500 0028 fff1 4000 ef06 130e 96cb e002
0101 0101 0015 8032 3786 7941 bd6b ca25
5010 269c 57c8 0000
4500 0036 fff2 4000 ef06 12ff 96cb e002
0101 0101 0015 8032 3786 791b bd6b ca3d
5018 269c 68e8 0000 3232 3120 476f 6f64
6279 652e 0d0a
# 32818,21 ACK+FIN
[out,ppp0]
4500 0028 10e2 4000 ff06 3274 c0a8 0103
96cb e002 8032 0015 bd6b ca3d 3786 7929
5011 269c 981d 0000
# 21,32818 ACK+FIN
[in,ppp0]
4500 0028 fff3 4000 ef06 130c 96cb e002
0101 0101 0015 8032 3786 7929 bd6b ca3d
5011 269c 57c7 0000
# 32818,21 ACK
[out,ppp0]
4500 0028 10e3 4000 ff06 3273 c0a8 0103
96cb e002 8032 0015 bd6b ca3d 3786 792a
5010 269c 981d 0000
# 21,32818 ACK
[in,ppp0]
4500 0028 fff4 4000 ef06 130b 96cb e002
0101 0101 0015 8032 3786 792a bd6b ca3e
5010 269c 57c6 0000