]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Some systems (*cough*Irix*cough) not only don't declare
authorguy <guy>
Wed, 20 Apr 2005 11:20:51 +0000 (11:20 +0000)
committerguy <guy>
Wed, 20 Apr 2005 11:20:51 +0000 (11:20 +0000)
"ether_ntohost()" but don't even declare "struct ether_addr"; on those
systems, declare "struct ether_addr".

addrtoname.c
config.h.in
configure
configure.in

index 376080a5dde10a55cae6cd7b6c73dde6a54f0fea..5a6965c2a781340d882597ae5364924abce12732 100644 (file)
@@ -23,7 +23,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.108.2.3 2005-04-20 10:51:02 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.108.2.4 2005-04-20 11:20:51 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -44,6 +44,11 @@ struct rtentry;              /* declarations in <net/if.h> */
 #endif /* NETINET_ETHER_H_DECLARES_ETHER_NTOHOST */
 
 #if !defined(HAVE_DECL_ETHER_NTOHOST) || !HAVE_DECL_ETHER_NTOHOST
+#ifndef HAVE_STRUCT_ETHER_ADDR
+struct ether_addr {
+       unsigned char ether_addr_octet[6];
+};
+#endif
 extern int ether_ntohost(char *, const struct ether_addr *);
 #endif
 
index 5d23fa9d9027c8410c2efa29dce638a5e8357865..afc66d80aadf2f382ed6b4e4f54a49dff3d33d5f 100644 (file)
 /* Define to 1 if you have the `strsep' function. */
 #undef HAVE_STRSEP
 
+/* Define to 1 if the system has the type `struct ether_addr'. */
+#undef HAVE_STRUCT_ETHER_ADDR
+
 /* Define to 1 if you have the <sys/bitypes.h> header file. */
 #undef HAVE_SYS_BITYPES_H
 
index ace12ec3cd2225c7d0f84c503c44c5f8311e1f6c..9a9ebe0c2838ec87ae2e22f979dae212fb50a92c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.188.2.2 .
+# From configure.in Revision: 1.188.2.3 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.57.
 #
@@ -9385,6 +9385,81 @@ fi
 
                fi
        fi
+       #
+       # Is ether_ntohost() declared?
+       #
+       if test "$ac_cv_have_decl_ether_ntohost" != yes; then
+               #
+               # No, we'll have to declare it ourselves.
+               # Do we have "struct ether_addr"?
+               #
+               echo "$as_me:$LINENO: checking for struct ether_addr" >&5
+echo $ECHO_N "checking for struct ether_addr... $ECHO_C" >&6
+if test "${ac_cv_type_struct_ether_addr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+struct mbuf;
+struct rtentry;
+#include <net/if.h>
+#include <netinet/if_ether.h>
+
+
+int
+main ()
+{
+if ((struct ether_addr *) 0)
+  return 0;
+if (sizeof (struct ether_addr))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_struct_ether_addr=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_ether_addr=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_ether_addr" >&5
+echo "${ECHO_T}$ac_cv_type_struct_ether_addr" >&6
+if test $ac_cv_type_struct_ether_addr = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ETHER_ADDR 1
+_ACEOF
+
+
+fi
+
+       fi
 fi
 
 
index 4fc7626160df95ffb9d706e6356487b12493ff8b..376e9fab98539158d2b7a35ff23cc83bb076fbcd 100644 (file)
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.188.2.2 2005-04-20 09:51:04 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.188.2.3 2005-04-20 11:20:52 guy Exp $ (LBL)
 dnl
 dnl Copyright (c) 1994, 1995, 1996, 1997
 dnl    The Regents of the University of California.  All rights reserved.
@@ -6,7 +6,7 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 
-AC_REVISION($Revision: 1.188.2.2 $)
+AC_REVISION($Revision: 1.188.2.3 $)
 AC_PREREQ(2.50)
 AC_INIT(tcpdump.c)
 
@@ -661,6 +661,26 @@ struct rtentry;
                            ])
                fi
        fi
+       #
+       # Is ether_ntohost() declared?
+       #
+       if test "$ac_cv_have_decl_ether_ntohost" != yes; then
+               #
+               # No, we'll have to declare it ourselves.
+               # Do we have "struct ether_addr"?
+               #
+               AC_CHECK_TYPES(struct ether_addr,,,
+                   [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+struct mbuf;
+struct rtentry;
+#include <net/if.h>
+#include <netinet/if_ether.h>
+                   ])
+       fi
 fi
 
 dnl portability macros for getaddrinfo/getnameinfo