diff options
author | darrenr <darrenr@FreeBSD.org> | 2002-03-19 11:45:20 +0000 |
---|---|---|
committer | darrenr <darrenr@FreeBSD.org> | 2002-03-19 11:45:20 +0000 |
commit | 5df96985515dd8f51d4209b69c12cbab7c289fd0 (patch) | |
tree | e420b9c485fbd878875892eef69b8b6121924075 /contrib/ipfilter/ipsend | |
parent | c51cd1facc817411a340278e6e0b901d53f11cc5 (diff) | |
download | FreeBSD-src-5df96985515dd8f51d4209b69c12cbab7c289fd0.zip FreeBSD-src-5df96985515dd8f51d4209b69c12cbab7c289fd0.tar.gz |
Import IPFilter 3.4.25
Diffstat (limited to 'contrib/ipfilter/ipsend')
-rw-r--r-- | contrib/ipfilter/ipsend/44arp.c | 3 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/arp.c | 5 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/ip.c | 5 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/ipresend.c | 6 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/ipsend.c | 5 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/ipsopt.c | 6 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/iptest.c | 5 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/iptests.c | 22 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/lsock.c | 5 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/resend.c | 5 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/sbpf.c | 4 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/sirix.c | 3 | ||||
-rw-r--r-- | contrib/ipfilter/ipsend/sock.c | 7 |
13 files changed, 60 insertions, 21 deletions
diff --git a/contrib/ipfilter/ipsend/44arp.c b/contrib/ipfilter/ipsend/44arp.c index 7a16c5a..920c7e1 100644 --- a/contrib/ipfilter/ipsend/44arp.c +++ b/contrib/ipfilter/ipsend/44arp.c @@ -1,6 +1,9 @@ /* * Based upon 4.4BSD's /usr/sbin/arp */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <unistd.h> #include <string.h> #include <stdlib.h> diff --git a/contrib/ipfilter/ipsend/arp.c b/contrib/ipfilter/ipsend/arp.c index 898815a..307f4cb 100644 --- a/contrib/ipfilter/ipsend/arp.c +++ b/contrib/ipfilter/ipsend/arp.c @@ -3,6 +3,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <errno.h> #include <sys/types.h> @@ -26,7 +29,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)arp.c 1.4 1/11/96 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: arp.c,v 2.1.4.2 2001/07/15 22:00:13 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: arp.c,v 2.1.4.3 2002/02/22 15:32:57 darrenr Exp $"; #endif diff --git a/contrib/ipfilter/ipsend/ip.c b/contrib/ipfilter/ipsend/ip.c index db6d477..dc2b816 100644 --- a/contrib/ipfilter/ipsend/ip.c +++ b/contrib/ipfilter/ipsend/ip.c @@ -3,6 +3,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -29,7 +32,7 @@ #if !defined(lint) static const char sccsid[] = "%W% %G% (C)1995"; -static const char rcsid[] = "@(#)$Id: ip.c,v 2.1.4.3 2001/07/15 22:00:13 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: ip.c,v 2.1.4.4 2002/02/22 15:32:57 darrenr Exp $"; #endif static char *ipbuf = NULL, *ethbuf = NULL; diff --git a/contrib/ipfilter/ipsend/ipresend.c b/contrib/ipfilter/ipsend/ipresend.c index 4a4ec1c..ea63ab2 100644 --- a/contrib/ipfilter/ipsend/ipresend.c +++ b/contrib/ipfilter/ipsend/ipresend.c @@ -8,12 +8,16 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netdb.h> #include <string.h> #include <sys/types.h> +#include <sys/param.h> #include <sys/time.h> #include <sys/socket.h> #include <netinet/in.h> @@ -30,7 +34,7 @@ #if !defined(lint) static const char sccsid[] = "%W% %G% (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: ipresend.c,v 2.1.4.2 2001/07/15 22:00:13 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: ipresend.c,v 2.1.4.3 2002/02/22 15:32:57 darrenr Exp $"; #endif diff --git a/contrib/ipfilter/ipsend/ipsend.c b/contrib/ipfilter/ipsend/ipsend.c index 74f624e..86a1e3f 100644 --- a/contrib/ipfilter/ipsend/ipsend.c +++ b/contrib/ipfilter/ipsend/ipsend.c @@ -8,6 +8,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -32,7 +35,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)ipsend.c 1.5 12/10/95 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: ipsend.c,v 2.2.2.3 2001/07/15 22:00:14 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: ipsend.c,v 2.2.2.4 2002/02/22 15:32:57 darrenr Exp $"; #endif diff --git a/contrib/ipfilter/ipsend/ipsopt.c b/contrib/ipfilter/ipsend/ipsopt.c index 691ee7d..27bb513 100644 --- a/contrib/ipfilter/ipsend/ipsopt.c +++ b/contrib/ipfilter/ipsend/ipsopt.c @@ -3,6 +3,10 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif +#include <sys/param.h> #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -21,7 +25,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)ipsopt.c 1.2 1/11/96 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: ipsopt.c,v 2.1.4.2 2001/07/15 22:00:14 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: ipsopt.c,v 2.1.4.3 2002/02/22 15:32:58 darrenr Exp $"; #endif diff --git a/contrib/ipfilter/ipsend/iptest.c b/contrib/ipfilter/ipsend/iptest.c index d4d37ba..463fd4f 100644 --- a/contrib/ipfilter/ipsend/iptest.c +++ b/contrib/ipfilter/ipsend/iptest.c @@ -8,6 +8,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <netdb.h> #include <unistd.h> @@ -34,7 +37,7 @@ #if !defined(lint) static const char sccsid[] = "%W% %G% (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: iptest.c,v 2.2.2.2 2001/07/15 22:00:14 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: iptest.c,v 2.2.2.3 2002/02/22 15:32:58 darrenr Exp $"; #endif diff --git a/contrib/ipfilter/ipsend/iptests.c b/contrib/ipfilter/ipsend/iptests.c index a133e34..cc64f60 100644 --- a/contrib/ipfilter/ipsend/iptests.c +++ b/contrib/ipfilter/ipsend/iptests.c @@ -3,6 +3,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -76,7 +79,7 @@ #if !defined(lint) static const char sccsid[] = "%W% %G% (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: iptests.c,v 2.1.4.2 2001/07/15 22:00:14 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: iptests.c,v 2.1.4.5 2002/02/22 15:32:58 darrenr Exp $"; #endif @@ -299,14 +302,14 @@ int ptest; ip->ip_len = MIN(768 + 20, mtu - 68); i = 512; for (; i < (63 * 1024 + 768); i += 768) { - ip->ip_off = htons(IP_MF | (i >> 3)); + ip->ip_off = htons(IP_MF | ((i >> 3) & 0x1fff)); (void) send_ip(nfd, mtu, ip, gwip, 1); printf("%d\r", i); fflush(stdout); PAUSE(); } ip->ip_len = 896 + 20; - ip->ip_off = htons(i >> 3); + ip->ip_off = htons((i >> 3) & 0x1fff); (void) send_ip(nfd, mtu, ip, gwip, 1); printf("%d\r", i); putchar('\n'); @@ -333,7 +336,7 @@ int ptest; ip->ip_len = MIN(768 + 20, mtu - 68); i = 512; for (; i < (63 * 1024 + 768); i += 768) { - ip->ip_off = htons(IP_MF | (i >> 3)); + ip->ip_off = htons(IP_MF | ((i >> 3) & 0x1fff)); if ((rand() & 0x1f) != 0) { (void) send_ip(nfd, mtu, ip, gwip, 1); printf("%d\r", i); @@ -343,7 +346,7 @@ int ptest; PAUSE(); } ip->ip_len = 896 + 20; - ip->ip_off = htons(i >> 3); + ip->ip_off = htons((i >> 3) & 0x1fff); if ((rand() & 0x1f) != 0) { (void) send_ip(nfd, mtu, ip, gwip, 1); printf("%d\r", i); @@ -370,14 +373,14 @@ int ptest; ip->ip_len = MIN(768 + 20, mtu - 68); i = 512; for (; i < (32 * 1024 + 768); i += 768) { - ip->ip_off = htons(IP_MF | (i >> 3)); + ip->ip_off = htons(IP_MF | ((i >> 3) & 0x1fff)); (void) send_ip(nfd, mtu, ip, gwip, 1); printf("%d\r", i); fflush(stdout); PAUSE(); } ip->ip_len = 896 + 20; - ip->ip_off = htons(i >> 3); + ip->ip_off = htons((i >> 3) & 0x1fff); (void) send_ip(nfd, mtu, ip, gwip, 1); printf("%d\r", i); putchar('\n'); @@ -1030,6 +1033,7 @@ int ptest; struct sockaddr_in sin; int fd, slen; + fd = -1; bzero((char *)&sin, sizeof(sin)); for (i = 1; i < 63; i++) { @@ -1262,7 +1266,7 @@ int ptest; for (j = 768; j < 3584; j += 768) { ip->ip_len = sizeof(*ip) + 768; - ip->ip_off = htons(IP_MF|(j>>3)); + ip->ip_off = htons(IP_MF|((j>>3) & 0x1fff)); (void) send_ip(nfd, 1500, ip, gwip, 1); printf("%d %d\r", i, j); fflush(stdout); @@ -1270,7 +1274,7 @@ int ptest; ip->ip_len = sizeof(*ip) + 128; for (k = j - 768; k < j; k += 128) { - ip->ip_off = htons(IP_MF|(k>>3)); + ip->ip_off = htons(IP_MF|((k>>3) & 0x1fff)); (void) send_ip(nfd, 1500, ip, gwip, 1); printf("%d %d\r", i, k); fflush(stdout); diff --git a/contrib/ipfilter/ipsend/lsock.c b/contrib/ipfilter/ipsend/lsock.c index 058ab40..56442c7 100644 --- a/contrib/ipfilter/ipsend/lsock.c +++ b/contrib/ipfilter/ipsend/lsock.c @@ -5,7 +5,10 @@ */ #if !defined(lint) static const char sccsid[] = "@(#)lsock.c 1.2 1/11/96 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: lsock.c,v 2.1.4.1 2001/06/26 10:43:22 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: lsock.c,v 2.1.4.2 2002/02/22 15:32:58 darrenr Exp $"; +#endif +#ifdef __sgi +# include <sys/ptimers.h> #endif #include <stdio.h> #include <unistd.h> diff --git a/contrib/ipfilter/ipsend/resend.c b/contrib/ipfilter/ipsend/resend.c index 0d4102c..2cbfe75 100644 --- a/contrib/ipfilter/ipsend/resend.c +++ b/contrib/ipfilter/ipsend/resend.c @@ -8,6 +8,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <netdb.h> #include <string.h> @@ -35,7 +38,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)resend.c 1.3 1/11/96 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: resend.c,v 2.1.4.3 2001/07/15 22:00:14 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: resend.c,v 2.1.4.4 2002/02/22 15:32:58 darrenr Exp $"; #endif diff --git a/contrib/ipfilter/ipsend/sbpf.c b/contrib/ipfilter/ipsend/sbpf.c index 5b8428c..ec95b49 100644 --- a/contrib/ipfilter/ipsend/sbpf.c +++ b/contrib/ipfilter/ipsend/sbpf.c @@ -41,7 +41,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)sbpf.c 1.3 8/25/95 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: sbpf.c,v 2.1.4.1 2001/06/26 10:43:22 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: sbpf.c,v 2.1.4.2 2001/09/30 04:04:28 darrenr Exp $"; #endif /* @@ -61,6 +61,8 @@ int sport, tout; char bpfname[16]; int fd, i; + fd = -1; + for (i = 0; i < 16; i++) { (void) sprintf(bpfname, "/dev/bpf%d", i); diff --git a/contrib/ipfilter/ipsend/sirix.c b/contrib/ipfilter/ipsend/sirix.c index 4178c0e..403c7e9 100644 --- a/contrib/ipfilter/ipsend/sirix.c +++ b/contrib/ipfilter/ipsend/sirix.c @@ -4,6 +4,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <sys/types.h> #include <string.h> diff --git a/contrib/ipfilter/ipsend/sock.c b/contrib/ipfilter/ipsend/sock.c index b20bf93..3568f23 100644 --- a/contrib/ipfilter/ipsend/sock.c +++ b/contrib/ipfilter/ipsend/sock.c @@ -3,6 +3,9 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ +#ifdef __sgi +# include <sys/ptimers.h> +#endif #include <stdio.h> #include <unistd.h> #include <string.h> @@ -62,7 +65,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)sock.c 1.2 1/11/96 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: sock.c,v 2.1.4.3 2001/07/15 22:00:14 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: sock.c,v 2.1.4.5 2002/02/22 15:32:58 darrenr Exp $"; #endif @@ -187,8 +190,6 @@ struct tcpiphdr *ti; if (!(p = getproc())) return NULL; -printf("fl %x ty %x cn %d mc %d\n", -f->f_flag, f->f_type, f->f_count, f->f_msgcount); up = (struct user *)malloc(sizeof(*up)); #ifndef ultrix if (KMCPY(up, p->p_uarea, sizeof(*up)) == -1) |