dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

37 Commits

Author SHA1 Message Date
Guy Harris 936df0fbc1 From Gisle Vanem:
* nametoaddr.c with DECNETLIB defined needs <netdnet/dnetdb.h>
  included. And which again needs <sys/types.h>.

* Remove "IP6_misc.h" since it's already included in pcap-stdinc.h
  (ref. my patch to pcap-stdinc.h).
2009-02-14 14:36:34 -08:00
guy f8f7ec5ace From Arien Vijn: support various notions for MAC addresses. 2008-02-06 10:21:30 +00:00
guy a6186fa56d Pick up changes from NetBSD:
several files:

	date: 2006/02/27 15:53:24;  author: drochner;  state: Exp;
	avoid shadowing globals, for WARNS=2

	date: 2006/02/27 15:55:30;  author: drochner;  state: Exp;
	minor constification, good for WARNS=3 now

	date: 2006/02/27 15:57:17;  author: drochner;  state: Exp;
	NetBSD adaption:

		...

	-const pcap_strerror() for consistency


    gencode.c:

	date: 2006/04/26 09:24:33;  author: tron;  state: Exp;
	Add missing "const" keywords to match declarations in "pcap.h".

	date: 2006/10/15 19:27:21;  author: christos;  state: Exp;
	add a volatile variable to prevent vfork/longjmp clobbering.

    optimize.c:

	date: 2006/05/17 17:48:36;  author: drochner;  state: Exp;
	Make the optimizer use unsigned numbers as the kernel does.
	While it is not agreed on that purely unsigned arithmetics is nice,
	different behaviour of optimized and unoptimized code is less desirable.

    pcap-bpf.c:

	date: 2006/02/27 15:51:38;  author: drochner;  state: Exp;
	pull in from NetBSD's libpcap: use cloning bpf device on NetBSD

Have the configure script check for paths.h, so that we can include it
only if we have it, and use the cloning BPF device only if we're on
NetBSD *and* _PATH_BPF is defined (hopefully this will keep us from
using it on versions of NetBSD that don't have a cloning BPF device; if,
in the future, other OSes with BPF get cloning BPF devices, we can make
this work for them as well).
2007-06-11 10:04:24 +00:00
guy 084bcf12ea Put the public libpcap headers into a pcap subdirectory in both the
source directory and the target include directory, and have include
files at the top-level directory to include those headers, for backwards
compatibility.

Update the FILES and INSTALL.txt files to reflect current reality.
2006-10-04 18:09:21 +00:00
guy eeaf96fb94 Some systems (*cough*Irix*cough) not only don't declare
"ether_hostton()" but don't even declare "struct ether_addr"; on those
systems, declare "struct ether_addr".
2005-04-20 11:12:36 +00:00
guy 24c3633894 <string.h> is the ANSI C standard header file to include for various
routines, including malloc() and company - and for string routines used
in this file, which aren't necessarily declared in <memory.h>, so
include <string.h>.
2005-04-20 10:37:32 +00:00
guy 97a8e5112d From Patrick Marie <mycroft@virgaria.org>: add support for port ranges
in tests - "portrange X-Y" matches all ports in the range [X,Y].

Support added for port ranges with IPv6.

Fix some comments.
2005-04-19 04:25:00 +00:00
guy 73a0081c01 Fix some typoes for "ether_hostton".
If we don't have ether_hostton(), don't bother checking
NETINET_ETHER_H_DECLARES_ETHER_HOSTTON and including <netinet/ether.h>
if it's defined.
2005-03-27 22:26:25 +00:00
guy 822f0efb5f If we don't get a declaration of ether_hostton() by including
<netinet/if_ether.h>, try <netinet/ether.h>.
2005-03-27 02:45:03 +00:00
guy d3bc29242e If we have ether_hostton(), check whether we have <netinet/if_ether.h>
and if including it declares ether_hostton(), and define
HAVE_DECL_ETHER_HOSTTON appropriately, and use that to determine whether
to define it ourselves, rather than having a set of OSes that don't need
it, as that set can change over time.

Make the default declaration of "ether_hostton()" declare its first
argument as "const char *", as that's what it's *supposed* to be
(although it's not declared as such in some OSes, so we still have to
cast a "const char *" when passed as the first argument).
2005-03-26 23:07:50 +00:00
guy afe114b070 For "ether proto", allow LLC value names as well as Ethernet type value
names, so that, as the tcpdump man page claims to be the case, "ether
proto \{iso,stp,ipx,netbeui}" are equivalent to "{iso,stp,ipx,netbeui}".
2005-03-17 07:02:31 +00:00
itojun 1b3a318d83 typo 2003-12-24 09:14:21 +00:00
itojun 08ef9a54d2 some getaddrinfo(3) can return multiple address against SOCK_STREAM (like tcp
adn sctp).  hardcode to tcp for now.  suz@kame
2003-12-24 08:27:04 +00:00
guy d7bc98d08b Typo fix from Brian Ginsbach. 2003-11-19 18:14:18 +00:00
guy 52c71acb69 From Brian Ginsbach <ginsbach@cray.com>: add UNICOS/mp to the list of
OSes that declare "ether_hostton()" themselves.
2003-11-16 09:48:25 +00:00
guy 30e89f192a Add _U_ to "rcsid[]" definitions, to eliminate "unused variable"
warnings from newer versions of GCC.
2003-11-15 23:23:57 +00:00
fenner c5419d46c8 Only look up "tcp" and "udp" in pcap_nametoport(). This fixes the
case in e.g. FreeBSD where /etc/services lists port 4 for the ddp "echo"
 service.

