dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

85 Commits

Author SHA1 Message Date
guy 6a1ffe2206 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:21:09 +00:00
guy 30ca1ea42d Fix some compile errors. 2008-04-05 05:25:51 +00:00
guy 0fcba3d48e Clean up the output of the configure script a bit. 2008-04-05 05:21:11 +00:00
guy 710c715410 Clean up the output of the configure script a bit. 2008-04-05 04:56:59 +00:00
guy 4e6a56a9ab If an interface doesn't support SIOC{G,S}IFMEDIA, just report it as not
supporting monitor mode.
2008-04-05 04:33:34 +00:00
guy 56ef271897 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:52:00 +00:00
guy eba1589dfe 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:39:05 +00:00
guy e90961d77f 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:29 +00:00
guy 98328628d7 Get rid of empty statement. 2008-03-15 04:15:46 +00:00
guy 7ee45f25e7 Regenerate. 2008-03-14 09:14:06 +00:00
guy deabdba31d AC_DEFINE now requires a comment for the #define. 2008-03-14 09:13:49 +00:00
guy ba695ca78c 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:13:33 +00:00
guy e598e9e145 Support for libdlpi, and for enabling "passive mode" on Solaris systems
that support it, from Sagun Shakya.
2008-03-13 18:16:37 +00:00
guy e9c012f5fd Fix a typo.
Add some new link-layer types for automotive buses, as requested by
Hannes Kaelber.
2008-02-18 20:21:28 +00:00
guy 4eda6499ab 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:28:00 +00:00
guy 5919ff5192 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:36:39 +00:00
guy f6e8d3a083 Fix one comment, add another comment to reflect current reality. 2008-02-06 11:20:05 +00:00
guy 53284e3029 From Arien Vijn: support various notions for MAC addresses. 2008-02-06 10:21:47 +00:00
guy 6b6566b6e8 From Mike Frysinger: include the Blackfin processor as one of the
processors that don't support unaligned accesses.
2008-02-06 10:05:34 +00:00
guy 611a5b92ff Get rid of an unused configuration variable. 2008-02-04 21:10:36 +00:00
guy 5296fdd0b5 Use $(AR) to build the library. 2008-02-04 21:08:23 +00:00
guy 2f157aab51 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:28:13 +00:00
guy 6ff6e9531d Do the address-obscuring the same way we did it for tcpdump. 2008-02-02 21:33:00 +00:00
guy fb46201395 From Alexander 'Leo' Bergolth: fix a typo.
Slightly obscure the e-mail addresses (better late than never, I guess).
2008-02-02 21:27:40 +00:00
guy 107f4731d6 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:52 +00:00
guy ae330d9cef 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:31 +00:00
guy 1dfbba087d Treat a max_packets value of 0 the same way that we treat a max_packets
value of -1.
2008-02-02 20:57:04 +00:00
guy 19ab916c70 Treat a max_packets value of 0 the same way that we treat a max_packets
value of -1.
2008-02-02 20:51:00 +00:00
guy 4345449f3d 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:57 +00:00
guy 253c0a18df From Sagun Shakya: update a comment. 2008-01-30 09:42:29 +00:00
guy 24d000a3c7 From Sagun Shakya: fix typoes in comments. 2008-01-30 09:36:09 +00:00
guy 8f9a4b1018 Get rid of trailing blanks and tabs. 2008-01-29 10:13:11 +00:00
guy cb5be6a88e 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:01:07 +00:00
guy f6b660f997 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:21:34 +00:00
guy 52e4ca8e0e Move the late Jun-ichiro itojun Hagino to a "Past maintainers" section. 2008-01-07 00:10:08 +00:00
guy 40052936cd Fix a typo; this fixes bug 1854436. 2008-01-06 21:26:14 +00:00
guy 2a29edccfe 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:55 +00:00
guy d2ae6943a6 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:24:12 +00:00
guy a916704f52 From Paolo Abeni: support for a memory-mapped capture buffer. 2008-01-05 22:33:00 +00:00
guy 8beb0eacb6 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:22:16 +00:00
guy bbc283a8e8 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:35:08 +00:00
guy 68b83da6c9 Use AC_SYS_LARGEFILE and AC_FUNC_FSEEKO to try to get large file support. 2008-01-01 03:50:18 +00:00
guy 085e1760d4 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:39:06 +00:00
guy d63c1a41f6 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:04:12 +00:00
guy 4ea7a08627 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:53 +00:00
guy f2b05af0e0 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:58 +00:00
guy bcd4727cd5 No need to quote $(LEX) when passing it to runlex.sh; that way, it can
process all the arguments as such, and makes its first argument the name
of the command to run.
2007-12-31 02:35:23 +00:00
guy 33439722eb Pass a bunch of --noyyXXX options to suppress routines defined but not
used or declared (and thus suppress some warnings about functins with no
declaration before the definition).
2007-12-31 02:32:29 +00:00
guy 4fb3bf9e45 Add a wrapper around Lex/Flex; that lets us handle Lex's lack of support
for -o and Flex's support for it in a way that lets us more easily fail
if Lex/Flex fails (so that we don't try to compile a bogus scanner.c
that might be generated; that appears to have happened on at least one
occasion, with the resulting scanner.o missing some functions, causing
weird errors in configure scripts for programs using libpcap), and also
prepares us to handle newer versions of Flex where we want Flex to
generate a header file so we don't get "defined but not declared"
warnings.
2007-12-30 00:33:20 +00:00
guy 00862cc529 The Prism header is in theory variable-length, but in practice it's
always 144 bytes long.  However, some drivers on Linux use
ARPHRD_IEEE80211_PRISM, but sometimes or always supply an AVS header, so
we have to check whether the radio header is a Prism header or an AVS
header, so, in practice, it's variable-length.

Treat DLT_PRISM_HEADER as having a variable-length header, and generate
code to find the length of the Prism header that first checks for an AVS
header and, if we have an AVS header, gets the length from the header,
and otherwise just gets a length of 144.  This fixes Sourceforge bug
1847574.

Sort various references to the radio headers (case labels, functions,
etc.) into the same order (Prism, AVS, radiotap), for consistency.  Put
PPI after them all.

Handle 802.11 and 802.11-plus-radio-header with a common case when
initializing.
2007-12-29 23:15:43 +00:00