dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

1107 Commits

Author SHA1 Message Date
guy f84d077e07 Document the new API's, move a bunch of information about libpcap
concepts to the pcap(3PCAP) man page, refer people to the pcap(3PCAP)
man page from the man pages for libpcap functions, and clean up some
errors.
2008-04-06 02:53:21 +00:00
guy 3734017134 Include <pcap/pcap.h> in the SUMMARY sections - as long as we're going
to 1.0, might as well go with the place where Red Hat stuck the header
at one point and where the header "officially" resides.

(We should put a "backwards compatibility" note into pcap.3pcap.)
2008-04-05 20:26:56 +00:00
guy baadfaab07 Split the pcap(3) man page into a bunch of individual man pages for
functions plus an overall man page for libpcap, and put them all into
section 3PCAP.  That means you can actually do "man pcap_open_live" and
get something meaningful, rather than having to do "man pcap" and then
scroll through all the other stuff in the man page.
2008-04-05 20:19:41 +00:00
guy b043aa85c0 Fix some compile errors. 2008-04-05 05:25:38 +00:00
guy 8fc17acf3c Clean up the output of the configure script a bit. 2008-04-05 05:20:48 +00:00
guy e3f0aadca9 Clean up the output of the configure script a bit. 2008-04-05 04:56:47 +00:00
guy 90ae077df5 If an interface doesn't support SIOC{G,S}IFMEDIA, just report it as not
supporting monitor mode.
2008-04-05 04:33:08 +00:00
guy 653586c5f7 The value you get back from a SIOCGIWPRIV querying how much stuff you
get back is in units of struct iw_priv_args, not in units of bytes.
2008-04-04 20:51:43 +00:00
guy a9b5ae35f2 From Paolo Abeni and me: split pcap_open_live() into a "get a pcap_t
handle" routine, an 'activate a pcap_t handle" routine, and some "set
the properties of the pcap_t handle" routines, so that, for example, the
buffer size can be set on a BPF device before the device is bound to an
interface.

Add additional routines to set monitor mode, and make at least an
initial attempt at supporting that on Linux, *BSD, and Mac OS X 10.4 and
10.5.

Have a "timeout" member of the pcap_md structure on all platforms, use
that on Windows instead of the "timeout" member of the pcap_t structure,
and get rid of the "timeout" member of that structure.
2008-04-04 19:40:02 +00:00
guy d9b420231a From Paolo Abeni and me: split pcap_open_live() into a "get a pcap_t
handle" routine, an 'activate a pcap_t handle" routine, and some "set
the properties of the pcap_t handle" routines, so that, for example, the
buffer size can be set on a BPF device before the device is bound to an
interface.

Add additional routines to set monitor mode, and make at least an
initial attempt at supporting that on Linux, *BSD, and Mac OS X 10.4 and
10.5.  (Very much "initial" for Linux, which is a twisty little maze of
wireless drivers, many different.)