Submitted by:	Alan Bawden <Alan@LCS.MIT.EDU>
2003-02-25 22:12:03 +00:00
guy bf6b573fc3 Include "IP6_misc.h" even on UNIX if __MINGW32__ is defined, as had
been the case before the previous checkin.
2002-08-02 05:53:53 +00:00
guy 309e386870 Use <pcap-stdinc.h> only on Windows; on UNIX, selectively include, in
each source file, only the headers that file needs, and all the headers
it needs in order to compile on various platforms and not to get any
avoidable compiler warnings on those platforms (as well as any
incomplete structure definitions needed to avoid those warnings).

That also means that <pcap.h> doesn't include <pcap-stdinc.h> on UNIX;
we don't want it to include <pcap-stdinc.h>, at least on UNIX, as doing
so

	1) would mean we'd have to install that, so that programs can
	   build with libpcap

and

	2) would mean that programs including <pcap.h> would drag in a
	   bunch of header files that they don't need.

Put a newline at the end of "inet.c" - the Sun C compiler doesn't like
it if the last line doesn't end with a newline.
2002-08-02 03:44:19 +00:00
risso 6831542ec7 Added support for Win32, based on WinPcap. 2002-08-01 08:33:01 +00:00
itojun 5918c491c1 whitespace cleanup 2002-06-11 17:04:44 +00:00
guy 55dba26a62 Indicate why we have incomplete definitions for "struct mbuf" and
"struct rtentry" (in <net/if.h> on some systems, e.g.  Digital UNIX 4.0,
there are prototypes for kernel functions that include "struct mbuf *"
and "struct rtentry *" arguments, and they are included even if you're
just user-mode code).

We don't need to include <netinet/if_ether.h> unless we have
"ether_hostton()", and we don't need to include <net/if.h> unless we're
including <netinet/if_ether.h>, and we don't need to define "struct
mbuf" or "struct rtentry" unless we're including <net/if.h>.
2002-04-09 07:41:19 +00:00
guy 67a0588585 No need to include <sys/socket.h> twice. 2002-04-07 00:22:30 +00:00
guy 8d52bdae65 There's no need to include <netdb.h> twice. 2002-04-06 23:27:33 +00:00
guy b92ebafe8e Cast the argument to <ctype.h> macros to "unsigned char", to eliminate
GCC warnings and to keep the macros from referring outside an array when
handed bytes with the 8th bit set.
2001-07-28 22:56:34 +00:00
guy 70836ff6e9 Put a "return (0);" into "__pcap_nametodnaddr()" to squelch complaints
the Digital^H^H^H^H^H^H^HTru64 UNIX C compiler.
2001-06-27 05:11:48 +00:00
guy 8a6db7a7d5 Sigh. Not all systems have <netinet/if_ether.h> - for example, at least
some libc5 Linux systems don't - so we have to check whether it exists,
and include it only if it does.
2001-01-17 18:18:48 +00:00
guy 892c4a4436 Put in a comment noting that we should, perhaps, declare
"ether_hostton()" in "lbl/os-XXX.h" files rather than in "nametoaddr.c".
2000-12-18 03:45:34 +00:00
guy 839690365f As per many suggestions, the most recent in mail to
"patches@tcpdump.org" by Jonathan Wilkins
<jwilkins@madscience.dyndns.org>, we don't declare "ether_hostton()" on
FreeBSD - it's declared in <net/ethernet.h> in 3.0 and later, and is
declared with the first argument as "const char *" in 4.0 and later so
that if we declare it with the first argument as "char *" we get errors.
(If we declare it with "const char *", you get errors on FreeBSD 3.x and
other systems that *don't* declare it with "const char *".)

XXX - should it go, instead, into "lbl/os-XXX.h" files, for those OS
versions that don't declare it, and not be declared at all here?
2000-12-18 03:42:39 +00:00
guy bcb41391ec Eliminate a warning with some compilers. 2000-10-10 04:53:54 +00:00
assar 0e2f8c8892 add config.h, remove gnuc.h. remove __dead 2000-07-11 00:37:04 +00:00
assar 7b517010e0 remove non-STDC code and malloc.h 2000-07-01 03:35:07 +00:00
itojun a906e591fb revert renaming of pcap_nametoaddrinfo to pcap_nametoaddr. this gets
painful when upgrading old libpcap to tcpdump.org pcap (function rename
usually requires shlib major number bump, while api addition only require
minor)
2000-04-27 09:18:57 +00:00
itojun 45ac9150b7 restrict result from getaddrinfo() by specifying hints.ai_socktype.
otherwise, multiple answer may be returned for single numeric address
(for SOCK_STREAM and SOCK_DGRAM, for example).
1999-11-25 08:25:35 +00:00
itojun 7fe3c1111a IPv6 packet filtering code.
./configure --enable-ipv6 (requires getaddrinfo(3) and getnameinfo(3)).

TODO: make it work even without getaddrinfo(3) or getnameinfo(3)
(or, tcpdump/configure.in should provide alternative version by
AC_REPLACE_FUNCS)
TODO: make IPv6 filtering code work by default
TODO: make "protochain" friendly with optimization
1999-10-19 15:18:28 +00:00
mcr db0e314c6d removed prototype to permit building on NetBSD 1999-10-17 21:29:18 +00:00
mcr b11ddf8a9b Initial revision 1999-10-07 23:46:40 +00:00