]> The Tcpdump Group git mirrors - tcpdump/blobdiff - configure
Avoid collison with error(), clean up code a bit.
[tcpdump] / configure
index c217f1398e26cb81625dae02426b0e2dc315f53d..822c1abe18f481a0cf8b4592c0f5e3c159e0ca81 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,12 +1,9 @@
 #! /bin/sh
-# From configure.in Revision: 1.204 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68.
+# Generated by GNU Autoconf 2.69.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -135,6 +132,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -168,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -213,21 +236,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-       # neutralization value for shells without unset; and this also
-       # works around shells that cannot unset nonexistent variables.
-       # Preserve -v and -x to the replacement shell.
-       BASH_ENV=/dev/null
-       ENV=/dev/null
-       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-       export CONFIG_SHELL
-       case $- in # ((((
-         *v*x* | *x*v* ) as_opts=-vx ;;
-         *v* ) as_opts=-v ;;
-         *x* ) as_opts=-x ;;
-         * ) as_opts= ;;
-       esac
-       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -329,6 +356,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -450,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -484,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -505,28 +544,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -612,6 +631,9 @@ V_INCLS
 V_GROUP
 V_DEFS
 V_CCOPT
+MKDEP
+DEPENDENCY_CFLAG
+AR
 RANLIB
 PCAP_CONFIG
 LIBOBJS
@@ -681,8 +703,11 @@ with_smi
 enable_smb
 with_user
 with_chroot
+with_sandbox_capsicum
 enable_ipv6
+with_system_libpcap
 with_crypto
+with_cap_ng
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1148,8 +1173,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1320,7 +1343,11 @@ Optional Packages:
   --without-smi           don't link with libsmi
   --with-user=USERNAME    drop privileges by default to USERNAME
   --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY
+  --with-sandbox-capsicum use Capsicum security functions [default=yes, if
+                          available]
+  --with-system-libpcap   don't use local pcap library
   --with-crypto           use OpenSSL libcrypto [default=yes, if available]
+  --with-cap-ng           use libcap-ng [default=yes, if available]
 
 Some influential environment variables:
   CC          C compiler command
@@ -1399,9 +1426,9 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 configure
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1674,7 +1701,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
+        test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1859,12 +1886,142 @@ $as_echo "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_type
+
+# ac_fn_c_find_intX_t LINENO BITS VAR
+# -----------------------------------
+# Finds a signed integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_intX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+$as_echo_n "checking for int$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in int$2_t 'int' 'long int' \
+        'long long int' 'short int' 'signed char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+            enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+               enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+                < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  case $ac_type in #(
+  int$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_intX_t
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+        'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  case $ac_type in #(
+  uint$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2324,7 +2481,6 @@ if test "${with_gcc+set}" = set; then :
   withval=$with_gcc;
 fi
 
-    V_CCOPT="-O"
     V_INCLS=""
     if test "${srcdir}" != "." ; then
            V_INCLS="-I$srcdir"
@@ -2352,7 +2508,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_SHLICC2="yes"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2408,7 +2564,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2448,7 +2604,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2501,7 +2657,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2542,7 +2698,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2600,7 +2756,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2644,7 +2800,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3090,8 +3246,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3180,147 +3335,107 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
     if test "$GCC" = yes ; then
-           if test "$SHLICC2" = yes ; then
-                   ac_cv_lbl_gcc_vers=2
-                   V_CCOPT="-O2"
-           else
-                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5
-$as_echo_n "checking gcc version... " >&6; }
-                   if ${ac_cv_lbl_gcc_vers+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_lbl_gcc_vers=`$CC -v 2>&1 | \
-                           sed -e '/^gcc version /!d' \
-                               -e 's/^gcc version //' \
-                               -e 's/ .*//' -e 's/^[^0-9]*//' \
-                               -e 's/\..*//'`
-fi
+           #
+           # -Werror forces warnings to be errors.
+           #
+           ac_lbl_cc_force_warning_errors=-Werror
 
-                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_gcc_vers" >&5
-$as_echo "$ac_cv_lbl_gcc_vers" >&6; }
-                   if test $ac_cv_lbl_gcc_vers -gt 1 ; then
-                           V_CCOPT="-O2"
-                   fi
-           fi
-    else
-           { $as_echo "$as_me:${as_lineno-$LINENO}: checking that $CC handles ansi prototypes" >&5
-$as_echo_n "checking that $CC handles ansi prototypes... " >&6; }
-           if ${ac_cv_lbl_cc_ansi_prototypes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+           #
+           # Use -ffloat-store so that, on 32-bit x86, we don't
+           # do 80-bit arithmetic with the FPU; that way we should
+           # get the same results for floating-point calculations
+           # on x86-32 and x86-64.
+           #
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -ffloat-store option" >&5
+$as_echo_n "checking whether the compiler supports the -ffloat-store option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -ffloat-store"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-int
-main ()
-{
-int frob(int, char *)
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_lbl_cc_ansi_prototypes=yes
-else
-  ac_cv_lbl_cc_ansi_prototypes=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-           { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_cc_ansi_prototypes" >&5
-$as_echo "$ac_cv_lbl_cc_ansi_prototypes" >&6; }
-           if test $ac_cv_lbl_cc_ansi_prototypes = no ; then
-                   case "$host_os" in
-
-                   hpux*)
-                           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5
-$as_echo_n "checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)... " >&6; }
-                           savedcflags="$CFLAGS"
-                           CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS"
-                           if ${ac_cv_lbl_cc_hpux_cc_aa+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
 int
 main ()
 {
-int frob(int, char *)
+return 0
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_lbl_cc_hpux_cc_aa=yes
-else
-  ac_cv_lbl_cc_hpux_cc_aa=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_cc_hpux_cc_aa" >&5
-$as_echo "$ac_cv_lbl_cc_hpux_cc_aa" >&6; }
-                           if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then
-                                   as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
-                           fi
-                           CFLAGS="$savedcflags"
-                           V_CCOPT="-Aa $V_CCOPT"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -ffloat-store"
 
-$as_echo "#define _HPUX_SOURCE 1" >>confdefs.h
+else
 
-                           ;;
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
-                   osf*)
-                           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ansi mode in DEC compiler ($CC -std1)" >&5
-$as_echo_n "checking for ansi mode in DEC compiler ($CC -std1)... " >&6; }
-                           savedcflags="$CFLAGS"
-                           CFLAGS="-std1"
-                           if ${ac_cv_lbl_cc_osf1_cc_std1+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-int
-main ()
-{
-int frob(int, char *)
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_lbl_cc_osf1_cc_std1=yes
-else
-  ac_cv_lbl_cc_osf1_cc_std1=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_cc_osf1_cc_std1" >&5
-$as_echo "$ac_cv_lbl_cc_osf1_cc_std1" >&6; }
-                           if test $ac_cv_lbl_cc_osf1_cc_std1 = no ; then
-                                   as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
-                           fi
-                           CFLAGS="$savedcflags"
-                           V_CCOPT="-std1 $V_CCOPT"
-                           ;;
-
-                   *)
-                           as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
-                           ;;
-                   esac
-           fi
+    else
            V_INCLS="$V_INCLS -I/usr/local/include"
            LDFLAGS="$LDFLAGS -L/usr/local/lib"
 
            case "$host_os" in
 
+           darwin*)
+                   #
+                   # This is assumed either to be GCC or clang, both
+                   # of which use -Werror to force warnings to be errors.
+                   #
+                   ac_lbl_cc_force_warning_errors=-Werror
+                   ;;
+
+           hpux*)
+                   #
+                   # HP C, which is what we presume we're using, doesn't
+                   # exit with a non-zero exit status if we hand it an
+                   # invalid -W flag, can't be forced to do so even with
+                   # +We, and doesn't handle GCC-style -W flags, so we
+                   # don't want to try using GCC-style -W flags.
+                   #
+                   ac_lbl_cc_dont_try_gcc_dashW=yes
+                   ;;
+
            irix*)
-                   V_CCOPT="$V_CCOPT -xansi -signed -O"
+                   #
+                   # MIPS C, which is what we presume we're using, doesn't
+                   # necessarily exit with a non-zero exit status if we
+                   # hand it an invalid -W flag, can't be forced to do
+                   # so, and doesn't handle GCC-style -W flags, so we
+                   # don't want to try using GCC-style -W flags.
+                   #
+                   ac_lbl_cc_dont_try_gcc_dashW=yes
+                   #
+                   # It also, apparently, defaults to "char" being
+                   # unsigned, unlike most other C implementations;
+                   # I suppose we could say "signed char" whenever
+                   # we want to guarantee a signed "char", but let's
+                   # just force signed chars.
+                   #
+                   # -xansi is normally the default, but the
+                   # configure script was setting it; perhaps -cckr
+                   # was the default in the Old Days.  (Then again,
+                   # that would probably be for backwards compatibility
+                   # in the days when ANSI C was Shiny and New, i.e.
+                   # 1989 and the early '90's, so maybe we can just
+                   # drop support for those compilers.)
+                   #
+                   # -g is equivalent to -g2, which turns off
+                   # optimization; we choose -g3, which generates
+                   # debugging information but doesn't turn off
+                   # optimization (even if the optimization would
+                   # cause inaccuracies in debugging).
+                   #
+                   V_CCOPT="$V_CCOPT -xansi -signed -g3"
                    ;;
 
            osf*)
@@ -3328,7 +3443,29 @@ $as_echo "$ac_cv_lbl_cc_osf1_cc_std1" >&6; }
                    # Presumed to be DEC OSF/1, Digital UNIX, or
                    # Tru64 UNIX.
                    #
-                   V_CCOPT="$V_CCOPT -O"
+                   # The DEC C compiler, which is what we presume we're
+                   # using, doesn't exit with a non-zero exit status if we
+                   # hand it an invalid -W flag, can't be forced to do
+                   # so, and doesn't handle GCC-style -W flags, so we
+                   # don't want to try using GCC-style -W flags.
+                   #
+                   ac_lbl_cc_dont_try_gcc_dashW=yes
+                   #
+                   # -g is equivalent to -g2, which turns off
+                   # optimization; we choose -g3, which generates
+                   # debugging information but doesn't turn off
+                   # optimization (even if the optimization would
+                   # cause inaccuracies in debugging).
+                   #
+                   V_CCOPT="$V_CCOPT -g3"
+                   ;;
+
+           solaris*)
+                   #
+                   # Assumed to be Sun C, which requires -errwarn to force
+                   # warnings to be treated as errors.
+                   #
+                   ac_lbl_cc_force_warning_errors=-errwarn
                    ;;
 
            ultrix*)
@@ -3366,6 +3503,7 @@ $as_echo "#define const /**/" >>confdefs.h
                    fi
                    ;;
            esac
+           V_CCOPT="$V_CCOPT -O"
     fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
@@ -3470,8 +3608,11 @@ if test "$ac_cv___attribute__" = "yes"; then
 
 $as_echo "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h
 
-  V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\""
 else