Have a "timeout" member of the pcap_md structure on all platforms, use
that on Windows instead of the "timeout" member of the pcap_t structure,
and get rid of the "timeout" member of that structure.
2008-04-04 19:37:44 +00:00
guy 19d1a629c7 Get rid of an unused variable, and stop using an unset variable and then
get rid of it as it's then unused.
2008-03-15 04:26:14 +00:00
guy dbdc1e6c7e Get rid of empty statement. 2008-03-15 04:15:26 +00:00
guy 5148b1804b Regenerate. 2008-03-14 09:13:05 +00:00
guy 9e26c39a2e AC_DEFINE now requires a comment for the #define. 2008-03-14 09:12:49 +00:00
guy 45191202aa From Kris Katterjohn: explicitly check for socklen_t, don't just assume
glibc is the only Linux libc that defines socklen_t.
2008-03-14 09:09:13 +00:00
guy cb44cb0520 Support for libdlpi, and for enabling "passive mode" on Solaris systems
that support it, from Sagun Shakya.
2008-03-13 18:13:57 +00:00
guy b322103696 Fix a typo.
Add some new link-layer types for automotive buses, as requested by
Hannes Kaelber.
2008-02-18 20:21:00 +00:00
guy b9ec4e5223 Use %zu to print something with the type size_t - I think most if not
all versions of glibc support it, and it handles both 32-bit and 64-bit
size_t.
2008-02-14 23:27:42 +00:00
guy b3366dd5b4 From Hagen Paul Pfeifer: define some routines as static, to match the
way they're declared (and the way they're intended to be).
2008-02-08 01:34:49 +00:00
guy 6579f06bf1 Fix one comment, add another comment to reflect current reality. 2008-02-06 11:18:57 +00:00
guy f8f7ec5ace From Arien Vijn: support various notions for MAC addresses. 2008-02-06 10:21:30 +00:00
guy 26504998e7 Back out some changes not intended to be checked in. 2008-02-06 10:18:54 +00:00
guy 171e80b8ff From Mike Frysinger: include the Blackfin processor as one of the
processors that don't support unaligned accesses.
2008-02-06 10:04:31 +00:00
guy cbd65556a7 Get rid of an unused configuration variable. 2008-02-04 21:09:27 +00:00
guy 0a62e79b82 Use $(AR) to build the library. 2008-02-04 21:08:05 +00:00
guy a27e58b244 Error messages returned in the pcap_t's error buffer shouldn't have a
newline in them.

If we're in cooked mode, the packet pointer argument we pass to the callback
should point to the beginning of the constructed sll header, not to the
packet data itself.  While we're at it, have a paranoid check to make
sure that we were given enough space to construct the sll header, so we
don't stomp on the tpacket header.
2008-02-02 22:25:51 +00:00
guy beba34d0f9 Do the address-obscuring the same way we did it for tcpdump. 2008-02-02 21:32:27 +00:00
guy 92e587e157 From Alexander 'Leo' Bergolth: fix a typo.
Slightly obscure the e-mail addresses (better late than never, I guess).
2008-02-02 21:27:28 +00:00
guy a375e0656a Get rid of an extra blank line.
Note that a value of 0 for the "cnt" argument to pcap_dispatch() or
pcap_loop() is now the same as a value of -1 - and that it used to be
undefined what it meant, and that it behaved differently on different
platforms, so any application that needs to work on older versions of
libpcap should use -1, not 0.  (We also explicitly say that -1 should be
used, rather than saying that a negative value should be used, as some
platforms checked explicitly for -1.)
2008-02-02 21:19:40 +00:00
guy ee4fa22844 As is done in the loop in pcap-bpf.c, check for non-positive values of
"cnt", not for non-negative values, so a "cnt" of 0 is treated the same
as a "cnt" of -1.
2008-02-02 20:58:18 +00:00
guy 2acadd544c Treat a max_packets value of 0 the same way that we treat a max_packets
value of -1.
2008-02-02 20:56:48 +00:00
guy 988bc0da21 Treat a max_packets value of 0 the same way that we treat a max_packets
value of -1.
2008-02-02 20:50:31 +00:00
guy 43b6c2d818 Explicitly check for a positive "cnt" argument, as at least some other
read_op loops do, to clarify that a zero or negative "cnt" value means
"loop until we run out of packets".
2008-02-02 20:42:35 +00:00
guy d46f258195 From Sagun Shakya: update a comment. 2008-01-30 09:41:52 +00:00
guy 04b952b6d5 From Sagun Shakya: fix typoes in comments. 2008-01-30 09:35:48 +00:00
guy 56741e253c Get rid of trailing blanks and tabs. 2008-01-29 10:12:55 +00:00
guy 198bb69e6d Get rid of a no-longer-necessary #include (we no longer check
no_optimize - we check, instead, whether the kernel rejected the
program).

Move the initialization of the bpf_dltlist structure right before its
first use.
2008-01-29 10:00:32 +00:00
guy c0b1d4703d map_packet_type_to_sll_type() isn't used - and won't compile - if you
don't have PF_PACKET support; #ifdef it out.

