diff options
author | Guido van Rooij <guido@FreeBSD.org> | 1999-11-08 20:51:23 +0000 |
---|---|---|
committer | Guido van Rooij <guido@FreeBSD.org> | 1999-11-08 20:51:23 +0000 |
commit | c9bff7ba93205e0745fa8a309db3789ba1562f24 (patch) | |
tree | dbbb879c93cb0348e4c4fd6a3ef24f80198ce5a1 /contrib/ipfilter/misc.c | |
parent | 9b632708fe7d7ae0badd09f08d11857ca24400f7 (diff) | |
download | src-c9bff7ba93205e0745fa8a309db3789ba1562f24.tar.gz src-c9bff7ba93205e0745fa8a309db3789ba1562f24.zip |
Import of ipfilter 3.3.3 in anticipation of its revival.
More to come in the next days.
Notes
Notes:
svn path=/vendor/ipfilter/dist/; revision=53024
Diffstat (limited to 'contrib/ipfilter/misc.c')
-rw-r--r-- | contrib/ipfilter/misc.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/contrib/ipfilter/misc.c b/contrib/ipfilter/misc.c index 082b5d6d0c0c..bd89be0c9a91 100644 --- a/contrib/ipfilter/misc.c +++ b/contrib/ipfilter/misc.c @@ -1,10 +1,19 @@ /* - * Copyright (C) 1993-1997 by Darren Reed. + * Copyright (C) 1993-1998 by Darren Reed. * * Redistribution and use in source and binary forms are permitted * provided that this notice is preserved and due credit is given * to the original author and the contributors. */ +#if (SOLARIS2 >= 7) +# define _SYS_VARARGS_H +# define _VARARGS_H +#endif +#if defined(__STDC__) +# include <stdarg.h> +#else +# include <varargs.h> +#endif #include <stdio.h> #include <assert.h> #include <string.h> @@ -43,7 +52,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)misc.c 1.3 2/4/96 (C) 1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: misc.c,v 2.0.2.8.2.1 1997/11/12 10:58:26 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: misc.c,v 2.1 1999/08/04 17:30:11 darrenr Exp $"; #endif extern int opts; @@ -52,26 +61,26 @@ extern int opts; void printpacket(ip) ip_t *ip; { - struct tcphdr *tcp; + tcphdr_t *tcp; tcp = (struct tcphdr *)((char *)ip + (ip->ip_hl << 2)); - printf("ip %d(%d) %d ", ip->ip_len, ip->ip_hl << 2, ip->ip_p); - if (ip->ip_off & 0x1fff) - printf("@%d", ip->ip_off << 3); + printf("ip %d(%d) %d", ip->ip_len, ip->ip_hl << 2, ip->ip_p); + if (ip->ip_off & IP_OFFMASK) + printf(" @%d", ip->ip_off << 3); (void)printf(" %s", inet_ntoa(ip->ip_src)); - if (!(ip->ip_off & 0x1fff)) + if (!(ip->ip_off & IP_OFFMASK)) if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_UDP) (void)printf(",%d", ntohs(tcp->th_sport)); (void)printf(" > "); (void)printf("%s", inet_ntoa(ip->ip_dst)); - if (!(ip->ip_off & 0x1fff)) + if (!(ip->ip_off & IP_OFFMASK)) if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_UDP) (void)printf(",%d", ntohs(tcp->th_dport)); putchar('\n'); } -#ifdef __STDC__ +#if defined(__STDC__) void verbose(char *fmt, ...) #else void verbose(fmt, va_alist) |