+  #
+  # We can't use __attribute__, so we can't use __attribute__((unused)),
+  # so we define _U_ to an empty string.
+  #
   V_DEFS="$V_DEFS -D_U_=\"\""
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute__" >&5
@@ -3479,91 +3620,219 @@ $as_echo "$ac_cv___attribute__" >&6; }
 
 if test "$ac_cv___attribute__" = "yes"; then
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((format)) can be applied to function pointers" >&5
-$as_echo_n "checking whether __attribute__((format)) can be applied to function pointers... " >&6; }
-if ${ac_cv___attribute___format_function_pointer+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((unused)) can be used without warnings" >&5
+$as_echo_n "checking whether __attribute__((unused)) can be used without warnings... " >&6; }
+if ${ac_cv___attribute___unused+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 
 #include <stdlib.h>
-
-extern int (*foo)(const char *fmt, ...)
-                 __attribute__ ((format (printf, 1, 2)));
+#include <stdio.h>
 
 int
-main(int argc, char **argv)
+main(int argc  __attribute((unused)), char **argv __attribute((unused)))
 {
-  (*foo)("%s", "test");
+  printf("Hello, world!\n");
+  return 0;
 }
 
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv___attribute___format_function_pointer=yes
+  ac_cv___attribute___unused=yes
 else
-  ac_cv___attribute___format_function_pointer=no
+  ac_cv___attribute___unused=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-if test "$ac_cv___attribute___format_function_pointer" = "yes"; then
-
-$as_echo "#define __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS 1" >>confdefs.h
-
+CFLAGS="$save_CFLAGS"
+if test "$ac_cv___attribute___unused" = "yes"; then
+  V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\""
+else
+  V_DEFS="$V_DEFS -D_U_=\"\""
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___format_function_pointer" >&5
-$as_echo "$ac_cv___attribute___format_function_pointer" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___unused" >&5
+$as_echo "$ac_cv___attribute___unused" >&6; }
 
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((noreturn)) can be applied to function pointers without warnings" >&5
+$as_echo_n "checking whether __attribute__((noreturn)) can be applied to function pointers without warnings... " >&6; }
+if ${ac_cv___attribute___noreturn_function_pointer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
 
+
+#include <stdlib.h>
+
+extern int (*foo)(int i)
+                 __attribute__ ((noreturn));
+
+int
+main(int argc, char **argv)
+{
+  (*foo)(1);
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv___attribute___noreturn_function_pointer=yes
 else
-  # Broken: fails on valid input.
-continue
+  ac_cv___attribute___noreturn_function_pointer=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
+CFLAGS="$save_CFLAGS"
+if test "$ac_cv___attribute___noreturn_function_pointer" = "yes"; then
+
+$as_echo "#define __ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___noreturn_function_pointer" >&5
+$as_echo "$ac_cv___attribute___noreturn_function_pointer" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((format)) can be used without warnings" >&5
+$as_echo_n "checking whether __attribute__((format)) can be used without warnings... " >&6; }
+if ${ac_cv___attribute___format+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+#include <stdlib.h>
+
+extern int foo(const char *fmt, ...)
+                 __attribute__ ((format (printf, 1, 2)));
+
+int
+main(int argc, char **argv)
+{
+  foo("%s", "test");
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv___attribute___format=yes
+else
+  ac_cv___attribute___format=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+CFLAGS="$save_CFLAGS"
+if test "$ac_cv___attribute___format" = "yes"; then
+
+$as_echo "#define __ATTRIBUTE___FORMAT_OK 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___format" >&5
+$as_echo "$ac_cv___attribute___format" >&6; }
+
+       if test "$ac_cv___attribute___format" = "yes"; then
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((format)) can be applied to function pointers" >&5
+$as_echo_n "checking whether __attribute__((format)) can be applied to function pointers... " >&6; }
+if ${ac_cv___attribute___format_function_pointer+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+#include <stdlib.h>
+
+extern int (*foo)(const char *fmt, ...)
+                 __attribute__ ((format (printf, 1, 2)));
+
+int
+main(int argc, char **argv)
+{
+  (*foo)("%s", "test");
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv___attribute___format_function_pointer=yes
+else
+  ac_cv___attribute___format_function_pointer=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test "$ac_cv___attribute___format_function_pointer" = "yes"; then
+
+$as_echo "#define __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___format_function_pointer" >&5
+$as_echo "$ac_cv___attribute___format_function_pointer" >&6; }
+
+       fi
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
@@ -3672,7 +3941,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -3738,7 +4007,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -3944,7 +4213,25 @@ fi
 done
 
 if test "$ac_cv_header_net_pfvar_h" = yes; then
-       LOCALSRC="print-pflog.c $LOCALSRC"
+       for ac_header in net/if_pflog.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "net/if_pflog.h" "ac_cv_header_net_if_pflog_h" "#include <sys/types.h>
+       #include <sys/socket.h>
+       #include <net/if.h>
+       #include <net/pfvar.h>
+"
+if test "x$ac_cv_header_net_if_pflog_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_IF_PFLOG_H 1
+_ACEOF
+
+fi
+
+done
+
+       if test "$ac_cv_header_net_if_pflog_h" = yes; then
+               LOCALSRC="print-pflog.c $LOCALSRC"
+       fi
 fi
 for ac_header in netinet/if_ether.h
 do :
@@ -4058,38 +4345,6 @@ fi
                esac
        fi
        ;;
-
-linux*)
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux kernel version" >&5
-$as_echo_n "checking Linux kernel version... " >&6; }
-       if test "$cross_compiling" = yes; then
-               if ${ac_cv_linux_vers+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_linux_vers=unknown
-fi
-
-       else
-               if ${ac_cv_linux_vers+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_linux_vers=`uname -r 2>&1 | \
-                       sed -n -e '$s/.* //' -e '$s/\..*//p'`
-fi
-
-       fi
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_linux_vers" >&5
-$as_echo "$ac_cv_linux_vers" >&6; }
-       if test $ac_cv_linux_vers = unknown ; then
-               as_fn_error $? "cannot determine linux version when cross-compiling" "$LINENO" 5
-       fi
-       if test $ac_cv_linux_vers -lt 2 ; then
-               as_fn_error $? "version 2 or higher required; see the INSTALL doc for more info" "$LINENO" 5
-       fi
-       ;;
-
-*)
-       ;;
 esac
 
 
@@ -4103,19 +4358,13 @@ fi
 
 
 if test "x$with_smi" != "xno" ; then
-for ac_header in smi.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "smi.h" "ac_cv_header_smi_h" "$ac_includes_default"
+       ac_fn_c_check_header_mongrel "$LINENO" "smi.h" "ac_cv_header_smi_h" "$ac_includes_default"
 if test "x$ac_cv_header_smi_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SMI_H 1
-_ACEOF
-
-fi
-
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for smiInit in -lsmi" >&5
+               #
+               # OK, we found smi.h.  Do we have libsmi with smiInit?
+               #
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for smiInit in -lsmi" >&5
 $as_echo_n "checking for smiInit in -lsmi... " >&6; }
 if ${ac_cv_lib_smi_smiInit+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -4152,27 +4401,26 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smi_smiInit" >&5
 $as_echo "$ac_cv_lib_smi_smiInit" >&6; }
 if test "x$ac_cv_lib_smi_smiInit" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSMI 1
-_ACEOF
-
-  LIBS="-lsmi $LIBS"
 
-fi
-
-if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
-then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libsmi" >&5
+                       #
+                       # OK, we have libsmi with smiInit.  Can we use it?
+                       #
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libsmi" >&5
 $as_echo_n "checking whether to enable libsmi... " >&6; }
-        if test "$cross_compiling" = yes; then :
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: not when cross-compiling" >&5
+                       savedlibs="$LIBS"
+                       LIBS="-lsmi $LIBS"
+                       if test "$cross_compiling" = yes; then :
+
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not when cross-compiling" >&5
 $as_echo "not when cross-compiling" >&6; }
-  libsmi=no
+                                       LIBS="$savedlibs"
+
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
- /* libsmi available check */
+
+/* libsmi available check */
 #include <smi.h>
 main()
 {
@@ -4192,31 +4440,41 @@ main()
 
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-  $as_echo "#define LIBSMI 1" >>confdefs.h
 
-  libsmi=yes
+$as_echo "#define USE_LIBSMI 1" >>confdefs.h
+
+
 else
-   case $? in
-  1) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - smiInit failed" >&5
+
+                                                                                                                                                                                                                                                                                       case $? in
+                                         1) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - smiInit failed" >&5
 $as_echo "no - smiInit failed" >&6; } ;;
-  2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - header/library version mismatch" >&5
+                                         2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - header/library version mismatch" >&5
 $as_echo "no - header/library version mismatch" >&6; } ;;
-  3) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - can't determine library version" >&5
+                                         3) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - can't determine library version" >&5
 $as_echo "no - can't determine library version" >&6; } ;;
-  4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - too old" >&5
+                                         4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - too old" >&5
 $as_echo "no - too old" >&6; } ;;
-  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+                                         *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; } ;;
-  esac
-  libsmi=no
+                                       esac
+                                       LIBS="$savedlibs"
+
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+
+fi
+
+
 fi
+
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the possibly-buggy SMB printer" >&5
@@ -4233,7 +4491,8 @@ yes)      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&5
 $as_echo "$as_me: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&2;}
-       $as_echo "#define TCPDUMP_DO_SMB 1" >>confdefs.h
+
+$as_echo "#define TCPDUMP_DO_SMB 1" >>confdefs.h
 
        LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
        ;;
@@ -4251,7 +4510,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to drop root privileges by default" >&5
 $as_echo_n "checking whether to drop root privileges by default... " >&6; }
 if test ! -z "$with_user" ; then
-        cat >>confdefs.h <<_ACEOF
+
+cat >>confdefs.h <<_ACEOF
 #define WITH_USER "$withval"
 _ACEOF
 
@@ -4271,7 +4531,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to chroot" >&5
 $as_echo_n "checking whether to chroot... " >&6; }
 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
-        cat >>confdefs.h <<_ACEOF
+
+cat >>confdefs.h <<_ACEOF
 #define WITH_CHROOT "$withval"
 _ACEOF
 
@@ -4282,230 +4543,170 @@ else
 $as_echo "no" >&6; }
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ipv6" >&5
-$as_echo_n "checking whether to enable ipv6... " >&6; }
-# Check whether --enable-ipv6 was given.
-if test "${enable_ipv6+set}" = set; then :
-  enableval=$enable_ipv6;  case "$enableval" in
-yes)   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
-       $as_echo "#define INET6 1" >>confdefs.h
 
-       ipv6=yes
-       ;;
-*)
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       ipv6=no
-       ;;
-  esac
-else
-  if test "$cross_compiling" = yes; then :
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  ipv6=no
+# Check whether --with-sandbox-capsicum was given.
+if test "${with_sandbox_capsicum+set}" = set; then :
+  withval=$with_sandbox_capsicum;
+fi
 
+#
+# Check whether various functions are available.  If any are, set
+# ac_lbl_capsicum_function_seen to yes; if any are not, set
+# ac_lbl_capsicum_function_not_seen to yes.
+#
+# We don't check cap_rights_init(), as it's a macro, wrapping another
+# function, in at least some versions of FreeBSD, and AC_CHECK_FUNCS()
+# doesn't handle that.
+#
+# All of the ones we check for must be available in order to enable
+# capsicum sandboxing.
+#
+# XXX - do we need to check for all of them, or are there some that, if
+# present, imply others are present?
+#
+if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
+       for ac_func in cap_enter cap_rights_limit cap_ioctls_limit openat
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ac_lbl_capsicum_function_seen=yes
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- /* AF_INET6 available check */
-#include <sys/types.h>
-#include <sys/socket.h>
-main()
-{
- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
-   exit(1);
- else
-   exit(0);
-}
+  ac_lbl_capsicum_function_not_seen=yes
+fi
+done
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
-  $as_echo "#define INET6 1" >>confdefs.h
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to sandbox using capsicum" >&5
+$as_echo_n "checking whether to sandbox using capsicum... " >&6; }
+if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then
 
-  ipv6=yes
+$as_echo "#define HAVE_CAPSICUM 1" >>confdefs.h
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-  ipv6=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-fi
+#
+# We must check this before checking whether to enable IPv6, because,
+# on some platforms (such as SunOS 5.x), the test program requires
+# the extra networking libraries.
+#
 
+    # Most operating systems have gethostbyname() in the default searched
+    # libraries (i.e. libc):
+    # Some OSes (eg. Solaris) place it in libnsl
+    # Some strange OSes (SINIX) have it in libsocket:
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if ${ac_cv_search_gethostbyname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-ipv6type=unknown
-ipv6lib=none
-ipv6trylibc=no
-
-if test "$ipv6" = "yes"; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5
-$as_echo_n "checking ipv6 stack type... " >&6; }
-       for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
-               case $i in
-               inria)
-                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <netinet/in.h>
-#ifdef IPV6_INRIA_VERSION
-yes
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
 #endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
-  ipv6type=$i;
-                               CFLAGS="-DINET6 $CFLAGS"
+for ac_lib in '' nsl socket resolv; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_gethostbyname=$ac_res
 fi
-rm -f conftest*
-
-                       ;;
-               kame)
-                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <netinet/in.h>
-#ifdef __KAME__
-yes
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
-  ipv6type=$i;
-                               ipv6lib=inet6;
-                               ipv6libdir=/usr/local/v6/lib;
-                               ipv6trylibc=yes;
-                               CFLAGS="-DINET6 $CFLAGS"
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_gethostbyname+:} false; then :
+  break
 fi
-rm -f conftest*
+done
+if ${ac_cv_search_gethostbyname+:} false; then :
 
-                       ;;
-               linux-glibc)
-                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <features.h>
-#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
-yes
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
-  ipv6type=$i;
-                               CFLAGS="-DINET6 $CFLAGS"
+else
+  ac_cv_search_gethostbyname=no
 fi
-rm -f conftest*
-
-                       ;;
-               linux-libinet6)
-                                                                                                                                               if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
-                               ipv6type=$i
-                               ipv6lib=inet6
-                               ipv6libdir=/usr/inet6/lib
-                               ipv6trylibc=yes;
-                               CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
-                       fi
-                       ;;
-               toshiba)
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/param.h>
-#ifdef _TOSHIBA_INET6
-yes
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
-  ipv6type=$i;
-                               ipv6lib=inet6;
-                               ipv6libdir=/usr/local/v6/lib;
-                               CFLAGS="-DINET6 $CFLAGS"
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
 fi
-rm -f conftest*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+$as_echo "$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-                       ;;
-               v6d)
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include </usr/local/v6/include/sys/v6config.h>
-#ifdef __V6D__
-yes
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
-  ipv6type=$i;
-                               ipv6lib=v6;
-                               ipv6libdir=/usr/local/v6/lib;
-                               CFLAGS="-I/usr/local/v6/include $CFLAGS"
 fi
-rm -f conftest*
 
-                       ;;
-               zeta)
-                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    # Unfortunately libsocket sometimes depends on libnsl and
+    # AC_SEARCH_LIBS isn't up to the task of handling dependencies like this.
+    if test "$ac_cv_search_gethostbyname" = "no"
+    then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
+$as_echo_n "checking for gethostbyname in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_gethostbyname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket -lnsl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/param.h>
-#ifdef _ZETA_MINAMI_INET6
-yes
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
 #endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
-  ipv6type=$i;
-                               ipv6lib=inet6;
-                               ipv6libdir=/usr/local/v6/lib;
-                               CFLAGS="-DINET6 $CFLAGS"
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_socket_gethostbyname=yes
+else
+  ac_cv_lib_socket_gethostbyname=no
 fi
-rm -f conftest*
-
-                       ;;
-               esac
-               if test "$ipv6type" != "unknown"; then
-                       break
-               fi
-       done
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ipv6type" >&5
-$as_echo "$ipv6type" >&6; }
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
-       if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
-               LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
-               echo "You have $ipv6lib library, using it"
-       else
-               if test "$ipv6trylibc" = "yes"; then
-                       echo "You do not have $ipv6lib library, using libc"
-               else
-                       echo 'Fatal: no $ipv6lib library found.  cannot continue.'
-                       echo "You need to fetch lib$ipv6lib.a from appropriate"
-                       echo 'ipv6 kit and compile beforehand.'
-                       exit 1
-               fi
-       fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
+$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; }
+if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then :
+  LIBS="-lsocket -lnsl $LIBS"
 fi
 