Move the code to compute the buffer size into live_open_new() and
live_open_old(), as it's dependent on the mechanism being used; there's
little code shared between the two variants.
2008-01-24 20:20:08 +00:00
guy 9f8edc61fa Move the late Jun-ichiro itojun Hagino to a "Past maintainers" section. 2008-01-07 00:09:54 +00:00
guy b7f2a2ee77 Fix a typo; this fixes bug 1854436. 2008-01-06 21:25:54 +00:00
guy c558b285f5 From Joerg Mayer: add a new man page for the filter syntax, copied from
the tcpdump manual page, so that documentation for other applications
using libpcap can refer to it.

Update pcap(3) to refer to it - and not to suggest sending patches to
patches@tcpdump.org, which is a spam magnet that's no longer read by
anybody.
2008-01-06 21:14:16 +00:00
guy f57d847d09 The SITA code in pcap-linux.c shares very little with the Linux code;
move it into pcap-sita.c, and make --with-sita set the pcap type to
"sita", so we build pcap-sita.c instead of, rather than in addition to,
pcap-linux.c.

Use "bpf_u_int32" rather than "ulong" in the SITA code, as it's intended
to be 32 bits long (the "l" in "htonl()" and "ntohl()" is historical -
they work on 32-bit quantities, and the "l" dates back to the days when
32-bit processors were a bit newer and 16-bit Unix was more common).

Those changes also, at least in theory, makes the SITA support work on
other Unix-compatible platforms; note that in README.sita.

Clean up pcap-sita.c, making routines no longer called outside it
static, folding trivial wrappers, and fixing various warnings.

Put the routines used by fad-sita.c and defined by pcap-sita.c into
pcap-sita.h.  Remove from pcap-sita.h the files that are now static to
pcap-sita.c.  Include pcap-sita.h in both fad-sita.c and pcap-sita.c, so
that we do cross-file prototype checking.
2008-01-06 20:23:17 +00:00
guy 92c5d33d7a From Paolo Abeni: support for a memory-mapped capture buffer. 2008-01-05 22:32:31 +00:00
guy 0446821e49 Make some arguments const pointers if that makes sense.
Add some additional checks to bpf_validate(), from OpenBSD.

Use bpf_validate() in install_bpf_program(), so we validate programs
even when they're being processed by userland filters; we make
bpf_validate() not reject backward branches, as we use them for the
protochain operator.

For BPF, don't assume that, just because no_optimize was set, we have a
program that we can't hand to the kernel; the user of the application
might have specified no optimization (e.g., tcpdump with -O), or we
might have generated code to handle 802.11 headers (the optimizer can't
handle that code).  Instead, try handing the filter to the kernel and,
if that fails, try it in userland.

Get rid of BPF_MAXINSNS - we don't have a limit on program size in
libpcap.
2008-01-02 04:16:46 +00:00
guy 716cd1f4dd Now that we try to build libpcap with large file support, add a warning
to users of pcap_file() that the resulting FILE * might refer to a file
> 2GB and a suggestion that they use large-file-capable calls on it or
on the result of passing it to fileno() if at all possible.
2008-01-01 04:34:49 +00:00
guy a9b98caa0d Use AC_SYS_LARGEFILE and AC_FUNC_FSEEKO to try to get large file support. 2008-01-01 03:49:11 +00:00
guy b2e8e34e97 Add --nounput if Flex supports the --noFUNCTION options, as at least
some versions that support those options don't support disabling yyunput
by defining YY_NO_UNPUT.

If it doesn't support those options, don't check if it supports
generating reentrant scanners, as we can't add any --noFUNCTION options
to suppress generation of functions.
2007-12-31 03:38:39 +00:00
guy 9070702bd0 Check for u_int64_t and define it as "unsigned long long" if we don't
have it; we use it in the USB pseudo-header.
2007-12-31 03:00:47 +00:00
guy bef9d3afe0 Check for u_int64_t and define it as "unsigned long long" if we don't
have it; we use it in the USB pseudo-header.
2007-12-31 02:49:26 +00:00
guy c370aa3788 The first argument to runlex is now just the command to run, so we can
just compare it with "flex" to determine whether we're running Lex or
Flex.
2007-12-31 02:40:21 +00:00