mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 10:04:05 +08:00
- enable build outside of the tree
- endian checks (use WORDS_BIGENDIAN) - fallback def for IPPROTO_{AH,ESP} - sa_len issues - do not use bittypes.h, respect AC_LBL_CHECK_TYPES
This commit is contained in:
parent
a68de397e8
commit
b8037ee961
@ -17,7 +17,7 @@
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.210 1999-10-30 05:11:06 itojun Exp $ (LBL)
|
||||
# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.211 1999-10-30 07:36:34 itojun Exp $ (LBL)
|
||||
|
||||
#
|
||||
# Various configurable paths (remember to edit Makefile.in, not Makefile)
|
||||
@ -118,6 +118,8 @@ getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
|
||||
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
|
||||
|
||||
version.o: version.c
|
||||
$(CC) $(CFLAGS) -c version.c
|
||||
|
||||
version.c: $(srcdir)/VERSION
|
||||
@rm -f $@
|
||||
sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
|
||||
|
13
aclocal.m4
vendored
13
aclocal.m4
vendored
@ -1,4 +1,4 @@
|
||||
dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.65 1999-10-30 05:11:06 itojun Exp $ (LBL)
|
||||
dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.66 1999-10-30 07:36:35 itojun Exp $ (LBL)
|
||||
dnl
|
||||
dnl Copyright (c) 1995, 1996, 1997, 1998
|
||||
dnl The Regents of the University of California. All rights reserved.
|
||||
@ -51,7 +51,7 @@ AC_DEFUN(AC_LBL_C_INIT,
|
||||
$1="-O"
|
||||
$2=""
|
||||
if test "${srcdir}" != "." ; then
|
||||
$2="-I\$\(srcdir\)"
|
||||
$2="-I\$(srcdir)"
|
||||
fi
|
||||
if test "${CFLAGS+set}" = set; then
|
||||
LBL_CFLAGS="$CFLAGS"
|
||||
@ -200,7 +200,7 @@ AC_DEFUN(AC_LBL_LIBPCAP,
|
||||
continue;
|
||||
fi
|
||||
lastdir=$dir
|
||||
if test -r $dir/pcap.c ; then
|
||||
if test -r $dir/libpcap.a ; then
|
||||
libpcap=$dir/libpcap.a
|
||||
d=$dir
|
||||
dnl continue and select the last one that exists
|
||||
@ -214,7 +214,13 @@ AC_DEFUN(AC_LBL_LIBPCAP,
|
||||
fi
|
||||
else
|
||||
$1=$libpcap
|
||||
if test -r $d/pcap.h; then
|
||||
$2="-I$d $$2"
|
||||
elif test -r $srcdir/../libpcap/pcap.h; then
|
||||
$2="-I$d -I$srcdir/../libpcap $$2"
|
||||
else
|
||||
AC_MSG_ERROR(cannot find pcap.h, see INSTALL)
|
||||
fi
|
||||
AC_MSG_RESULT($libpcap)
|
||||
fi
|
||||
LIBS="$libpcap $LIBS"
|
||||
@ -920,6 +926,7 @@ AC_DEFUN(AC_CHECK_AAAA, [
|
||||
AC_MSG_CHECKING(for AAAA)
|
||||
AC_CACHE_VAL($1,
|
||||
AC_TRY_COMPILE([
|
||||
# include <sys/types.h>
|
||||
# include <arpa/nameser.h>],
|
||||
[int a = T_AAAA],
|
||||
$1=yes,
|
||||
|
10
isakmp.h
10
isakmp.h
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* YIPS @(#)$Id: isakmp.h,v 1.1 1999-10-30 05:11:09 itojun Exp $ */
|
||||
/* YIPS @(#)$Id: isakmp.h,v 1.2 1999-10-30 07:36:36 itojun Exp $ */
|
||||
|
||||
/* refer to RFC 2408 */
|
||||
|
||||
@ -101,12 +101,12 @@ struct isakmp {
|
||||
cookie_t i_ck; /* Initiator Cookie */
|
||||
cookie_t r_ck; /* Responder Cookie */
|
||||
u_int8_t np; /* Next Payload Type */
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
u_int8_t v_min:4, /* MnVer */
|
||||
v_maj:4; /* MjVer */
|
||||
#else
|
||||
#if defined(WORDS_BIGENDIAN) || (defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN))
|
||||
u_int8_t v_maj:4, /* MnVer */
|
||||
v_min:4; /* MjVer */
|
||||
#else
|
||||
u_int8_t v_min:4, /* MnVer */
|
||||
v_maj:4; /* MjVer */
|
||||
#endif
|
||||
u_int8_t etype; /* Exchange Type */
|
||||
u_int8_t flags; /* Flags */
|
||||
|
@ -65,9 +65,11 @@
|
||||
#include "cdecl_ext.h"
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifndef HAVE_U_INT32_T
|
||||
#include "bittypes.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SOCKADDR_STORAGE
|
||||
#include "sockstorage.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.71 1999-10-30 05:30:20 itojun Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.72 1999-10-30 07:36:37 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -400,6 +400,9 @@ ip_print(register const u_char *bp, register u_int length)
|
||||
again:
|
||||
switch (nh) {
|
||||
|
||||
#ifndef IPPROTO_AH
|
||||
#define IPPROTO_AH 51
|
||||
#endif
|
||||
case IPPROTO_AH:
|
||||
nh = *cp;
|
||||
advance = ah_print(cp, (const u_char *)ip);
|
||||
@ -407,6 +410,9 @@ again:
|
||||
len -= advance;
|
||||
goto again;
|
||||
|
||||
#ifndef IPPROTO_ESP
|
||||
#define IPPROTO_ESP 50
|
||||
#endif
|
||||
case IPPROTO_ESP:
|
||||
{
|
||||
int enh;
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.5 1999-10-30 05:37:35 itojun Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.6 1999-10-30 07:36:37 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
@ -206,11 +206,15 @@ cookie_record(cookie_t *in, const u_char *bp2)
|
||||
sizeof(cookiecache[ninitiator].raddr));
|
||||
|
||||
sin = (struct sockaddr_in *)&cookiecache[ninitiator].iaddr;
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
sin->sin_len = sizeof(struct sockaddr_in);
|
||||
#endif
|
||||
sin->sin_family = AF_INET;
|
||||
memcpy(&sin->sin_addr, &ip->ip_src, sizeof(ip->ip_src));
|
||||
sin = (struct sockaddr_in *)&cookiecache[ninitiator].raddr;
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
sin->sin_len = sizeof(struct sockaddr_in);
|
||||
#endif
|
||||
sin->sin_family = AF_INET;
|
||||
memcpy(&sin->sin_addr, &ip->ip_dst, sizeof(ip->ip_dst));
|
||||
break;
|
||||
@ -223,11 +227,15 @@ cookie_record(cookie_t *in, const u_char *bp2)
|
||||
|
||||
ip6 = (struct ip6_hdr *)bp2;
|
||||
sin6 = (struct sockaddr_in6 *)&cookiecache[ninitiator].iaddr;
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
sin6->sin6_len = sizeof(struct sockaddr_in6);
|
||||
#endif
|
||||
sin6->sin6_family = AF_INET6;
|
||||
memcpy(&sin6->sin6_addr, &ip6->ip6_src, sizeof(ip6->ip6_src));
|
||||
sin6 = (struct sockaddr_in6 *)&cookiecache[ninitiator].raddr;
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
sin6->sin6_len = sizeof(struct sockaddr_in6);
|
||||
#endif
|
||||
sin6->sin6_family = AF_INET6;
|
||||
memcpy(&sin6->sin6_addr, &ip6->ip6_dst, sizeof(ip6->ip6_dst));
|
||||
break;
|
||||
@ -259,7 +267,9 @@ cookie_sidecheck(int i, const u_char *bp2, int initiator)
|
||||
switch (ip->ip_v) {
|
||||
case 4:
|
||||
sin = (struct sockaddr_in *)&ss;
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
sin->sin_len = sizeof(struct sockaddr_in);
|
||||
#endif
|
||||
sin->sin_family = AF_INET;
|
||||
memcpy(&sin->sin_addr, &ip->ip_src, sizeof(ip->ip_src));
|
||||
break;
|
||||
@ -267,7 +277,9 @@ cookie_sidecheck(int i, const u_char *bp2, int initiator)
|
||||
case 6:
|
||||
ip6 = (struct ip6_hdr *)bp2;
|
||||
sin6 = (struct sockaddr_in6 *)&ss;
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
sin6->sin6_len = sizeof(struct sockaddr_in6);
|
||||
#endif
|
||||
sin6->sin6_family = AF_INET6;
|
||||
memcpy(&sin6->sin6_addr, &ip6->ip6_src, sizeof(ip6->ip6_src));
|
||||
break;
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.9 1999-10-30 05:11:19 itojun Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.10 1999-10-30 07:36:38 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -44,7 +44,7 @@ static const char rcsid[] =
|
||||
#include <netinet6/pim6.h>
|
||||
#else
|
||||
struct pim {
|
||||
#if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
|
||||
#if defined(WORDS_BIGENDIAN) || (defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN))
|
||||
u_char pim_type:4, /* the PIM message type, currently they are:
|
||||
* Hello, Register, Register-Stop, Join/Prune,
|
||||
* Bootstrap, Assert, Graft (PIM-DM only),
|
||||
|
@ -24,7 +24,7 @@ static const char copyright[] =
|
||||
"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.132 1999-10-30 05:11:23 itojun Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.133 1999-10-30 07:36:39 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -430,7 +430,7 @@ default_print_unaligned(register const u_char *cp, register u_int length)
|
||||
putchar('\n');
|
||||
while (nshorts >= 0) {
|
||||
|
||||
snprintf(line+20+i*5, 7, "%02x%02x ", cp[0], cp[1]);
|
||||
sprintf(line+20+i*5, "%02x%02x ", cp[0], cp[1]);
|
||||
|
||||
if(isprint(cp[0])) {
|
||||
line[62+i*2]=cp[0];
|
||||
|
Loading…
Reference in New Issue
Block a user