-
-if test "$ipv6" = "yes"; then
-       #
-       # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
-       # function in libc; there are "ngetaddrinfo()" and
-       # "ogetaddrinfo()" functions, and <netdb.h> #defines
-       # "getaddrinfo" to be either "ngetaddrinfo" or
-       # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
-       # or _XOPEN_SOURCE_EXTENDED are defined or not.
-       #
-       # So this test doesn't work on Tru64 5.1, and possibly
-       # on other 5.x releases.  This causes the configure
-       # script to become confused, and results in libpcap
-       # being unbuildable.
-       #
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
-$as_echo_n "checking for library containing getaddrinfo... " >&6; }
-if ${ac_cv_search_getaddrinfo+:} false; then :
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -4518,11 +4719,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char getaddrinfo ();
+char socket ();
 int
 main ()
 {
-return getaddrinfo ();
+return socket ();
   ;
   return 0;
 }
@@ -4535,38 +4736,413 @@ for ac_lib in '' socket; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
   if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_getaddrinfo=$ac_res
+  ac_cv_search_socket=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if ${ac_cv_search_getaddrinfo+:} false; then :
+  if ${ac_cv_search_socket+:} false; then :
   break
 fi
 done
-if ${ac_cv_search_getaddrinfo+:} false; then :
+if ${ac_cv_search_socket+:} false; then :
 
 else
-  ac_cv_search_getaddrinfo=no
+  ac_cv_search_socket=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5
-$as_echo "$ac_cv_search_getaddrinfo" >&6; }
-ac_res=$ac_cv_search_getaddrinfo
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5
-$as_echo_n "checking getaddrinfo bug... " >&6; }
-       if ${td_cv_buggygetaddrinfo+:} false; then :
-  $as_echo_n "(cached) " >&6
+
 else
-  if test "$cross_compiling" = yes; then :
-  td_cv_buggygetaddrinfo=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_socket+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket -lnsl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_socket_socket=yes
+else
+  ac_cv_lib_socket_socket=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
+  LIBS="-lsocket -lnsl $LIBS"
+fi
+
+fi
+
+    # DLPI needs putmsg under HPUX so test for -lstr while we're at it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing putmsg" >&5
+$as_echo_n "checking for library containing putmsg... " >&6; }
+if ${ac_cv_search_putmsg+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char putmsg ();
+int
+main ()
+{
+return putmsg ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' str; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_putmsg=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_putmsg+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_putmsg+:} false; then :
+
+else
+  ac_cv_search_putmsg=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_putmsg" >&5
+$as_echo "$ac_cv_search_putmsg" >&6; }
+ac_res=$ac_cv_search_putmsg
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ipv6" >&5
+$as_echo_n "checking whether to enable ipv6... " >&6; }
+# Check whether --enable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then :
+  enableval=$enable_ipv6;  case "$enableval" in
+yes)   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       LOCALSRC="print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
+
+$as_echo "#define INET6 1" >>confdefs.h
+
+       ipv6=yes
+       ;;
+*)
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       ipv6=no
+       ;;
+  esac
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+      /* AF_INET6 available check */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#ifdef AF_INET6
+void
+foo(struct in6_addr *addr)
+{
+ memset(addr, 0, sizeof (struct in6_addr));
+}
+#else
+#error "AF_INET6 not defined"
+#endif
+
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  LOCALSRC="print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
+
+$as_echo "#define INET6 1" >>confdefs.h
+
+  ipv6=yes
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  ipv6=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+ipv6type=unknown
+ipv6lib=none
+ipv6trylibc=no
+
+if test "$ipv6" = "yes"; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5
+$as_echo_n "checking ipv6 stack type... " >&6; }
+       for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
+               case $i in
+               inria)
+                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <netinet/in.h>
+#ifdef IPV6_INRIA_VERSION
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  ipv6type=$i;
+                               CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+                       ;;
+               kame)
+                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <netinet/in.h>
+#ifdef __KAME__
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  ipv6type=$i;
+                               ipv6lib=inet6;
+                               ipv6libdir=/usr/local/v6/lib;
+                               ipv6trylibc=yes;
+                               CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+                       ;;
+               linux-glibc)
+                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <features.h>
+#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  ipv6type=$i;
+                               CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+                       ;;
+               linux-libinet6)
+                                                                                                                                               if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
+                               ipv6type=$i
+                               ipv6lib=inet6
+                               ipv6libdir=/usr/inet6/lib
+                               ipv6trylibc=yes;
+                               CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
+                       fi
+                       ;;
+               toshiba)
+                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/param.h>
+#ifdef _TOSHIBA_INET6
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  ipv6type=$i;
+                               ipv6lib=inet6;
+                               ipv6libdir=/usr/local/v6/lib;
+                               CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+                       ;;
+               v6d)
+                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include </usr/local/v6/include/sys/v6config.h>
+#ifdef __V6D__
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  ipv6type=$i;
+                               ipv6lib=v6;
+                               ipv6libdir=/usr/local/v6/lib;
+                               CFLAGS="-I/usr/local/v6/include $CFLAGS"
+fi
+rm -f conftest*
+
+                       ;;
+               zeta)
+                       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/param.h>
+#ifdef _ZETA_MINAMI_INET6
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  ipv6type=$i;
+                               ipv6lib=inet6;
+                               ipv6libdir=/usr/local/v6/lib;
+                               CFLAGS="-DINET6 $CFLAGS"
+fi
+rm -f conftest*
+
+                       ;;
+               esac
+               if test "$ipv6type" != "unknown"; then
+                       break
+               fi
+       done
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ipv6type" >&5
+$as_echo "$ipv6type" >&6; }
+fi
+
+if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
+       if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
+               LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
+               echo "You have $ipv6lib library, using it"
+       else
+               if test "$ipv6trylibc" = "yes"; then
+                       echo "You do not have $ipv6lib library, using libc"
+               else
+                       echo 'Fatal: no $ipv6lib library found.  cannot continue.'
+                       echo "You need to fetch lib$ipv6lib.a from appropriate"
+                       echo 'ipv6 kit and compile beforehand.'
+                       exit 1
+               fi
+       fi
+fi
+
+
+if test "$ipv6" = "yes"; then
+       #
+       # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
+       # function in libc; there are "ngetaddrinfo()" and
+       # "ogetaddrinfo()" functions, and <netdb.h> #defines
+       # "getaddrinfo" to be either "ngetaddrinfo" or
+       # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
+       # or _XOPEN_SOURCE_EXTENDED are defined or not.
+       #
+       # So this test doesn't work on Tru64 5.1, and possibly
+       # on other 5.x releases.  This causes the configure
+       # script to become confused, and results in libpcap
+       # being unbuildable.
+       #
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
+$as_echo_n "checking for library containing getaddrinfo... " >&6; }
+if ${ac_cv_search_getaddrinfo+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getaddrinfo ();
+int
+main ()
+{
+return getaddrinfo ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_getaddrinfo=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_getaddrinfo+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_getaddrinfo+:} false; then :
+
+else
+  ac_cv_search_getaddrinfo=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5
+$as_echo "$ac_cv_search_getaddrinfo" >&6; }
+ac_res=$ac_cv_search_getaddrinfo
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5
+$as_echo_n "checking getaddrinfo bug... " >&6; }
+       if ${td_cv_buggygetaddrinfo+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  td_cv_buggygetaddrinfo=unknown
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
 #include <sys/types.h>
 #include <netdb.h>
 #include <string.h>
@@ -4676,6 +5252,9 @@ fi
        if test "$td_cv_buggygetaddrinfo" = no; then
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: good" >&5
 $as_echo "good" >&6; }
+       elif test "$td_cv_buggygetaddrinfo" = unknown; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5
+$as_echo "unknown (cross-compiling)" >&6; }
        else
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5
 $as_echo "buggy" >&6; }
@@ -4740,7 +5319,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $td_cv_decl_netdnet_dnetdb_h_dnet_htoa" >&5
 $as_echo "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" >&6; }
 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
-       $as_echo "#define HAVE_NETDNET_DNETDB_H_DNET_HTOA 1" >>confdefs.h
+
+$as_echo "#define HAVE_NETDNET_DNETDB_H_DNET_HTOA 1" >>confdefs.h
 
 fi
 
@@ -4773,10 +5353,12 @@ fi
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_addrinfo" >&5
 $as_echo "$ac_cv_addrinfo" >&6; }
        if test $ac_cv_addrinfo = yes; then
-               $as_echo "#define HAVE_ADDRINFO 1" >>confdefs.h
+
+$as_echo "#define HAVE_ADDRINFO 1" >>confdefs.h
 
        else
-               $as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h
+
+$as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h
 
        fi
 
@@ -4852,44 +5434,6 @@ if test "$ac_cv_namereqd" = no; then
        missing_includes=yes
 fi
 
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5
-$as_echo_n "checking for sockaddr_storage... " >&6; }
-       if ${ac_cv_sa_storage+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#              include <sys/types.h>
-#              include <sys/socket.h>
-int
-main ()
-{
-struct sockaddr_storage s
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sa_storage=yes
-else
-  ac_cv_sa_storage=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sa_storage" >&5
-$as_echo "$ac_cv_sa_storage" >&6; }
-       if test $ac_cv_sa_storage = yes; then
-               $as_echo "#define HAVE_SOCKADDR_STORAGE 1" >>confdefs.h
-
-       fi
-
-if test "$ac_cv_sa_storage" = no; then
-       missing_includes=yes
-fi
-
 ac_fn_c_check_func "$LINENO" "vfprintf" "ac_cv_func_vfprintf"
 if test "x$ac_cv_func_vfprintf" = xyes; then :
   $as_echo "#define HAVE_VFPRINTF 1" >>confdefs.h
@@ -4903,19 +5447,6 @@ esac
 
 fi
 
-ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
-if test "x$ac_cv_func_strcasecmp" = xyes; then :
-  $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h
-
-else
-  case " $LIBOBJS " in
-  *" strcasecmp.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext"
- ;;
-esac
-
-fi
-
 ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
 if test "x$ac_cv_func_strlcat" = xyes; then :
   $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
@@ -4968,6 +5499,19 @@ esac
 
 fi
 
+ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
+if test "x$ac_cv_func_getopt_long" = xyes; then :
+  $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
+
+else
+  case " $LIBOBJS " in
+  *" getopt_long.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
+ ;;
+esac
+
+fi
+
 
 for ac_func in fork vfork strftime
 do :
@@ -5150,7 +5694,8 @@ $as_echo "$ac_cv_search_dnet_htoa" >&6; }
 ac_res=$ac_cv_search_dnet_htoa
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  $as_echo "#define HAVE_DNET_HTOA 1" >>confdefs.h
+
+$as_echo "#define HAVE_DNET_HTOA 1" >>confdefs.h
 
 fi
 
@@ -5247,621 +5792,763 @@ $as_echo "$ac_cv_search_getrpcbynumber" >&6; }
 ac_res=$ac_cv_search_getrpcbynumber
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  $as_echo "#define HAVE_GETRPCBYNUMBER 1" >>confdefs.h
+
+$as_echo "#define HAVE_GETRPCBYNUMBER 1" >>confdefs.h
 
 fi
 
 
 
 
