]> The Tcpdump Group git mirrors - tcpdump/commitdiff
- enable build outside of the tree
authoritojun <itojun>
Sat, 30 Oct 1999 07:36:34 +0000 (07:36 +0000)
committeritojun <itojun>
Sat, 30 Oct 1999 07:36:34 +0000 (07:36 +0000)
- endian checks (use WORDS_BIGENDIAN)
- fallback def for IPPROTO_{AH,ESP}
- sa_len issues
- do not use bittypes.h, respect AC_LBL_CHECK_TYPES

Makefile.in
aclocal.m4
isakmp.h
missing/getaddrinfo.c
print-ip.c
print-isakmp.c
print-pim.c
tcpdump.c

index 8cadccf1b9bdb4d53d8628b0077611ff6b79086e..228f0820322ba48560d901dcb8f8445d47c73e98 100644 (file)
@@ -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 > $@
index baec00c969553b861bbed52aa8ef11b0f694f781..ff49c84822b6ceba5b848d4fb55780dde42d44ca 100644 (file)
@@ -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,
index 1820b125558072d552521f5765637a89a1788852..b989a233c029ec53049152a9e3226fc997759bbf 100644 (file)
--- a/isakmp.h
+++ b/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 */
index 9da09cbb03323b6ce6044626fff399cab9ffa190..59568c2ccb8f78e9754f8f81dc9c1a16445f3546 100644 (file)
 #include "cdecl_ext.h"
 #endif 
 
+#if 0
 #ifndef HAVE_U_INT32_T
 #include "bittypes.h"
 #endif 
+#endif
 
 #ifndef HAVE_SOCKADDR_STORAGE
 #include "sockstorage.h"
index 93b643884b1e7b65ffa47c2b42c8b4224aec952d..625095b62b2c2b3a076419a2fb571f3f75151371 100644 (file)
@@ -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;
index f82ae0ab3f527a6563e7b49061378bf47680a954..7acf89402075002078d319aadf8e6ad675d667b1 100644 (file)
@@ -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;
index 2eb795aa276d48067e0bde96e9f6fcd30932f83e..29b32dfebb2e4226c966eaffe95ccda55ccd14a0 100644 (file)
@@ -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),
index 1e8271a29108bba77210d8fd77749911b7516259..cdf30d759c8e47768b63ee5d185d85f1465228f3 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -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];