Virgin import of tcpdump.org libpcap v0.5
This commit is contained in:
parent
a4b5b39fce
commit
8751327cb4
@ -1,4 +1,10 @@
|
||||
@(#) $Header: CHANGES,v 1.47 98/07/25 12:40:16 leres Exp $ (LBL)
|
||||
@(#) $Header: /tcpdump/master/libpcap/CHANGES,v 1.48 1999/10/30 23:50:43 itojun Exp $ (LBL)
|
||||
|
||||
Sun Oct 19 JST 1999 itojun@iijlab.net
|
||||
* bring in KAME IPv6/IPsec bpf compiler.
|
||||
|
||||
Sometime in 1999
|
||||
* tcpdump.org imported LBL 0.4
|
||||
|
||||
v0.4 Sat Jul 25 12:40:09 PDT 1998
|
||||
|
||||
|
15
contrib/libpcap/CREDITS
Normal file
15
contrib/libpcap/CREDITS
Normal file
@ -0,0 +1,15 @@
|
||||
This file lists people who contributed to libpcap or tcpdump:
|
||||
Bill Fenner <fenner@research.att.com>
|
||||
Assar Westerlund <assar@sics.se>
|
||||
Alexei <kuznet@ms2.inr.ac.ru>
|
||||
Jun-ichiro itojun Hagino <itojun@iijlab.net>
|
||||
Guy Harris <gharris@flashcom.net>
|
||||
Torsten Landschoff <t.landschoff@gmx.net>
|
||||
Michael Richardson <mcr@sandelman.ottawa.on.ca>
|
||||
|
||||
The original LBL crew:
|
||||
Steve McCanne
|
||||
Craig Leres
|
||||
Van Jacobson
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@(#) $Header: INSTALL,v 1.42 98/03/20 18:49:16 vern Exp $ (LBL)
|
||||
@(#) $Header: /tcpdump/master/libpcap/INSTALL,v 1.42.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)
|
||||
|
||||
To build libpcap, first customize any paths in Makefile.in, then run
|
||||
"./configure" (a shell script). The configure script will determine
|
||||
|
@ -17,7 +17,7 @@
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# @(#) $Header: Makefile.in,v 1.72 97/06/30 13:56:14 leres Exp $ (LBL)
|
||||
# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.75 1999/10/30 05:33:45 itojun Exp $ (LBL)
|
||||
|
||||
#
|
||||
# Various configurable paths (remember to edit Makefile.in, not Makefile)
|
||||
@ -102,6 +102,8 @@ scanner.c: $(srcdir)/scanner.l
|
||||
$(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
|
||||
|
||||
scanner.o: scanner.c tokdefs.h
|
||||
$(CC) $(CFLAGS) -c scanner.c
|
||||
|
||||
tokdefs.h: grammar.c
|
||||
grammar.c: $(srcdir)/grammar.y
|
||||
@rm -f grammar.c tokdefs.h
|
||||
@ -114,10 +116,15 @@ grammar.o: grammar.c
|
||||
$(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
|
||||
|
||||
version.o: version.c
|
||||
$(CC) $(CFLAGS) -c version.c
|
||||
|
||||
version.c: $(srcdir)/VERSION
|
||||
@rm -f $@
|
||||
sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
|
||||
|
||||
bpf_filter.o: $(srcdir)/bpf/net/bpf_filter.c
|
||||
$(CC) $(CFLAGS) -c $(srcdir)/bpf/net/bpf_filter.c -o bpf_filter.o
|
||||
|
||||
install: force
|
||||
$(INSTALL) -m 444 -o bin -g bin libpcap.a $(DESTDIR)$(LIBDEST)/libpcap.a
|
||||
$(RANLIB) $(DESTDIR)$(LIBDEST)/libpcap.a
|
||||
@ -127,7 +134,7 @@ install-incl: force
|
||||
$(DESTDIR)$(INCLDEST)/pcap.h
|
||||
$(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap-namedb.h \
|
||||
$(DESTDIR)$(INCLDEST)/pcap-namedb.h
|
||||
$(INSTALL) -m 444 -o bin -g bin $(srcdir)/net/bpf.h \
|
||||
$(INSTALL) -m 444 -o bin -g bin $(srcdir)/bpf/net/bpf.h \
|
||||
$(DESTDIR)$(INCLDEST)/net/bpf.h
|
||||
|
||||
install-man: force
|
||||
@ -139,7 +146,7 @@ clean:
|
||||
|
||||
distclean:
|
||||
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
|
||||
gnuc.h os-proto.h bpf_filter.c net
|
||||
gnuc.h os-proto.h net
|
||||
|
||||
tags: $(TAGFILES)
|
||||
ctags -wtd $(TAGFILES)
|
||||
|
@ -1,4 +1,4 @@
|
||||
@(#) $Header: README,v 1.18 97/06/12 14:23:56 leres Exp $ (LBL)
|
||||
@(#) $Header: /tcpdump/master/libpcap/README,v 1.18.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)
|
||||
|
||||
LIBPCAP 0.4
|
||||
Lawrence Berkeley National Laboratory
|
||||
|
@ -1 +1 @@
|
||||
0.4
|
||||
0.5
|
||||
|
4
contrib/libpcap/aclocal.m4
vendored
4
contrib/libpcap/aclocal.m4
vendored
@ -1,4 +1,4 @@
|
||||
dnl @(#) $Header: aclocal.m4,v 1.63 98/06/12 03:44:50 leres Exp $ (LBL)
|
||||
dnl @(#) $Header: /tcpdump/master/libpcap/aclocal.m4,v 1.66 1999/10/30 04:41:48 itojun Exp $ (LBL)
|
||||
dnl
|
||||
dnl Copyright (c) 1995, 1996, 1997, 1998
|
||||
dnl The Regents of the University of California. All rights reserved.
|
||||
@ -51,7 +51,7 @@ AC_DEFUN(AC_LBL_C_INIT,
|
||||
$1="-O"
|
||||
$2=""
|
||||
if test "${srcdir}" != "." ; then
|
||||
$2="-I\$\(srcdir\)"
|
||||
$2="-I\$(srcdir)"
|
||||
fi
|
||||
if test "${CFLAGS+set}" = set; then
|
||||
LBL_CFLAGS="$CFLAGS"
|
||||
|
@ -37,7 +37,7 @@
|
||||
*
|
||||
* @(#)bpf.h 7.1 (Berkeley) 5/7/91
|
||||
*
|
||||
* @(#) $Header: bpf.h,v 1.36 97/06/12 14:29:53 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/bpf/net/bpf.h,v 1.37 1999/10/19 15:18:31 itojun Exp $ (LBL)
|
||||
*/
|
||||
|
||||
#ifndef BPF_MAJOR_VERSION
|
||||
@ -52,7 +52,11 @@ typedef u_int bpf_u_int32;
|
||||
* Alignment macros. BPF_WORDALIGN rounds up to the next
|
||||
* even multiple of BPF_ALIGNMENT.
|
||||
*/
|
||||
#ifndef __NetBSD__
|
||||
#define BPF_ALIGNMENT sizeof(bpf_int32)
|
||||
#else
|
||||
#define BPF_ALIGNMENT sizeof(long)
|
||||
#endif
|
||||
#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
|
||||
|
||||
#define BPF_MAXINSNS 512
|
||||
@ -168,10 +172,21 @@ struct bpf_hdr {
|
||||
#define DLT_SLIP 8 /* Serial Line IP */
|
||||
#define DLT_PPP 9 /* Point-to-point Protocol */
|
||||
#define DLT_FDDI 10 /* FDDI */
|
||||
#ifdef __FreeBSD__
|
||||
#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
|
||||
#define DLT_RAW 12 /* raw IP */
|
||||
#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
|
||||
#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
|
||||
#endif
|
||||
#ifdef __OpenBSD__
|
||||
#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
|
||||
#define DLT_LOOP 12 /* loopback */
|
||||
#endif
|
||||
/* offset to avoid collision with BSD/OS values */
|
||||
#ifndef DLT_ATM_RFC1483
|
||||
#define DLT_ATM_RFC1483 100 /* LLC/SNAP encapsulated atm */
|
||||
#endif
|
||||
#define DLT_RAW 101 /* raw IP */
|
||||
#define DLT_SLIP_BSDOS 102 /* BSD/OS Serial Line IP */
|
||||
#define DLT_PPP_BSDOS 103 /* BSD/OS Point-to-point Protocol */
|
||||
#define DLT_CHDLC 104 /* Cisco HDLC */
|
||||
|
||||
/*
|
||||
* The instruction encondings.
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
#if !(defined(lint) || defined(KERNEL))
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: bpf_filter.c,v 1.33 97/04/26 13:37:18 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/bpf/net/bpf_filter.c,v 1.33.1.1 1999/10/07 23:46:41 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: bpf_image.c,v 1.22 96/09/26 23:27:56 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/bpf_image.c,v 1.22.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
345
contrib/libpcap/configure
vendored
345
contrib/libpcap/configure
vendored
@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.12
|
||||
# Generated automatically using autoconf version 2.13
|
||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
@ -13,8 +13,12 @@ ac_default_prefix=/usr/local
|
||||
# Any additions from configure.in:
|
||||
ac_help="$ac_help
|
||||
--without-gcc don't use gcc"
|
||||
ac_help="$ac_help
|
||||
--disable-protochain disable \"protochain\" insn"
|
||||
ac_help="$ac_help
|
||||
--with-pcap=TYPE use packet capture TYPE"
|
||||
ac_help="$ac_help
|
||||
--enable-ipv6 build IPv6-capable version"
|
||||
ac_help="$ac_help
|
||||
--without-flex don't use flex"
|
||||
ac_help="$ac_help
|
||||
@ -57,6 +61,7 @@ mandir='${prefix}/man'
|
||||
# Initialize some other variables.
|
||||
subdirs=
|
||||
MFLAGS= MAKEFLAGS=
|
||||
SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Maximum number of lines to put in a shell here document.
|
||||
ac_max_here_lines=12
|
||||
|
||||
@ -340,7 +345,7 @@ EOF
|
||||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.12"
|
||||
echo "configure generated by autoconf version 2.13"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
@ -510,9 +515,11 @@ ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
ac_exeext=
|
||||
ac_objext=o
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
||||
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
||||
@ -569,33 +576,33 @@ esac
|
||||
|
||||
|
||||
# Make sure we can run config.sub.
|
||||
if $ac_config_sub sun4 >/dev/null 2>&1; then :
|
||||
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
|
||||
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:578: checking host system type" >&5
|
||||
echo "configure:585: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
NONE)
|
||||
case $nonopt in
|
||||
NONE)
|
||||
if host_alias=`$ac_config_guess`; then :
|
||||
if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
|
||||
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
|
||||
fi ;;
|
||||
*) host_alias=$nonopt ;;
|
||||
esac ;;
|
||||
esac
|
||||
|
||||
host=`$ac_config_sub $host_alias`
|
||||
host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
|
||||
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$host" 1>&6
|
||||
|
||||
echo $ac_n "checking target system type""... $ac_c" 1>&6
|
||||
echo "configure:599: checking target system type" >&5
|
||||
echo "configure:606: checking target system type" >&5
|
||||
|
||||
target_alias=$target
|
||||
case "$target_alias" in
|
||||
@ -606,14 +613,14 @@ NONE)
|
||||
esac ;;
|
||||
esac
|
||||
|
||||
target=`$ac_config_sub $target_alias`
|
||||
target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
|
||||
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$target" 1>&6
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:617: checking build system type" >&5
|
||||
echo "configure:624: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@ -624,7 +631,7 @@ NONE)
|
||||
esac ;;
|
||||
esac
|
||||
|
||||
build=`$ac_config_sub $build_alias`
|
||||
build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
|
||||
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
@ -655,7 +662,7 @@ fi
|
||||
V_CCOPT="-O"
|
||||
V_INCLS=""
|
||||
if test "${srcdir}" != "." ; then
|
||||
V_INCLS="-I\$\(srcdir\)"
|
||||
V_INCLS="-I\$(srcdir)"
|
||||
fi
|
||||
if test "${CFLAGS+set}" = set; then
|
||||
LBL_CFLAGS="$CFLAGS"
|
||||
@ -667,15 +674,16 @@ fi
|
||||
# Extract the first word of "shlicc2", so it can be a program name with args.
|
||||
set dummy shlicc2; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:671: checking for $ac_word" >&5
|
||||
echo "configure:678: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_SHLICC2'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$SHLICC2"; then
|
||||
ac_cv_prog_SHLICC2="$SHLICC2" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
|
||||
ac_dummy="$PATH"
|
||||
for ac_dir in $ac_dummy; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_SHLICC2="yes"
|
||||
@ -707,15 +715,16 @@ fi
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:711: checking for $ac_word" >&5
|
||||
echo "configure:719: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$CC"; then
|
||||
ac_cv_prog_CC="$CC" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
|
||||
ac_dummy="$PATH"
|
||||
for ac_dir in $ac_dummy; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_CC="gcc"
|
||||
@ -736,16 +745,17 @@ if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:740: checking for $ac_word" >&5
|
||||
echo "configure:749: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$CC"; then
|
||||
ac_cv_prog_CC="$CC" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
|
||||
ac_prog_rejected=no
|
||||
for ac_dir in $PATH; do
|
||||
ac_dummy="$PATH"
|
||||
for ac_dir in $ac_dummy; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
|
||||
@ -780,25 +790,61 @@ else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
if test -z "$CC"; then
|
||||
case "`uname -s`" in
|
||||
*win32* | *WIN32*)
|
||||
# Extract the first word of "cl", so it can be a program name with args.
|
||||
set dummy cl; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:800: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$CC"; then
|
||||
ac_cv_prog_CC="$CC" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
|
||||
ac_dummy="$PATH"
|
||||
for ac_dir in $ac_dummy; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_CC="cl"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
fi
|
||||
fi
|
||||
CC="$ac_cv_prog_CC"
|
||||
if test -n "$CC"; then
|
||||
echo "$ac_t""$CC" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:788: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:832: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 798 "configure"
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 843 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -812,18 +858,24 @@ else
|
||||
ac_cv_prog_cc_works=no
|
||||
fi
|
||||
rm -fr conftest*
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
|
||||
if test $ac_cv_prog_cc_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:822: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:874: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:827: checking whether we are using GNU C" >&5
|
||||
echo "configure:879: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -832,7 +884,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
@ -843,11 +895,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
|
||||
|
||||
if test $ac_cv_prog_gcc = yes; then
|
||||
GCC=yes
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:851: checking whether ${CC-cc} accepts -g" >&5
|
||||
else
|
||||
GCC=
|
||||
fi
|
||||
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:907: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -862,16 +918,20 @@ rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
|
||||
if test "$ac_test_CFLAGS" = set; then
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
elif test $ac_cv_prog_cc_g = yes; then
|
||||
if test "$ac_test_CFLAGS" = set; then
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
elif test $ac_cv_prog_cc_g = yes; then
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="-g -O2"
|
||||
else
|
||||
CFLAGS="-O2"
|
||||
CFLAGS="-g"
|
||||
fi
|
||||
else
|
||||
GCC=
|
||||
test "${CFLAGS+set}" = set || CFLAGS="-g"
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="-O2"
|
||||
else
|
||||
CFLAGS=
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$GCC" = yes ; then
|
||||
@ -880,7 +940,7 @@ fi
|
||||
V_CCOPT="-O2"
|
||||
else
|
||||
echo $ac_n "checking gcc version""... $ac_c" 1>&6
|
||||
echo "configure:884: checking gcc version" >&5
|
||||
echo "configure:944: checking gcc version" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_gcc_vers'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -898,19 +958,19 @@ fi
|
||||
fi
|
||||
else
|
||||
echo $ac_n "checking that $CC handles ansi prototypes""... $ac_c" 1>&6
|
||||
echo "configure:902: checking that $CC handles ansi prototypes" >&5
|
||||
echo "configure:962: checking that $CC handles ansi prototypes" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_cc_ansi_prototypes'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 907 "configure"
|
||||
#line 967 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
int main() {
|
||||
int frob(int, char *)
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_lbl_cc_ansi_prototypes=yes
|
||||
else
|
||||
@ -928,21 +988,21 @@ fi
|
||||
|
||||
hpux*)
|
||||
echo $ac_n "checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)""... $ac_c" 1>&6
|
||||
echo "configure:932: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5
|
||||
echo "configure:992: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5
|
||||
savedcflags="$CFLAGS"
|
||||
CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS"
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_cc_hpux_cc_aa'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 939 "configure"
|
||||
#line 999 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
int main() {
|
||||
int frob(int, char *)
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_lbl_cc_hpux_cc_aa=yes
|
||||
else
|
||||
@ -986,12 +1046,12 @@ EOF
|
||||
|
||||
ultrix*)
|
||||
echo $ac_n "checking that Ultrix $CC hacks const in prototypes""... $ac_c" 1>&6
|
||||
echo "configure:990: checking that Ultrix $CC hacks const in prototypes" >&5
|
||||
echo "configure:1050: checking that Ultrix $CC hacks const in prototypes" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_cc_const_proto'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 995 "configure"
|
||||
#line 1055 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
int main() {
|
||||
@ -999,7 +1059,7 @@ struct a { int b; };
|
||||
void c(const struct a *)
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_lbl_cc_const_proto=yes
|
||||
else
|
||||
@ -1024,7 +1084,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1028: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1088: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@ -1039,14 +1099,14 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1043 "configure"
|
||||
#line 1103 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
{ (eval echo configure:1109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
else
|
||||
@ -1056,14 +1116,31 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1060 "configure"
|
||||
#line 1120 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
{ (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -nologo -E"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1137 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
else
|
||||
@ -1075,6 +1152,8 @@ else
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
rm -f conftest*
|
||||
ac_cv_prog_CPP="$CPP"
|
||||
fi
|
||||
@ -1088,18 +1167,18 @@ for ac_hdr in malloc.h sys/ioccom.h sys/sockio.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:1092: checking for $ac_hdr" >&5
|
||||
echo "configure:1171: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1097 "configure"
|
||||
#line 1176 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
{ (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=yes"
|
||||
@ -1127,12 +1206,12 @@ done
|
||||
|
||||
if test "$GCC" = yes ; then
|
||||
echo $ac_n "checking for ANSI ioctl definitions""... $ac_c" 1>&6
|
||||
echo "configure:1131: checking for ANSI ioctl definitions" >&5
|
||||
echo "configure:1210: checking for ANSI ioctl definitions" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_gcc_fixincludes'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1136 "configure"
|
||||
#line 1215 "configure"
|
||||
#include "confdefs.h"
|
||||
/*
|
||||
* This generates a "duplicate case value" when fixincludes
|
||||
@ -1151,7 +1230,7 @@ switch (0) {
|
||||
}
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_lbl_gcc_fixincludes=yes
|
||||
else
|
||||
@ -1174,12 +1253,12 @@ fi
|
||||
for ac_func in ether_hostton strerror
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:1178: checking for $ac_func" >&5
|
||||
echo "configure:1257: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1183 "configure"
|
||||
#line 1262 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -1202,7 +1281,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -1227,6 +1306,28 @@ fi
|
||||
done
|
||||
|
||||
|
||||
echo $ac_n "checking if --disable-protochain option is specified""... $ac_c" 1>&6
|
||||
echo "configure:1311: checking if --disable-protochain option is specified" >&5
|
||||
# Check whether --enable-protochain or --disable-protochain was given.
|
||||
if test "${enable_protochain+set}" = set; then
|
||||
enableval="$enable_protochain"
|
||||
:
|
||||
fi
|
||||
|
||||
case "x$enable_protochain" in
|
||||
xyes) enable_protochain=enabled ;;
|
||||
xno) enable_protochain=disabled ;;
|
||||
x) enable_protochain=enabled ;;
|
||||
esac
|
||||
|
||||
if test "$enable_protochain" = "disabled"; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define NO_PROTOCHAIN 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
echo "$ac_t""${enable_protochain}" 1>&6
|
||||
|
||||
# Check whether --with-pcap or --without-pcap was given.
|
||||
if test "${with_pcap+set}" = set; then
|
||||
withval="$with_pcap"
|
||||
@ -1234,7 +1335,7 @@ if test "${with_pcap+set}" = set; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking packet capture type""... $ac_c" 1>&6
|
||||
echo "configure:1238: checking packet capture type" >&5
|
||||
echo "configure:1339: checking packet capture type" >&5
|
||||
if test ! -z "$with_pcap" ; then
|
||||
V_PCAP="$withval"
|
||||
elif test -r /dev/bpf0 ; then
|
||||
@ -1264,6 +1365,22 @@ else
|
||||
fi
|
||||
echo "$ac_t""$V_PCAP" 1>&6
|
||||
|
||||
echo $ac_n "checking if --enable-ipv6 option is specified""... $ac_c" 1>&6
|
||||
echo "configure:1370: checking if --enable-ipv6 option is specified" >&5
|
||||
# Check whether --enable-ipv6 or --disable-ipv6 was given.
|
||||
if test "${enable_ipv6+set}" = set; then
|
||||
enableval="$enable_ipv6"
|
||||
:
|
||||
fi
|
||||
|
||||
if test "$enable_ipv6" = "yes"; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define INET6 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
echo "$ac_t""${enable_ipv6-no}" 1>&6
|
||||
|
||||
case "$V_PCAP" in
|
||||
|
||||
dlpi)
|
||||
@ -1271,18 +1388,18 @@ dlpi)
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:1275: checking for $ac_hdr" >&5
|
||||
echo "configure:1392: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1280 "configure"
|
||||
#line 1397 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
{ (eval echo configure:1402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=yes"
|
||||
@ -1308,7 +1425,7 @@ fi
|
||||
done
|
||||
|
||||
echo $ac_n "checking for /dev/dlpi device""... $ac_c" 1>&6
|
||||
echo "configure:1312: checking for /dev/dlpi device" >&5
|
||||
echo "configure:1429: checking for /dev/dlpi device" >&5
|
||||
if test -c /dev/dlpi ; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
cat >> confdefs.h <<\EOF
|
||||
@ -1319,7 +1436,7 @@ EOF
|
||||
echo "$ac_t""no" 1>&6
|
||||
dir="/dev/dlpi"
|
||||
echo $ac_n "checking for $dir directory""... $ac_c" 1>&6
|
||||
echo "configure:1323: checking for $dir directory" >&5
|
||||
echo "configure:1440: checking for $dir directory" >&5
|
||||
if test -d $dir ; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
cat >> confdefs.h <<EOF
|
||||
@ -1337,18 +1454,18 @@ linux)
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:1341: checking for $ac_hdr" >&5
|
||||
echo "configure:1458: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1346 "configure"
|
||||
#line 1463 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
{ (eval echo configure:1468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=yes"
|
||||
@ -1374,7 +1491,7 @@ fi
|
||||
done
|
||||
|
||||
echo $ac_n "checking Linux kernel version""... $ac_c" 1>&6
|
||||
echo "configure:1378: checking Linux kernel version" >&5
|
||||
echo "configure:1495: checking Linux kernel version" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_linux_vers'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1415,15 +1532,16 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1419: checking for $ac_word" >&5
|
||||
echo "configure:1536: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_V_LEX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$V_LEX"; then
|
||||
ac_cv_prog_V_LEX="$V_LEX" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
|
||||
ac_dummy="$PATH"
|
||||
for ac_dir in $ac_dummy; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_V_LEX="$ac_prog"
|
||||
@ -1448,7 +1566,7 @@ test -n "$V_LEX" || V_LEX="lex"
|
||||
if test "$V_LEX" = flex ; then
|
||||
# The -V flag was added in 2.4
|
||||
echo $ac_n "checking for flex 2.4 or higher""... $ac_c" 1>&6
|
||||
echo "configure:1452: checking for flex 2.4 or higher" >&5
|
||||
echo "configure:1570: checking for flex 2.4 or higher" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_flex_v24'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1474,15 +1592,16 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1478: checking for $ac_word" >&5
|
||||
echo "configure:1596: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_V_YACC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$V_YACC"; then
|
||||
ac_cv_prog_V_YACC="$V_YACC" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
|
||||
ac_dummy="$PATH"
|
||||
for ac_dir in $ac_dummy; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_V_YACC="$ac_prog"
|
||||
@ -1548,19 +1667,19 @@ EOF
|
||||
|
||||
sinix*)
|
||||
echo $ac_n "checking if SINIX compiler defines sinix""... $ac_c" 1>&6
|
||||
echo "configure:1552: checking if SINIX compiler defines sinix" >&5
|
||||
echo "configure:1671: checking if SINIX compiler defines sinix" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_cc_sinix_defined'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1557 "configure"
|
||||
#line 1676 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
int i = sinix;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_cc_sinix_defined=yes
|
||||
else
|
||||
@ -1598,15 +1717,16 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1602: checking for $ac_word" >&5
|
||||
echo "configure:1721: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_V_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test -n "$V_RANLIB"; then
|
||||
ac_cv_prog_V_RANLIB="$V_RANLIB" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
|
||||
ac_dummy="$PATH"
|
||||
for ac_dir in $ac_dummy; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_V_RANLIB="$ac_prog"
|
||||
@ -1668,12 +1788,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking if sockaddr struct has sa_len member""... $ac_c" 1>&6
|
||||
echo "configure:1672: checking if sockaddr struct has sa_len member" >&5
|
||||
echo "configure:1792: checking if sockaddr struct has sa_len member" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_sockaddr_has_sa_len'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1677 "configure"
|
||||
#line 1797 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
# include <sys/types.h>
|
||||
@ -1682,7 +1802,7 @@ int main() {
|
||||
u_int i = sizeof(((struct sockaddr *)0)->sa_len)
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_lbl_sockaddr_has_sa_len=yes
|
||||
else
|
||||
@ -1703,7 +1823,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6
|
||||
echo "configure:1707: checking if unaligned accesses fail" >&5
|
||||
echo "configure:1827: checking if unaligned accesses fail" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1765,21 +1885,13 @@ EOF
|
||||
|
||||
fi
|
||||
|
||||
if test "${srcdir}" = "." ; then
|
||||
srcdirprefix=""
|
||||
else
|
||||
srcdirprefix="./"
|
||||
fi
|
||||
|
||||
if test -r ${srcdirprefix}lbl/gnuc.h ; then
|
||||
if test -r ${srcdir}/lbl/gnuc.h ; then
|
||||
rm -f gnuc.h
|
||||
ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
|
||||
ln -s ${srcdir}/lbl/gnuc.h gnuc.h
|
||||
fi
|
||||
|
||||
rm -f bpf_filter.c
|
||||
ln -s ${srcdirprefix}bpf/net/bpf_filter.c bpf_filter.c
|
||||
rm -f net
|
||||
ln -s ${srcdirprefix}bpf/net net
|
||||
ln -s ${srcdir}/bpf/net net
|
||||
|
||||
|
||||
|
||||
@ -1795,28 +1907,30 @@ ln -s ${srcdirprefix}bpf/net net
|
||||
# SunOS /usr/etc/install
|
||||
# IRIX /sbin/install
|
||||
# AIX /bin/install
|
||||
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
|
||||
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
|
||||
echo "configure:1803: checking for a BSD compatible install" >&5
|
||||
echo "configure:1916: checking for a BSD compatible install" >&5
|
||||
if test -z "$INSTALL"; then
|
||||
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
|
||||
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
|
||||
for ac_dir in $PATH; do
|
||||
# Account for people who put trailing slashes in PATH elements.
|
||||
case "$ac_dir/" in
|
||||
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
|
||||
*)
|
||||
# OSF1 and SCO ODT 3.0 have their own names for install.
|
||||
for ac_prog in ginstall installbsd scoinst install; do
|
||||
# Don't use installbsd from OSF since it installs stuff as root
|
||||
# by default.
|
||||
for ac_prog in ginstall scoinst install; do
|
||||
if test -f $ac_dir/$ac_prog; then
|
||||
if test $ac_prog = install &&
|
||||
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
|
||||
# AIX install. It has an incompatible calling convention.
|
||||
# OSF/1 installbsd also uses dspmsg, but is usable.
|
||||
:
|
||||
else
|
||||
ac_cv_path_install="$ac_dir/$ac_prog -c"
|
||||
@ -1846,6 +1960,8 @@ echo "$ac_t""$INSTALL" 1>&6
|
||||
# It thinks the first close brace ends the variable substitution.
|
||||
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
|
||||
|
||||
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
|
||||
|
||||
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||
|
||||
|
||||
@ -1872,7 +1988,7 @@ EOF
|
||||
# Ultrix sh set writes to stderr and can't be redirected directly,
|
||||
# and sets the high bit in the cache file unless we assign to the vars.
|
||||
(set) 2>&1 |
|
||||
case `(ac_space=' '; set) 2>&1` in
|
||||
case `(ac_space=' '; set | grep ac_space) 2>&1` in
|
||||
*ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
||||
# turns \\\\ into \\, and sed turns \\ into \).
|
||||
@ -1951,7 +2067,7 @@ do
|
||||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.12"
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.13"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
@ -1971,9 +2087,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
|
||||
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
|
||||
$ac_vpsub
|
||||
$extrasub
|
||||
s%@SHELL@%$SHELL%g
|
||||
s%@CFLAGS@%$CFLAGS%g
|
||||
s%@CPPFLAGS@%$CPPFLAGS%g
|
||||
s%@CXXFLAGS@%$CXXFLAGS%g
|
||||
s%@FFLAGS@%$FFLAGS%g
|
||||
s%@DEFS@%$DEFS%g
|
||||
s%@LDFLAGS@%$LDFLAGS%g
|
||||
s%@LIBS@%$LIBS%g
|
||||
@ -2017,6 +2135,7 @@ s%@V_CCOPT@%$V_CCOPT%g
|
||||
s%@V_INCLS@%$V_INCLS%g
|
||||
s%@V_PCAP@%$V_PCAP%g
|
||||
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
|
||||
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
|
||||
s%@INSTALL_DATA@%$INSTALL_DATA%g
|
||||
|
||||
CEOF
|
||||
|
@ -1,4 +1,4 @@
|
||||
dnl @(#) $Header: configure.in,v 1.67 97/07/27 22:16:17 leres Exp $ (LBL)
|
||||
dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.71 1999/11/01 15:56:40 itojun Exp $ (LBL)
|
||||
dnl
|
||||
dnl Copyright (c) 1994, 1995, 1996, 1997
|
||||
dnl The Regents of the University of California. All rights reserved.
|
||||
@ -24,6 +24,20 @@ AC_LBL_FIXINCLUDES
|
||||
|
||||
AC_CHECK_FUNCS(ether_hostton strerror)
|
||||
|
||||
dnl to pacify those who hate protochain insn
|
||||
AC_MSG_CHECKING(if --disable-protochain option is specified)
|
||||
AC_ARG_ENABLE(protochain, [ --disable-protochain disable \"protochain\" insn])
|
||||
case "x$enable_protochain" in
|
||||
xyes) enable_protochain=enabled ;;
|
||||
xno) enable_protochain=disabled ;;
|
||||
x) enable_protochain=enabled ;;
|
||||
esac
|
||||
|
||||
if test "$enable_protochain" = "disabled"; then
|
||||
AC_DEFINE(NO_PROTOCHAIN)
|
||||
fi
|
||||
AC_MSG_RESULT(${enable_protochain})
|
||||
|
||||
dnl
|
||||
dnl Not all versions of test support -c (character special) but it's a
|
||||
dnl better way of testing since the device might be protected. So we
|
||||
@ -61,6 +75,13 @@ else
|
||||
fi
|
||||
AC_MSG_RESULT($V_PCAP)
|
||||
|
||||
AC_MSG_CHECKING(if --enable-ipv6 option is specified)
|
||||
AC_ARG_ENABLE(ipv6, [ --enable-ipv6 build IPv6-capable version])
|
||||
if test "$enable_ipv6" = "yes"; then
|
||||
AC_DEFINE(INET6)
|
||||
fi
|
||||
AC_MSG_RESULT(${enable_ipv6-no})
|
||||
|
||||
case "$V_PCAP" in
|
||||
|
||||
dlpi)
|
||||
@ -156,21 +177,13 @@ AC_LBL_SOCKADDR_SA_LEN
|
||||
|
||||
AC_LBL_UNALIGNED_ACCESS
|
||||
|
||||
if test "${srcdir}" = "." ; then
|
||||
srcdirprefix=""
|
||||
else
|
||||
srcdirprefix="./"
|
||||
fi
|
||||
|
||||
if test -r ${srcdirprefix}lbl/gnuc.h ; then
|
||||
if test -r ${srcdir}/lbl/gnuc.h ; then
|
||||
rm -f gnuc.h
|
||||
ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
|
||||
ln -s ${srcdir}/lbl/gnuc.h gnuc.h
|
||||
fi
|
||||
|
||||
rm -f bpf_filter.c
|
||||
ln -s ${srcdirprefix}bpf/net/bpf_filter.c bpf_filter.c
|
||||
rm -f net
|
||||
ln -s ${srcdirprefix}bpf/net net
|
||||
ln -s ${srcdir}/bpf/net net
|
||||
|
||||
AC_SUBST(V_CCOPT)
|
||||
AC_SUBST(V_INCLS)
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: etherent.c,v 1.20 96/09/26 23:28:00 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/etherent.c,v 1.20.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -18,7 +18,7 @@
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: ethertype.h,v 1.6 96/07/14 18:21:49 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/ethertype.h,v 1.7 1999/10/30 04:30:13 itojun Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Types missing from some systems */
|
||||
@ -71,6 +71,9 @@
|
||||
#ifndef ETHERTYPE_AARP
|
||||
#define ETHERTYPE_AARP 0x80f3
|
||||
#endif
|
||||
#ifndef ETHERTYPE_IPV6
|
||||
#define ETHERTYPE_IPV6 0x80f3
|
||||
#endif
|
||||
#ifndef ETHERTYPE_LOOPBACK
|
||||
#define ETHERTYPE_LOOPBACK 0x9000
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: gencode.h,v 1.36 96/07/17 00:11:34 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.37 1999/10/19 15:18:29 itojun Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/*XXX*/
|
||||
@ -31,6 +31,7 @@
|
||||
#define Q_PORT 3
|
||||
#define Q_GATEWAY 4
|
||||
#define Q_PROTO 5
|
||||
#define Q_PROTOCHAIN 6
|
||||
|
||||
/* Protocol qualifiers. */
|
||||
|
||||
@ -52,6 +53,14 @@
|
||||
#define Q_MOPRC 14
|
||||
#define Q_MOPDL 15
|
||||
|
||||
|
||||
#define Q_IPV6 16
|
||||
#define Q_ICMPV6 17
|
||||
#define Q_AH 18
|
||||
#define Q_ESP 19
|
||||
|
||||
#define Q_PIM 20
|
||||
|
||||
/* Directional qualifiers. */
|
||||
|
||||
#define Q_SRC 1
|
||||
@ -62,8 +71,12 @@
|
||||
#define Q_DEFAULT 0
|
||||
#define Q_UNDEF 255
|
||||
|
||||
struct slist;
|
||||
|
||||
struct stmt {
|
||||
int code;
|
||||
struct slist *jt; /*only for relative jump in block*/
|
||||
struct slist *jf; /*only for relative jump in block*/
|
||||
bpf_int32 k;
|
||||
};
|
||||
|
||||
@ -150,6 +163,9 @@ void gen_not(struct block *);
|
||||
struct block *gen_scode(const char *, struct qual);
|
||||
struct block *gen_ecode(const u_char *, struct qual);
|
||||
struct block *gen_mcode(const char *, const char *, int, struct qual);
|
||||
#ifdef INET6
|
||||
struct block *gen_mcode6(const char *, const char *, int, struct qual);
|
||||
#endif
|
||||
struct block *gen_ncode(const char *, bpf_u_int32, struct qual);
|
||||
struct block *gen_proto_abbrev(int);
|
||||
struct block *gen_relation(int, struct arth *, struct arth *, int);
|
||||
@ -177,3 +193,5 @@ void sappend(struct slist *, struct slist *);
|
||||
/* XXX */
|
||||
#define JT(b) ((b)->et.succ)
|
||||
#define JF(b) ((b)->ef.succ)
|
||||
|
||||
extern int no_optimize;
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: grammar.y,v 1.56 96/11/02 21:54:55 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.57 1999/10/19 15:18:30 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -102,20 +102,21 @@ pcap_parse()
|
||||
%type <rblk> other
|
||||
|
||||
%token DST SRC HOST GATEWAY
|
||||
%token NET MASK PORT LESS GREATER PROTO BYTE
|
||||
%token ARP RARP IP TCP UDP ICMP IGMP IGRP
|
||||
%token NET MASK PORT LESS GREATER PROTO PROTOCHAIN BYTE
|
||||
%token ARP RARP IP TCP UDP ICMP IGMP IGRP PIM
|
||||
%token ATALK DECNET LAT SCA MOPRC MOPDL
|
||||
%token TK_BROADCAST TK_MULTICAST
|
||||
%token NUM INBOUND OUTBOUND
|
||||
%token LINK
|
||||
%token GEQ LEQ NEQ
|
||||
%token ID EID HID
|
||||
%token ID EID HID HID6
|
||||
%token LSH RSH
|
||||
%token LEN
|
||||
%token IPV6 ICMPV6 AH ESP
|
||||
|
||||
%type <s> ID
|
||||
%type <e> EID
|
||||
%type <s> HID
|
||||
%type <s> HID HID6
|
||||
%type <i> NUM
|
||||
|
||||
%left OR AND
|
||||
@ -167,6 +168,24 @@ nid: ID { $$.b = gen_scode($1, $$.q = $<blk>0.q); }
|
||||
break;
|
||||
}
|
||||
}
|
||||
| HID6 '/' NUM {
|
||||
#ifdef INET6
|
||||
$$.b = gen_mcode6($1, NULL, $3,
|
||||
$$.q = $<blk>0.q);
|
||||
#else
|
||||
bpf_error("'ip6addr/prefixlen' not supported "
|
||||
"in this configuration");
|
||||
#endif /*INET6*/
|
||||
}
|
||||
| HID6 {
|
||||
#ifdef INET6
|
||||
$$.b = gen_mcode6($1, 0, 128,
|
||||
$$.q = $<blk>0.q);
|
||||
#else
|
||||
bpf_error("'ip6addr' not supported "
|
||||
"in this configuration");
|
||||
#endif /*INET6*/
|
||||
}
|
||||
| EID { $$.b = gen_ecode($1, $$.q = $<blk>0.q); }
|
||||
| not id { gen_not($2.b); $$ = $2; }
|
||||
;
|
||||
@ -189,6 +208,7 @@ head: pqual dqual aqual { QSET($$.q, $1, $2, $3); }
|
||||
| pqual dqual { QSET($$.q, $1, $2, Q_DEFAULT); }
|
||||
| pqual aqual { QSET($$.q, $1, Q_DEFAULT, $2); }
|
||||
| pqual PROTO { QSET($$.q, $1, Q_DEFAULT, Q_PROTO); }
|
||||
| pqual PROTOCHAIN { QSET($$.q, $1, Q_DEFAULT, Q_PROTOCHAIN); }
|
||||
| pqual ndaqual { QSET($$.q, $1, Q_DEFAULT, $2); }
|
||||
;
|
||||
rterm: head id { $$ = $2; }
|
||||
@ -229,12 +249,17 @@ pname: LINK { $$ = Q_LINK; }
|
||||
| ICMP { $$ = Q_ICMP; }
|
||||
| IGMP { $$ = Q_IGMP; }
|
||||
| IGRP { $$ = Q_IGRP; }
|
||||
| PIM { $$ = Q_PIM; }
|
||||
| ATALK { $$ = Q_ATALK; }
|
||||
| DECNET { $$ = Q_DECNET; }
|
||||
| LAT { $$ = Q_LAT; }
|
||||
| SCA { $$ = Q_SCA; }
|
||||
| MOPDL { $$ = Q_MOPDL; }
|
||||
| MOPRC { $$ = Q_MOPRC; }
|
||||
| IPV6 { $$ = Q_IPV6; }
|
||||
| ICMPV6 { $$ = Q_ICMPV6; }
|
||||
| AH { $$ = Q_AH; }
|
||||
| ESP { $$ = Q_ESP; }
|
||||
;
|
||||
other: pqual TK_BROADCAST { $$ = gen_broadcast($1); }
|
||||
| pqual TK_MULTICAST { $$ = gen_multicast($1); }
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: inet.c,v 1.22 98/01/30 17:29:34 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.24.2.1 2000/01/14 18:00:50 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -89,26 +89,45 @@ pcap_lookupdev(errbuf)
|
||||
register char *cp;
|
||||
register struct ifreq *ifrp, *ifend, *ifnext, *mp;
|
||||
struct ifconf ifc;
|
||||
struct ifreq ibuf[16], ifr;
|
||||
char *buf;
|
||||
struct ifreq ifr;
|
||||
static char device[sizeof(ifrp->ifr_name) + 1];
|
||||
unsigned buf_size;
|
||||
|
||||
fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (fd < 0) {
|
||||
(void)sprintf(errbuf, "socket: %s", pcap_strerror(errno));
|
||||
return (NULL);
|
||||
}
|
||||
ifc.ifc_len = sizeof ibuf;
|
||||
ifc.ifc_buf = (caddr_t)ibuf;
|
||||
|
||||
memset((char *)ibuf, 0, sizeof(ibuf));
|
||||
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 ||
|
||||
ifc.ifc_len < sizeof(struct ifreq)) {
|
||||
(void)sprintf(errbuf, "SIOCGIFCONF: %s", pcap_strerror(errno));
|
||||
(void)close(fd);
|
||||
return (NULL);
|
||||
buf_size = 8192;
|
||||
|
||||
for (;;) {
|
||||
buf = malloc (buf_size);
|
||||
if (buf == NULL) {
|
||||
close (fd);
|
||||
(void)sprintf(errbuf, "out of memory");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ifc.ifc_len = buf_size;
|
||||
ifc.ifc_buf = buf;
|
||||
memset (buf, 0, buf_size);
|
||||
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0) {
|
||||
free (buf);
|
||||
(void)sprintf(errbuf, "SIOCGIFCONF: %s",
|
||||
pcap_strerror(errno));
|
||||
(void)close(fd);
|
||||
return (NULL);
|
||||
}
|
||||
if (ifc.ifc_len < buf_size)
|
||||
break;
|
||||
free (buf);
|
||||
buf_size *= 2;
|
||||
}
|
||||
ifrp = ibuf;
|
||||
ifend = (struct ifreq *)((char *)ibuf + ifc.ifc_len);
|
||||
|
||||
ifrp = (struct ifreq *)buf;
|
||||
ifend = (struct ifreq *)(buf + ifc.ifc_len);
|
||||
|
||||
mp = NULL;
|
||||
minunit = 666;
|
||||
@ -138,6 +157,7 @@ pcap_lookupdev(errbuf)
|
||||
(int)sizeof(ifr.ifr_name), ifr.ifr_name,
|
||||
pcap_strerror(errno));
|
||||
(void)close(fd);
|
||||
free (buf);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -153,6 +173,7 @@ pcap_lookupdev(errbuf)
|
||||
mp = ifrp;
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
(void)close(fd);
|
||||
if (mp == NULL) {
|
||||
(void)strcpy(errbuf, "no suitable device found");
|
||||
@ -186,8 +207,13 @@ pcap_lookupnet(device, netp, maskp, errbuf)
|
||||
#endif
|
||||
(void)strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
|
||||
if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) < 0) {
|
||||
(void)sprintf(errbuf, "SIOCGIFADDR: %s: %s",
|
||||
device, pcap_strerror(errno));
|
||||
if (errno == EADDRNOTAVAIL) {
|
||||
(void)sprintf(errbuf, "%s: no IPv4 address assigned",
|
||||
device);
|
||||
} else {
|
||||
(void)sprintf(errbuf, "SIOCGIFADDR: %s: %s",
|
||||
device, pcap_strerror(errno));
|
||||
}
|
||||
(void)close(fd);
|
||||
return (-1);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* @(#) $Header: gnuc.h,v 1.3 95/10/09 02:47:01 leres Exp $ (LBL) */
|
||||
/* @(#) $Header: /tcpdump/master/libpcap/lbl/gnuc.h,v 1.3.1.1 1999/10/07 23:46:41 mcr Exp $ (LBL) */
|
||||
|
||||
/* Define __P() macro, if necessary */
|
||||
#ifndef __P
|
||||
|
@ -18,7 +18,7 @@
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: os-solaris2.h,v 1.18 97/10/01 01:10:22 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/lbl/os-solaris2.h,v 1.18.1.1 1999/10/07 23:46:41 mcr Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in SunOS 5 */
|
||||
|
@ -18,7 +18,7 @@
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: os-sunos4.h,v 1.32 96/11/29 15:18:18 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/lbl/os-sunos4.h,v 1.32.1.1 1999/10/07 23:46:41 mcr Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in SunOS 4 */
|
||||
|
@ -18,7 +18,7 @@
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: os-ultrix4.h,v 1.19 96/11/29 15:33:19 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/lbl/os-ultrix4.h,v 1.19.1.1 1999/10/07 23:46:41 mcr Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/* Prototypes missing in Ultrix 4 */
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: nametoaddr.c,v 1.48 98/07/12 13:15:36 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.51 1999/11/25 08:25:35 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -41,6 +41,10 @@ struct rtentry;
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
#include <arpa/inet.h>
|
||||
#ifdef INET6
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#endif /*INET6*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -70,6 +74,7 @@ static inline int xdtoi(int);
|
||||
* Convert host name to internet address.
|
||||
* Return 0 upon failure.
|
||||
*/
|
||||
#ifndef INET6
|
||||
bpf_u_int32 **
|
||||
pcap_nametoaddr(const char *name)
|
||||
{
|
||||
@ -93,6 +98,23 @@ pcap_nametoaddr(const char *name)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
struct addrinfo *
|
||||
pcap_nametoaddr(const char *name)
|
||||
{
|
||||
struct addrinfo hints, *res;
|
||||
int error;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM; /*not really*/
|
||||
error = getaddrinfo(name, NULL, &hints, &res);
|
||||
if (error)
|
||||
return NULL;
|
||||
else
|
||||
return res;
|
||||
}
|
||||
#endif /*INET6*/
|
||||
|
||||
/*
|
||||
* Convert net name to internet address.
|
||||
@ -185,6 +207,9 @@ struct eproto eproto_db[] = {
|
||||
{ "pup", ETHERTYPE_PUP },
|
||||
{ "xns", ETHERTYPE_NS },
|
||||
{ "ip", ETHERTYPE_IP },
|
||||
#ifdef INET6
|
||||
{ "ip6", ETHERTYPE_IPV6 },
|
||||
#endif
|
||||
{ "arp", ETHERTYPE_ARP },
|
||||
{ "rarp", ETHERTYPE_REVARP },
|
||||
{ "sprite", ETHERTYPE_SPRITE },
|
||||
@ -330,7 +355,7 @@ pcap_ether_hostton(const char *name)
|
||||
}
|
||||
#else
|
||||
|
||||
#ifndef sgi
|
||||
#if !defined(sgi) && !defined(__NetBSD__)
|
||||
extern int ether_hostton(char *, struct ether_addr *);
|
||||
#endif
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: optimize.c,v 1.60 96/09/26 23:28:14 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/optimize.c,v 1.61 1999/10/19 15:18:30 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -1104,6 +1104,14 @@ opt_blk(b, do_stmts)
|
||||
int i;
|
||||
bpf_int32 aval;
|
||||
|
||||
#if 0
|
||||
for (s = b->stmts; s && s->next; s = s->next)
|
||||
if (BPF_CLASS(s->s.code) == BPF_JMP) {
|
||||
do_stmts = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize the atom values.
|
||||
* If we have no predecessors, everything is undefined.
|
||||
@ -1886,6 +1894,7 @@ convert_code_r(p)
|
||||
int slen;
|
||||
u_int off;
|
||||
int extrajmps; /* number of extra jumps inserted */
|
||||
struct slist **offset = NULL;
|
||||
|
||||
if (p == 0 || isMarked(p))
|
||||
return (1);
|
||||
@ -1902,13 +1911,90 @@ convert_code_r(p)
|
||||
|
||||
p->offset = dst - fstart;
|
||||
|
||||
/* generate offset[] for convenience */
|
||||
if (slen) {
|
||||
offset = (struct slist **)calloc(sizeof(struct slist *), slen);
|
||||
if (!offset) {
|
||||
bpf_error("not enough core");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
}
|
||||
src = p->stmts;
|
||||
for (off = 0; off < slen && src; off++) {
|
||||
#if 0
|
||||
printf("off=%d src=%x\n", off, src);
|
||||
#endif
|
||||
offset[off] = src;
|
||||
src = src->next;
|
||||
}
|
||||
|
||||
off = 0;
|
||||
for (src = p->stmts; src; src = src->next) {
|
||||
if (src->s.code == NOP)
|
||||
continue;
|
||||
dst->code = (u_short)src->s.code;
|
||||
dst->k = src->s.k;
|
||||
|
||||
/* fill block-local relative jump */
|
||||
if (BPF_CLASS(src->s.code) != BPF_JMP || src->s.code == BPF_JMP|BPF_JA) {
|
||||
#if 0
|
||||
if (src->s.jt || src->s.jf) {
|
||||
bpf_error("illegal jmp destination");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
#endif
|
||||
goto filled;
|
||||
}
|
||||
if (off == slen - 2) /*???*/
|
||||
goto filled;
|
||||
|
||||
{
|
||||
int i;
|
||||
int jt, jf;
|
||||
char *ljerr = "%s for block-local relative jump: off=%d";
|
||||
|
||||
#if 0
|
||||
printf("code=%x off=%d %x %x\n", src->s.code,
|
||||
off, src->s.jt, src->s.jf);
|
||||
#endif
|
||||
|
||||
if (!src->s.jt || !src->s.jf) {
|
||||
bpf_error(ljerr, "no jmp destination", off);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
jt = jf = 0;
|
||||
for (i = 0; i < slen; i++) {
|
||||
if (offset[i] == src->s.jt) {
|
||||
if (jt) {
|
||||
bpf_error(ljerr, "multiple matches", off);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
dst->jt = i - off - 1;
|
||||
jt++;
|
||||
}
|
||||
if (offset[i] == src->s.jf) {
|
||||
if (jf) {
|
||||
bpf_error(ljerr, "multiple matches", off);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
dst->jf = i - off - 1;
|
||||
jf++;
|
||||
}
|
||||
}
|
||||
if (!jt || !jf) {
|
||||
bpf_error(ljerr, "no destination found", off);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
}
|
||||
filled:
|
||||
++dst;
|
||||
++off;
|
||||
}
|
||||
if (offset)
|
||||
free(offset);
|
||||
|
||||
#ifdef BDEBUG
|
||||
bids[dst - fstart] = p->id + 1;
|
||||
#endif
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-bpf.c,v 1.31 98/07/12 13:14:55 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.32 1999/10/19 15:18:30 itojun Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h> /* optionally get BSD define */
|
||||
@ -47,6 +47,8 @@ static const char rcsid[] =
|
||||
#include "os-proto.h"
|
||||
#endif
|
||||
|
||||
#include "gencode.h"
|
||||
|
||||
int
|
||||
pcap_stats(pcap_t *p, struct pcap_stat *ps)
|
||||
{
|
||||
@ -202,6 +204,13 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
|
||||
sprintf(ebuf, "BIOCGDLT: %s", pcap_strerror(errno));
|
||||
goto bad;
|
||||
}
|
||||
#ifdef __OpenBSD__
|
||||
switch (v) {
|
||||
case DLT_LOOP:
|
||||
v = DLT_NULL;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#if _BSDI_VERSION - 0 >= 199510
|
||||
/* The SLIP and PPP link layer header changed in BSD/OS 2.1 */
|
||||
switch (v) {
|
||||
@ -213,6 +222,14 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
|
||||
case DLT_PPP:
|
||||
v = DLT_PPP_BSDOS;
|
||||
break;
|
||||
|
||||
case 11: /*DLT_FR*/
|
||||
v = DLT_RAW; /*XXX*/
|
||||
break;
|
||||
|
||||
case 12: /*DLT_C_HDLC*/
|
||||
v = DLT_CHDLC;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
p->linktype = v;
|
||||
@ -253,7 +270,14 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
|
||||
int
|
||||
pcap_setfilter(pcap_t *p, struct bpf_program *fp)
|
||||
{
|
||||
if (p->sf.rfile != NULL)
|
||||
/*
|
||||
* It looks that BPF code generated by gen_protochain() is not
|
||||
* compatible with some of kernel BPF code (for example BSD/OS 3.1).
|
||||
* Take a safer side for now.
|
||||
*/
|
||||
if (no_optimize)
|
||||
p->fcode = *fp;
|
||||
else if (p->sf.rfile != NULL)
|
||||
p->fcode = *fp;
|
||||
else if (ioctl(p->fd, BIOCSETF, (caddr_t)fp) < 0) {
|
||||
sprintf(p->errbuf, "BIOCSETF: %s", pcap_strerror(errno));
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-dlpi.c,v 1.52 97/10/03 19:47:47 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.52.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#) $Header: pcap-int.h,v 1.18 96/11/27 18:43:09 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap-int.h,v 1.20 1999/11/21 01:10:20 assar Exp $ (LBL)
|
||||
*/
|
||||
|
||||
#ifndef pcap_int_h
|
||||
@ -97,6 +97,27 @@ struct pcap {
|
||||
char errbuf[PCAP_ERRBUF_SIZE];
|
||||
};
|
||||
|
||||
/*
|
||||
* This is a timeval as stored in disk in a dumpfile.
|
||||
* It has to use the same types everywhere, independent of the actual
|
||||
* `struct timeval'
|
||||
*/
|
||||
|
||||
struct pcap_timeval {
|
||||
bpf_int32 tv_sec; /* seconds */
|
||||
bpf_int32 tv_usec; /* microseconds */
|
||||
};
|
||||
|
||||
/*
|
||||
* How a `pcap_pkthdr' is actually stored in the dumpfile.
|
||||
*/
|
||||
|
||||
struct pcap_sf_pkthdr {
|
||||
struct pcap_timeval ts; /* time stamp */
|
||||
bpf_u_int32 caplen; /* length of portion present */
|
||||
bpf_u_int32 len; /* length this packet (off wire) */
|
||||
};
|
||||
|
||||
int yylex(void);
|
||||
|
||||
#ifndef min
|
||||
@ -108,7 +129,7 @@ int pcap_offline_read(pcap_t *, int, pcap_handler, u_char *);
|
||||
int pcap_read(pcap_t *, int cnt, pcap_handler, u_char *);
|
||||
|
||||
/* Ultrix pads to make everything line up on a nice boundary */
|
||||
#if defined(ultrix) || defined(__alpha)
|
||||
#if defined(ultrix) || defined(__alpha) || defined(__NetBSD__)
|
||||
#define PCAP_FDDIPAD 3
|
||||
#endif
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-linux.c,v 1.15 97/10/02 22:39:37 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.15.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#) $Header: pcap-namedb.h,v 1.5 96/07/14 03:00:14 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap-namedb.h,v 1.6 1999/10/19 15:18:31 itojun Exp $ (LBL)
|
||||
*/
|
||||
|
||||
#ifndef lib_pcap_ethers_h
|
||||
@ -54,7 +54,11 @@ struct pcap_etherent *pcap_next_etherent(FILE *);
|
||||
u_char *pcap_ether_hostton(const char*);
|
||||
u_char *pcap_ether_aton(const char *);
|
||||
|
||||
#ifndef INET6
|
||||
bpf_u_int32 **pcap_nametoaddr(const char *);
|
||||
#else
|
||||
struct addrinfo *pcap_nametoaddr(const char *);
|
||||
#endif
|
||||
bpf_u_int32 pcap_nametonetaddr(const char *);
|
||||
|
||||
int pcap_nametoport(const char *, int *, int *);
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-nit.c,v 1.31 96/12/10 23:15:01 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.31.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -15,5 +15,5 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: pcap-nit.h,v 1.2 94/06/14 20:06:03 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap-nit.h,v 1.2.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)
|
||||
*/
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-null.c,v 1.7 96/12/10 23:15:01 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-null.c,v 1.7.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h> /* optionally get BSD define */
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-pf.c,v 1.54 96/12/10 23:15:01 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-pf.c,v 1.54.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -15,5 +15,5 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#) $Header: pcap-pf.h,v 1.2 94/06/14 20:06:33 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap-pf.h,v 1.2.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-snit.c,v 1.45 96/12/10 23:15:01 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.45.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap-snoop.c,v 1.20 97/04/08 21:06:17 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.20.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -225,6 +225,15 @@ controls whether optimization on the resulting code is performed.
|
||||
.I netmask
|
||||
specifies the netmask of the local net.
|
||||
.PP
|
||||
.B pcap_compile_nopcap()
|
||||
is similar to
|
||||
.B pcap_compile()
|
||||
except that instead of passing a pcap structure, one passes the
|
||||
snaplen and linktype explicitly. It is intended to be used for
|
||||
compiling filters for direct bpf usage, without necessarily having
|
||||
called
|
||||
.BR pcap_open() .
|
||||
.PP
|
||||
.B pcap_setfilter()
|
||||
is used to specify a filter program.
|
||||
.I fp
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: pcap.c,v 1.29 98/07/12 13:15:39 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.29.1.1 1999/10/07 23:46:40 mcr Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#) $Header: pcap.h,v 1.21 97/10/15 21:59:13 leres Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.22 1999/12/08 19:54:03 mcr Exp $ (LBL)
|
||||
*/
|
||||
|
||||
#ifndef lib_pcap_h
|
||||
@ -115,6 +115,8 @@ char *pcap_strerror(int);
|
||||
char *pcap_geterr(pcap_t *);
|
||||
int pcap_compile(pcap_t *, struct bpf_program *, char *, int,
|
||||
bpf_u_int32);
|
||||
int pcap_compile_nopcap(int, int, struct bpf_program *,
|
||||
char *, int, bpf_u_int32);
|
||||
/* XXX */
|
||||
int pcap_freecode(pcap_t *, struct bpf_program *);
|
||||
int pcap_datalink(pcap_t *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* @(#) $Header: ppp.h,v 1.7 95/05/04 17:52:46 mccanne Exp $ (LBL) */
|
||||
/* @(#) $Header: /tcpdump/master/libpcap/ppp.h,v 1.8 1999/10/19 15:18:31 itojun Exp $ (LBL) */
|
||||
/*
|
||||
* Point to Point Protocol (PPP) RFC1331
|
||||
*
|
||||
@ -30,6 +30,7 @@
|
||||
#define PPP_BRPDU 0x0031 /* Bridging PDU */
|
||||
#define PPP_STII 0x0033 /* Stream Protocol (ST-II) */
|
||||
#define PPP_VINES 0x0035 /* Banyan Vines */
|
||||
#define PPP_IPV6 0x0057 /* Internet Protocol version 6 */
|
||||
|
||||
#define PPP_HELLO 0x0201 /* 802.1d Hello Packets */
|
||||
#define PPP_LUXCOM 0x0231 /* Luxcom */
|
||||
@ -43,6 +44,7 @@
|
||||
#define PPP_IPXCP 0x802b /* Novell IPX Control Protocol */
|
||||
#define PPP_STIICP 0x8033 /* Strean Protocol Control Protocol */
|
||||
#define PPP_VINESCP 0x8035 /* Banyan Vines Control Protocol */
|
||||
#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
|
||||
|
||||
#define PPP_LCP 0xc021 /* Link Control Protocol */
|
||||
#define PPP_PAP 0xc023 /* Password Authentication Protocol */
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: savefile.c,v 1.37 97/10/15 21:58:58 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.38 1999/11/21 01:11:58 assar Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -194,20 +194,26 @@ pcap_open_offline(const char *fname, char *errbuf)
|
||||
static int
|
||||
sf_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char *buf, int buflen)
|
||||
{
|
||||
struct pcap_sf_pkthdr sf_hdr;
|
||||
FILE *fp = p->sf.rfile;
|
||||
|
||||
/* read the stamp */
|
||||
if (fread((char *)hdr, sizeof(struct pcap_pkthdr), 1, fp) != 1) {
|
||||
if (fread(&sf_hdr, sizeof(struct pcap_sf_pkthdr), 1, fp) != 1) {
|
||||
/* probably an EOF, though could be a truncated packet */
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (p->sf.swapped) {
|
||||
/* these were written in opposite byte order */
|
||||
hdr->caplen = SWAPLONG(hdr->caplen);
|
||||
hdr->len = SWAPLONG(hdr->len);
|
||||
hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec);
|
||||
hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec);
|
||||
hdr->caplen = SWAPLONG(sf_hdr.caplen);
|
||||
hdr->len = SWAPLONG(sf_hdr.len);
|
||||
hdr->ts.tv_sec = SWAPLONG(sf_hdr.ts.tv_sec);
|
||||
hdr->ts.tv_usec = SWAPLONG(sf_hdr.ts.tv_usec);
|
||||
} else {
|
||||
hdr->caplen = sf_hdr.caplen;
|
||||
hdr->len = sf_hdr.len;
|
||||
hdr->ts.tv_sec = sf_hdr.ts.tv_sec;
|
||||
hdr->ts.tv_usec = sf_hdr.ts.tv_usec;
|
||||
}
|
||||
/*
|
||||
* We interchanged the caplen and len fields at version 2.3,
|
||||
@ -311,10 +317,15 @@ void
|
||||
pcap_dump(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
|
||||
{
|
||||
register FILE *f;
|
||||
struct pcap_sf_pkthdr sf_hdr;
|
||||
|
||||
f = (FILE *)user;
|
||||
sf_hdr.ts.tv_sec = h->ts.tv_sec;
|
||||
sf_hdr.ts.tv_usec = h->ts.tv_usec;
|
||||
sf_hdr.caplen = h->caplen;
|
||||
sf_hdr.len = h->len;
|
||||
/* XXX we should check the return status */
|
||||
(void)fwrite((char *)h, sizeof(*h), 1, f);
|
||||
(void)fwrite(&sf_hdr, sizeof(sf_hdr), 1, f);
|
||||
(void)fwrite((char *)sp, h->caplen, 1, f);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: scanner.l,v 1.56 97/07/21 13:31:50 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.60 1999/11/17 04:09:58 assar Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -30,11 +30,16 @@ static const char rcsid[] =
|
||||
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "pcap-int.h"
|
||||
|
||||
#include "gencode.h"
|
||||
#include <pcap-namedb.h>
|
||||
#ifdef INET6
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#endif /*INET6*/
|
||||
#include "tokdefs.h"
|
||||
|
||||
#include "gnuc.h"
|
||||
@ -76,8 +81,91 @@ static char *in_buffer;
|
||||
|
||||
N ([0-9]+|(0X|0x)[0-9A-Fa-f]+)
|
||||
B ([0-9A-Fa-f][0-9A-Fa-f]?)
|
||||
W ([0-9A-Fa-f][0-9A-Fa-f]?[0-9A-Fa-f]?[0-9A-Fa-f]?)
|
||||
|
||||
%a 3000
|
||||
%a 15000
|
||||
%o 17000
|
||||
%e 6000
|
||||
%k 4000
|
||||
%p 19000
|
||||
|
||||
V680 {W}:{W}:{W}:{W}:{W}:{W}:{W}:{W}
|
||||
|
||||
V670 ::{W}:{W}:{W}:{W}:{W}:{W}:{W}
|
||||
V671 {W}::{W}:{W}:{W}:{W}:{W}:{W}
|
||||
V672 {W}:{W}::{W}:{W}:{W}:{W}:{W}
|
||||
V673 {W}:{W}:{W}::{W}:{W}:{W}:{W}
|
||||
V674 {W}:{W}:{W}:{W}::{W}:{W}:{W}
|
||||
V675 {W}:{W}:{W}:{W}:{W}::{W}:{W}
|
||||
V676 {W}:{W}:{W}:{W}:{W}:{W}::{W}
|
||||
V677 {W}:{W}:{W}:{W}:{W}:{W}:{W}::
|
||||
|
||||
V660 ::{W}:{W}:{W}:{W}:{W}:{W}
|
||||
V661 {W}::{W}:{W}:{W}:{W}:{W}
|
||||
V662 {W}:{W}::{W}:{W}:{W}:{W}
|
||||
V663 {W}:{W}:{W}::{W}:{W}:{W}
|
||||
V664 {W}:{W}:{W}:{W}::{W}:{W}
|
||||
V665 {W}:{W}:{W}:{W}:{W}::{W}
|
||||
V666 {W}:{W}:{W}:{W}:{W}:{W}::
|
||||
|
||||
V650 ::{W}:{W}:{W}:{W}:{W}
|
||||
V651 {W}::{W}:{W}:{W}:{W}
|
||||
V652 {W}:{W}::{W}:{W}:{W}
|
||||
V653 {W}:{W}:{W}::{W}:{W}
|
||||
V654 {W}:{W}:{W}:{W}::{W}
|
||||
V655 {W}:{W}:{W}:{W}:{W}::
|
||||
|
||||
V640 ::{W}:{W}:{W}:{W}
|
||||
V641 {W}::{W}:{W}:{W}
|
||||
V642 {W}:{W}::{W}:{W}
|
||||
V643 {W}:{W}:{W}::{W}
|
||||
V644 {W}:{W}:{W}:{W}::
|
||||
|
||||
V630 ::{W}:{W}:{W}
|
||||
V631 {W}::{W}:{W}
|
||||
V632 {W}:{W}::{W}
|
||||
V633 {W}:{W}:{W}::
|
||||
|
||||
V620 ::{W}:{W}
|
||||
V621 {W}::{W}
|
||||
V622 {W}:{W}::
|
||||
|
||||
V610 ::{W}
|
||||
V611 {W}::
|
||||
|
||||
V600 ::
|
||||
|
||||
V6604 {W}:{W}:{W}:{W}:{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
|
||||
V6504 ::{W}:{W}:{W}:{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6514 {W}::{W}:{W}:{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6524 {W}:{W}::{W}:{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6534 {W}:{W}:{W}::{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6544 {W}:{W}:{W}:{W}::{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6554 {W}:{W}:{W}:{W}:{W}::{N}\.{N}\.{N}\.{N}
|
||||
|
||||
V6404 ::{W}:{W}:{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6414 {W}::{W}:{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6424 {W}:{W}::{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6434 {W}:{W}:{W}::{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6444 {W}:{W}:{W}:{W}::{N}\.{N}\.{N}\.{N}
|
||||
|
||||
V6304 ::{W}:{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6314 {W}::{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6324 {W}:{W}::{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6334 {W}:{W}:{W}::{N}\.{N}\.{N}\.{N}
|
||||
|
||||
V6204 ::{W}:{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6214 {W}::{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6224 {W}:{W}::{N}\.{N}\.{N}\.{N}
|
||||
|
||||
V6104 ::{W}:{N}\.{N}\.{N}\.{N}
|
||||
V6114 {W}::{N}\.{N}\.{N}\.{N}
|
||||
|
||||
V6004 ::{N}\.{N}\.{N}\.{N}
|
||||
|
||||
|
||||
V6 ({V680}|{V670}|{V671}|{V672}|{V673}|{V674}|{V675}|{V676}|{V677}|{V660}|{V661}|{V662}|{V663}|{V664}|{V665}|{V666}|{V650}|{V651}|{V652}|{V653}|{V654}|{V655}|{V640}|{V641}|{V642}|{V643}|{V644}|{V630}|{V631}|{V632}|{V633}|{V620}|{V621}|{V622}|{V610}|{V611}|{V600}|{V6604}|{V6504}|{V6514}|{V6524}|{V6534}|{V6544}|{V6554}|{V6404}|{V6414}|{V6424}|{V6434}|{V6444}|{V6304}|{V6314}|{V6324}|{V6334}|{V6204}|{V6214}|{V6224}|{V6104}|{V6114}|{V6004})
|
||||
|
||||
%%
|
||||
dst return DST;
|
||||
@ -93,6 +181,12 @@ udp return UDP;
|
||||
icmp return ICMP;
|
||||
igmp return IGMP;
|
||||
igrp return IGRP;
|
||||
pim return PIM;
|
||||
|
||||
ip6 return IPV6;
|
||||
icmp6 return ICMPV6;
|
||||
ah return AH;
|
||||
esp return ESP;
|
||||
|
||||
atalk return ATALK;
|
||||
decnet return DECNET;
|
||||
@ -106,6 +200,13 @@ net return NET;
|
||||
mask return MASK;
|
||||
port return PORT;
|
||||
proto return PROTO;
|
||||
protochain {
|
||||
#ifdef NO_PROTOCHAIN
|
||||
bpf_error("%s not supported", yytext);
|
||||
#else
|
||||
return PROTOCHAIN;
|
||||
#endif
|
||||
}
|
||||
|
||||
gateway return GATEWAY;
|
||||
|
||||
@ -136,6 +237,21 @@ outbound return OUTBOUND;
|
||||
yylval.s = sdup((char *)yytext); return HID; }
|
||||
{B}:{B}:{B}:{B}:{B}:{B} { yylval.e = pcap_ether_aton((char *)yytext);
|
||||
return EID; }
|
||||
{V6} {
|
||||
#ifdef INET6
|
||||
struct addrinfo hints, *res;
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_INET6;
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
if (getaddrinfo(yytext, NULL, &hints, &res))
|
||||
bpf_error("bogus IPv6 address %s", yytext);
|
||||
else {
|
||||
yylval.e = sdup((char *)yytext); return HID6;
|
||||
}
|
||||
#else
|
||||
bpf_error("IPv6 address %s not supported", yytext);
|
||||
#endif /*INET6*/
|
||||
}
|
||||
{B}:+({B}:+)+ { bpf_error("bogus ethernet address %s", yytext); }
|
||||
[A-Za-z0-9][-_.A-Za-z0-9]*[.A-Za-z0-9] {
|
||||
yylval.s = sdup((char *)yytext); return ID; }
|
||||
|
Loading…
Reference in New Issue
Block a user