-    # Most operating systems have gethostbyname() in the default searched
-    # libraries (i.e. libc):
-    # Some OSes (eg. Solaris) place it in libnsl
-    # Some strange OSes (SINIX) have it in libsocket:
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
-$as_echo_n "checking for library containing gethostbyname... " >&6; }
-if ${ac_cv_search_gethostbyname+:} false; then :
+                LBL_LIBS="$LIBS"
+    pfopen=/usr/examples/packetfilter/pfopen.c
+    if test -f $pfopen ; then
+           for ac_func in pfopen
+do :
+  ac_fn_c_check_func "$LINENO" "pfopen" "ac_cv_func_pfopen"
+if test "x$ac_cv_func_pfopen" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PFOPEN 1
+_ACEOF
+
+fi
+done
+
+           if test $ac_cv_func_pfopen = "no" ; then
+                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $pfopen" >&5
+$as_echo "Using $pfopen" >&6; }
+                   LIBS="$LIBS $pfopen"
+           fi
+    fi
+       libpcap=FAIL
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local pcap library" >&5
+$as_echo_n "checking for local pcap library... " >&6; }
+
+# Check whether --with-system-libpcap was given.
+if test "${with_system_libpcap+set}" = set; then :
+  withval=$with_system_libpcap;
+fi
+
+       if test "x$with_system_libpcap" != xyes ; then
+               lastdir=FAIL
+       places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
+               egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
+       places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
+               egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
+       for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
+               basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \
+                       sed -e 's/-PRE-GIT$//' `
+               if test $lastdir = $basedir ; then
+                                               continue;
+               fi
+               lastdir=$dir
+               if test -r $dir/libpcap.a ; then
+                       libpcap=$dir/libpcap.a
+                       d=$dir
+                                       fi
+               done
+       fi
+    if test $libpcap = FAIL ; then
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+
+           #
+           # Look for pcap-config.
+           #
+           if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pcap-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pcap-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PCAP_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  case $PCAP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' nsl socket resolv; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  ;;
+esac
+fi
+PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG
+if test -n "$PCAP_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5
+$as_echo "$PCAP_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PCAP_CONFIG"; then
+  ac_pt_PCAP_CONFIG=$PCAP_CONFIG
+  # Extract the first word of "pcap-config", so it can be a program name with args.
+set dummy pcap-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PCAP_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PCAP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PCAP_CONFIG="$ac_pt_PCAP_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_gethostbyname=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_gethostbyname+:} false; then :
-  break
-fi
 done
-if ${ac_cv_search_gethostbyname+:} false; then :
+  done
+IFS=$as_save_IFS
 
-else
-  ac_cv_search_gethostbyname=no
+  ;;
+esac
 fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+ac_pt_PCAP_CONFIG=$ac_cv_path_ac_pt_PCAP_CONFIG
+if test -n "$ac_pt_PCAP_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PCAP_CONFIG" >&5
+$as_echo "$ac_pt_PCAP_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
-$as_echo "$ac_cv_search_gethostbyname" >&6; }
-ac_res=$ac_cv_search_gethostbyname
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
+  if test "x$ac_pt_PCAP_CONFIG" = x; then
+    PCAP_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PCAP_CONFIG=$ac_pt_PCAP_CONFIG
+  fi
+else
+  PCAP_CONFIG="$ac_cv_path_PCAP_CONFIG"
 fi
 
-    # Unfortunately libsocket sometimes depends on libnsl and
-    # AC_SEARCH_LIBS isn't up to the task of handling dependencies like this.
-    if test "$ac_cv_search_gethostbyname" = "no"
-    then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
-$as_echo_n "checking for gethostbyname in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_gethostbyname+:} false; then :
+           if test -n "$PCAP_CONFIG" ; then
+               #
+               # Found - use it to get the include flags for
+               # libpcap and the flags to link with libpcap.
+               #
+               # Please read section 11.6 "Shell Substitutions"
+               # in the autoconf manual before doing anything
+               # to this that involves quoting.  Especially note
+               # the statement "There is just no portable way to use
+               # double-quoted strings inside double-quoted back-quoted
+               # expressions (pfew!)."
+               #
+               cflags=`"$PCAP_CONFIG" --cflags`
+               V_INCLS="$cflags $V_INCLS"
+               libpcap=`"$PCAP_CONFIG" --libs`
+           else
+               #
+               # Not found; look for pcap.
+               #
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpcap" >&5
+$as_echo_n "checking for main in -lpcap... " >&6; }
+if ${ac_cv_lib_pcap_main+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket -lnsl $LIBS"
+LIBS="-lpcap  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
+
 int
 main ()
 {
-return gethostbyname ();
+return main ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_socket_gethostbyname=yes
+  ac_cv_lib_pcap_main=yes
 else
-  ac_cv_lib_socket_gethostbyname=no
+  ac_cv_lib_pcap_main=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
-$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; }
-if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then :
-  LIBS="-lsocket -lnsl $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_main" >&5
+$as_echo "$ac_cv_lib_pcap_main" >&6; }
+if test "x$ac_cv_lib_pcap_main" = xyes; then :
+  libpcap="-lpcap"
 fi
 
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-$as_echo_n "checking for library containing socket... " >&6; }
-if ${ac_cv_search_socket+:} false; then :
+               if test $libpcap = FAIL ; then
+                   as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
+               fi
+                                                                                                                                                                                                                                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extraneous pcap header directories" >&5
+$as_echo_n "checking for extraneous pcap header directories... " >&6; }
+               if test \( ! -r /usr/local/include/pcap.h \) -a \
+                       \( ! -r /usr/include/pcap.h \); then
+                   if test -r /usr/local/include/pcap/pcap.h; then
+                       d="/usr/local/include/pcap"
+                   elif test -r /usr/include/pcap/pcap.h; then
+                       d="/usr/include/pcap"
+                   fi
+               fi
+               if test -z "$d" ; then
+                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+               else
+                   V_INCLS="-I$d $V_INCLS"
+                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: found -- -I$d added" >&5
+$as_echo "found -- -I$d added" >&6; }
+               fi
+           fi
+    else
+           V_PCAPDEP=$libpcap
+           places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
+                       egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'`
+           places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
+                       egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'`
+            pcapH=FAIL
+           if test -r $d/pcap.h; then
+                    pcapH=$d
+           else
+                for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
+                   if test -r $dir/pcap.h ; then
+                       pcapH=$dir
+                   fi
+                done
+            fi
+
+            if test $pcapH = FAIL ; then
+                    as_fn_error $? "cannot find pcap.h: see INSTALL" "$LINENO" 5
+           fi
+            V_INCLS="-I$pcapH $V_INCLS"
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5
+$as_echo "$libpcap" >&6; }
+           # Extract the first word of "pcap-config", so it can be a program name with args.
+set dummy pcap-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PCAP_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_func_search_save_LIBS=$LIBS
+  case $PCAP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $d
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG
+if test -n "$PCAP_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5
+$as_echo "$PCAP_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+           if test -n "$PCAP_CONFIG"; then
+               #
+               # The libpcap directory has a pcap-config script.
+               # Use it to get any additioal libraries needed
+               # to link with the libpcap archive library in
+               # that directory.
+               #
+               # Please read section 11.6 "Shell Substitutions"
+               # in the autoconf manual before doing anything
+               # to this that involves quoting.  Especially note
+               # the statement "There is just no portable way to use
+               # double-quoted strings inside double-quoted back-quoted
+               # expressions (pfew!)."
+               #
+               additional_libs=`"$PCAP_CONFIG" --additional-libs --static`
+               libpcap="$libpcap $additional_libs"
+           fi
+    fi
+    LIBS="$libpcap $LIBS"
+    if ! test -n "$PCAP_CONFIG" ; then
+       #
+       # We don't have pcap-config; find out any additional link flags
+       # we need.  (If we have pcap-config, we assume it tells us what
+       # we need.)
+       #
+       case "$host_os" in
+
+       aix*)
+           #
+           # If libpcap is DLPI-based, we have to use /lib/pse.exp if
+           # present, as we use the STREAMS routines.
+           #
+           # (XXX - true only if we're linking with a static libpcap?)
+           #
+           pseexe="/lib/pse.exp"
+           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $pseexe" >&5
+$as_echo_n "checking for $pseexe... " >&6; }
+           if test -f $pseexe ; then
+                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                   LIBS="$LIBS -I:$pseexe"
+           fi
+
+           #
+           # If libpcap is BPF-based, we need "-lodm" and "-lcfg", as
+           # we use them to load the BPF module.
+           #
+           # (XXX - true only if we're linking with a static libpcap?)
+           #
+           LIBS="$LIBS -lodm -lcfg"
+           ;;
+       esac
+    fi
+
+                                    ac_fn_c_check_func "$LINENO" "pcap_loop" "ac_cv_func_pcap_loop"
+if test "x$ac_cv_func_pcap_loop" = xyes; then :
+
+else
+
+           as_fn_error $? "Report this to [email protected], and include the
+config.log file in your report.  If you have downloaded libpcap from
+tcpdump.org, and built it yourself, please also include the config.log
+file from the libpcap source directory, the Makefile from the libpcap
+source directory, and the output of the make process for libpcap, as
+this could be a problem with the libpcap that was built, and we will
+not be able to determine why this is happening, and thus will not be
+able to fix it, without that information, as we have not been able to
+reproduce this problem ourselves." "$LINENO" 5
+
+fi
+
+
+
+#
+# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
+# libraries (e.g., "-lsocket -lnsl" on Solaris).
+#
+# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
+# use AC_CHECK_FUNC which doesn't let us specify the right #includes
+# to make this work on BSD/OS 4.x.  BSD/OS 4.x ships with the BIND8
+# resolver, and the way it defines inet_{ntop,pton} is rather strange;
+# it does not ship with a libc symbol "inet_ntop()", it ships with
+# "_inet_ntop()", and has a #define macro in one of the system headers
+# to rename it.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop" >&5
+$as_echo_n "checking for inet_ntop... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char socket ();
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 int
 main ()
 {
-return socket ();
+char src[4], dst[128];
+inet_ntop(AF_INET, src, dst, sizeof(dst));
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' socket; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_socket=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_socket+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_socket+:} false; then :
-
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  ac_cv_search_socket=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-$as_echo "$ac_cv_search_socket" >&6; }
-ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       case " $LIBOBJS " in
+  *" inet_ntop.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext"
+ ;;
+esac
 
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
-$as_echo_n "checking for socket in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_socket+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket -lnsl $LIBS"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5
+$as_echo_n "checking for inet_pton... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char socket ();
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 int
 main ()
 {
-return socket ();
+char src[128], dst[4];
+inet_pton(AF_INET, src, dst);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_socket_socket=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  ac_cv_lib_socket_socket=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       case " $LIBOBJS " in
+  *" inet_pton.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS inet_pton.$ac_objext"
+ ;;
+esac
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
-$as_echo "$ac_cv_lib_socket_socket" >&6; }
-if test "x$ac_cv_lib_socket_socket" = xyes; then :
-  LIBS="-lsocket -lnsl $LIBS"
-fi
-
-fi
-
-    # DLPI needs putmsg under HPUX so test for -lstr while we're at it
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing putmsg" >&5
-$as_echo_n "checking for library containing putmsg... " >&6; }
-if ${ac_cv_search_putmsg+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5
+$as_echo_n "checking for inet_aton... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char putmsg ();
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 int
 main ()
 {
-return putmsg ();
+char src[128];
+struct in_addr dst;
+inet_aton(src, &dst);
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' str; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_putmsg=$ac_res
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       case " $LIBOBJS " in
+  *" inet_aton.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
+ ;;
+esac
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_putmsg+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_putmsg+:} false; then :
+    conftest$ac_exeext conftest.$ac_ext
+
+#
+# Check for these after AC_LBL_LIBPCAP, for the same reason.
+#
+# You are in a twisty little maze of UN*Xes, all different.
+# Some might not have ether_ntohost().
+# Some might have it, but not declare it in any header file.
+# Some might have it, but declare it in <netinet/if_ether.h>.
+# Some might have it, but declare it in <netinet/ether.h>
+# (And some might have it but document it as something declared in
+# <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
+#
+# Before you is a C compiler.
+#
+for ac_func in ether_ntohost
+do :
+  ac_fn_c_check_func "$LINENO" "ether_ntohost" "ac_cv_func_ether_ntohost"
+if test "x$ac_cv_func_ether_ntohost" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ETHER_NTOHOST 1
+_ACEOF
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy ether_ntohost" >&5
+$as_echo_n "checking for buggy ether_ntohost... " >&6; }
+if ${ac_cv_buggy_ether_ntohost+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_search_putmsg=no
+
+       if test "$cross_compiling" = yes; then :
+  ac_cv_buggy_ether_ntohost="not while cross-compiling"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+               #include <netdb.h>
+               #include <sys/types.h>
+               #include <sys/param.h>
+               #include <sys/socket.h>
+
+               int
+               main(int argc, char **argv)
+               {
+                       u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
+                       char name[MAXHOSTNAMELEN];
+
+                       ether_ntohost(name, (struct ether_addr *)ea);
+                       exit(0);
+               }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_buggy_ether_ntohost=no
+else
+  ac_cv_buggy_ether_ntohost=yes
 fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_putmsg" >&5
-$as_echo "$ac_cv_search_putmsg" >&6; }
-ac_res=$ac_cv_search_putmsg
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_ether_ntohost" >&5
+$as_echo "$ac_cv_buggy_ether_ntohost" >&6; }
+    if test "$ac_cv_buggy_ether_ntohost" = "no"; then
 
+$as_echo "#define USE_ETHER_NTOHOST 1" >>confdefs.h
 
+    fi
 
-                LBL_LIBS="$LIBS"
-    pfopen=/usr/examples/packetfilter/pfopen.c
-    if test -f $pfopen ; then
-           for ac_func in pfopen
+fi
+done
+
+if test "$ac_cv_func_ether_ntohost" = yes -a \
+    "$ac_cv_buggy_ether_ntohost" = "no"; then
+       #
+       # OK, we have ether_ntohost().  Do we have <netinet/if_ether.h>?
+       #
+       if test "$ac_cv_header_netinet_if_ether_h" = yes; then
+               #
+               # Yes.  Does it declare ether_ntohost()?
+               #
+               ac_fn_c_check_decl "$LINENO" "ether_ntohost" "ac_cv_have_decl_ether_ntohost" "
+#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>
+
+"
+if test "x$ac_cv_have_decl_ether_ntohost" = xyes; then :
+
+
+$as_echo "#define NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST /**/" >>confdefs.h
+
+
+fi
+
+       fi
+       #
+       # Did that succeed?
+       #
+       if test "$ac_cv_have_decl_ether_ntohost" != yes; then
+               #
+               # No, how about <netinet/ether.h>, as on Linux?
+               #
+               for ac_header in netinet/ether.h
 do :
-  ac_fn_c_check_func "$LINENO" "pfopen" "ac_cv_func_pfopen"
-if test "x$ac_cv_func_pfopen" = xyes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "netinet/ether.h" "ac_cv_header_netinet_ether_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_ether_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_PFOPEN 1
+#define HAVE_NETINET_ETHER_H 1
 _ACEOF
 
 fi
+
 done
 
