diff options
Diffstat (limited to 'contrib/tcpdump')
46 files changed, 137 insertions, 2814 deletions
diff --git a/contrib/tcpdump/FREEBSD-upgrade b/contrib/tcpdump/FREEBSD-upgrade new file mode 100644 index 0000000..02c2e36 --- /dev/null +++ b/contrib/tcpdump/FREEBSD-upgrade @@ -0,0 +1,28 @@ +This directory contains virgin copies of the original distribution files +on a "vendor" branch. Do not, under any circumstances, attempt to upgrade +the files in this directory via patches and a cvs commit. + +To upgrade to a newer version of tcpdump, when it is available: + 1. Unpack the new version into an empty directory. + [Do not make ANY changes to the files.] + + 2. Use the command: + cvs import -m 'Virgin import of LBL tcpdump v<version>' \ + -I linux-include src/contrib/tcpdump LBL v<version> + + For example, to do the import of version 3.2.1, I typed: + cvs import -m 'Virgin import of LBL tcpdump v3.2.1' \ + -I linux-include src/contrib/tcpdump LBL v3_2_1 + + 3. Follow the instructions printed out in step 2 to resolve any + conflicts between local FreeBSD changes and the newer version. + +Do not, under any circumstances, deviate from this procedure. + +To make local changes to tcpdump, simply patch and commit to the main +branch (aka HEAD). Never make local changes on the LBL branch. + +All local changes should be submitted to "tcpdump@ee.lbl.gov" for +inclusion in the next vendor release. + +pst@freebsd.org - 19 Aug 1996 diff --git a/contrib/tcpdump/aclocal.m4 b/contrib/tcpdump/aclocal.m4 deleted file mode 100644 index 38076b6..0000000 --- a/contrib/tcpdump/aclocal.m4 +++ /dev/null @@ -1,1256 +0,0 @@ -dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.106.2.6 2005/06/03 22:10:16 guy Exp $ (LBL) -dnl -dnl Copyright (c) 1995, 1996, 1997, 1998 -dnl The Regents of the University of California. All rights reserved. -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that: (1) source code distributions -dnl retain the above copyright notice and this paragraph in its entirety, (2) -dnl distributions including binary code include the above copyright notice and -dnl this paragraph in its entirety in the documentation or other materials -dnl provided with the distribution, and (3) all advertising materials mentioning -dnl features or use of this software display the following acknowledgement: -dnl ``This product includes software developed by the University of California, -dnl Lawrence Berkeley Laboratory and its contributors.'' Neither the name of -dnl the University nor the names of its contributors may be used to endorse -dnl or promote products derived from this software without specific prior -dnl written permission. -dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -dnl WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -dnl -dnl LBL autoconf macros -dnl - -dnl -dnl Determine which compiler we're using (cc or gcc) -dnl If using gcc, determine the version number -dnl If using cc, require that it support ansi prototypes -dnl If using gcc, use -O2 (otherwise use -O) -dnl If using cc, explicitly specify /usr/local/include -dnl -dnl usage: -dnl -dnl AC_LBL_C_INIT(copt, incls) -dnl -dnl results: -dnl -dnl $1 (copt set) -dnl $2 (incls set) -dnl CC -dnl LDFLAGS -dnl ac_cv_lbl_gcc_vers -dnl LBL_CFLAGS -dnl -AC_DEFUN(AC_LBL_C_INIT, - [AC_PREREQ(2.12) - AC_BEFORE([$0], [AC_PROG_CC]) - AC_BEFORE([$0], [AC_LBL_FIXINCLUDES]) - AC_BEFORE([$0], [AC_LBL_DEVEL]) - AC_ARG_WITH(gcc, [ --without-gcc don't use gcc]) - $1="-O" - $2="" - if test "${srcdir}" != "." ; then - $2="-I\$(srcdir)" - fi - if test "${CFLAGS+set}" = set; then - LBL_CFLAGS="$CFLAGS" - fi - if test -z "$CC" ; then - case "$host_os" in - - bsdi*) - AC_CHECK_PROG(SHLICC2, shlicc2, yes, no) - if test $SHLICC2 = yes ; then - CC=shlicc2 - export CC - fi - ;; - esac - fi - if test -z "$CC" -a "$with_gcc" = no ; then - CC=cc - export CC - fi - AC_PROG_CC - if test "$GCC" = yes ; then - if test "$SHLICC2" = yes ; then - ac_cv_lbl_gcc_vers=2 - $1="-O2" - else - AC_MSG_CHECKING(gcc version) - AC_CACHE_VAL(ac_cv_lbl_gcc_vers, - 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/\..*//'`) - AC_MSG_RESULT($ac_cv_lbl_gcc_vers) - if test $ac_cv_lbl_gcc_vers -gt 1 ; then - $1="-O2" - fi - fi - else - AC_MSG_CHECKING(that $CC handles ansi prototypes) - AC_CACHE_VAL(ac_cv_lbl_cc_ansi_prototypes, - AC_TRY_COMPILE( - [#include <sys/types.h>], - [int frob(int, char *)], - ac_cv_lbl_cc_ansi_prototypes=yes, - ac_cv_lbl_cc_ansi_prototypes=no)) - AC_MSG_RESULT($ac_cv_lbl_cc_ansi_prototypes) - if test $ac_cv_lbl_cc_ansi_prototypes = no ; then - case "$host_os" in - - hpux*) - AC_MSG_CHECKING(for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)) - savedcflags="$CFLAGS" - CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS" - AC_CACHE_VAL(ac_cv_lbl_cc_hpux_cc_aa, - AC_TRY_COMPILE( - [#include <sys/types.h>], - [int frob(int, char *)], - ac_cv_lbl_cc_hpux_cc_aa=yes, - ac_cv_lbl_cc_hpux_cc_aa=no)) - AC_MSG_RESULT($ac_cv_lbl_cc_hpux_cc_aa) - if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then - AC_MSG_ERROR(see the INSTALL doc for more info) - fi - CFLAGS="$savedcflags" - V_CCOPT="-Aa $V_CCOPT" - AC_DEFINE(_HPUX_SOURCE) - ;; - - *) - AC_MSG_ERROR(see the INSTALL doc for more info) - ;; - esac - fi - $2="$$2 -I/usr/local/include" - LDFLAGS="$LDFLAGS -L/usr/local/lib" - - case "$host_os" in - - irix*) - V_CCOPT="$V_CCOPT -xansi -signed -O" - ;; - - osf*) - V_CCOPT="$V_CCOPT -std1 -O" - ;; - - ultrix*) - AC_MSG_CHECKING(that Ultrix $CC hacks const in prototypes) - AC_CACHE_VAL(ac_cv_lbl_cc_const_proto, - AC_TRY_COMPILE( - [#include <sys/types.h>], - [struct a { int b; }; - void c(const struct a *)], - ac_cv_lbl_cc_const_proto=yes, - ac_cv_lbl_cc_const_proto=no)) - AC_MSG_RESULT($ac_cv_lbl_cc_const_proto) - if test $ac_cv_lbl_cc_const_proto = no ; then - AC_DEFINE(const,) - fi - ;; - esac - fi -]) - - -# -# Try compiling a sample of the type of code that appears in -# gencode.c with "inline", "__inline__", and "__inline". -# -# Autoconf's AC_C_INLINE, at least in autoconf 2.13, isn't good enough, -# as it just tests whether a function returning "int" can be inlined; -# at least some versions of HP's C compiler can inline that, but can't -# inline a function that returns a struct pointer. -# -AC_DEFUN(AC_LBL_C_INLINE, - [AC_MSG_CHECKING(for inline) - AC_CACHE_VAL(ac_cv_lbl_inline, [ - ac_cv_lbl_inline="" - ac_lbl_cc_inline=no - for ac_lbl_inline in inline __inline__ __inline - do - AC_TRY_COMPILE( - [#define inline $ac_lbl_inline - static inline struct iltest *foo(void); - struct iltest { - int iltest1; - int iltest2; - }; - - static inline struct iltest * - foo() - { - static struct iltest xxx; - - return &xxx; - }],,ac_lbl_cc_inline=yes,) - if test "$ac_lbl_cc_inline" = yes ; then - break; - fi - done - if test "$ac_lbl_cc_inline" = yes ; then - ac_cv_lbl_inline=$ac_lbl_inline - fi]) - if test ! -z "$ac_cv_lbl_inline" ; then - AC_MSG_RESULT($ac_cv_lbl_inline) - else - AC_MSG_RESULT(no) - fi - AC_DEFINE_UNQUOTED(inline, $ac_cv_lbl_inline, [Define as token for inline if inlining supported])]) - -dnl -dnl Use pfopen.c if available and pfopen() not in standard libraries -dnl Require libpcap -dnl Look for libpcap in .. -dnl Use the installed libpcap if there is no local version -dnl -dnl usage: -dnl -dnl AC_LBL_LIBPCAP(pcapdep, incls) -dnl -dnl results: -dnl -dnl $1 (pcapdep set) -dnl $2 (incls appended) -dnl LIBS -dnl LBL_LIBS -dnl -AC_DEFUN(AC_LBL_LIBPCAP, - [AC_REQUIRE([AC_LBL_LIBRARY_NET]) - dnl - dnl save a copy before locating libpcap.a - dnl - LBL_LIBS="$LIBS" - pfopen=/usr/examples/packetfilter/pfopen.c - if test -f $pfopen ; then - AC_CHECK_FUNCS(pfopen) - if test $ac_cv_func_pfopen = "no" ; then - AC_MSG_RESULT(Using $pfopen) - LIBS="$LIBS $pfopen" - fi - fi - AC_MSG_CHECKING(for local pcap library) - libpcap=FAIL - lastdir=FAIL - places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ - egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'` - for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do - basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'` - if test $lastdir = $basedir ; then - dnl skip alphas when an actual release is present - continue; - fi - lastdir=$dir - if test -r $dir/libpcap.a ; then - libpcap=$dir/libpcap.a - d=$dir - dnl continue and select the last one that exists - fi - done - if test $libpcap = FAIL ; then - AC_MSG_RESULT(not found) - AC_CHECK_LIB(pcap, main, libpcap="-lpcap") - if test $libpcap = FAIL ; then - AC_MSG_ERROR(see the INSTALL doc for more info) - fi - dnl - dnl Good old Red Hat Linux puts "pcap.h" in - dnl "/usr/include/pcap"; had the LBL folks done so, - dnl that would have been a good idea, but for - dnl the Red Hat folks to do so just breaks source - dnl compatibility with other systems. - dnl - dnl We work around this by assuming that, as we didn't - dnl find a local libpcap, libpcap is in /usr/lib or - dnl /usr/local/lib and that the corresponding header - dnl file is under one of those directories; if we don't - dnl find it in either of those directories, we check to - dnl see if it's in a "pcap" subdirectory of them and, - dnl if so, add that subdirectory to the "-I" list. - dnl - AC_MSG_CHECKING(for extraneous pcap header directories) - 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 - AC_MSG_RESULT(not found) - else - $2="-I$d $$2" - AC_MSG_RESULT(found -- -I$d added) - fi - else - $1=$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 - $2="-I$d $$2" - elif test -r $places/pcap.h; then - $2="-I$places $$2" - else - AC_MSG_ERROR(cannot find pcap.h, see INSTALL) - fi - AC_MSG_RESULT($libpcap) - fi - LIBS="$libpcap $LIBS" - case "$host_os" in - - aix*) - pseexe="/lib/pse.exp" - AC_MSG_CHECKING(for $pseexe) - if test -f $pseexe ; then - AC_MSG_RESULT(yes) - LIBS="$LIBS -I:$pseexe" - fi - # - # We need "-lodm" and "-lcfg", as libpcap requires them on - # AIX, and we just build a static libpcap.a and thus can't - # arrange that when you link with libpcap you automatically - # link with those libraries. - # - LIBS="$LIBS -lodm -lcfg" - ;; - esac - - dnl - dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()", - dnl and "pcap_datalink_name_to_val()", and use substitute versions - dnl if they're not present. - dnl - AC_CHECK_FUNC(pcap_list_datalinks, - AC_DEFINE(HAVE_PCAP_LIST_DATALINKS), - [ - AC_LIBOBJ(datalinks) - ]) - AC_CHECK_FUNC(pcap_set_datalink, - AC_DEFINE(HAVE_PCAP_SET_DATALINK)) - AC_CHECK_FUNC(pcap_datalink_name_to_val, - [ - AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL) - AC_CHECK_FUNC(pcap_datalink_val_to_description, - AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION), - [ - AC_LIBOBJ(dlnames) - ]) - ], - [ - AC_LIBOBJ(dlnames) - ]) - - dnl - dnl Check for "pcap_breakloop()"; you can't substitute for it if - dnl it's absent (it has hooks into the live capture routines), - dnl so just define the HAVE_ value if it's there. - dnl - AC_CHECK_FUNCS(pcap_breakloop) - - dnl - dnl Check for "pcap_dump_ftell()" and use a substitute version - dnl if it's not present. - AC_CHECK_FUNC(pcap_dump_ftell, - AC_DEFINE(HAVE_PCAP_DUMP_FTELL), - [ - AC_LIBOBJ(pcap_dump_ftell) - ]) -]) - -dnl -dnl Define RETSIGTYPE and RETSIGVAL -dnl -dnl usage: -dnl -dnl AC_LBL_TYPE_SIGNAL -dnl -dnl results: -dnl -dnl RETSIGTYPE (defined) -dnl RETSIGVAL (defined) -dnl -AC_DEFUN(AC_LBL_TYPE_SIGNAL, - [AC_BEFORE([$0], [AC_LBL_LIBPCAP]) - AC_TYPE_SIGNAL - if test "$ac_cv_type_signal" = void ; then - AC_DEFINE(RETSIGVAL,) - else - AC_DEFINE(RETSIGVAL,(0)) - fi - case "$host_os" in - - irix*) - AC_DEFINE(_BSD_SIGNALS) - ;; - - *) - dnl prefer sigaction() to sigset() - AC_CHECK_FUNCS(sigaction) - if test $ac_cv_func_sigaction = no ; then - AC_CHECK_FUNCS(sigset) - fi - ;; - esac]) - -dnl -dnl If using gcc, make sure we have ANSI ioctl definitions -dnl -dnl usage: -dnl -dnl AC_LBL_FIXINCLUDES -dnl -AC_DEFUN(AC_LBL_FIXINCLUDES, - [if test "$GCC" = yes ; then - AC_MSG_CHECKING(for ANSI ioctl definitions) - AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes, - AC_TRY_COMPILE( - [/* - * This generates a "duplicate case value" when fixincludes - * has not be run. - */ -# include <sys/types.h> -# include <sys/time.h> -# include <sys/ioctl.h> -# ifdef HAVE_SYS_IOCCOM_H -# include <sys/ioccom.h> -# endif], - [switch (0) { - case _IO('A', 1):; - case _IO('B', 1):; - }], - ac_cv_lbl_gcc_fixincludes=yes, - ac_cv_lbl_gcc_fixincludes=no)) - AC_MSG_RESULT($ac_cv_lbl_gcc_fixincludes) - if test $ac_cv_lbl_gcc_fixincludes = no ; then - # Don't cache failure - unset ac_cv_lbl_gcc_fixincludes - AC_MSG_ERROR(see the INSTALL for more info) - fi - fi]) - -dnl -dnl Check for flex, default to lex -dnl Require flex 2.4 or higher -dnl Check for bison, default to yacc -dnl Default to lex/yacc if both flex and bison are not available -dnl Define the yy prefix string if using flex and bison -dnl -dnl usage: -dnl -dnl AC_LBL_LEX_AND_YACC(lex, yacc, yyprefix) -dnl -dnl results: -dnl -dnl $1 (lex set) -dnl $2 (yacc appended) -dnl $3 (optional flex and bison -P prefix) -dnl -AC_DEFUN(AC_LBL_LEX_AND_YACC, - [AC_ARG_WITH(flex, [ --without-flex don't use flex]) - AC_ARG_WITH(bison, [ --without-bison don't use bison]) - if test "$with_flex" = no ; then - $1=lex - else - AC_CHECK_PROGS($1, flex, lex) - fi - if test "$$1" = flex ; then - # The -V flag was added in 2.4 - AC_MSG_CHECKING(for flex 2.4 or higher) - AC_CACHE_VAL(ac_cv_lbl_flex_v24, - if flex -V >/dev/null 2>&1; then - ac_cv_lbl_flex_v24=yes - else - ac_cv_lbl_flex_v24=no - fi) - AC_MSG_RESULT($ac_cv_lbl_flex_v24) - if test $ac_cv_lbl_flex_v24 = no ; then - s="2.4 or higher required" - AC_MSG_WARN(ignoring obsolete flex executable ($s)) - $1=lex - fi - fi - if test "$with_bison" = no ; then - $2=yacc - else - AC_CHECK_PROGS($2, bison, yacc) - fi - if test "$$2" = bison ; then - $2="$$2 -y" - fi - if test "$$1" != lex -a "$$2" = yacc -o "$$1" = lex -a "$$2" != yacc ; then - AC_MSG_WARN(don't have both flex and bison; reverting to lex/yacc) - $1=lex - $2=yacc - fi - if test "$$1" = flex -a -n "$3" ; then - $1="$$1 -P$3" - $2="$$2 -p $3" - fi]) - -dnl -dnl Checks to see if union wait is used with WEXITSTATUS() -dnl -dnl usage: -dnl -dnl AC_LBL_UNION_WAIT -dnl -dnl results: -dnl -dnl DECLWAITSTATUS (defined) -dnl -AC_DEFUN(AC_LBL_UNION_WAIT, - [AC_MSG_CHECKING(if union wait is used) - AC_CACHE_VAL(ac_cv_lbl_union_wait, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <sys/wait.h>], - [int status; - u_int i = WEXITSTATUS(status); - u_int j = waitpid(0, &status, 0);], - ac_cv_lbl_union_wait=no, - ac_cv_lbl_union_wait=yes)) - AC_MSG_RESULT($ac_cv_lbl_union_wait) - if test $ac_cv_lbl_union_wait = yes ; then - AC_DEFINE(DECLWAITSTATUS,union wait) - else - AC_DEFINE(DECLWAITSTATUS,int) - fi]) - -dnl -dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member -dnl -dnl usage: -dnl -dnl AC_LBL_SOCKADDR_SA_LEN -dnl -dnl results: -dnl -dnl HAVE_SOCKADDR_SA_LEN (defined) -dnl -AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN, - [AC_MSG_CHECKING(if sockaddr struct has sa_len member) - AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <sys/socket.h>], - [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], - ac_cv_lbl_sockaddr_has_sa_len=yes, - ac_cv_lbl_sockaddr_has_sa_len=no)) - AC_MSG_RESULT($ac_cv_lbl_sockaddr_has_sa_len) - if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then - AC_DEFINE(HAVE_SOCKADDR_SA_LEN) - fi]) - -dnl -dnl Checks to see if -R is used -dnl -dnl usage: -dnl -dnl AC_LBL_HAVE_RUN_PATH -dnl -dnl results: -dnl -dnl ac_cv_lbl_have_run_path (yes or no) -dnl -AC_DEFUN(AC_LBL_HAVE_RUN_PATH, - [AC_MSG_CHECKING(for ${CC-cc} -R) - AC_CACHE_VAL(ac_cv_lbl_have_run_path, - [echo 'main(){}' > conftest.c - ${CC-cc} -o conftest conftest.c -R/a1/b2/c3 >conftest.out 2>&1 - if test ! -s conftest.out ; then - ac_cv_lbl_have_run_path=yes - else - ac_cv_lbl_have_run_path=no - fi - rm -f conftest*]) - AC_MSG_RESULT($ac_cv_lbl_have_run_path) - ]) - -dnl -dnl Check whether a given format can be used to print 64-bit integers -dnl -AC_DEFUN(AC_LBL_CHECK_64BIT_FORMAT, - [ - AC_MSG_CHECKING([whether %$1x can be used to format 64-bit integers]) - AC_RUN_IFELSE( - [ - AC_LANG_SOURCE( - [[ -# 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, "%016$1x", t << 32); - if (strcmp(strbuf, "0000000100000000") == 0) - exit(0); - else - exit(1); - } - ]]) - ], - [ - AC_DEFINE(PRId64, "$1d") - AC_DEFINE(PRIo64, "$1o") - AC_DEFINE(PRIx64, "$1x") - AC_DEFINE(PRIu64, "$1u") - AC_MSG_RESULT(yes) - ], - [ - AC_MSG_RESULT(no) - $2 - ]) - ]) - -dnl -dnl Checks to see if unaligned memory accesses fail -dnl -dnl usage: -dnl -dnl AC_LBL_UNALIGNED_ACCESS -dnl -dnl results: -dnl -dnl LBL_ALIGN (DEFINED) -dnl -AC_DEFUN(AC_LBL_UNALIGNED_ACCESS, - [AC_MSG_CHECKING(if unaligned accesses fail) - AC_CACHE_VAL(ac_cv_lbl_unaligned_fail, - [case "$host_cpu" in - - # - # These are CPU types where: - # - # the CPU faults on an unaligned access, but at least some - # OSes that support that CPU catch the fault and simulate - # the unaligned access (e.g., Alpha/{Digital,Tru64} UNIX) - - # the simulation is slow, so we don't want to use it; - # - # the CPU, I infer (from the old - # - # XXX: should also check that they don't do weird things (like on arm) - # - # comment) doesn't fault on unaligned accesses, but doesn't - # do a normal unaligned fetch, either (e.g., presumably, ARM); - # - # for whatever reason, the test program doesn't work - # (this has been claimed to be the case for several of those - # CPUs - I don't know what the problem is; the problem - # was reported as "the test program dumps core" for SuperH, - # but that's what the test program is *supposed* to do - - # it dumps core before it writes anything, so the test - # for an empty output file should find an empty output - # file and conclude that unaligned accesses don't work). - # - # This run-time test won't work if you're cross-compiling, so - # in order to support cross-compiling for a particular CPU, - # we have to wire in the list of CPU types anyway, as far as - # I know, so perhaps we should just have a set of CPUs on - # which we know it doesn't work, a set of CPUs on which we - # know it does work, and have the script just fail on other - # cpu types and update it when such a failure occurs. - # - alpha*|arm*|hp*|mips*|sh*|sparc*|ia64|nv1) - ac_cv_lbl_unaligned_fail=yes - ;; - - *) - cat >conftest.c <<EOF -# include <sys/types.h> -# include <sys/wait.h> -# include <stdio.h> - unsigned char a[[5]] = { 1, 2, 3, 4, 5 }; - main() { - unsigned int i; - pid_t pid; - int status; - /* avoid "core dumped" message */ - pid = fork(); - if (pid < 0) - exit(2); - if (pid > 0) { - /* parent */ - pid = waitpid(pid, &status, 0); - if (pid < 0) - exit(3); - exit(!WIFEXITED(status)); - } - /* child */ - i = *(unsigned int *)&a[[1]]; - printf("%d\n", i); - exit(0); - } -EOF - ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \ - conftest.c $LIBS >/dev/null 2>&1 - if test ! -x conftest ; then - dnl failed to compile for some reason - ac_cv_lbl_unaligned_fail=yes - else - ./conftest >conftest.out - if test ! -s conftest.out ; then - ac_cv_lbl_unaligned_fail=yes - else - ac_cv_lbl_unaligned_fail=no - fi - fi - rm -f conftest* core core.conftest - ;; - esac]) - AC_MSG_RESULT($ac_cv_lbl_unaligned_fail) - if test $ac_cv_lbl_unaligned_fail = yes ; then - AC_DEFINE(LBL_ALIGN) - fi]) - -dnl -dnl If using gcc and the file .devel exists: -dnl Compile with -g (if supported) and -Wall -dnl If using gcc 2 or later, do extra prototype checking and some other -dnl checks -dnl If an os prototype include exists, symlink os-proto.h to it -dnl -dnl usage: -dnl -dnl AC_LBL_DEVEL(copt) -dnl -dnl results: -dnl -dnl $1 (copt appended) -dnl HAVE_OS_PROTO_H (defined) -dnl os-proto.h (symlinked) -dnl -AC_DEFUN(AC_LBL_DEVEL, - [rm -f os-proto.h - if test "${LBL_CFLAGS+set}" = set; then - $1="$$1 ${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 - $1="-g $$1" - fi - $1="$$1 -Wall" - if test $ac_cv_lbl_gcc_vers -gt 1 ; then - $1="$$1 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -W" - fi - fi - else - case "$host_os" in - - irix6*) - V_CCOPT="$V_CCOPT -n32" - ;; - - *) - ;; - esac - fi - os=`echo $host_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'` - name="lbl/os-$os.h" - if test -f $name ; then - ln -s $name os-proto.h - AC_DEFINE(HAVE_OS_PROTO_H) - else - AC_MSG_WARN(can't find $name) - fi - fi]) - -dnl -dnl Improved version of AC_CHECK_LIB -dnl -dnl Thanks to John Hawkinson (jhawk@mit.edu) -dnl -dnl usage: -dnl -dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, -dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) -dnl -dnl results: -dnl -dnl LIBS -dnl -dnl XXX - "AC_LBL_LIBRARY_NET" was redone to use "AC_SEARCH_LIBS" -dnl rather than "AC_LBL_CHECK_LIB", so this isn't used any more. -dnl We keep it around for reference purposes in case it's ever -dnl useful in the future. -dnl - -define(AC_LBL_CHECK_LIB, -[AC_MSG_CHECKING([for $2 in -l$1]) -dnl Use a cache variable name containing the library, function -dnl name, and extra libraries to link with, because the test really is -dnl for library $1 defining function $2, when linked with potinal -dnl library $5, not just for library $1. Separate tests with the same -dnl $1 and different $2's or $5's may have different results. -ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'` -AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var, -[ac_save_LIBS="$LIBS" -LIBS="-l$1 $5 $LIBS" -AC_TRY_LINK(dnl -ifelse([$2], [main], , dnl Avoid conflicting decl of main. -[/* Override any gcc2 internal prototype to avoid an error. */ -]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus -extern "C" -#endif -])dnl -[/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $2(); -]), - [$2()], - eval "ac_cv_lbl_lib_$ac_lib_var=yes", - eval "ac_cv_lbl_lib_$ac_lib_var=no") -LIBS="$ac_save_LIBS" -])dnl -if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then - AC_MSG_RESULT(yes) - ifelse([$3], , -[changequote(, )dnl - ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` -changequote([, ])dnl - AC_DEFINE_UNQUOTED($ac_tr_lib) - LIBS="-l$1 $LIBS" -], [$3]) -else - AC_MSG_RESULT(no) -ifelse([$4], , , [$4 -])dnl -fi -]) - -dnl -dnl AC_LBL_LIBRARY_NET -dnl -dnl This test is for network applications that need socket() and -dnl gethostbyname() -ish functions. Under Solaris, those applications -dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link -dnl with "-lnsl" but should *not* link with "-lsocket" because -dnl libsocket.a breaks a number of things (for instance: -dnl gethostbyname() under IRIX 5.2, and snoop sockets under most -dnl versions of IRIX). -dnl -dnl Unfortunately, many application developers are not aware of this, -dnl and mistakenly write tests that cause -lsocket to be used under -dnl IRIX. It is also easy to write tests that cause -lnsl to be used -dnl under operating systems where neither are necessary (or useful), -dnl such as SunOS 4.1.4, which uses -lnsl for TLI. -dnl -dnl This test exists so that every application developer does not test -dnl this in a different, and subtly broken fashion. - -dnl It has been argued that this test should be broken up into two -dnl seperate tests, one for the resolver libraries, and one for the -dnl libraries necessary for using Sockets API. Unfortunately, the two -dnl are carefully intertwined and allowing the autoconf user to use -dnl them independantly potentially results in unfortunate ordering -dnl dependancies -- as such, such component macros would have to -dnl carefully use indirection and be aware if the other components were -dnl executed. Since other autoconf macros do not go to this trouble, -dnl and almost no applications use sockets without the resolver, this -dnl complexity has not been implemented. -dnl -dnl The check for libresolv is in case you are attempting to link -dnl statically and happen to have a libresolv.a lying around (and no -dnl libnsl.a). -dnl -AC_DEFUN(AC_LBL_LIBRARY_NET, [ - # 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: - AC_SEARCH_LIBS(gethostbyname, nsl socket resolv) - # 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 - AC_CHECK_LIB(socket, gethostbyname, - LIBS="-lsocket -lnsl $LIBS", , -lnsl) - fi - AC_SEARCH_LIBS(socket, socket, , - AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)) - # DLPI needs putmsg under HPUX so test for -lstr while we're at it - AC_SEARCH_LIBS(putmsg, str) - ]) - -dnl Copyright (c) 1999 WIDE Project. All rights reserved. -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions -dnl are met: -dnl 1. Redistributions of source code must retain the above copyright -dnl notice, this list of conditions and the following disclaimer. -dnl 2. Redistributions in binary form must reproduce the above copyright -dnl notice, this list of conditions and the following disclaimer in the -dnl documentation and/or other materials provided with the distribution. -dnl 3. Neither the name of the project nor the names of its contributors -dnl may be used to endorse or promote products derived from this software -dnl without specific prior written permission. -dnl -dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND -dnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -dnl ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE -dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -dnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -dnl SUCH DAMAGE. - -dnl -dnl Checks to see if AF_INET6 is defined -AC_DEFUN(AC_CHECK_AF_INET6, [ - AC_MSG_CHECKING(for AF_INET6) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <sys/socket.h>], - [int a = AF_INET6], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes ; then - AC_DEFINE(HAVE_AF_INET6) - fi -]) - -dnl -dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member -dnl borrowed from LBL libpcap -AC_DEFUN(AC_CHECK_SA_LEN, [ - AC_MSG_CHECKING(if sockaddr struct has sa_len member) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <sys/socket.h>], - [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes ; then - AC_DEFINE(HAVE_SOCKADDR_SA_LEN) - fi -]) - -dnl -dnl Checks for portable prototype declaration macro -AC_DEFUN(AC_CHECK_PORTABLE_PROTO, [ - AC_MSG_CHECKING(for __P) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <unistd.h>], - [int f __P(())], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes; then - AC_DEFINE(HAVE_PORTABLE_PROTOTYPE) - fi -]) - -dnl checks for u_intXX_t -AC_DEFUN(AC_CHECK_BITTYPES, [ - $1=yes -dnl check for u_int8_t - AC_MSG_CHECKING(for u_int8_t) - AC_CACHE_VAL(ac_cv_u_int8_t, - AC_TRY_COMPILE([ -# include <sys/types.h>], - [u_int8_t i], - ac_cv_u_int8_t=yes, - ac_cv_u_int8_t=no)) - AC_MSG_RESULT($ac_cv_u_int8_t) - if test $ac_cv_u_int8_t = yes; then - AC_DEFINE(HAVE_U_INT8_T) - else - $1=no - fi -dnl check for u_int16_t - AC_MSG_CHECKING(for u_int16_t) - AC_CACHE_VAL(ac_cv_u_int16_t, - AC_TRY_COMPILE([ -# include <sys/types.h>], - [u_int16_t i], - ac_cv_u_int16_t=yes, - ac_cv_u_int16_t=no)) - AC_MSG_RESULT($ac_cv_u_int16_t) - if test $ac_cv_u_int16_t = yes; then - AC_DEFINE(HAVE_U_INT16_T) - else - $1=no - fi -dnl check for u_int32_t - AC_MSG_CHECKING(for u_int32_t) - AC_CACHE_VAL(ac_cv_u_int32_t, - AC_TRY_COMPILE([ -# include <sys/types.h>], - [u_int32_t i], - ac_cv_u_int32_t=yes, - ac_cv_u_int32_t=no)) - AC_MSG_RESULT($ac_cv_u_int32_t) - if test $ac_cv_u_int32_t = yes; then - AC_DEFINE(HAVE_U_INT32_T) - else - $1=no - fi -dnl check for u_int64_t - AC_MSG_CHECKING(for u_int64_t) - AC_CACHE_VAL(ac_cv_u_int64_t, - AC_TRY_COMPILE([ -# include <sys/types.h>], - [u_int64_t i], - ac_cv_u_int64_t=yes, - ac_cv_u_int64_t=no)) - AC_MSG_RESULT($ac_cv_u_int64_t) - if test $ac_cv_u_int64_t = yes; then - AC_DEFINE(HAVE_U_INT64_T) - else - $1=no - fi -]) - -dnl -dnl Checks for addrinfo structure -AC_DEFUN(AC_STRUCT_ADDRINFO, [ - AC_MSG_CHECKING(for addrinfo) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <netdb.h>], - [struct addrinfo a], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes; then - AC_DEFINE(HAVE_ADDRINFO) - else - AC_DEFINE(NEED_ADDRINFO_H) - fi -]) - -dnl -dnl Checks for NI_MAXSERV -AC_DEFUN(AC_NI_MAXSERV, [ - AC_MSG_CHECKING(for NI_MAXSERV) - AC_CACHE_VAL($1, - AC_EGREP_CPP(yes, [#include <netdb.h> -#ifdef NI_MAXSERV -yes -#endif], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 != yes; then - AC_DEFINE(NEED_ADDRINFO_H) - fi -]) - -dnl -dnl Checks for NI_NAMEREQD -AC_DEFUN(AC_NI_NAMEREQD, [ - AC_MSG_CHECKING(for NI_NAMEREQD) - AC_CACHE_VAL($1, - AC_EGREP_CPP(yes, [#include <netdb.h> -#ifdef NI_NOFQDN -yes -#endif], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 != yes; then - AC_DEFINE(NEED_ADDRINFO_H) - fi -]) - -dnl -dnl Checks for sockaddr_storage structure -AC_DEFUN(AC_STRUCT_SA_STORAGE, [ - AC_MSG_CHECKING(for sockaddr_storage) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <sys/socket.h>], - [struct sockaddr_storage s], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes; then - AC_DEFINE(HAVE_SOCKADDR_STORAGE) - fi -]) - -dnl -dnl Checks for macro of IP address size -AC_DEFUN(AC_CHECK_ADDRSZ, [ - $1=yes -dnl check for INADDRSZ - AC_MSG_CHECKING(for INADDRSZ) - AC_CACHE_VAL(ac_cv_inaddrsz, - AC_TRY_COMPILE([ -# include <arpa/nameser.h>], - [int a = INADDRSZ], - ac_cv_inaddrsz=yes, - ac_cv_inaddrsz=no)) - AC_MSG_RESULT($ac_cv_inaddrsz) - if test $ac_cv_inaddrsz = yes; then - AC_DEFINE(HAVE_INADDRSZ) - else - $1=no - fi -dnl check for IN6ADDRSZ - AC_MSG_CHECKING(for IN6ADDRSZ) - AC_CACHE_VAL(ac_cv_in6addrsz, - AC_TRY_COMPILE([ -# include <arpa/nameser.h>], - [int a = IN6ADDRSZ], - ac_cv_in6addrsz=yes, - ac_cv_in6addrsz=no)) - AC_MSG_RESULT($ac_cv_in6addrsz) - if test $ac_cv_in6addrsz = yes; then - AC_DEFINE(HAVE_IN6ADDRSZ) - else - $1=no - fi -]) - -dnl -dnl check for RES_USE_INET6 -AC_DEFUN(AC_CHECK_RES_USE_INET6, [ - AC_MSG_CHECKING(for RES_USE_INET6) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <netinet/in.h> -# include <resolv.h>], - [int a = RES_USE_INET6], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes; then - AC_DEFINE(HAVE_RES_USE_INET6) - fi -]) - -dnl -dnl check for AAAA -AC_DEFUN(AC_CHECK_AAAA, [ - AC_MSG_CHECKING(for AAAA) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <arpa/nameser.h>], - [int a = T_AAAA], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes; then - AC_DEFINE(HAVE_AAAA) - fi -]) - -dnl -dnl check for struct res_state_ext -AC_DEFUN(AC_STRUCT_RES_STATE_EXT, [ - AC_MSG_CHECKING(for res_state_ext) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <netinet/in.h> -# include <netinet6/in6.h> -# include <resolv.h>], - [struct __res_state_ext e], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes; then - AC_DEFINE(HAVE_RES_STATE_EXT) - fi -]) - -dnl -dnl check for struct res_state_ext -AC_DEFUN(AC_STRUCT_RES_STATE, [ - AC_MSG_CHECKING(for nsort in res_state) - AC_CACHE_VAL($1, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <netinet/in.h> -# include <netinet6/in6.h> -# include <resolv.h>], - [struct __res_state e; e.nsort = 0], - $1=yes, - $1=no)) - AC_MSG_RESULT($$1) - if test $$1 = yes; then - AC_DEFINE(HAVE_NEW_RES_STATE) - fi -]) - -dnl -dnl check for h_errno -AC_DEFUN(AC_VAR_H_ERRNO, [ - AC_MSG_CHECKING(for h_errno) - AC_CACHE_VAL(ac_cv_var_h_errno, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <netdb.h>], - [int foo = h_errno;], - ac_cv_var_h_errno=yes, - ac_cv_var_h_errno=no)) - AC_MSG_RESULT($ac_cv_var_h_errno) - if test "$ac_cv_var_h_errno" = "yes"; then - AC_DEFINE(HAVE_H_ERRNO) - fi -]) - -dnl -dnl Test for __attribute__ -dnl - -AC_DEFUN(AC_C___ATTRIBUTE__, [ -AC_MSG_CHECKING(for __attribute__) -AC_CACHE_VAL(ac_cv___attribute__, [ -AC_COMPILE_IFELSE( - AC_LANG_SOURCE([[ -#include <stdlib.h> - -static void foo(void) __attribute__ ((noreturn)); - -static void -foo(void) -{ - exit(1); -} - -int -main(int argc, char **argv) -{ - foo(); -} - ]]), -ac_cv___attribute__=yes, -ac_cv___attribute__=no)]) -if test "$ac_cv___attribute__" = "yes"; then - AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) - V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\"" -else - V_DEFS="$V_DEFS -D_U_=\"\"" -fi -AC_MSG_RESULT($ac_cv___attribute__) -]) diff --git a/contrib/tcpdump/acsite.m4 b/contrib/tcpdump/acsite.m4 deleted file mode 100644 index 746faf1..0000000 --- a/contrib/tcpdump/acsite.m4 +++ /dev/null @@ -1,505 +0,0 @@ -dnl @(#) $Header: acsite.m4,v 1.41 96/11/29 15:30:40 leres Exp $ (LBL) -dnl -dnl Copyright (c) 1995, 1996 -dnl The Regents of the University of California. All rights reserved. -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that: (1) source code distributions -dnl retain the above copyright notice and this paragraph in its entirety, (2) -dnl distributions including binary code include the above copyright notice and -dnl this paragraph in its entirety in the documentation or other materials -dnl provided with the distribution, and (3) all advertising materials mentioning -dnl features or use of this software display the following acknowledgement: -dnl ``This product includes software developed by the University of California, -dnl Lawrence Berkeley Laboratory and its contributors.'' Neither the name of -dnl the University nor the names of its contributors may be used to endorse -dnl or promote products derived from this software without specific prior -dnl written permission. -dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -dnl WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -dnl -dnl LBL autoconf macros -dnl - -dnl -dnl Determine which compiler we're using (cc or gcc) -dnl If using gcc, determine the version number -dnl If using cc, require that it support ansi prototypes -dnl If using gcc, use -O2 (otherwise use -O) -dnl If using cc, explicitly specify /usr/local/include -dnl -dnl usage: -dnl -dnl AC_LBL_C_INIT(copt, incls) -dnl -dnl results: -dnl -dnl $1 (copt set) -dnl $2 (incls set) -dnl CC -dnl ac_cv_gcc_vers -dnl LBL_CFLAGS -dnl -dnl XXX need to add test to make sure ac_prog_cc hasn't been called -AC_DEFUN(AC_LBL_C_INIT, - [AC_PREREQ(2.12) - $1=-O - $2="" - if test "${CFLAGS+set}" = set; then - LBL_CFLAGS="$CFLAGS" - fi - if test -z "$CC" ; then - case "$target_os" in - - bsdi*) - AC_CHECK_PROG(SHLICC2, shlicc2, yes, no) - if test $SHLICC2 = yes ; then - CC=shlicc2 - export CC - fi - ;; - esac - fi - AC_PROG_CC - if test $ac_cv_prog_gcc = yes ; then - if test "$SHLICC2" = yes ; then - ac_cv_gcc_vers=2 - $1=-O2 - else - AC_MSG_CHECKING(gcc version) - AC_CACHE_VAL(ac_cv_gcc_vers, - ac_cv_gcc_vers=`$CC -v 2>&1 | \ - sed -n -e '$s/.* //' -e '$s/\..*//p'`) - AC_MSG_RESULT($ac_cv_gcc_vers) - if test $ac_cv_gcc_vers -gt 1 ; then - $1=-O2 - fi - fi - else - AC_MSG_CHECKING(that $CC handles ansi prototypes) - AC_CACHE_VAL(ac_cv_cc_ansi_prototypes, - AC_TRY_COMPILE( - [#include <sys/types.h>], - [int frob(int, char *)], - ac_cv_cc_ansi_prototypes=yes, - ac_cv_cc_ansi_prototypes=no)) - AC_MSG_RESULT($ac_cv_cc_ansi_prototypes) - if test $ac_cv_cc_ansi_prototypes = no ; then - case "$target_os" in - - hpux*) - AC_MSG_CHECKING(for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)) - savedcflags="$CFLAGS" - CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS" - AC_CACHE_VAL(ac_cv_cc_hpux_cc_aa, - AC_TRY_COMPILE( - [#include <sys/types.h>], - [int frob(int, char *)], - ac_cv_cc_hpux_cc_aa=yes, - ac_cv_cc_hpux_cc_aa=no)) - AC_MSG_RESULT($ac_cv_cc_hpux_cc_aa) - if test $ac_cv_cc_hpux_cc_aa = no ; then - AC_MSG_ERROR(see the INSTALL for more info) - fi - CFLAGS="$savedcflags" - V_CCOPT="-Aa $V_CCOPT" - AC_DEFINE(_HPUX_SOURCE) - ;; - - *) - AC_MSG_ERROR(see the INSTALL for more info) - ;; - esac - fi - $2=-I/usr/local/include - - case "$target_os" in - - irix*) - V_CCOPT="$V_CCOPT -xansi -signed -g3" - ;; - - osf*) - V_CCOPT="$V_CCOPT -g3" - ;; - - ultrix*) - AC_MSG_CHECKING(that Ultrix $CC hacks const in prototypes) - AC_CACHE_VAL(ac_cv_cc_const_proto, - AC_TRY_COMPILE( - [#include <sys/types.h>], - [struct a { int b; }; - void c(const struct a *)], - ac_cv_cc_const_proto=yes, - ac_cv_cc_const_proto=no)) - AC_MSG_RESULT($ac_cv_cc_const_proto) - if test $ac_cv_cc_const_proto = no ; then - AC_DEFINE(const,) - fi - ;; - esac - fi -]) - -dnl -dnl Use pfopen.c if available and pfopen() not in standard libraries -dnl Require libpcap -dnl Look for libpcap in .. -dnl Use the installed libpcap if there is no local version -dnl -dnl usage: -dnl -dnl AC_LBL_LIBPCAP(pcapdep, incls) -dnl -dnl results: -dnl -dnl $1 (pcapdep set) -dnl $2 (incls appended) -dnl LIBS -dnl -AC_DEFUN(AC_LBL_LIBPCAP, - [pfopen=/usr/examples/packetfilter/pfopen.c - if test -f $pfopen ; then - AC_CHECK_FUNCS(pfopen) - if test $ac_cv_func_pfopen = "no" ; then - AC_MSG_RESULT(Using $pfopen) - LIBS="$LIBS $pfopen" - fi - fi - AC_MSG_CHECKING(for local pcap library) - libpcap=FAIL - lastdir=FAIL - places=`ls .. | sed -e 's,/$,,' -e 's,^,../,' | \ - egrep '/libpcap-[[0-9]]*\.[[0-9]]*(\.[[0-9]]*)?([[ab]][[0-9]]*)?$'` - for dir in $places ../libpcap libpcap ; do - basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'` - if test $lastdir = $basedir ; then - dnl skip alphas when an actual release is present - continue; - fi - lastdir=$dir - if test -r $dir/pcap.c ; then - libpcap=$dir/libpcap.a - d=$dir - dnl continue and select the last one that exists - fi - done - if test $libpcap = FAIL ; then - AC_MSG_RESULT(not found) - AC_CHECK_LIB(pcap, main, libpcap="-lpcap") - if test $libpcap = FAIL ; then - AC_MSG_ERROR(see the INSTALL doc for more info) - fi - else - $1=$libpcap - $2="-I$d $$2" - AC_MSG_RESULT($libpcap) - fi - LIBS="$libpcap $LIBS"]) - -dnl -dnl Define RETSIGTYPE and RETSIGVAL -dnl -dnl usage: -dnl -dnl AC_LBL_TYPE_SIGNAL -dnl -dnl results: -dnl -dnl RETSIGTYPE (defined) -dnl RETSIGVAL (defined) -dnl -AC_DEFUN(AC_LBL_TYPE_SIGNAL, - [AC_TYPE_SIGNAL - if test "$ac_cv_type_signal" = void ; then - AC_DEFINE(RETSIGVAL,) - else - AC_DEFINE(RETSIGVAL,(0)) - fi - case "$target_os" in - - irix*) - AC_DEFINE(_BSD_SIGNALS) - ;; - - *) - AC_CHECK_FUNCS(sigset) - if test $ac_cv_func_sigset = yes ; then - AC_DEFINE(signal, sigset) - fi - ;; - esac]) - -dnl -dnl If using gcc, see if fixincludes should be run -dnl -dnl usage: -dnl -dnl AC_LBL_FIXINCLUDES -dnl -AC_DEFUN(AC_LBL_FIXINCLUDES, - [if test $ac_cv_prog_gcc = yes ; then - AC_MSG_CHECKING(if fixincludes is needed) - AC_CACHE_VAL(ac_cv_gcc_fixincludes, - AC_TRY_COMPILE( - [/* - * This generates a "duplicate case value" when fixincludes - * has not be run. - */ -# include <sys/types.h> -# include <sys/time.h> -# include <sys/ioctl.h> -# ifdef HAVE_SYS_IOCCOM_H -# include <sys/ioccom.h> -# endif], - [switch (0) { - case _IO('A', 1):; - case _IO('B', 1):; - }], - ac_cv_gcc_fixincludes=yes, - ac_cv_gcc_fixincludes=no)) - AC_MSG_RESULT($ac_cv_gcc_fixincludes) - if test $ac_cv_gcc_fixincludes = no ; then - # Don't cache failure - unset ac_cv_gcc_fixincludes - AC_MSG_ERROR(see the INSTALL for more info) - fi - fi]) - -dnl -dnl Check for flex, default to lex -dnl Require flex 2.4 or higher -dnl Check for bison, default to yacc -dnl Default to lex/yacc if both flex and bison are not available -dnl Define the yy prefix string if using flex and bison -dnl -dnl usage: -dnl -dnl AC_LBL_LEX_AND_YACC(lex, yacc, yyprefix) -dnl -dnl results: -dnl -dnl $1 (lex set) -dnl $2 (yacc appended) -dnl $3 (optional flex and bison -P prefix) -dnl -AC_DEFUN(AC_LBL_LEX_AND_YACC, - [AC_CHECK_PROGS($1, flex, lex) - if test "$$1" = flex ; then - # The -V flag was added in 2.4 - AC_MSG_CHECKING(for flex 2.4 or higher) - AC_CACHE_VAL(ac_cv_flex_v24, - if flex -V >/dev/null 2>&1; then - ac_cv_flex_v24=yes - else - ac_cv_flex_v24=no - fi) - AC_MSG_RESULT($ac_cv_flex_v24) - if test $ac_cv_flex_v24 = no ; then - s="2.4 or higher required" - AC_MSG_WARN(ignoring obsolete flex executable ($s)) - $1=lex - fi - fi - AC_CHECK_PROGS($2, bison, yacc) - if test "$$2" = bison ; then - $2="$$2 -y" - fi - if test "$$1" != lex -a "$$2" = yacc -o "$$1" = lex -a "$$2" != yacc ; then - AC_MSG_WARN(don't have both flex and bison; reverting to lex/yacc) - $1=lex - $2=yacc - fi - if test "$$1" = flex -a -n "$3" ; then - $1="$$1 -P$3" - $2="$$2 -p $3" - fi]) - -dnl -dnl Checks to see if union wait is used with WEXITSTATUS() -dnl -dnl usage: -dnl -dnl AC_LBL_UNION_WAIT -dnl -dnl results: -dnl -dnl DECLWAITSTATUS (defined) -dnl -AC_DEFUN(AC_LBL_UNION_WAIT, - [AC_MSG_CHECKING(if union wait is used) - AC_CACHE_VAL(ac_cv_union_wait, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <sys/wait.h>], - [int status; - u_int i = WEXITSTATUS(status); - u_int j = waitpid(0, &status, 0);], - ac_cv_union_wait=no, - ac_cv_union_wait=yes)) - AC_MSG_RESULT($ac_cv_union_wait) - if test $ac_cv_union_wait = yes ; then - AC_DEFINE(DECLWAITSTATUS,union wait) - else - AC_DEFINE(DECLWAITSTATUS,int) - fi]) - -dnl -dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member -dnl -dnl usage: -dnl -dnl AC_LBL_SOCKADDR_SA_LEN -dnl -dnl results: -dnl -dnl HAVE_SOCKADDR_SA_LEN (defined) -dnl -AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN, - [AC_MSG_CHECKING(if sockaddr struct has sa_len member) - AC_CACHE_VAL(ac_cv_sockaddr_has_sa_len, - AC_TRY_COMPILE([ -# include <sys/types.h> -# include <sys/socket.h>], - [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], - ac_cv_sockaddr_has_sa_len=yes, - ac_cv_sockaddr_has_sa_len=no)) - AC_MSG_RESULT($ac_cv_sockaddr_has_sa_len) - if test $ac_cv_sockaddr_has_sa_len = yes ; then - AC_DEFINE(HAVE_SOCKADDR_SA_LEN) - fi]) - -dnl -dnl Checks to see if -R is used -dnl -dnl usage: -dnl -dnl AC_LBL_HAVE_RUN_PATH -dnl -dnl results: -dnl -dnl ac_cv_have_run_path (yes or no) -dnl -AC_DEFUN(AC_LBL_HAVE_RUN_PATH, - [AC_MSG_CHECKING(for ${CC-cc} -R) - AC_CACHE_VAL(ac_cv_have_run_path, - [echo 'main(){}' > conftest.c - ${CC-cc} -o conftest conftest.c -R/a1/b2/c3 >conftest.out 2>&1 - if test ! -s conftest.out ; then - ac_cv_have_run_path=yes - else - ac_cv_have_run_path=no - fi - rm -f conftest*]) - AC_MSG_RESULT($ac_cv_have_run_path) - ]) - -dnl -dnl Checks to see if unaligned memory accesses fail -dnl -dnl usage: -dnl -dnl AC_LBL_UNALIGNED_ACCESS -dnl -dnl results: -dnl -dnl LBL_ALIGN (DEFINED) -dnl -AC_DEFUN(AC_LBL_UNALIGNED_ACCESS, - [AC_MSG_CHECKING(if unaligned accesses fail) - AC_CACHE_VAL(ac_cv_unaligned_fail, - [case "$target_cpu" in - - alpha|hp*|mips|sparc) - ac_cv_unaligned_fail=yes - ;; - - *) - cat >conftest.c <<EOF -# include <sys/types.h> -# include <sys/wait.h> -# include <stdio.h> - unsigned char a[[5]] = { 1, 2, 3, 4, 5 }; - main() { - unsigned int i; - pid_t pid; - int status; - /* avoid "core dumped" message */ - pid = fork(); - if (pid < 0) - exit(2); - if (pid > 0) { - /* parent */ - pid = waitpid(pid, &status, 0); - if (pid < 0) - exit(3); - exit(!WIFEXITED(status)); - } - /* child */ - i = *(unsigned int *)&a[[1]]; - printf("%d\n", i); - exit(0); - } -EOF - ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \ - conftest.c $LIBS >/dev/null 2>&1 - if test ! -x conftest ; then - dnl failed to compile for some reason - ac_cv_unaligned_fail=yes - else - ./conftest >conftest.out - if test ! -s conftest.out ; then - ac_cv_unaligned_fail=yes - else - ac_cv_unaligned_fail=no - fi - fi - rm -f conftest* core core.conftest - ;; - esac]) - AC_MSG_RESULT($ac_cv_unaligned_fail) - if test $ac_cv_unaligned_fail = yes ; then - AC_DEFINE(LBL_ALIGN) - fi]) - -dnl -dnl If using gcc and the file .devel exists: -dnl Compile with -g (if supported) and -Wall -dnl If using gcc 2, do extra prototype checking -dnl If an os prototype include exists, symlink os-proto.h to it -dnl -dnl usage: -dnl -dnl AC_LBL_DEVEL(copt) -dnl -dnl results: -dnl -dnl $1 (copt appended) -dnl HAVE_OS_PROTO_H (defined) -dnl os-proto.h (symlinked) -dnl -AC_DEFUN(AC_LBL_DEVEL, - [rm -f os-proto.h - if test "${LBL_CFLAGS+set}" = set; then - $1="$$1 ${LBL_CFLAGS}" - fi - if test $ac_cv_prog_gcc = yes -a -f .devel ; then - if test "${LBL_CFLAGS+set}" != set; then - if test "$ac_cv_prog_cc_g" = yes ; then - $1="-g $$1" - fi - $1="$$1 -Wall" - if test $ac_cv_gcc_vers -gt 1 ; then - $1="$$1 -Wmissing-prototypes -Wstrict-prototypes" - fi - fi - os=`echo $target_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'` - name="lbl/os-$os.h" - if test -f $name ; then - ln -s $name os-proto.h - AC_DEFINE(HAVE_OS_PROTO_H) - else - AC_MSG_WARN(can't find $name) - fi - fi]) diff --git a/contrib/tcpdump/addrtoname.c b/contrib/tcpdump/addrtoname.c index 648a823..bb0f2f5 100644 --- a/contrib/tcpdump/addrtoname.c +++ b/contrib/tcpdump/addrtoname.c @@ -20,6 +20,8 @@ * * Internet, ethernet, port, and protocol string to address * and address to string conversion routines + * + * $FreeBSD$ */ #ifndef lint static const char rcsid[] _U_ = diff --git a/contrib/tcpdump/dhcp6.h b/contrib/tcpdump/dhcp6.h deleted file mode 100644 index 8381b11..0000000 --- a/contrib/tcpdump/dhcp6.h +++ /dev/null @@ -1,200 +0,0 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/Attic/dhcp6.h,v 1.4 2000/12/17 23:07:48 guy Exp $ (LBL) */ -/* - * Copyright (C) 1998 and 1999 WIDE Project. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -/* - * draft-ietf-dhc-dhcpv6-15 - */ - -#ifndef __DHCP6_H_DEFINED -#define __DHCP6_H_DEFINED - -/* Error Values */ -#define DH6ERR_FAILURE 16 -#define DH6ERR_AUTHFAIL 17 -#define DH6ERR_POORLYFORMED 18 -#define DH6ERR_UNAVAIL 19 -#define DH6ERR_NOBINDING 20 -#define DH6ERR_INVALIDSOURCE 21 -#define DH6ERR_NOSERVER 23 -#define DH6ERR_ICMPERROR 64 - -/* Message type */ -#define DH6_SOLICIT 1 -#define DH6_ADVERT 2 -#define DH6_REQUEST 3 -#define DH6_REPLY 4 -#define DH6_RELEASE 5 -#define DH6_RECONFIG 6 - -/* Predefined addresses */ -#define DH6ADDR_ALLAGENT "ff02::1:2" -#define DH6ADDR_ALLSERVER "ff05::1:3" -#define DH6ADDR_ALLRELAY "ff05::1:4" -#define DH6PORT_DOWNSTREAM "546" -#define DH6PORT_UPSTREAM "547" - -/* Protocol constants */ -#define ADV_CLIENT_WAIT 2 /* sec */ -#define DEFAULT_SOLICIT_HOPCOUNT 4 -#define SERVER_MIN_ADV_DELAY 100 /* msec */ -#define SERVER_MAX_ADV_DELAY 1000 /* msec */ -#define REPLY_MSG_TIMEOUT 2 /* sec */ -#define REQUEST_MSG_MIN_RETRANS 10 /* retransmissions */ -#define RECONF_MSG_MIN_RETRANS 10 /* retransmissions */ -#define RECONF_MSG_RETRANS_INTERVAL 12 /* sec */ -#define RECONF_MMSG_MIN_RESP 2 /* sec */ -#define RECONF_MMSG_MAX_RESP 10 /* sec */ -#define RECONF_MULTICAST_REQUEST_WAIT 120 /* sec */ -#define MIN_SOLICIT_DELAY 1 /* sec */ -#define MAX_SOLICIT_DELAY 5 /* sec */ -#define XID_TIMEOUT 600 /* sec */ - -/* DHCP6 base packet format */ -struct dhcp6_solicit { - u_int8_t dh6sol_msgtype; /* DH6_SOLICIT */ - u_int8_t dh6sol_flags; -#define DH6SOL_CLOSE 0x80 -#define DH6SOL_PREFIX 0x40 - /* XXX: solicit-ID is a 9-bit field...ugly! */ -#define DH6SOL_SOLICIT_ID_MASK 0x01ff -#define DH6SOL_SOLICIT_ID_SHIFT 0 -#define DH6SOL_SOLICIT_ID(x) \ - (((x) & DH6SOL_SOLICIT_ID_MASK) >> DH6SOL_SOLICIT_ID_SHIFT) -#define DH6SOL_SOLICIT_PLEN_MASK 0xfe00 -#define DH6SOL_SOLICIT_PLEN_SHIFT 9 -#define DH6SOL_SOLICIT_PLEN(x) \ - (((x) & DH6SOL_SOLICIT_PLEN_MASK) >> DH6SOL_SOLICIT_PLEN_SHIFT) - u_int16_t dh6sol_plen_id; /* prefix-len and solict-ID */ - struct in6_addr dh6sol_cliaddr; /* client's lladdr */ - struct in6_addr dh6sol_relayaddr; /* relay agent's lladdr */ -}; - -struct dhcp6_advert { - u_int8_t dh6adv_msgtype; /* DH6_ADVERT */ - u_int8_t dh6adv_rsv_id; /* reserved and uppermost bit of ID */ - u_int8_t dh6adv_solcit_id; /* lower 8 bits of solicit-ID */ - u_int8_t dh6adv_pref; - struct in6_addr dh6adv_cliaddr; /* client's link-local addr */ - struct in6_addr dh6adv_relayaddr; /* relay agent's (non-ll) addr */ - struct in6_addr dh6adv_serveraddr; /* server's addr */ - /* extensions */ -}; - -struct dhcp6_request { - u_int8_t dh6req_msgtype; /* DH6_REQUEST */ - u_int8_t dh6req_flags; -#define DH6REQ_CLOSE 0x80 -#define DH6REQ_REBOOT 0x40 - u_int16_t dh6req_xid; /* transaction-ID */ - struct in6_addr dh6req_cliaddr; /* client's lladdr */ - struct in6_addr dh6req_relayaddr; /* relay agent's (non-ll) addr */ - struct in6_addr dh6req_serveraddr; /* server's addr */ - /* extensions */ -}; - -struct dhcp6_reply { - u_int8_t dh6rep_msgtype; /* DH6_REPLY */ - u_int8_t dh6rep_flagandstat; -#define DH6REP_RELAYPRESENT 0x80 -#define DH6REP_STATMASK 0x7f - u_int16_t dh6rep_xid; /* transaction-ID */ - struct in6_addr dh6rep_cliaddr; /* client's lladdr */ - /* struct in6_addr dh6rep_relayaddr; optional: relay address */ - /* extensions */ -}; - -/* XXX: followings are based on older drafts */ -struct dhcp6_release { - u_int8_t dh6rel_msgtype; /* DH6_RELEASE */ - u_int8_t dh6rel_flags; -#define DH6REL_DIRECT 0x80 - u_int16_t dh6rel_xid; /* transaction-ID */ - struct in6_addr dh6rel_cliaddr; /* client's lladdr */ - struct in6_addr dh6rel_relayaddr; /* relay agent's (non-ll) addr */ - struct in6_addr dh6rel_reladdr; /* server's addr to be released */ - /* extensions */ -}; - -struct dhcp6_reconfig { - u_int8_t dh6cfg_msgtype; /* DH6_RECONFIG */ - u_int8_t dh6cfg_flags; -#define DH6REP_NOREPLY 0x80 - u_int16_t dh6cfg_xid; /* transaction-ID */ - struct in6_addr dh6cfg_servaddr; /* server's addr */ - /* extensions */ -}; - -union dhcp6 { - u_int8_t dh6_msgtype; - struct dhcp6_solicit dh6_sol; - struct dhcp6_advert dh6_adv; - struct dhcp6_request dh6_req; - struct dhcp6_reply dh6_rep; - struct dhcp6_release dh6_rel; - struct dhcp6_reconfig dh6_cfg; -}; - -/* DHCP6 extension */ -struct dhcp6e_ipaddr { - u_int16_t dh6eip_type; - u_int16_t dh6eip_len; - u_int8_t dh6eip_status; -#define DH6EX_IP_SUCCESS 0 /* request granted, no errors */ -#define DH6EX_IP_SECFAIL 18 /* Security parameters failed */ -#define DH6EX_IP_AAAAFAIL 20 /* AAAA Record Parameter Problem */ -#define DH6EX_IP_PTRFAIL 21 /* PTR Record Parameter Problem */ -#define DH6EX_IP_PARAMFAIL 22 /* Unable to honor required params */ -#define DH6EX_IP_DNSNAMEFAIL 23 /* DNS name string error */ -#define DH6EX_IP_NODYNDNS 24 /* dynDNS Not Implemented */ -#define DH6EX_IP_NOAUTHDNS 25 /* Authoritative DNS Server not found */ -#define DH6EX_IP_DNSFORMFAIL 33 /* DNS format error */ -#define DH6EX_IP_SERVFAIL 34 /* dynDNS unavailable at this time */ -#define DH6EX_IP_NXDOMAIN 35 /* name does not exist */ -#define DH6EX_IP_NOTIMP 36 /* DNS does not support the Opcode */ -#define DH6EX_IP_REFUSED 37 /* DNS refuses specified operation */ -#define DH6EX_IP_YXDOMAIN 38 /* name does not exist */ -#define DH6EX_IP_YXRRSET 39 /* RRset does not exist */ -#define DH6EX_IP_NXRRSET 40 /* RRset does not exist */ -#define DH6EX_IP_NOTAUTH 41 /* non authoritative name server */ -#define DH6EX_IP_NOTZONE 42 /* prerequisite out of zone */ - u_int8_t dh6eip_flags; -#define DH6EX_IP_CLIANTADDR 0x80 /* C: cliant's addr */ -#define DH6EX_IP_LIFETIME 0x40 /* L: preferred/valid lifetime */ -#define DH6EX_IP_FORCEOPTS 0x20 /* Q: options are mandatory */ -#define DH6EX_IP_AAAA 0x10 /* A: DNS dynamic update for AAAA */ -#define DH6EX_IP_PTR 0x08 /* P: DNS dynamic update for PTR*/ - u_int8_t dh6eip_pad; - u_int8_t dh6eip_prefixlen; - /* struct in6_addr: client's address (if C bit = 1) */ - /* u_int: preferred lifetime (if L bit = 1) */ - /* u_int: valid lifetime (if L bit = 1) */ - /* string: DNS name */ -}; - -#endif /*__DHCP6_H_DEFINED*/ diff --git a/contrib/tcpdump/dhcp6opt.h b/contrib/tcpdump/dhcp6opt.h deleted file mode 100644 index fc6534d..0000000 --- a/contrib/tcpdump/dhcp6opt.h +++ /dev/null @@ -1,81 +0,0 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/Attic/dhcp6opt.h,v 1.4 2001/09/17 21:57:51 fenner Exp $ (LBL) */ -/* - * Copyright (C) 1998 and 1999 WIDE Project. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * draft-ietf-dhc-v6exts-11 - */ - -#ifndef __DHCP6OPT_H_DEFINED -#define __DHCP6OPT_H_DEFINED - -#define OL6_N -1 -#define OL6_16N -2 -#define OL6_Z -3 - -#define OT6_NONE 0 -#define OT6_V6 1 -#define OT6_STR 2 -#define OT6_NUM 3 - -struct dhcp6_opt { - u_int code; - int len; - const char *name; - int type; -}; - -/* index to parameters */ -#define DH6T_CLIENT_ADV_WAIT 1 /* milliseconds */ -#define DH6T_DEFAULT_SOLICIT_HOPCOUNT 2 /* times */ -#define DH6T_SERVER_MIN_ADV_DELAY 3 /* milliseconds */ -#define DH6T_SERVER_MAX_ADV_DELAY 4 /* milliseconds */ -#define DH6T_REQUEST_MSG_MIN_RETRANS 5 /* retransmissions */ -#define DH6T_REPLY_MSG_TIMEOUT 6 /* milliseconds */ -#define DH6T_REPLY_MSG_RETRANS_INTERVAL 7 /* milliseconds */ -#define DH6T_RECONF_MSG_TIMEOUT 8 /* milliseconds */ -#define DH6T_RECONF_MSG_MIN_RETRANS 9 /* retransmissions */ -#define DH6T_RECONF_MSG_RETRANS_INTERVAL 10 /* milliseconds */ -#define DH6T_RECONF_MMSG_MIN_RESP 11 /* milliseconds */ -#define DH6T_RECONF_MMSG_MAX_RESP 12 /* milliseconds */ -#define DH6T_MIN_SOLICIT_DELAY 13 /* milliseconds */ -#define DH6T_MAX_SOLICIT_DELAY 14 /* milliseconds */ -#define DH6T_XID_TIMEOUT 15 /* milliseconds */ -#define DH6T_RECONF_MULTICAST_REQUEST_WAIT 16 /* milliseconds */ - -#if 0 -extern struct dhcp6_opt *dh6o_pad; -extern struct dhcp6_opt *dh6o_end; -extern int dhcp6_param[]; -extern void dhcp6opttab_init (void); -extern struct dhcp6_opt *dhcp6opttab_byname (char *); -extern struct dhcp6_opt *dhcp6opttab_bycode (u_int); -#endif - -#endif /*__DHCP6OPT_H_DEFINED*/ diff --git a/contrib/tcpdump/ethertype.h b/contrib/tcpdump/ethertype.h index 2513fbd..808cdcf 100644 --- a/contrib/tcpdump/ethertype.h +++ b/contrib/tcpdump/ethertype.h @@ -18,7 +18,9 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * + * * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.24 2004/10/07 16:04:07 hannes Exp $ (LBL) + * $FreeBSD$ */ /* @@ -121,6 +123,12 @@ #ifndef ETHERTYPE_PPPOES #define ETHERTYPE_PPPOES 0x8864 #endif +#ifndef ETHERTYPE_PPPOED2 +#define ETHERTYPE_PPPOED2 0x3c12 +#endif +#ifndef ETHERTYPE_PPPOES2 +#define ETHERTYPE_PPPOES2 0x3c13 +#endif #ifndef ETHERTYPE_JUMBO #define ETHERTYPE_JUMBO 0x8870 #endif diff --git a/contrib/tcpdump/interface.h b/contrib/tcpdump/interface.h index 9b9be23..3fb09b4 100644 --- a/contrib/tcpdump/interface.h +++ b/contrib/tcpdump/interface.h @@ -18,7 +18,9 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.244.2.11 2005/06/20 07:45:04 hannes Exp $ (LBL) + * + * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.244 2005/04/06 21:33:27 mcr Exp $ (LBL) + * $FreeBSD$ */ #ifndef tcpdump_interface_h diff --git a/contrib/tcpdump/lbl/gnuc.h b/contrib/tcpdump/lbl/gnuc.h deleted file mode 100644 index 1615d43..0000000 --- a/contrib/tcpdump/lbl/gnuc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/lbl/gnuc.h,v 1.3.1.1 1999/10/07 23:47:13 mcr Exp $ (LBL) */ - -/* Define __P() macro, if necessary */ -#ifndef __P -#if __STDC__ -#define __P(protos) protos -#else -#define __P(protos) () -#endif -#endif - -/* inline foo */ -#ifdef __GNUC__ -#define inline __inline -#else -#define inline -#endif - -/* - * Handle new and old "dead" routine prototypes - * - * For example: - * - * __dead void foo(void) __attribute__((volatile)); - * - */ -#ifdef __GNUC__ -#ifndef __dead -#define __dead volatile -#endif -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -#ifndef __attribute__ -#define __attribute__(args) -#endif -#endif -#else -#ifndef __dead -#define __dead -#endif -#ifndef __attribute__ -#define __attribute__(args) -#endif -#endif diff --git a/contrib/tcpdump/missing/cdecl_ext.h b/contrib/tcpdump/missing/cdecl_ext.h deleted file mode 100644 index 9591db2..0000000 --- a/contrib/tcpdump/missing/cdecl_ext.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 1999 WIDE Project. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#ifndef HAVE_PORTABLE_PROTOTYPE - -#if defined(__STDC__) || defined(__cplusplus) -#define __P(protos) protos /* full-blown ANSI C */ -#else -#define __P(protos) () /* traditional C preprocessor */ -#endif - -#endif /* !HAVE_PORTABLE_PROTOTYPE */ diff --git a/contrib/tcpdump/nfs.h b/contrib/tcpdump/nfs.h index 3d47c7d..82c8dd3 100644 --- a/contrib/tcpdump/nfs.h +++ b/contrib/tcpdump/nfs.h @@ -36,6 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ * @(#)nfsproto.h 8.2 (Berkeley) 3/30/95 */ diff --git a/contrib/tcpdump/nfsfh.h b/contrib/tcpdump/nfsfh.h index b8a82e4..8a337ba 100644 --- a/contrib/tcpdump/nfsfh.h +++ b/contrib/tcpdump/nfsfh.h @@ -39,6 +39,8 @@ * Jeffrey C. Mogul * Digital Equipment Corporation * Western Research Laboratory + * $FreeBSD$ + * $NetBSD: nfsfh.h,v 1.1.1.2 1997/10/03 17:25:13 christos Exp $ */ /* diff --git a/contrib/tcpdump/nfsv2.h b/contrib/tcpdump/nfsv2.h deleted file mode 100644 index b2c0ff9..0000000 --- a/contrib/tcpdump/nfsv2.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 1994, 1995, 1996 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Rick Macklem at The University of Guelph. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)nfsv2.h 7.11 (Berkeley) 9/30/92 - */ - -/* - * nfs definitions as per the version 2 specs - */ - -/* - * Constants as defined in the Sun NFS Version 2 spec. - * "NFS: Network File System Protocol Specification" RFC1094 - */ - -#define NFS_PORT 2049 -#define NFS_PROG 100003 -#define NFS_VER2 2 -#define NFS_MAXDGRAMDATA 8192 -#define NFS_MAXDATA 32768 -#define NFS_MAXPATHLEN 1024 -#define NFS_MAXNAMLEN 255 -#define NFS_FHSIZE 32 -#define NFS_MAXPKTHDR 404 -#define NFS_MAXPACKET (NFS_MAXPKTHDR+NFS_MAXDATA) -#define NFS_MINPACKET 20 -#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ - -/* Stat numbers for rpc returns */ -#define NFS_OK 0 -#define NFSERR_PERM 1 -#define NFSERR_NOENT 2 -#define NFSERR_IO 5 -#define NFSERR_NXIO 6 -#define NFSERR_ACCES 13 -#define NFSERR_EXIST 17 -#define NFSERR_NODEV 19 -#define NFSERR_NOTDIR 20 -#define NFSERR_ISDIR 21 -#define NFSERR_FBIG 27 -#define NFSERR_NOSPC 28 -#define NFSERR_ROFS 30 -#define NFSERR_NAMETOL 63 -#define NFSERR_NOTEMPTY 66 -#define NFSERR_DQUOT 69 -#define NFSERR_STALE 70 -#define NFSERR_WFLUSH 99 - -/* Sizes in bytes of various nfs rpc components */ -#define NFSX_FH 32 -#define NFSX_UNSIGNED 4 -#define NFSX_NFSFATTR 68 -#define NFSX_NQFATTR 92 -#define NFSX_NFSSATTR 32 -#define NFSX_NQSATTR 44 -#define NFSX_COOKIE 4 -#define NFSX_NFSSTATFS 20 -#define NFSX_NQSTATFS 28 -#define NFSX_FATTR(isnq) ((isnq) ? NFSX_NQFATTR : NFSX_NFSFATTR) -#define NFSX_SATTR(isnq) ((isnq) ? NFSX_NQSATTR : NFSX_NFSSATTR) -#define NFSX_STATFS(isnq) ((isnq) ? NFSX_NQSTATFS : NFSX_NFSSTATFS) - -/* nfs rpc procedure numbers */ -#define NFSPROC_NULL 0 -#define NFSPROC_GETATTR 1 -#define NFSPROC_SETATTR 2 -#define NFSPROC_NOOP 3 -#define NFSPROC_ROOT NFSPROC_NOOP /* Obsolete */ -#define NFSPROC_LOOKUP 4 -#define NFSPROC_READLINK 5 -#define NFSPROC_READ 6 -#define NFSPROC_WRITECACHE NFSPROC_NOOP /* Obsolete */ -#define NFSPROC_WRITE 8 -#define NFSPROC_CREATE 9 -#define NFSPROC_REMOVE 10 -#define NFSPROC_RENAME 11 -#define NFSPROC_LINK 12 -#define NFSPROC_SYMLINK 13 -#define NFSPROC_MKDIR 14 -#define NFSPROC_RMDIR 15 -#define NFSPROC_READDIR 16 -#define NFSPROC_STATFS 17 - -/* NQ nfs numbers */ -#define NQNFSPROC_READDIRLOOK 18 -#define NQNFSPROC_GETLEASE 19 -#define NQNFSPROC_VACATED 20 -#define NQNFSPROC_EVICTED 21 -#define NQNFSPROC_ACCESS 22 - -#define NFS_NPROCS 23 -/* Conversion macros */ -extern int vttoif_tab[]; -#define vtonfs_mode(t,m) \ - txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \ - MAKEIMODE((t), (m))) -#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777) -#define vtonfs_type(a) txdr_unsigned(nfs_type[((int32_t)(a))]) -#define nfstov_type(a) ntov_type[fxdr_unsigned(u_int32_t,(a))&0x7] - -/* File types */ -typedef enum { - NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5 -} tcpdump_nfstype; - -/* Structs for common parts of the rpc's */ -struct nfsv2_time { - u_int32_t nfs_sec; - u_int32_t nfs_usec; -}; - -struct nqnfs_time { - u_int32_t nq_sec; - u_int32_t nq_nsec; -}; - -/* - * File attributes and setable attributes. These structures cover both - * NFS version 2 and the NQNFS protocol. Note that the union is only - * used to that one pointer can refer to both variants. These structures - * go out on the wire and must be densely packed, so no quad data types - * are used. (all fields are int32_t or u_int32_t's or structures of same) - * NB: You can't do sizeof(struct nfsv2_fattr), you must use the - * NFSX_FATTR(isnq) macro. - */ -struct nfsv2_fattr { - u_int32_t fa_type; - u_int32_t fa_mode; - u_int32_t fa_nlink; - u_int32_t fa_uid; - u_int32_t fa_gid; - union { - struct { - u_int32_t nfsfa_size; - u_int32_t nfsfa_blocksize; - u_int32_t nfsfa_rdev; - u_int32_t nfsfa_blocks; - u_int32_t nfsfa_fsid; - u_int32_t nfsfa_fileid; - struct nfsv2_time nfsfa_atime; - struct nfsv2_time nfsfa_mtime; - struct nfsv2_time nfsfa_ctime; - } fa_nfsv2; - struct { - struct { - u_int32_t nqfa_qsize[2]; - } nqfa_size; - u_int32_t nqfa_blocksize; - u_int32_t nqfa_rdev; - struct { - u_int32_t nqfa_qbytes[2]; - } nqfa_bytes; - u_int32_t nqfa_fsid; - u_int32_t nqfa_fileid; - struct nqnfs_time nqfa_atime; - struct nqnfs_time nqfa_mtime; - struct nqnfs_time nqfa_ctime; - u_int32_t nqfa_flags; - u_int32_t nqfa_gen; - struct { - u_int32_t nqfa_qfilerev[2]; - } nqfa_filerev; - } fa_nqnfs; - } fa_un; -}; - -/* and some ugly defines for accessing union components */ -#define fa_nfssize fa_un.fa_nfsv2.nfsfa_size -#define fa_nfsblocksize fa_un.fa_nfsv2.nfsfa_blocksize -#define fa_nfsrdev fa_un.fa_nfsv2.nfsfa_rdev -#define fa_nfsblocks fa_un.fa_nfsv2.nfsfa_blocks -#define fa_nfsfsid fa_un.fa_nfsv2.nfsfa_fsid -#define fa_nfsfileid fa_un.fa_nfsv2.nfsfa_fileid -#define fa_nfsatime fa_un.fa_nfsv2.nfsfa_atime -#define fa_nfsmtime fa_un.fa_nfsv2.nfsfa_mtime -#define fa_nfsctime fa_un.fa_nfsv2.nfsfa_ctime -#define fa_nqsize fa_un.fa_nqnfs.nqfa_size -#define fa_nqblocksize fa_un.fa_nqnfs.nqfa_blocksize -#define fa_nqrdev fa_un.fa_nqnfs.nqfa_rdev -#define fa_nqbytes fa_un.fa_nqnfs.nqfa_bytes -#define fa_nqfsid fa_un.fa_nqnfs.nqfa_fsid -#define fa_nqfileid fa_un.fa_nqnfs.nqfa_fileid -#define fa_nqatime fa_un.fa_nqnfs.nqfa_atime -#define fa_nqmtime fa_un.fa_nqnfs.nqfa_mtime -#define fa_nqctime fa_un.fa_nqnfs.nqfa_ctime -#define fa_nqflags fa_un.fa_nqnfs.nqfa_flags -#define fa_nqgen fa_un.fa_nqnfs.nqfa_gen -#define fa_nqfilerev fa_un.fa_nqnfs.nqfa_filerev - -struct nfsv2_sattr { - u_int32_t sa_mode; - u_int32_t sa_uid; - u_int32_t sa_gid; - union { - struct { - u_int32_t nfssa_size; - struct nfsv2_time nfssa_atime; - struct nfsv2_time nfssa_mtime; - } sa_nfsv2; - struct { - struct { - u_int32_t nqsa_qsize[2]; - } nqsa_size; - struct nqnfs_time nqsa_atime; - struct nqnfs_time nqsa_mtime; - u_int32_t nqsa_flags; - u_int32_t nqsa_rdev; - } sa_nqnfs; - } sa_un; -}; - -/* and some ugly defines for accessing the unions */ -#define sa_nfssize sa_un.sa_nfsv2.nfssa_size -#define sa_nfsatime sa_un.sa_nfsv2.nfssa_atime -#define sa_nfsmtime sa_un.sa_nfsv2.nfssa_mtime -#define sa_nqsize sa_un.sa_nqnfs.nqsa_size -#define sa_nqatime sa_un.sa_nqnfs.nqsa_atime -#define sa_nqmtime sa_un.sa_nqnfs.nqsa_mtime -#define sa_nqflags sa_un.sa_nqnfs.nqsa_flags -#define sa_nqrdev sa_un.sa_nqnfs.nqsa_rdev - -struct nfsv2_statfs { - u_int32_t sf_tsize; - u_int32_t sf_bsize; - u_int32_t sf_blocks; - u_int32_t sf_bfree; - u_int32_t sf_bavail; - u_int32_t sf_files; /* Nqnfs only */ - u_int32_t sf_ffree; /* ditto */ -}; diff --git a/contrib/tcpdump/parsenfsfh.c b/contrib/tcpdump/parsenfsfh.c index 686d01e..2e3da02 100644 --- a/contrib/tcpdump/parsenfsfh.c +++ b/contrib/tcpdump/parsenfsfh.c @@ -38,6 +38,8 @@ * Jeffrey C. Mogul * Digital Equipment Corporation * Western Research Laboratory + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/ppp.h b/contrib/tcpdump/ppp.h index 71621ca..484ea46 100644 --- a/contrib/tcpdump/ppp.h +++ b/contrib/tcpdump/ppp.h @@ -14,22 +14,30 @@ * University. Carnegie Mellon makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. + * + * $FreeBSD$ */ #define PPP_HDRLEN 4 /* length of PPP header */ +#undef PPP_ADDRESS #define PPP_ADDRESS 0xff /* The address byte value */ +#undef PPP_CONTROL #define PPP_CONTROL 0x03 /* The control byte value */ #define PPP_WITHDIRECTION_IN 0x00 /* non-standard for DLT_PPP_WITHDIRECTION */ #define PPP_WITHDIRECTION_OUT 0x01 /* non-standard for DLT_PPP_WITHDIRECTION */ /* Protocol numbers */ +#ifndef PPP_IP #define PPP_IP 0x0021 /* Raw IP */ +#endif #define PPP_OSI 0x0023 /* OSI Network Layer */ #define PPP_NS 0x0025 /* Xerox NS IDP */ #define PPP_DECNET 0x0027 /* DECnet Phase IV */ #define PPP_APPLE 0x0029 /* Appletalk */ +#ifndef PPP_IPX #define PPP_IPX 0x002b /* Novell IPX */ +#endif #define PPP_VJC 0x002d /* Van Jacobson Compressed TCP/IP */ #define PPP_VJNC 0x002f /* Van Jacobson Uncompressed TCP/IP */ #define PPP_BRPDU 0x0031 /* Bridging PDU */ diff --git a/contrib/tcpdump/print-arp.c b/contrib/tcpdump/print-arp.c index 68e9dc6..3dc2894 100644 --- a/contrib/tcpdump/print-arp.c +++ b/contrib/tcpdump/print-arp.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-atalk.c b/contrib/tcpdump/print-atalk.c index f1f45a3..1d575a6 100644 --- a/contrib/tcpdump/print-atalk.c +++ b/contrib/tcpdump/print-atalk.c @@ -19,6 +19,8 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print AppleTalk packets. + * + * $FreeBSD$ */ #ifndef lint @@ -99,6 +101,7 @@ llap_print(register const u_char *bp, u_int length) u_short snet; u_int hdrlen; +#if 0 /* * Our packet is on a 4-byte boundary, as we're either called * directly from a top-level link-layer printer (ltalk_if_print) @@ -110,6 +113,12 @@ llap_print(register const u_char *bp, u_int length) lp = (const struct LAP *)bp; bp += sizeof(*lp); length -= sizeof(*lp); +#else + { + static struct LAP lp_ = {0, 0, lapDDP}; + lp = &lp_; + } +#endif hdrlen = sizeof(*lp); switch (lp->type) { @@ -213,7 +222,7 @@ aarp_print(register const u_char *bp, u_int length) case 2: /* response */ (void)printf("reply %s is-at %s", - AT(pdaddr), etheraddr_string(ap->hdaddr)); + AT(psaddr), etheraddr_string(ap->hsaddr)); return; case 3: /* probe (oy!) */ @@ -567,10 +576,10 @@ ataddr_string(u_short atnet, u_char athost) else continue; - for (tp = &hnametable[i3 & (HASHNAMESIZE-1)]; + for (tp = &hnametable[i2 & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) ; - tp->addr = i3; + tp->addr = i2; tp->nxt = newhnamemem(); tp->name = strdup(nambuf); } diff --git a/contrib/tcpdump/print-atm.c b/contrib/tcpdump/print-atm.c index 6726818..4e061b0 100644 --- a/contrib/tcpdump/print-atm.c +++ b/contrib/tcpdump/print-atm.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint static const char rcsid[] _U_ = @@ -135,7 +137,6 @@ atm_if_print(const struct pcap_pkthdr *h, const u_char *p) printf("[|atm]"); return (caplen); } - /* * Extract the presumed LLC header into a variable, for quick * testing. diff --git a/contrib/tcpdump/print-bootp.c b/contrib/tcpdump/print-bootp.c index 8108993..844aecc 100644 --- a/contrib/tcpdump/print-bootp.c +++ b/contrib/tcpdump/print-bootp.c @@ -19,6 +19,8 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print bootp packets. + * + * $FreeBSD$ */ #ifndef lint static const char rcsid[] _U_ = diff --git a/contrib/tcpdump/print-bxxp.c b/contrib/tcpdump/print-bxxp.c deleted file mode 100644 index 56be54f..0000000 --- a/contrib/tcpdump/print-bxxp.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2000, Richard Sharpe - * - * This software may be distributed either under the terms of the - * BSD-style licence that accompanies tcpdump or under the GNU GPL - * version 2 or later. - * - * print-bxxp.c - * - */ - -#ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-bxxp.c,v 1.3 2000/10/05 04:10:01 itojun Exp $"; -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/param.h> -#include <sys/time.h> - -#ifdef HAVE_MEMORY_H -#include <memory.h> -#endif -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include "interface.h" -#include "extract.h" - -/* Check for a string but not go beyond length - * Return TRUE on match, FALSE otherwise - * - * Looks at the first few chars up to tl1 ... - */ - -int l_strnstart(const u_char *, u_int, const u_char *, u_int); - -int -l_strnstart(register const u_char *tstr1, register u_int tl1, - register const u_char *str2, register u_int l2) -{ - - if (tl1 > l2) - return 0; - - return (strncmp(tstr1, str2, tl1) == 0 ? 1 : 0); - -} - -void -bxxp_print(register const u_char *bp, register u_int length) -{ - - if (l_strnstart("REQ ", 4, bp, length)) { /* A REQuest */ - - printf(" BXXP REQ"); - - } - else if (l_strnstart("RSP ", 4, bp, length)) { - - printf(" BXXP RSP"); - - } - else if (l_strnstart("SEQ ", 4, bp, length)) { - - printf(" BXXP SEQ"); - - } - else if (l_strnstart("END", 4, bp, length)) { - - printf(" BXXP END"); - - } - else - printf(" BXXP (payload or undecoded)"); - -} diff --git a/contrib/tcpdump/print-domain.c b/contrib/tcpdump/print-domain.c index adcf592..08b5cea 100644 --- a/contrib/tcpdump/print-domain.c +++ b/contrib/tcpdump/print-domain.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-ether.c b/contrib/tcpdump/print-ether.c index e445017..a82fc93 100644 --- a/contrib/tcpdump/print-ether.c +++ b/contrib/tcpdump/print-ether.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint static const char rcsid[] _U_ = @@ -281,6 +283,8 @@ ether_encap_print(u_short ether_type, const u_char *p, case ETHERTYPE_PPPOED: case ETHERTYPE_PPPOES: + case ETHERTYPE_PPPOED2: + case ETHERTYPE_PPPOES2: pppoe_print(p, length); return (1); diff --git a/contrib/tcpdump/print-fddi.c b/contrib/tcpdump/print-fddi.c index d4112e1..acb68a9 100644 --- a/contrib/tcpdump/print-fddi.c +++ b/contrib/tcpdump/print-fddi.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-fr.c b/contrib/tcpdump/print-fr.c index fd04dce..6e5798f 100644 --- a/contrib/tcpdump/print-fr.c +++ b/contrib/tcpdump/print-fr.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-icmp.c b/contrib/tcpdump/print-icmp.c index 191005c..1ef5a68 100644 --- a/contrib/tcpdump/print-icmp.c +++ b/contrib/tcpdump/print-icmp.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-ip.c b/contrib/tcpdump/print-ip.c index ed81c5b..9773c29 100644 --- a/contrib/tcpdump/print-ip.c +++ b/contrib/tcpdump/print-ip.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-ip6.c b/contrib/tcpdump/print-ip6.c index cb9f803..cdf2f2a 100644 --- a/contrib/tcpdump/print-ip6.c +++ b/contrib/tcpdump/print-ip6.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-ipx.c b/contrib/tcpdump/print-ipx.c index 5309aa4..4afc4b3 100644 --- a/contrib/tcpdump/print-ipx.c +++ b/contrib/tcpdump/print-ipx.c @@ -20,6 +20,8 @@ * * Format and print Novell IPX packets. * Contributed by Brad Parker (brad@fcr.com). + * + * $FreeBSD$ */ #ifndef lint @@ -196,7 +198,7 @@ ipx_rip_print(const u_short *ipx, u_int length) (void)printf("ipx-rip-req"); if (length > 0) { TCHECK(ipx[3]); - (void)printf(" %u/%d.%d", EXTRACT_32BITS(&ipx[0]), + (void)printf(" %x/%d.%d", EXTRACT_32BITS(&ipx[0]), EXTRACT_16BITS(&ipx[2]), EXTRACT_16BITS(&ipx[3])); } break; @@ -204,7 +206,7 @@ ipx_rip_print(const u_short *ipx, u_int length) (void)printf("ipx-rip-resp"); for (i = 0; i < 50 && length > 0; i++) { TCHECK(ipx[3]); - (void)printf(" %u/%d.%d", EXTRACT_32BITS(&ipx[0]), + (void)printf(" %x/%d.%d", EXTRACT_32BITS(&ipx[0]), EXTRACT_16BITS(&ipx[2]), EXTRACT_16BITS(&ipx[3])); ipx += 4; diff --git a/contrib/tcpdump/print-isoclns.c b/contrib/tcpdump/print-isoclns.c index 77c03ed..ccfabc7 100644 --- a/contrib/tcpdump/print-isoclns.c +++ b/contrib/tcpdump/print-isoclns.c @@ -22,6 +22,8 @@ * * Extensively modified by Hannes Gredler (hannes@juniper.net) for more * complete IS-IS & CLNP support. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-lcp.c b/contrib/tcpdump/print-lcp.c deleted file mode 100644 index ddea9c6..0000000 --- a/contrib/tcpdump/print-lcp.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef lint -static const char rcsid[] = -"@(#) $Header: /tcpdump/master/tcpdump/print-lcp.c,v 1.9 2000/10/06 04:23:12 guy Exp $ (LBL)"; -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/param.h> -#include <sys/time.h> -#include <sys/socket.h> - -#include <netinet/in.h> - -#include <stdio.h> -#include <string.h> - -#include "interface.h" -#include "addrtoname.h" -#include "extract.h" /* must come after interface.h */ -#include "ppp.h" - -/* Codes */ -enum { - LCP_CONFREQ = 1, - LCP_CONFACK = 2, - LCP_CONFNAK = 3, - LCP_CONFREJ = 4, - LCP_TERMREQ = 5, - LCP_TERMACK = 6, - LCP_CODEREJ = 7, - LCP_PROTREJ = 8, - LCP_ECHOREQ = 9, - LCP_ECHOREP = 10, - LCP_DISCARD = 11 -}; - -static struct tok lcpcode2str[] = { - { LCP_CONFREQ, "ConfReq" }, - { LCP_CONFACK, "ConfAck" }, - { LCP_CONFNAK, "ConfNak" }, - { LCP_CONFREJ, "ConfRej" }, - { LCP_TERMREQ, "TermReq" }, - { LCP_TERMACK, "TermAck" }, - { LCP_CODEREJ, "CodeRej" }, - { LCP_PROTREJ, "ProtRej" }, - { LCP_ECHOREQ, "EchoReq" }, - { LCP_ECHOREP, "EchoRep" }, - { LCP_DISCARD, "Discard" }, - { 0, NULL } -}; - - -enum { - LCP_RESERVED = 0, - LCP_MRU = 1, - LCP_ASYNCMAP = 2, - LCP_AUTHPROTO = 3, - LCP_QUALPROTO = 4, - LCP_MAGICNUM = 5, - LCP_PCOMP = 7, - LCP_ACFCOMP = 8, - LCP_CALLBACK = 13 -}; - -static struct tok lcpoption2str[] = { - { LCP_RESERVED, "reserved"}, - { LCP_MRU, "mru"}, - { LCP_ASYNCMAP, "asyncmap"}, - { LCP_AUTHPROTO, "auth"}, - { LCP_QUALPROTO, "qual"}, - { LCP_MAGICNUM, "magic"}, - { LCP_PCOMP, "pcomp"}, - { LCP_ACFCOMP, "acfcomp"}, - { LCP_CALLBACK, "callback"}, - { 0, NULL } -}; - -static struct tok lcpauth2str[] = { - {0xc023, "PAP"}, - {0xc223, "CHAP"}, - { 0, NULL } -}; - -static struct tok lcpqual2str[] = { - {0xc025, "LQR"}, - { 0, NULL } -}; - -static struct tok lcpchap2str[] = { - {0x05, "MD5"}, - {0x80, "MS"}, - { 0, NULL } -}; - -void -lcp_print(register const u_char *bp, u_int length) -{ - u_short lcp_code, lcp_id, lcp_length; - const u_char *lcp_data; - - lcp_data = bp+4; - - if (snapend < lcp_data) { - printf(" [LCP|]"); - return; - } - - lcp_code = bp[0]; - lcp_id = bp[1]; - lcp_length = EXTRACT_16BITS(bp+2); - - printf("LCP %s id=0x%x", tok2str(lcpcode2str, "LCP-#%d", lcp_code), lcp_id); - - switch (lcp_code) { - case LCP_CONFREQ: - case LCP_CONFACK: - case LCP_CONFNAK: - case LCP_CONFREJ: - /* Print Options */ - { - u_char lcpopt_type, lcpopt_length; - const u_char *p=lcp_data; - while (p+2 < lcp_data+lcp_length && p+2 < snapend) { - lcpopt_type = p[0]; - lcpopt_length = p[1]; - p+=2; - printf(" <%s ",tok2str(lcpoption2str, "option-#%d", lcpopt_type)); - if (lcpopt_length) - switch (lcpopt_type) { - case LCP_MRU: - if (snapend < p+2) return; - printf("%d",ntohs(*(u_short*)p)); - if (lcpopt_length != 4) printf(" len=%d!",lcpopt_length); - break; - case LCP_AUTHPROTO: - if (snapend < p+2) return; - printf("%s",tok2str(lcpauth2str, "AUTH-%#x", ntohs(*(u_short*)p))); - if (lcpopt_length < 4) printf(" len=%d!",lcpopt_length); - if (lcpopt_length >= 5 && p < snapend) - printf(" %s",tok2str(lcpchap2str, "%#x", p[0])); - break; - case LCP_QUALPROTO: - if (snapend < p+2) return; - printf("%s",tok2str(lcpqual2str, "QUAL-%#x", ntohs(*(u_short*)p))); - if (lcpopt_length < 4) printf(" len=%d!",lcpopt_length); - /* Print data field of auth? */ - break; - case LCP_ASYNCMAP: - case LCP_MAGICNUM: - if (snapend < p+4) return; - printf("%#x", (unsigned)ntohl(*(u_long*)p)); - if (lcpopt_length != 6) printf(" len=%d!",lcpopt_length); - break; - case LCP_PCOMP: - case LCP_ACFCOMP: - case LCP_RESERVED: - if (lcpopt_length != 2) printf(" len=%d!",lcpopt_length); - break; - default: - if (lcpopt_length != 2) printf(" len=%d",lcpopt_length); - break; - } - printf(">"); - p+=lcpopt_length-2; - } - } - break; - case LCP_ECHOREQ: - case LCP_ECHOREP: - case LCP_DISCARD: - if (snapend < lcp_data+4) return; - printf(" magic=%#x", (unsigned)ntohl(*(u_long *) lcp_data)); - lcp_data +=4; - break; - case LCP_PROTREJ: - if (snapend < lcp_data+2) return; - printf(" prot=%s", tok2str(ppptype2str, "PROT-%#x", ntohs(*(u_short *) lcp_data))); - /* TODO print rejected packet too ? */ - break; - case LCP_CODEREJ: - if (snapend < lcp_data+4) return; - printf(" "); - lcp_print(lcp_data, (lcp_length+lcp_data > snapend ? snapend-lcp_data : lcp_length)); - break; - case LCP_TERMREQ: - case LCP_TERMACK: - break; - default: - break; - } - - return; -} diff --git a/contrib/tcpdump/print-llc.c b/contrib/tcpdump/print-llc.c index cbf16ce..cc665f5 100644 --- a/contrib/tcpdump/print-llc.c +++ b/contrib/tcpdump/print-llc.c @@ -20,6 +20,8 @@ * * Code by Matt Thomas, Digital Equipment Corporation * with an awful lot of hacking by Jeffrey Mogul, DECWRL + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-nfs.c b/contrib/tcpdump/print-nfs.c index a702170..8929d73 100644 --- a/contrib/tcpdump/print-nfs.c +++ b/contrib/tcpdump/print-nfs.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-ntp.c b/contrib/tcpdump/print-ntp.c index 606a654..9e8ccfa 100644 --- a/contrib/tcpdump/print-ntp.c +++ b/contrib/tcpdump/print-ntp.c @@ -21,6 +21,8 @@ * Format and print ntp packets. * By Jeffrey Mogul/DECWRL * loosely based on print-bootp.c + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-null.c b/contrib/tcpdump/print-null.c index 3a45f6a..04254d2 100644 --- a/contrib/tcpdump/print-null.c +++ b/contrib/tcpdump/print-null.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-pim.c b/contrib/tcpdump/print-pim.c index f50f821..d4bafe4 100644 --- a/contrib/tcpdump/print-pim.c +++ b/contrib/tcpdump/print-pim.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-ppp.c b/contrib/tcpdump/print-ppp.c index b6bafae..3c48c78 100644 --- a/contrib/tcpdump/print-ppp.c +++ b/contrib/tcpdump/print-ppp.c @@ -20,6 +20,8 @@ * * Extensively modified by Motonori Shindo (mshindo@mshindo.net) for more * complete PPP support. + * + * $FreeBSD$ */ /* diff --git a/contrib/tcpdump/print-sl.c b/contrib/tcpdump/print-sl.c index f28a21a..97389d8 100644 --- a/contrib/tcpdump/print-sl.c +++ b/contrib/tcpdump/print-sl.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-sunrpc.c b/contrib/tcpdump/print-sunrpc.c index 03e28a4..420ec36 100644 --- a/contrib/tcpdump/print-sunrpc.c +++ b/contrib/tcpdump/print-sunrpc.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/print-token.c b/contrib/tcpdump/print-token.c index 0633578..3f8e215 100644 --- a/contrib/tcpdump/print-token.c +++ b/contrib/tcpdump/print-token.c @@ -22,6 +22,8 @@ * * Further tweaked to more closely resemble print-fddi.c * Guy Harris <guy@alum.mit.edu> + * + * $FreeBSD$ */ #ifndef lint static const char rcsid[] _U_ = diff --git a/contrib/tcpdump/print-udp.c b/contrib/tcpdump/print-udp.c index 87da886..089da1a 100644 --- a/contrib/tcpdump/print-udp.c +++ b/contrib/tcpdump/print-udp.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint diff --git a/contrib/tcpdump/savestr.c b/contrib/tcpdump/savestr.c deleted file mode 100644 index a81227c..0000000 --- a/contrib/tcpdump/savestr.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 1997 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/Attic/savestr.c,v 1.6 2000/07/11 00:49:02 assar Exp $ (LBL)"; -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/types.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#ifdef HAVE_OS_PROTO_H -#include "os-proto.h" -#endif - -#include "savestr.h" - -/* A replacement for strdup() that cuts down on malloc() overhead */ -char * -savestr(register const char *str) -{ - register u_int size; - register char *p; - static char *strptr = NULL; - static u_int strsize = 0; - - size = strlen(str) + 1; - if (size > strsize) { - strsize = 1024; - if (strsize < size) - strsize = size; - strptr = (char *)malloc(strsize); - if (strptr == NULL) { - fprintf(stderr, "savestr: malloc\n"); - exit(1); - } - } - (void)strcpy(strptr, str); - p = strptr; - strptr += size; - strsize -= size; - return (p); -} diff --git a/contrib/tcpdump/savestr.h b/contrib/tcpdump/savestr.h deleted file mode 100644 index 8fe995e..0000000 --- a/contrib/tcpdump/savestr.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 1997 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#) $Header: /tcpdump/master/tcpdump/Attic/savestr.h,v 1.1.1.1 1999/10/07 23:47:12 mcr Exp $ (LBL) - */ - -extern char *savestr(const char *); diff --git a/contrib/tcpdump/tcpdump-stdinc.h b/contrib/tcpdump/tcpdump-stdinc.h index dbabeef..6591183 100644 --- a/contrib/tcpdump/tcpdump-stdinc.h +++ b/contrib/tcpdump/tcpdump-stdinc.h @@ -29,7 +29,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * - * @(#) $Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.12.2.3 2005/05/04 19:20:20 risso Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.12 2005/03/27 01:35:45 guy Exp $ (LBL) + * + * $FreeBSD$ */ /* @@ -143,37 +145,6 @@ typedef char* caddr_t; #define FOPEN_WRITE_BIN FOPEN_WRITE_TXT #endif -#if defined(__GNUC__) && defined(__i386__) && !defined(__ntohl) - #undef ntohl - #undef ntohs - #undef htonl - #undef htons - - extern __inline__ unsigned long __ntohl (unsigned long x); - extern __inline__ unsigned short __ntohs (unsigned short x); - - #define ntohl(x) __ntohl(x) - #define ntohs(x) __ntohs(x) - #define htonl(x) __ntohl(x) - #define htons(x) __ntohs(x) - - extern __inline__ unsigned long __ntohl (unsigned long x) - { - __asm__ ("xchgb %b0, %h0\n\t" /* swap lower bytes */ - "rorl $16, %0\n\t" /* swap words */ - "xchgb %b0, %h0" /* swap higher bytes */ - : "=q" (x) : "0" (x)); - return (x); - } - - extern __inline__ unsigned short __ntohs (unsigned short x) - { - __asm__ ("xchgb %b0, %h0" /* swap bytes */ - : "=q" (x) : "0" (x)); - return (x); - } -#endif - #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif diff --git a/contrib/tcpdump/tcpdump.1 b/contrib/tcpdump/tcpdump.1 index b08d2c6..5a009ac 100644 --- a/contrib/tcpdump/tcpdump.1 +++ b/contrib/tcpdump/tcpdump.1 @@ -22,6 +22,8 @@ .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" +.\" $FreeBSD$ +.\" .TH TCPDUMP 1 "18 April 2005" .SH NAME tcpdump \- dump traffic on a network @@ -99,6 +101,11 @@ tcpdump \- dump traffic on a network ] .ti +8 [ +.B \-y +.I datalinktype +] +.ti +8 +[ .I expression ] .br @@ -639,6 +646,15 @@ protos are: .BR arp , .BR rarp , .BR decnet , +.BR lat , +.BR sca , +.BR moprc , +.BR mopdl , +.BR iso , +.BR esis , +.BR isis , +.BR icmp , +.BR icmp6 , .B tcp and .BR udp . @@ -2200,7 +2216,7 @@ is made to account for the time lag between when the Ethernet interface removed the packet from the wire and when the kernel serviced the `new packet' interrupt. .SH "SEE ALSO" -stty(1), pcap(3), bpf(4), nit(4P), pfconfig(8) +bpf(4), pcap(3) .SH AUTHORS The original authors are: .LP diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c index 6c47f50..3263824 100644 --- a/contrib/tcpdump/tcpdump.c +++ b/contrib/tcpdump/tcpdump.c @@ -33,6 +33,8 @@ static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.253.2.8 2005/07/05 21:09:05 mcr Exp $ (LBL)"; #endif +/* $FreeBSD$ */ + /* * tcpdump - monitor tcp/ip traffic on an ethernet. * diff --git a/contrib/tcpdump/token.h b/contrib/tcpdump/token.h index 8e7fd6d..e466c84 100644 --- a/contrib/tcpdump/token.h +++ b/contrib/tcpdump/token.h @@ -25,6 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ #define TOKEN_HDRLEN 14 |