dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

59 Commits

Author SHA1 Message Date
guy c1401d4725 The DLT_LINUX_PPP_WITHDIRECTION is also used for pppd on some BSDs, so
rename it again to DLT_PPP_PPPD, and rename other #defines to match.

Add backwards-compatibility #defines of DLT_PPP_WITH_DIRECTION and
DLT_LINUX_PPP_WITHDIRECTION for software that used them.
2005-02-08 19:52:18 +00:00
guy d9e0597103 Rename DLT_PPP_WITHDIRECTION to DLT_LINUX_PPP_WITHDIRECTION, as it's a
Linux-specific mechanism, and rename other #defines accordingly.  Give
more details about it in comments.
2005-01-31 01:47:27 +00:00
hannes d6d37a1ad0 remove duplicate Juniper ML-PPP DLT name 2005-01-27 18:32:28 +00:00
hannes b82f83587c add support for DLT_JUNIPER_{MLFR,MLPPP) 2005-01-25 22:38:23 +00:00
hannes f718fd1835 add support for Juniper PIC Peer DLT_ 2005-01-12 09:15:05 +00:00
hannes 6e18a333d2 add gencode support for Juniper ML/LS PIC DLT_ 2005-01-12 09:02:55 +00:00
guy b3a008a463 Mark some arguments as unused (pointers to those functions are assigned
to pointer variables, so the signature can't be changed).

From Gisle Vanem: assign to the right variables in the Win32
version-string construction code (where one criterion for being "right"
is that the variable exist...).
2004-12-19 20:02:45 +00:00
guy f8a76d1d76 From Gisle Vanem: MS-DOS support. 2004-12-18 08:52:08 +00:00
guy 529f98f94f Use "version.h" if autoconf is being used (as that assumes a
UN*Xy-enough platform that the Makefile.in rules to generate "version.h"
work), and use the stuff from "version.h" iff HAVE_VERSION_H is defined,
so we can use it even with WinPcap.
2004-12-17 23:25:36 +00:00
guy 3ba117b68d On Win32, don't close "p->fd" in "pcap_close_common()", as there is no
"p->fd".  Do, however, use "pcap_close_common()" to free up "p->buffer",
as is done on other platforms.
2004-12-17 20:41:59 +00:00
guy 6fdd92e436 From Gisle Vanem: add some new link-layer types to the "dlt_choices[]"
table.

Add some even newer ones that arrived after his patch.
2004-12-17 19:55:41 +00:00
hannes 3bcf07168c add support for DLT_JUNIPER_ATM1 (137) and DLT_JUNIPER_ATM2 (135) 2004-10-19 15:55:28 +00:00
guy e5aebee6d8 Add a "pcap_close_common()" routine which can be used as the close
routine for some pcap-XXX.c files and can be called by the close routine
in other pcap-XXX.c files.
2004-10-19 07:06:11 +00:00
mcr 78caf331be patch from Gisle Vanem for Symantec/Raptor tcpdump. 2004-03-24 19:50:54 +00:00
guy 2d2890dd37 Add support for sending packets; includes contributions from Mark
Pizzolato <List-tcpdump-workers@subscriptions.pizzolato.net>.
2004-03-23 19:18:04 +00:00
guy 1bd06dd0d5 Add support for Apple's IP-over-IEEE 1394 encapsulation.
Fix a comment.
2004-03-17 19:03:28 +00:00
guy 7ac8a0a75b DLT_IEEE802_11_RADIO is used for the BSD radio header; add a new
DLT_IEEE802_11_RADIO_AVS for future use with the AVS radio header.

Fix a comment.

Put in reserved LINKTYPE_USERn values corresponding to the reserved
DLT_USERn values.
2004-01-29 10:36:43 +00:00
guy 619a9fe31b For devices that we have some reason to believe are real live Ethernet
devices, offer DLT_DOCSIS as one of the choices of link-layer type, and
support setting that type as meaning just "set libpcap's notion of the
link-layer type to DLT_DOCSIS" without telling the driver to use
DLT_DOCSIS.
2003-12-18 23:32:31 +00:00
guy c98ffbcabf Add a "pcap_get_selectable_fd()" API to get an FD on which you can do a
"select()" or "poll()" - or -1 if that won't work.
2003-11-21 10:19:33 +00:00
guy 2c618b93a0 Add "getnonblock" and "setnonblock" operations, and set the function
pointers appropriately, rather than using #ifdefs and run-time checks.

Get rid of declaration of non-existent "pcap_set_datalink_platform()"
routine.
2003-11-20 02:02:38 +00:00
guy 028bb1b31d From Koryn Grant <koryn@endace.com> - DAG support enhancements and fixes:
Added support for nonblocking operation.

	Added support for processing more than a single packet in
	pcap_dispatch().

	Fixed bug in loss counter code.

	Improved portability of loss counter code (e.g. use UINT_MAX
	instead of 0xffff).

	Removed unused local variables.

	Added required headers (ctype.h, limits.h, unistd.h,
	netinet/in.h).

	Changed semantics to match those of standard pcap on linux.
		- packets rejected by the filter are not counted.
2003-11-20 01:21:25 +00:00
guy ba73faeef3 Add "pcap_datalink_val_to_description()", which returns, for a DLT_
type, a short description intended for humans.

Fix up some man page typoes.
2003-11-18 22:14:24 +00:00
guy a08248f680 From Jean Tourrilhes <jean2@sourceforge.net>: IrDA capture support for
Linux.
2003-11-18 21:06:50 +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
guy 991d444f71 Add a "pcap_breakloop()" API to break out of the loop in
"pcap_dispatch()" and "pcap_loop()".
2003-11-04 07:05:32 +00:00
guy b30cb92144 Sort the link-layer types by value, and add some missing ones. 2003-10-31 21:49:18 +00:00
guy cd0d893ef9 Add a "read" function pointer to the pcap_t structure, which handles
reading packets from a pcap_t, and make "pcap_read()" call it.  That
removes the last place where we have to check for a pcap_t that refers
to a DAG card rather than a live capture, so get rid of the "is_dag" flag.
2003-07-25 05:32:02 +00:00
guy 08658f1c93 Add a "set_datalink" function pointer to the pcap_t structure, whichhandles
setting a filter for a pcap_t.  Have "pcap_set_datalink()" call it,
rather than explicitly calling "pcap_set_datalink_platform()".
2003-07-25 05:07:01 +00:00
guy cd2807e08d Add a "setfilter" function pointer to the pcap_t structure, which
handles setting a filter for a pcap_t.  Have "pcap_setfilter()" call it,
rather than being a per-platform function.  The per-platform functions
don't need to check for an offline capture any more, as they're not
called for an offline capture (and the ones that just call
"install_bpf_program()" don't need to exist at all).
2003-07-25 04:42:02 +00:00
guy 9792990eb8 Add a "stats" function pointer to the pcap_t structure, which handles
getting statistics for a pcap_t.  Have "pcap_stats()" call it, rather
than being a per-platform function; have stats routines for non-live
pcap_t's that return an error.
2003-07-25 04:04:56 +00:00
guy e648c9e593 Add a "close" function pointer to the pcap_t structure, which handles
the platform-dependent part of closing a pcap_t (and the
live-vs-savefile part as well, so that function must close the file
descriptor and free up any buffers allocated).

In the Digital UNIX support, add in a check for a memory allocation
failure.
2003-07-25 03:25:45 +00:00
guy 77cade932c From Jesper Peterson <jesper@endace.com>: support for capturing from
Endace DAG devices.
2003-07-23 05:29:19 +00:00
guy bd2783673c On Win32, get the packet.dll version string using "PacketGetVersion()",
and if it differs from the wpcap.dll version string, report both
versions (just in case somebody happens to have different versions of
wpcap.dll and packet.dll installed).
2003-06-07 10:26:04 +00:00
guy c2176de8a7 Back out the previous change - it reflected an earlier version of the
signature for "pcap_next_ex()".
2003-06-03 21:45:49 +00:00
risso a1851659e1 Avoid a compiler warning (at least) on BSD. 2003-05-26 08:52:42 +00:00
guy 401b04f629 Style cleanups, data type fix (make the "pkt_data" argument to
"pcap_next_ex()" a pointer to pointer to const u_char, to squelch
compiler warnings and to let the caller know that they're not supposed
to modify the data), and additional explanation in "pcap_next_ex()" of
the return-code conflict.
2003-04-10 06:10:37 +00:00
risso 66ed3857c4 Added the new pcap_next_ex() function and its support routines 2003-04-09 09:58:16 +00:00
guy 23d8b7205b Add support for OpenBSD DLT_PFLOG.
Get rid of bogus newline in BPF error string.
2003-03-11 06:23:52 +00:00
guy 694746f160 At least on SunOS 5.x, Digital UNIX 4.0, AIX 4.3, FreeBSD 3.4, some
version of Red Hat Linux, HP-UX 11.00, and MacOS X 10.1, if a string in
a shared library is static, and returned by a function in that library,
the return value of that function, when called from a program, will
reflect the contents of the string in the version of the shared library
with which the program is running, not the version with which it's
linked.

Therefore we can just generate a definition of the version string and
put it into "version.h", which means that VERSION can contain any string
(as long as " and \ are escaped with \) rather than having to be N.M or
N.M.MM.
2003-02-13 07:54:59 +00:00
guy be8c1efc2c Support dot-dot version numbers.
Generate version.h before generating dependencies.
2003-02-11 08:01:40 +00:00
guy c3d7575735 Handle Win32/WinPcap differently when generating the version string. 2003-02-11 07:50:03 +00:00
guy e13c350417 Add a "pcap_lib_version()" routine to return a version string for
libpcap; it generates the string at run time on the first call, so that
it's not a constant string - in at least some UNIXes, constant data in a
shared library is kept separate from the library code, and is bound into
applications linked with that library at link time, not at run time, so
a constant string (such as "pcap_version[]") can reflect the version of
the library with which the application was built, not the version with
which it's running.

Document it, in the hopes that vendors will be less likely to omit it
from their libpcaps (unlike "pcap_version[]", which is absent from some
vendors' libpcaps).
2003-02-11 07:40:09 +00:00
guy 2d1ac3b4d5 From Peter Fales <peter@fales-lorenz.net>: support for Linux ARCNET,
which supplies different headers from BSD ARCNET, and fixes to the
ARCNET code generator (the protocol ID field is 1 byte, so the values
for it shouldn't be byte-swapped).

Whitespace cleanups.

The "NetBSD-style" ARCNET headers are used in other BSDs as well, so
just call them "BSD-style".
2003-01-23 07:24:51 +00:00
guy 5b474ef2bb Move the freeing of "p->dlt_list" to the proper place. 2003-01-16 07:44:27 +00:00
guy 3150af88f7 Squelch compiler warnings from Sun C. 2003-01-03 08:34:46 +00:00
guy 482fa426bc NetBSD support for multiple data link types on an interface, from David
Young <dyoung@ojctech.com>, with some minor changes by Jason R.  Thorpe
<thorpej@netbsd.org>, and further changes by me to support it on BPF
systems lacking BIOCGDLTLIST and other platforms lacking an equivalent
feature.

Update Jason Thorpe's e-mail address (Zembu is going away, if it hasn't
done so already).

Add APIs to map DLT names to DLT values and vice versa.
2002-12-19 09:05:45 +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 99f5637e53 Have "pcap_setnonblock()" just return 0 on success, not the new value of
the file descriptor flags; there's no guarantee that it will actually
*affect* the file descriptor flags (consider a memory-mapped capture
mechanism such as the Linux 2.4 mechanism, where all "non-blocking mode"
means is "don't do a 'select()' or 'poll()' if there aren't any new
packets in the memory-mapped buffer") or, in fact, that there are file
descriptor flags to affect (consider WinPcap).
2001-12-29 21:55:32 +00:00