-           if test $ac_cv_func_pfopen = "no" ; then
-                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $pfopen" >&5
-$as_echo "Using $pfopen" >&6; }
-                   LIBS="$LIBS $pfopen"
-           fi
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local pcap library" >&5
-$as_echo_n "checking for local pcap library... " >&6; }
-    libpcap=FAIL
-    lastdir=FAIL
-    places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
-       egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
-    for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
-           basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \
-               sed -e 's/-PRE-GIT$//' `
-           if test $lastdir = $basedir ; then
-                                   continue;
-           fi
-           lastdir=$dir
-           if test -r $dir/libpcap.a ; then
-                   libpcap=$dir/libpcap.a
-                   d=$dir
-                           fi
-    done
-    if test $libpcap = FAIL ; then
-           { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
+               if test "$ac_cv_header_netinet_ether_h" = yes; then
+                       #
+                       # We have it - does it declare ether_ntohost()?
+                       # Unset ac_cv_have_decl_ether_ntohost so we don't
+                       # treat the previous failure as a cached value and
+                       # suppress the next test.
+                       #
+                       unset ac_cv_have_decl_ether_ntohost
+                       ac_fn_c_check_decl "$LINENO" "ether_ntohost" "ac_cv_have_decl_ether_ntohost" "
+#include <netinet/ether.h>
 
-           #
-           # Look for pcap-config.
-           #
-           if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pcap-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pcap-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PCAP_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PCAP_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+"
+if test "x$ac_cv_have_decl_ether_ntohost" = xyes; then :
 
-  ;;
-esac
-fi
-PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG
-if test -n "$PCAP_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5
-$as_echo "$PCAP_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
+$as_echo "#define NETINET_ETHER_H_DECLARES_ETHER_NTOHOST /**/" >>confdefs.h
 
-fi
-if test -z "$ac_cv_path_PCAP_CONFIG"; then
-  ac_pt_PCAP_CONFIG=$PCAP_CONFIG
-  # Extract the first word of "pcap-config", so it can be a program name with args.
-set dummy pcap-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PCAP_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PCAP_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PCAP_CONFIG="$ac_pt_PCAP_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-  ;;
-esac
 fi
-ac_pt_PCAP_CONFIG=$ac_cv_path_ac_pt_PCAP_CONFIG
-if test -n "$ac_pt_PCAP_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PCAP_CONFIG" >&5
-$as_echo "$ac_pt_PCAP_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+
+               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_fn_c_check_type "$LINENO" "struct ether_addr" "ac_cv_type_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>
+
+"
+if test "x$ac_cv_type_struct_ether_addr" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ETHER_ADDR 1
+_ACEOF
+
+
 fi
 
-  if test "x$ac_pt_PCAP_CONFIG" = x; then
-    PCAP_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PCAP_CONFIG=$ac_pt_PCAP_CONFIG
-  fi
-else
-  PCAP_CONFIG="$ac_cv_path_PCAP_CONFIG"
+
+$as_echo "#define HAVE_DECL_ETHER_NTOHOST 0" >>confdefs.h
+
+       else
+
+$as_echo "#define HAVE_DECL_ETHER_NTOHOST 1" >>confdefs.h
+
+       fi
 fi
 
-           if test -n "$PCAP_CONFIG" ; then
-               #
-               # Found - use it to get the include flags for
-               # libpcap and the flags to link with libpcap.
-               #
-               # Please read section 11.6 "Shell Substitutions"
-               # in the autoconf manual before doing anything
-               # to this that involves quoting.  Especially note
-               # the statement "There is just no portable way to use
-               # double-quoted strings inside double-quoted back-quoted
-               # expressions (pfew!)."
-               #
-               cflags=`"$PCAP_CONFIG" --cflags`
-               V_INCLS="$cflags $V_INCLS"
-               libpcap=`"$PCAP_CONFIG" --libs`
-           else
-               #
-               # Not found; look for pcap.
-               #
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpcap" >&5
-$as_echo_n "checking for main in -lpcap... " >&6; }
-if ${ac_cv_lib_pcap_main+:} false; then :
+# libdlpi is needed for Solaris 11 and later.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlpi_walk in -ldlpi" >&5
+$as_echo_n "checking for dlpi_walk in -ldlpi... " >&6; }
+if ${ac_cv_lib_dlpi_dlpi_walk+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpcap  $LIBS"
+LIBS="-ldlpi -L/lib $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlpi_walk ();
 int
 main ()
 {
-return main ();
+return dlpi_walk ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_pcap_main=yes
+  ac_cv_lib_dlpi_dlpi_walk=yes
 else
-  ac_cv_lib_pcap_main=no
+  ac_cv_lib_dlpi_dlpi_walk=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_main" >&5
-$as_echo "$ac_cv_lib_pcap_main" >&6; }
-if test "x$ac_cv_lib_pcap_main" = xyes; then :
-  libpcap="-lpcap"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dlpi_dlpi_walk" >&5
+$as_echo "$ac_cv_lib_dlpi_dlpi_walk" >&6; }
+if test "x$ac_cv_lib_dlpi_dlpi_walk" = xyes; then :
+  LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS"
 fi
 
-               if test $libpcap = FAIL ; then
-                   as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
-               fi
-                                                                                                                                                                                                                                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extraneous pcap header directories" >&5
-$as_echo_n "checking for extraneous pcap header directories... " >&6; }
-               if test \( ! -r /usr/local/include/pcap.h \) -a \
-                       \( ! -r /usr/include/pcap.h \); then
-                   if test -r /usr/local/include/pcap/pcap.h; then
-                       d="/usr/local/include/pcap"
-                   elif test -r /usr/include/pcap/pcap.h; then
-                       d="/usr/include/pcap"
-                   fi
-               fi
-               if test -z "$d" ; then
-                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-               else
-                   V_INCLS="-I$d $V_INCLS"
-                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: found -- -I$d added" >&5
-$as_echo "found -- -I$d added" >&6; }
-               fi
-           fi
-    else
-           V_PCAPDEP=$libpcap
-           places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
-                       egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'`
-           if test -r $d/pcap.h; then
-                   V_INCLS="-I$d $V_INCLS"
-           elif test -r $places/pcap.h; then
-                   V_INCLS="-I$places $V_INCLS"
-           else
-                    as_fn_error see INSTALL "cannot find pcap.h" "$LINENO" 5
-           fi
-           { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5
-$as_echo "$libpcap" >&6; }
-           # Extract the first word of "pcap-config", so it can be a program name with args.
-set dummy pcap-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PCAP_CONFIG+:} false; then :
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr struct has sa_len member" >&5
+$as_echo_n "checking if sockaddr struct has sa_len member... " >&6; }
+       if ${ac_cv_sockaddr_has_sa_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $PCAP_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $d
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  ;;
-esac
-fi
-PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG
-if test -n "$PCAP_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5
-$as_echo "$PCAP_CONFIG" >&6; }
+#              include <sys/types.h>
+#              include <sys/socket.h>
+int
+main ()
+{
+u_int i = sizeof(((struct sockaddr *)0)->sa_len)
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sockaddr_has_sa_len=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  ac_cv_sockaddr_has_sa_len=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sockaddr_has_sa_len" >&5
+$as_echo "$ac_cv_sockaddr_has_sa_len" >&6; }
+               if test $ac_cv_sockaddr_has_sa_len = yes ; then
+                       $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
 
-           if test -n "$PCAP_CONFIG"; then
-               #
-               # The libpcap directory has a pcap-config script.
-               # Use it to get any additioal libraries needed
-               # to link with the libpcap archive library in
-               # that directory.
-               #
-               # Please read section 11.6 "Shell Substitutions"
-               # in the autoconf manual before doing anything
-               # to this that involves quoting.  Especially note
-               # the statement "There is just no portable way to use
-               # double-quoted strings inside double-quoted back-quoted
-               # expressions (pfew!)."
-               #
-               additional_libs=`"$PCAP_CONFIG" --additional-libs --static`
-               libpcap="$libpcap $additional_libs"
-           fi
-    fi
-    LIBS="$libpcap $LIBS"
-    if ! test -n "$PCAP_CONFIG" ; then
-       #
-       # We don't have pcap-config; find out any additional link flags
-       # we need.  (If we have pcap-config, we assume it tells us what
-       # we need.)
-       #
-       case "$host_os" in
+       fi
 
-       aix*)
-           #
-           # If libpcap is DLPI-based, we have to use /lib/pse.exp if
-           # present, as we use the STREAMS routines.
-           #
-           # (XXX - true only if we're linking with a static libpcap?)
-           #
-           pseexe="/lib/pse.exp"
-           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $pseexe" >&5
-$as_echo_n "checking for $pseexe... " >&6; }
-           if test -f $pseexe ; then
-                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-                   LIBS="$LIBS -I:$pseexe"
-           fi
+if test "$ac_cv_sockaddr_has_sa_len" = no; then
+       missing_includes=yes
+fi
 
-           #
-           # If libpcap is BPF-based, we need "-lodm" and "-lcfg", as
-           # we use them to load the BPF module.
-           #
-           # (XXX - true only if we're linking with a static libpcap?)
-           #
-           LIBS="$LIBS -lodm -lcfg"
-           ;;
-       esac
-    fi
+ac_fn_c_check_func "$LINENO" "pcap_list_datalinks" "ac_cv_func_pcap_list_datalinks"
+if test "x$ac_cv_func_pcap_list_datalinks" = xyes; then :
 
-                                    ac_fn_c_check_func "$LINENO" "pcap_loop" "ac_cv_func_pcap_loop"
-if test "x$ac_cv_func_pcap_loop" = xyes; then :
 
-else
+$as_echo "#define HAVE_PCAP_LIST_DATALINKS 1" >>confdefs.h
 
-           as_fn_error $? "Report this to [email protected], and include the
-config.log file in your report.  If you have downloaded libpcap from
-tcpdump.org, and built it yourself, please also include the config.log
-file from the libpcap source directory, the Makefile from the libpcap
-source directory, and the output of the make process for libpcap, as
-this could be a problem with the libpcap that was built, and we will
-not be able to determine why this is happening, and thus will not be
-able to fix it, without that information, as we have not been able to
-reproduce this problem ourselves." "$LINENO" 5
+           for ac_func in pcap_free_datalinks
+do :
+  ac_fn_c_check_func "$LINENO" "pcap_free_datalinks" "ac_cv_func_pcap_free_datalinks"
+if test "x$ac_cv_func_pcap_free_datalinks" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_FREE_DATALINKS 1
+_ACEOF
 
 fi
+done
 
 
-                        ac_fn_c_check_func "$LINENO" "pcap_list_datalinks" "ac_cv_func_pcap_list_datalinks"
-if test "x$ac_cv_func_pcap_list_datalinks" = xyes; then :
-  $as_echo "#define HAVE_PCAP_LIST_DATALINKS 1" >>confdefs.h
-
 else
 
            case " $LIBOBJS " in
@@ -5873,20 +6560,27 @@ esac
 
 fi
 
-    ac_fn_c_check_func "$LINENO" "pcap_set_datalink" "ac_cv_func_pcap_set_datalink"
+for ac_func in pcap_set_datalink
+do :
+  ac_fn_c_check_func "$LINENO" "pcap_set_datalink" "ac_cv_func_pcap_set_datalink"
 if test "x$ac_cv_func_pcap_set_datalink" = xyes; then :
-  $as_echo "#define HAVE_PCAP_SET_DATALINK 1" >>confdefs.h
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_SET_DATALINK 1
+_ACEOF
 
 fi
+done
 
-    ac_fn_c_check_func "$LINENO" "pcap_datalink_name_to_val" "ac_cv_func_pcap_datalink_name_to_val"
+ac_fn_c_check_func "$LINENO" "pcap_datalink_name_to_val" "ac_cv_func_pcap_datalink_name_to_val"
 if test "x$ac_cv_func_pcap_datalink_name_to_val" = xyes; then :
 
-           $as_echo "#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1" >>confdefs.h
+
+$as_echo "#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1" >>confdefs.h
 
            ac_fn_c_check_func "$LINENO" "pcap_datalink_val_to_description" "ac_cv_func_pcap_datalink_val_to_description"
 if test "x$ac_cv_func_pcap_datalink_val_to_description" = xyes; then :
-  $as_echo "#define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1" >>confdefs.h
+
+$as_echo "#define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1" >>confdefs.h
 
 else
 
@@ -5912,7 +6606,7 @@ esac
 fi
 
 
-                        for ac_func in pcap_breakloop
+for ac_func in pcap_breakloop
 do :
   ac_fn_c_check_func "$LINENO" "pcap_breakloop" "ac_cv_func_pcap_breakloop"
 if test "x$ac_cv_func_pcap_breakloop" = xyes; then :
@@ -5924,9 +6618,10 @@ fi
 done
 
 
-                ac_fn_c_check_func "$LINENO" "pcap_dump_ftell" "ac_cv_func_pcap_dump_ftell"
+ac_fn_c_check_func "$LINENO" "pcap_dump_ftell" "ac_cv_func_pcap_dump_ftell"
 if test "x$ac_cv_func_pcap_dump_ftell" = xyes; then :
-  $as_echo "#define HAVE_PCAP_DUMP_FTELL 1" >>confdefs.h
+
+$as_echo "#define HAVE_PCAP_DUMP_FTELL 1" >>confdefs.h
 
 else
 
 fi
 
 
-
 #
-# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
-# libraries (e.g., "-lsocket -lnsl" on Solaris).
+# Do we have the new open API?  Check for pcap_create, and assume that,
+# if we do, we also have pcap_activate() and the other new routines
+# introduced in libpcap 1.0.0.
 #
-# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
-# use AC_CHECK_FUNC which doesn't let us specify the right #includes
-# to make this work on BSD/OS 4.x.  BSD/OS 4.x ships with the BIND8
-# resolver, and the way it defines inet_{ntop,pton} is rather strange;
-# it does not ship with a libc symbol "inet_ntop()", it ships with
-# "_inet_ntop()", and has a #define macro in one of the system headers
-# to rename it.
+for ac_func in pcap_create
+do :
+  ac_fn_c_check_func "$LINENO" "pcap_create" "ac_cv_func_pcap_create"
+if test "x$ac_cv_func_pcap_create" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_CREATE 1
+_ACEOF
+
+fi
+done
+
+if test $ac_cv_func_pcap_create = "yes" ; then
+       #
+       # OK, do we have pcap_set_tstamp_type?  If so, assume we have
+       # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
+       #
+       for ac_func in pcap_set_tstamp_type
+do :
+  ac_fn_c_check_func "$LINENO" "pcap_set_tstamp_type" "ac_cv_func_pcap_set_tstamp_type"
+if test "x$ac_cv_func_pcap_set_tstamp_type" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_SET_TSTAMP_TYPE 1
+_ACEOF
+
+fi
+done
+
+       #
+       # And do we have pcap_set_tstamp_precision?  If so, we assume
+       # we also have pcap_open_offline_with_tstamp_precision.
+       #
+       for ac_func in pcap_set_tstamp_precision
+do :
+  ac_fn_c_check_func "$LINENO" "pcap_set_tstamp_precision" "ac_cv_func_pcap_set_tstamp_precision"
+if test "x$ac_cv_func_pcap_set_tstamp_precision" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_SET_TSTAMP_PRECISION 1
+_ACEOF
+
+fi
+done
+
+fi
+
 #
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop" >&5
-$as_echo_n "checking for inet_ntop... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-int
-main ()
-{
-char src[4], dst[128];
-inet_ntop(AF_INET, src, dst, sizeof(dst));
-  ;
-  return 0;
-}
+# Check for a miscellaneous collection of functions which we use
+# if we have them.
+#
+for ac_func in pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection pcap_set_immediate_mode
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       case " $LIBOBJS " in
-  *" inet_ntop.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext"
- ;;
-esac
 
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5
-$as_echo_n "checking for inet_pton... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+done
+
+if test $ac_cv_func_pcap_findalldevs = "yes" ; then
+    savedcppflags="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $V_INCLS"
+    ac_fn_c_check_type "$LINENO" "pcap_if_t" "ac_cv_type_pcap_if_t" "#include <pcap.h>
+"
+if test "x$ac_cv_type_pcap_if_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_IF_T 1
+_ACEOF
+
+
+fi
+
+    CPPFLAGS="$savedcppflags"
+fi
+
+if test $ac_cv_func_pcap_lib_version = "no" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pcap_version is defined by libpcap" >&5
+$as_echo_n "checking whether pcap_version is defined by libpcap... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
 int
 main ()
 {
-char src[128], dst[4];
-inet_pton(AF_INET, src, dst);
+
+       extern char pcap_version[];
+
+       return (int)pcap_version;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  ac_lbl_cv_pcap_version_defined=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       case " $LIBOBJS " in
-  *" inet_pton.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS inet_pton.$ac_objext"
- ;;
-esac
-
+  ac_lbl_cv_pcap_version_defined=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5
-$as_echo_n "checking for inet_aton... " >&6; }
+    if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PCAP_VERSION 1" >>confdefs.h
+
+    else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pcap_debug is defined by libpcap" >&5
+$as_echo_n "checking whether pcap_debug is defined by libpcap... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
 int
 main ()
 {
-char src[128];
-struct in_addr dst;
-inet_aton(src, &dst);
+
+       extern int pcap_debug;
+
+       return pcap_debug;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  ac_lbl_cv_pcap_debug_defined=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       case " $LIBOBJS " in
-  *" inet_aton.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
- ;;
-esac
-
+  ac_lbl_cv_pcap_debug_defined=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-#
-# Check for these after AC_LBL_LIBPCAP, for the same reason.
-#
-# You are in a twisty little maze of UN*Xes, all different.
-# Some might not have ether_ntohost().
-# Some might have it, but not declare it in any header file.
-# Some might have it, but declare it in <netinet/if_ether.h>.
-# Some might have it, but declare it in <netinet/ether.h>
-# (And some might have it but document it as something declared in
-# <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
-#
-# Before you is a C compiler.
-#
-for ac_func in ether_ntohost
-do :
-  ac_fn_c_check_func "$LINENO" "ether_ntohost" "ac_cv_func_ether_ntohost"
-if test "x$ac_cv_func_ether_ntohost" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ETHER_NTOHOST 1
-_ACEOF
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy ether_ntohost" >&5
-$as_echo_n "checking for buggy ether_ntohost... " >&6; }
-if ${ac_cv_buggy_ether_ntohost+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+$as_echo "#define HAVE_PCAP_DEBUG 1" >>confdefs.h
 
-       if test "$cross_compiling" = yes; then :
-  ac_cv_buggy_ether_ntohost="not while cross-compiling"
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       #
+       # OK, what about "yydebug"?
+       #
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yydebug is defined by libpcap" >&5
+$as_echo_n "checking whether yydebug is defined by libpcap... " >&6; }
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-               #include <netdb.h>
-               #include <sys/types.h>
-               #include <sys/param.h>
-               #include <sys/socket.h>
+int
+main ()
+{
 
-               int
-               main(int argc, char **argv)
-               {
-                       u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
-                       char name[MAXHOSTNAMELEN];
+               extern int yydebug;
 
-                       ether_ntohost(name, (struct ether_addr *)ea);
-                       exit(0);
-               }
+               return yydebug;
 
+  ;
+  return 0;
+}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_buggy_ether_ntohost=no
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_lbl_cv_yydebug_defined=yes
 else
-  ac_cv_buggy_ether_ntohost=yes
+  ac_lbl_cv_yydebug_defined=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       if test "$ac_lbl_cv_yydebug_defined" = yes ; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_YYDEBUG 1" >>confdefs.h
+
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       fi
 fi
+ac_fn_c_check_func "$LINENO" "bpf_dump" "ac_cv_func_bpf_dump"
+if test "x$ac_cv_func_bpf_dump" = xyes; then :
+  $as_echo "#define HAVE_BPF_DUMP 1" >>confdefs.h
+
+else
+  case " $LIBOBJS " in
+  *" bpf_dump.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS bpf_dump.$ac_objext"
+ ;;
+esac
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_ether_ntohost" >&5
-$as_echo "$ac_cv_buggy_ether_ntohost" >&6; }
-    if test "$ac_cv_buggy_ether_ntohost" = "no"; then
-       $as_echo "#define USE_ETHER_NTOHOST 1" >>confdefs.h
 
-    fi
 
+V_GROUP=0
+if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
+       V_GROUP=wheel
 fi
-done
+#
+# Assume V7/BSD convention for man pages (file formats in section 5,
+# miscellaneous info in section 7).
+#
+MAN_FILE_FORMATS=5
+MAN_MISC_INFO=7
+case "$host_os" in
 
-if test "$ac_cv_func_ether_ntohost" = yes -a \
-    "$ac_cv_buggy_ether_ntohost" = "no"; then
+aix*)
+
+$as_echo "#define _SUN 1" >>confdefs.h
+
+       ;;
+
+hpux*)
        #
-       # OK, we have ether_ntohost().  Do we have <netinet/if_ether.h>?
+       # Use System V conventions for man pages.
        #
-       if test "$ac_cv_header_netinet_if_ether_h" = yes; then
-               #
-               # Yes.  Does it declare ether_ntohost()?
-               #
-               ac_fn_c_check_decl "$LINENO" "ether_ntohost" "ac_cv_have_decl_ether_ntohost" "
-#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>
+       MAN_FILE_FORMATS=4
+       MAN_MISC_INFO=5
+       ;;
 
-"
-if test "x$ac_cv_have_decl_ether_ntohost" = xyes; then :
+irix*)
+       V_GROUP=sys
 
+       #
+       # Use System V conventions for man pages.
+       #
+       MAN_FILE_FORMATS=4
+       MAN_MISC_INFO=5
+       ;;
 
-$as_echo "#define NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST /**/" >>confdefs.h
+osf*)
+       V_GROUP=system
 
+       #
+       # Use System V conventions for man pages.
+       #
+       MAN_FILE_FORMATS=4
+       MAN_MISC_INFO=5
+       ;;
 
-fi
+solaris*)
+       V_GROUP=sys
 
-       fi
        #
-       # Did that succeed?
+       # Use System V conventions for man pages.
        #
-       if test "$ac_cv_have_decl_ether_ntohost" != yes; then
-               #
-               # No, how about <netinet/ether.h>, as on Linux?
-               #
-               for ac_header in netinet/ether.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "netinet/ether.h" "ac_cv_header_netinet_ether_h" "$ac_includes_default"
-if test "x$ac_cv_header_netinet_ether_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_NETINET_ETHER_H 1
-_ACEOF
+       MAN_FILE_FORMATS=4
+       MAN_MISC_INFO=5
+       ;;
+esac
 
+if test -f /dev/bpf0 ; then
+       V_GROUP=bpf
 fi
 
-done
+#
+# Make sure we have definitions for all the C99 specified-width types
+# (regardless of whether the environment is a C99 environment or not).
+#
+ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
+case $ac_cv_c_int8_t in #(
+  no|yes) ;; #(
+  *)
 
-               if test "$ac_cv_header_netinet_ether_h" = yes; then
-                       #
-                       # We have it - does it declare ether_ntohost()?
-                       # Unset ac_cv_have_decl_ether_ntohost so we don't
-                       # treat the previous failure as a cached value and
-                       # suppress the next test.
-                       #
-                       unset ac_cv_have_decl_ether_ntohost
-                       ac_fn_c_check_decl "$LINENO" "ether_ntohost" "ac_cv_have_decl_ether_ntohost" "
-#include <netinet/ether.h>
+cat >>confdefs.h <<_ACEOF
+#define int8_t $ac_cv_c_int8_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+  no|yes) ;; #(
+  *)
 
-"
-if test "x$ac_cv_have_decl_ether_ntohost" = xyes; then :
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
 
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+  no|yes) ;; #(
+  *)
 
-$as_echo "#define NETINET_ETHER_H_DECLARES_ETHER_NTOHOST /**/" >>confdefs.h
+$as_echo "#define _UINT8_T 1" >>confdefs.h
 
 
-fi
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+  esac
 
-               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_fn_c_check_type "$LINENO" "struct ether_addr" "ac_cv_type_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>
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+  no|yes) ;; #(
+  *)
 
-"
-if test "x$ac_cv_type_struct_ether_addr" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_ETHER_ADDR 1
+#define uint16_t $ac_cv_c_uint16_t
 _ACEOF
+;;
+  esac
 
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+  no|yes) ;; #(
+  *)
 
-fi
+$as_echo "#define _UINT32_T 1" >>confdefs.h
 
 
-$as_echo "#define HAVE_DECL_ETHER_NTOHOST 0" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+  esac
 
-       else
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+  no|yes) ;; #(
+  *)
 
-$as_echo "#define HAVE_DECL_ETHER_NTOHOST 1" >>confdefs.h
+$as_echo "#define _UINT64_T 1" >>confdefs.h
 
-       fi
-fi
 
-# libdlpi is needed for Solaris 11 and later.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlpi_walk in -ldlpi" >&5
-$as_echo_n "checking for dlpi_walk in -ldlpi... " >&6; }
-if ${ac_cv_lib_dlpi_dlpi_walk+:} false; then :
-  $as_echo_n "(cached) " >&6
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+  esac
+
+
+#
+# Make sure we have a definition for C99's uintptr_t (regardless of
+# whether the environment is a C99 environment or not).
+#
+
+  ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldlpi -L/lib $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  for ac_type in 'unsigned int' 'unsigned long int' \
+       'unsigned long long int'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlpi_walk ();
+$ac_includes_default
 int
 main ()
 {
-return dlpi_walk ();
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0;
+return test_array [0];
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dlpi_dlpi_walk=yes
-else
-  ac_cv_lib_dlpi_dlpi_walk=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+         ac_type=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dlpi_dlpi_walk" >&5
-$as_echo "$ac_cv_lib_dlpi_dlpi_walk" >&6; }
-if test "x$ac_cv_lib_dlpi_dlpi_walk" = xyes; then :
-  LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       test -z "$ac_type" && break
+     done
 fi
 
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr struct has sa_len member" >&5
-$as_echo_n "checking if sockaddr struct has sa_len member... " >&6; }
-       if ${ac_cv_sockaddr_has_sa_len+:} false; then :
-  $as_echo_n "(cached) " >&6
+#
+# Define the old BSD specified-width types in terms of the C99 types;
+# we may need them with libpcap include files.
+#
+ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default
+#include <sys/types.h>
+
+"
+if test "x$ac_cv_type_u_int8_t" = xyes; then :
+
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#              include <sys/types.h>
-#              include <sys/socket.h>
-int
-main ()
-{
-u_int i = sizeof(((struct sockaddr *)0)->sa_len)
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sockaddr_has_sa_len=yes
+$as_echo "#define u_int8_t uint8_t" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default
+#include <sys/types.h>
+
+"
+if test "x$ac_cv_type_u_int16_t" = xyes; then :
+
 else
-  ac_cv_sockaddr_has_sa_len=no
+
+$as_echo "#define u_int16_t uint16_t" >>confdefs.h
+
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default
+#include <sys/types.h>
+
+"
+if test "x$ac_cv_type_u_int32_t" = xyes; then :
+
+else
+
+$as_echo "#define u_int32_t uint32_t" >>confdefs.h
+
 fi
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sockaddr_has_sa_len" >&5
-$as_echo "$ac_cv_sockaddr_has_sa_len" >&6; }
-               if test $ac_cv_sockaddr_has_sa_len = yes ; then
-                       $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
+ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "$ac_includes_default
+#include <sys/types.h>
 
-       fi
+"
+if test "x$ac_cv_type_u_int64_t" = xyes; then :
+
+else
+
+$as_echo "#define u_int64_t uint64_t" >>confdefs.h
 
-if test "$ac_cv_sockaddr_has_sa_len" = no; then
-       missing_includes=yes
 fi
 
+
 #
-# Do we have the new open API?  Check for pcap_create, and assume that,
-# if we do, we also have pcap_activate() and the other new routines
-# introduced in libpcap 1.0.0.
+# Check for <inttypes.h>
 #
-for ac_func in pcap_create
+for ac_header in inttypes.h
 do :
-  ac_fn_c_check_func "$LINENO" "pcap_create" "ac_cv_func_pcap_create"
-if test "x$ac_cv_func_pcap_create" = xyes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_inttypes_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_PCAP_CREATE 1
+#define HAVE_INTTYPES_H 1
 _ACEOF
 
-fi
-done
+    #
+    # OK, we have inttypes.h, but does it define all the PRI[doxu]64 macros?
+    # Some systems have an inttypes.h that doesn't define all of them.
+    #
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inttypes.h defines the PRI[doxu]64 macros" >&5
+$as_echo_n "checking whether inttypes.h defines the PRI[doxu]64 macros... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+           #include <inttypes.h>
+           #include <stdio.h>
+           #include <sys/types.h>
+
+           main()
+           {
+             printf("%" PRId64 "\n", (uint64_t)1);
+             printf("%" PRIo64 "\n", (uint64_t)1);
+             printf("%" PRIx64 "\n", (uint64_t)1);
+             printf("%" PRIu64 "\n", (uint64_t)1);
+           }
+
 
-if test $ac_cv_func_pcap_create = "yes" ; then
-       #
-       # OK, do we have pcap_set_tstamp_type?  If so, assume we have
-       # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
-       #
-       for ac_func in pcap_set_tstamp_type
-do :
-  ac_fn_c_check_func "$LINENO" "pcap_set_tstamp_type" "ac_cv_func_pcap_set_tstamp_type"
-if test "x$ac_cv_func_pcap_set_tstamp_type" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PCAP_SET_TSTAMP_TYPE 1
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-fi
-done
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       ac_lbl_inttypes_h_defines_formats=yes
+
+else
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       ac_lbl_inttypes_h_defines_formats=no
 
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-for ac_func in pcap_findalldevs pcap_dump_flush pcap_lib_version
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+else
+
+    #
+    # We don't have inttypes.h, so it obviously can't define those
+    # macros.
+    #
+    ac_lbl_inttypes_h_defines_formats=no
 
 fi
+
 done
 
-if test $ac_cv_func_pcap_findalldevs = "yes" ; then
-    savedcppflags="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $V_INCLS"
-    ac_fn_c_check_type "$LINENO" "pcap_if_t" "ac_cv_type_pcap_if_t" "#include <pcap.h>
-"
-if test "x$ac_cv_type_pcap_if_t" = xyes; then :
+if test "$ac_lbl_inttypes_h_defines_formats" = no; then
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %lx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %lx can be used to format 64-bit integers... " >&6; }
+    if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+#          ifdef HAVE_INTTYPES_H
+           #include <inttypes.h>
+#          endif
+           #include <stdio.h>
+           #include <sys/types.h>
+
+           main()
+           {
+             uint64_t t = 1;
+             char strbuf[16+1];
+             sprintf(strbuf, "%016lx", t << 32);
+             if (strcmp(strbuf, "0000000100000000") == 0)
+               exit(0);
+             else
+               exit(1);
+           }
+
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_PCAP_IF_T 1
 _ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
 
-fi
+$as_echo "#define PRId64 \"ld\"" >>confdefs.h
 
-    CPPFLAGS="$savedcppflags"
-fi
 
-if test $ac_cv_func_pcap_lib_version = "no" ; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pcap_version is defined by libpcap" >&5
-$as_echo_n "checking whether pcap_version is defined by libpcap... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+$as_echo "#define PRIo64 \"lo\"" >>confdefs.h
 
-int
-main ()
-{
 
-       extern char pcap_version[];
+$as_echo "#define PRIx64 \"lx\"" >>confdefs.h
 
-       return (int)pcap_version;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_lbl_cv_pcap_version_defined=yes
-else
-  ac_lbl_cv_pcap_version_defined=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "#define PRIu64 \"lu\"" >>confdefs.h
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-       $as_echo "#define HAVE_PCAP_VERSION 1" >>confdefs.h
 
-    else
+else
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pcap_debug is defined by libpcap" >&5
-$as_echo_n "checking whether pcap_debug is defined by libpcap... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %llx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %llx can be used to format 64-bit integers... " >&6; }
+    if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-int
-main ()
-{
 
-       extern int pcap_debug;
+#          ifdef HAVE_INTTYPES_H
+           #include <inttypes.h>
+#          endif
+           #include <stdio.h>
+           #include <sys/types.h>
+
+           main()
+           {
+             uint64_t t = 1;
+             char strbuf[16+1];
+             sprintf(strbuf, "%016llx", t << 32);
+             if (strcmp(strbuf, "0000000100000000") == 0)
+               exit(0);
+             else
+               exit(1);
+           }
 
-       return pcap_debug;
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_lbl_cv_pcap_debug_defined=yes
-else
-  ac_lbl_cv_pcap_debug_defined=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       $as_echo "#define HAVE_PCAP_DEBUG 1" >>confdefs.h
+if ac_fn_c_try_run "$LINENO"; then :
 
-else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       #
-       # OK, what about "yydebug"?
-       #
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yydebug is defined by libpcap" >&5
-$as_echo_n "checking whether yydebug is defined by libpcap... " >&6; }
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
+$as_echo "#define PRId64 \"lld\"" >>confdefs.h
 
-               extern int yydebug;
 
-               return yydebug;
+$as_echo "#define PRIo64 \"llo\"" >>confdefs.h
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_lbl_cv_yydebug_defined=yes
-else
-  ac_lbl_cv_yydebug_defined=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-       if test "$ac_lbl_cv_yydebug_defined" = yes ; then
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               $as_echo "#define HAVE_YYDEBUG 1" >>confdefs.h
 
-       else
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-fi
-ac_fn_c_check_func "$LINENO" "bpf_dump" "ac_cv_func_bpf_dump"
-if test "x$ac_cv_func_bpf_dump" = xyes; then :
-  $as_echo "#define HAVE_BPF_DUMP 1" >>confdefs.h
+$as_echo "#define PRIx64 \"llx\"" >>confdefs.h
 
-else
-  case " $LIBOBJS " in
-  *" bpf_dump.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS bpf_dump.$ac_objext"
- ;;
-esac
 
-fi
+$as_echo "#define PRIu64 \"llu\"" >>confdefs.h
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-V_GROUP=0
-if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
-       V_GROUP=wheel
-fi
-#
-# Assume V7/BSD convention for man pages (file formats in section 5,
-# miscellaneous info in section 7).
-#
-MAN_FILE_FORMATS=5
-MAN_MISC_INFO=7
-case "$host_os" in
+else
 
-aix*)
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-$as_echo "#define _SUN 1" >>confdefs.h
 
-       ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %Lx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %Lx can be used to format 64-bit integers... " >&6; }
+    if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-hpux*)
-       #
-       # Use System V conventions for man pages.
-       #
-       MAN_FILE_FORMATS=4
-       MAN_MISC_INFO=5
-       ;;
 
-irix*)
-       V_GROUP=sys
+#          ifdef HAVE_INTTYPES_H
+           #include <inttypes.h>
+#          endif
+           #include <stdio.h>
+           #include <sys/types.h>
 
-       #
-       # Use System V conventions for man pages.
-       #
-       MAN_FILE_FORMATS=4
-       MAN_MISC_INFO=5
-       ;;
+           main()
+           {
+             uint64_t t = 1;
+             char strbuf[16+1];
+             sprintf(strbuf, "%016Lx", t << 32);
+             if (strcmp(strbuf, "0000000100000000") == 0)
+               exit(0);
+             else
+               exit(1);
+           }
 
-osf*)
-       V_GROUP=system
 
-       #
-       # Use System V conventions for man pages.
-       #
-       MAN_FILE_FORMATS=4
-       MAN_MISC_INFO=5
-       ;;
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
-solaris*)
-       V_GROUP=sys
 
-       #
-       # Use System V conventions for man pages.
-       #
-       MAN_FILE_FORMATS=4
-       MAN_MISC_INFO=5
-       ;;
-esac
+$as_echo "#define PRId64 \"Ld\"" >>confdefs.h
 
-if test -f /dev/bpf0 ; then
-       V_GROUP=bpf
-fi
 
-for ac_header in sys/bitypes.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_bitypes_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_BITYPES_H 1
-_ACEOF
+$as_echo "#define PRIo64 \"Lo\"" >>confdefs.h
 
-fi
 
-done
+$as_echo "#define PRIx64 \"Lx\"" >>confdefs.h
 
 
-ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_int8_t" = xyes; then :
+$as_echo "#define PRIu64 \"Lu\"" >>confdefs.h
 
-else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-$as_echo "#define int8_t signed char" >>confdefs.h
+else
 
-fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int8_t" = xyes; then :
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %qx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %qx can be used to format 64-bit integers... " >&6; }
+    if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
 else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+#          ifdef HAVE_INTTYPES_H
+           #include <inttypes.h>
+#          endif
+           #include <stdio.h>
+           #include <sys/types.h>
+
+           main()
+           {
+             uint64_t t = 1;
+             char strbuf[16+1];
+             sprintf(strbuf, "%016qx", t << 32);
+             if (strcmp(strbuf, "0000000100000000") == 0)
+               exit(0);
+             else
+               exit(1);
+           }
 
-$as_echo "#define u_int8_t unsigned char" >>confdefs.h
 
-fi
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
-ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default"
-if test "x$ac_cv_type_int16_t" = xyes; then :
 
-else
+$as_echo "#define PRId64 \"qd\"" >>confdefs.h
 
-$as_echo "#define int16_t short" >>confdefs.h
 
-       $ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-fi
+$as_echo "#define PRIo64 \"qo\"" >>confdefs.h
 
-ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int16_t" = xyes; then :
 
-else
+$as_echo "#define PRIx64 \"qx\"" >>confdefs.h
 
-$as_echo "#define u_int16_t unsigned short" >>confdefs.h
 
-fi
+$as_echo "#define PRIu64 \"qu\"" >>confdefs.h
 
-ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_int32_t" = xyes; then :
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
 
-$as_echo "#define int32_t int" >>confdefs.h
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+                 as_fn_error $? "neither %llx nor %Lx nor %qx worked on a 64-bit integer" "$LINENO" 5
 
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int32_t" = xyes; then :
 
-else
 
-$as_echo "#define u_int32_t unsigned int" >>confdefs.h
 
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_int64_t" = xyes; then :
 
-else
 
-$as_echo "#define int64_t long long" >>confdefs.h
 
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int64_t" = xyes; then :
 
-else
 
-$as_echo "#define u_int64_t unsigned long long" >>confdefs.h
 
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
 
+fi
+
 #
-# We can't just check for <inttypes.h> - some systems have one that
-# doesn't define all the PRI[doxu]64 macros.
+# Check for some headers introduced in later versions of libpcap
+# and used by some printers.
 #
-for ac_header in inttypes.h
+# Those headers use the {u_}intN_t types, so we must do this after
+# we check for what's needed to get them defined.
+#
+savedcppflags="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $V_INCLS"
+for ac_header in pcap/bluetooth.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
-if test "x$ac_cv_header_inttypes_h" = xyes; then :
+  ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include \"tcpdump-stdinc.h\"
+"
+if test "x$ac_cv_header_pcap_bluetooth_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_INTTYPES_H 1
+#define HAVE_PCAP_BLUETOOTH_H 1
 _ACEOF
 
-    #
-    # OK, we have inttypes.h, but does it define those macros?
-    #
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inttypes.h defines the PRI[doxu]64 macros" >&5
-$as_echo_n "checking whether inttypes.h defines the PRI[doxu]64 macros... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+fi
 
+done
 
-           #include <inttypes.h>
-           #include <stdio.h>
-           #include <sys/types.h>
-           #ifdef HAVE_SYS_BITYPES_H
-           #include <sys/bitypes.h>
-           #endif
+for ac_header in pcap/nflog.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "pcap/nflog.h" "ac_cv_header_pcap_nflog_h" "#include \"tcpdump-stdinc.h\"
+"
+if test "x$ac_cv_header_pcap_nflog_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_NFLOG_H 1
+_ACEOF
 
-           main()
-           {
-             printf("%" PRId64 "\n", (u_int64_t)1);
-             printf("%" PRIo64 "\n", (u_int64_t)1);
-             printf("%" PRIx64 "\n", (u_int64_t)1);
-             printf("%" PRIu64 "\n", (u_int64_t)1);
-           }
+fi
 
+done
 
+for ac_header in pcap/usb.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "pcap/usb.h" "ac_cv_header_pcap_usb_h" "#include \"tcpdump-stdinc.h\"
+"
+if test "x$ac_cv_header_pcap_usb_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_USB_H 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       ac_lbl_inttypes_h_defines_formats=yes
+fi
+
+done
 
+CPPFLAGS="$savedcppflags"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-       ac_lbl_inttypes_h_defines_formats=no
-
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-    #
-    # We don't have inttypes.h, so it obviously can't define those
-    # macros.
-    #
-    ac_lbl_inttypes_h_defines_formats=no
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
 fi
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
 
-if test "$ac_lbl_inttypes_h_defines_formats" = no; then
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %lx can be used to format 64-bit integers" >&5
-$as_echo_n "checking whether %lx can be used to format 64-bit integers... " >&6; }
-    if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-#          ifdef HAVE_INTTYPES_H
-           #include <inttypes.h>
-#          endif
-#          ifdef HAVE_SYS_BITYPES_H
-            #include <sys/bitypes.h>
-#          endif
-           #include <stdio.h>
-           #include <sys/types.h>
 
-           main()
-           {
-             u_int64_t t = 1;
-             char strbuf[16+1];
-             sprintf(strbuf, "%016lx", t << 32);
-             if (strcmp(strbuf, "0000000100000000") == 0)
-               exit(0);
-             else
-               exit(1);
-           }
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+  if test "x$ac_ct_AR" = x; then
+    AR=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
 
-       $as_echo "#define PRId64 \"ld\"" >>confdefs.h
 
-       $as_echo "#define PRIo64 \"lo\"" >>confdefs.h
+rm -f os-proto.h
+    if test "${LBL_CFLAGS+set}" = set; then
+           V_CCOPT="$V_CCOPT ${LBL_CFLAGS}"
+    fi
+    if test -f .devel ; then
+           #
+           # Skip all the warning option stuff on some compilers.
+           #
+           if test "$ac_lbl_cc_dont_try_gcc_dashW" != yes; then
 
-       $as_echo "#define PRIx64 \"lx\"" >>confdefs.h
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wall option" >&5
+$as_echo_n "checking whether the compiler supports the -Wall option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wall"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-       $as_echo "#define PRIu64 \"lu\"" >>confdefs.h
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wall"
 
 else
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %llx can be used to format 64-bit integers" >&5
-$as_echo_n "checking whether %llx can be used to format 64-bit integers... " >&6; }
-    if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wmissing-prototypes option" >&5
+$as_echo_n "checking whether the compiler supports the -Wmissing-prototypes option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wmissing-prototypes"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-#          ifdef HAVE_INTTYPES_H
-           #include <inttypes.h>
-#          endif
-#          ifdef HAVE_SYS_BITYPES_H
-            #include <sys/bitypes.h>
-#          endif
-           #include <stdio.h>
-           #include <sys/types.h>
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-           main()
-           {
-             u_int64_t t = 1;
-             char strbuf[16+1];
-             sprintf(strbuf, "%016llx", t << 32);
-             if (strcmp(strbuf, "0000000100000000") == 0)
-               exit(0);
-             else
-               exit(1);
-           }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wmissing-prototypes"
 
+else
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
-       $as_echo "#define PRId64 \"lld\"" >>confdefs.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-       $as_echo "#define PRIo64 \"llo\"" >>confdefs.h
 
-       $as_echo "#define PRIx64 \"llx\"" >>confdefs.h
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wstrict-prototypes option" >&5
+$as_echo_n "checking whether the compiler supports the -Wstrict-prototypes option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wstrict-prototypes"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-       $as_echo "#define PRIu64 \"llu\"" >>confdefs.h
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wstrict-prototypes"
 
 else
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %Lx can be used to format 64-bit integers" >&5
-$as_echo_n "checking whether %Lx can be used to format 64-bit integers... " >&6; }
-    if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wwrite-strings option" >&5
+$as_echo_n "checking whether the compiler supports the -Wwrite-strings option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wwrite-strings"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-#          ifdef HAVE_INTTYPES_H
-           #include <inttypes.h>
-#          endif
-#          ifdef HAVE_SYS_BITYPES_H
-            #include <sys/bitypes.h>
-#          endif
-           #include <stdio.h>
-           #include <sys/types.h>
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-           main()
-           {
-             u_int64_t t = 1;
-             char strbuf[16+1];
-             sprintf(strbuf, "%016Lx", t << 32);
-             if (strcmp(strbuf, "0000000100000000") == 0)
-               exit(0);
-             else
-               exit(1);
-           }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wwrite-strings"
 
+else
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
-       $as_echo "#define PRId64 \"Ld\"" >>confdefs.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-       $as_echo "#define PRIo64 \"Lo\"" >>confdefs.h
 
-       $as_echo "#define PRIx64 \"Lx\"" >>confdefs.h
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wpointer-arith option" >&5
+$as_echo_n "checking whether the compiler supports the -Wpointer-arith option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wpointer-arith"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-       $as_echo "#define PRIu64 \"Lu\"" >>confdefs.h
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wpointer-arith"
 
 else
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %qx can be used to format 64-bit integers" >&5
-$as_echo_n "checking whether %qx can be used to format 64-bit integers... " >&6; }
-    if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wcast-qual option" >&5
+$as_echo_n "checking whether the compiler supports the -Wcast-qual option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wcast-qual"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-#          ifdef HAVE_INTTYPES_H
-           #include <inttypes.h>
-#          endif
-#          ifdef HAVE_SYS_BITYPES_H
-            #include <sys/bitypes.h>
-#          endif
-           #include <stdio.h>
-           #include <sys/types.h>
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-           main()
-           {
-             u_int64_t t = 1;
-             char strbuf[16+1];
-             sprintf(strbuf, "%016qx", t << 32);
-             if (strcmp(strbuf, "0000000100000000") == 0)
-               exit(0);
-             else
-               exit(1);
-           }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wcast-qual"
 
+else
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
-       $as_echo "#define PRId64 \"qd\"" >>confdefs.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-       $as_echo "#define PRIo64 \"qo\"" >>confdefs.h
 
-       $as_echo "#define PRIx64 \"qx\"" >>confdefs.h
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wshadow option" >&5
+$as_echo_n "checking whether the compiler supports the -Wshadow option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wshadow"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-       $as_echo "#define PRIu64 \"qu\"" >>confdefs.h
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wshadow"
 
 else
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
-                 as_fn_error $? "neither %llx nor %Lx nor %qx worked on a 64-bit integer" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wdeclaration-after-statement option" >&5
+$as_echo_n "checking whether the compiler supports the -Wdeclaration-after-statement option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wdeclaration-after-statement"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wdeclaration-after-statement"
 
+else
 
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wpedantic option" >&5
+$as_echo_n "checking whether the compiler supports the -Wpedantic option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wpedantic"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -Wpedantic"
 
+else
 
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
-fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -W option" >&5
+$as_echo_n "checking whether the compiler supports the -W option... " >&6; }
+       save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -W"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-#
-# Check for some headers introduced in later versions of libpcap
-# and used by some printers.
-#
-# Those headers use the {u_}intN_t types, so we must do this after
-# we check for what's needed to get them defined.
-#
-savedcppflags="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $V_INCLS"
-for ac_header in pcap/bluetooth.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include <tcpdump-stdinc.h>
-"
-if test "x$ac_cv_header_pcap_bluetooth_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PCAP_BLUETOOTH_H 1
+int
+main ()
+{
+return 0
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-fi
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               CFLAGS="$save_CFLAGS"
+               V_CCOPT="$V_CCOPT -W"
 
-done
+else
 
-for ac_header in pcap/usb.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "pcap/usb.h" "ac_cv_header_pcap_usb_h" "#include <tcpdump-stdinc.h>
-"
-if test "x$ac_cv_header_pcap_usb_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PCAP_USB_H 1
-_ACEOF
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               CFLAGS="$save_CFLAGS"
 
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-done
+           fi
 
-CPPFLAGS="$savedcppflags"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports generating dependencies" >&5
+$as_echo_n "checking whether the compiler supports generating dependencies... " >&6; }
+       if test "$GCC" = yes ; then
+               #
+               # GCC, or a compiler deemed to be GCC by AC_PROG_CC (even
+               # though it's not); we assume that, in this case, the flag
+               # would be -M.
+               #
+               ac_lbl_dependency_flag="-M"
+       else
+               #
+               # Not GCC or a compiler deemed to be GCC; what platform is
+               # this?  (We're assuming that if the compiler isn't GCC
+               # it's the compiler from the vendor of the OS; that won't
+               # necessarily be true for x86 platforms, where it might be
+               # the Intel C compiler.)
+               #
+               case "$host_os" in
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+               irix*|osf*|darwin*)
+                       #
+                       # MIPS C for IRIX, DEC C, and clang all use -M.
+                       #
+                       ac_lbl_dependency_flag="-M"
+                       ;;
 
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+               solaris*)
+                       #
+                       # Sun C uses -xM.
+                       #
+                       ac_lbl_dependency_flag="-xM"
+                       ;;
 
+               hpux*)
+                       #
+                       # HP's older C compilers don't support this.
+                       # HP's newer C compilers support this with
+                       # either +M or +Make; the older compilers
+                       # interpret +M as something completely
+                       # different, so we use +Make so we don't
+                       # think it works with the older compilers.
+                       #
+                       ac_lbl_dependency_flag="+Make"
+                       ;;
 
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+               *)
+                       #
+                       # Not one of the above; assume no support for
+                       # generating dependencies.
+                       #
+                       ac_lbl_dependency_flag=""
+                       ;;
+               esac
+       fi
 
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+       #
+       # Is ac_lbl_dependency_flag defined and, if so, does the compiler
+       # complain about it?
+       #
+       # Note: clang doesn't seem to exit with an error status when handed
+       # an unknown non-warning error, even if you pass it
+       # -Werror=unknown-warning-option.  However, it always supports
+       # -M, so the fact that this test always succeeds with clang
+       # isn't an issue.
+       #
+       if test ! -z "$ac_lbl_dependency_flag"; then
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void) { return 0; }
+_ACEOF
+               echo "$CC" $ac_lbl_dependency_flag conftest.c >&5
+               if "$CC" $ac_lbl_dependency_flag conftest.c >/dev/null 2>&1; then
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, with $ac_lbl_dependency_flag" >&5
+$as_echo "yes, with $ac_lbl_dependency_flag" >&6; }
+                       DEPENDENCY_CFLAG="$ac_lbl_dependency_flag"
+                       MKDEP='${srcdir}/mkdep'
+               else
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
+                       #
+                       # We can't run mkdep, so have "make depend" do
+                       # nothing.
+                       #
+                       MKDEP=:
+               fi
+               rm -rf conftest*
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               #
+               # We can't run mkdep, so have "make depend" do
+               # nothing.
+               #
+               MKDEP=:
+       fi
 
-rm -f os-proto.h
-    if test "${LBL_CFLAGS+set}" = set; then
-           V_CCOPT="$V_CCOPT ${LBL_CFLAGS}"
-    fi
-    if test -f .devel ; then
-           if test "$GCC" = yes ; then
-                   if test "${LBL_CFLAGS+set}" != set; then
-                           if test "$ac_cv_prog_cc_g" = yes ; then
-                                   V_CCOPT="-g $V_CCOPT"
-                           fi
-                           V_CCOPT="$V_CCOPT -Wall"
-                           if test $ac_cv_lbl_gcc_vers -gt 1 ; then
-                                   V_CCOPT="$V_CCOPT -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -W"
-                           fi
-                   fi
-           else
-                   case "$host_os" in
 
-                   irix6*)
-                           V_CCOPT="$V_CCOPT -n32"
-                           ;;
 
-                   *)
-                           ;;
-                   esac
-           fi
+           #
+           # We used to set -n32 for IRIX 6 when not using GCC (presumed
+           # to mean that we're using MIPS C or MIPSpro C); it specified
+           # the "new" faster 32-bit ABI, introduced in IRIX 6.2.  I'm
+           # not sure why that would be something to do *only* with a
+           # .devel file; why should the ABI for which we produce code
+           # depend on .devel?
+           #
            os=`echo $host_os | sed -e 's/\([0-9][0-9]*\)[^0-9].*$/\1/'`
            name="lbl/os-$os.h"
            if test -f $name ; then
@@ -7308,7 +8255,8 @@ fi
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_h_errno" >&5
 $as_echo "$ac_cv_var_h_errno" >&6; }
        if test "$ac_cv_var_h_errno" = "yes"; then
-               $as_echo "#define HAVE_H_ERRNO 1" >>confdefs.h
+
+$as_echo "#define HAVE_H_ERRNO 1" >>confdefs.h
 
        fi
 
@@ -7405,6 +8353,98 @@ done
 
 fi
 
+# Check for libcap-ng
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libcap-ng" >&5
+$as_echo_n "checking whether to use libcap-ng... " >&6; }
+# Specify location for both includes and libraries.
+want_libcap_ng=ifavailable
+
+# Check whether --with-cap_ng was given.
+if test "${with_cap_ng+set}" = set; then :
+  withval=$with_cap_ng;
+       if test $withval = no
+       then
+               want_libcap_ng=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       elif test $withval = yes
+       then
+               want_libcap_ng=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       fi
+
+else
+
+       #
+       # Use libcap-ng if it's present, otherwise don't.
+       #
+       want_libcap_ng=ifavailable
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, if available" >&5
+$as_echo "yes, if available" >&6; }
+
+fi
+
+if test "$want_libcap_ng" != "no"; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for capng_change_id in -lcap-ng" >&5
+$as_echo_n "checking for capng_change_id in -lcap-ng... " >&6; }
+if ${ac_cv_lib_cap_ng_capng_change_id+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcap-ng  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char capng_change_id ();
+int
+main ()
+{
+return capng_change_id ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_cap_ng_capng_change_id=yes
+else
+  ac_cv_lib_cap_ng_capng_change_id=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_ng_capng_change_id" >&5
+$as_echo "$ac_cv_lib_cap_ng_capng_change_id" >&6; }
+if test "x$ac_cv_lib_cap_ng_capng_change_id" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCAP_NG 1
+_ACEOF
+
+  LIBS="-lcap-ng $LIBS"
+
+fi
+
+       for ac_header in cap-ng.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "cap-ng.h" "ac_cv_header_cap_ng_h" "$ac_includes_default"
+if test "x$ac_cv_header_cap_ng_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_CAP_NG_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
 if test "$missing_includes" = "yes"; then
        CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
        V_INCLS="$V_INCLS -I$srcdir/missing"
@@ -7456,7 +8496,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
@@ -7927,16 +8967,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -7996,28 +9036,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -8039,7 +9067,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # values after options handling.
 ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -8105,10 +9133,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -8197,7 +9225,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'