dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

1122 Commits

Author SHA1 Message Date
guy c6aa29a8dc Rename pcap_errtostr() to pcap_statustostr(), and have it handle
PCAP_WARNING values as well.
2008-04-09 21:39:21 +00:00
guy a590c21380 Add some PCAP_WARNING return values for "success, but you might want to
know that..."; currently, only pcap_activate() returns them, but we
might want some more warning returns for some other calls, such as the
ones that set filters.  It's a little cleaner than "clear out the error
message buffer and, if it's not empty after a successful return, it has
a warning", and a little cleaner than spewing a warning to the standard
error (as that might not be visible to the user if they're running a GUI
application).
2008-04-09 21:26:12 +00:00
gianluca 0bee352573 Fixed a compilation error under Windows. Some code left while porting the
libpcap code to the new pcap_create() pcap_activate() pattern.
2008-04-09 21:20:26 +00:00
guy 1b7a8f1c6e Document the extra error information supplied for
PCAP_ERROR_NO_SUCH_DEVICE and PCAP_ERROR_PERM_DENIED.
2008-04-09 20:20:17 +00:00
guy 216c64a7ce Add an error for "you don't have permission to open that device", as
that often means "sorry, this platform requires you to run as root or to
somehow tweak the system to give you capture privileges", and
applications might want to explain that in a way that does a better job
of letting the user know what they have to do.

Try to return or PCAP_ERROR_PERM_DENIED for open errors, rather than
just returning PCAP_ERROR, so that the application can, if it chooses,
try to explain the error better (as those two errors are the ones that
don't mean "there's probably some obscure OS or libpcap problem", but
mean, instead, "you made an error" or "you need to get permission to
capture").

Check for monitor mode *after* checking whether the device exists in the
first place; a non-existent device doesn't support monitor mode, but
that's because it doesn't, well, exist, and the latter would be a more
meaningful error.

Have pcap_open_live() supply an error message for return values other
than PCAP_ERROR, PCAP_ERROR_NO_SUCH_DEVICE, and PCAP_ERROR_PERM_DENIED -
those all supply error strings (PCAP_ERROR because it's for various OS
problems that might require debugging, and the other two because there
might be multiple causes).
2008-04-09 19:58:02 +00:00
guy 745e497e4c Fix some errors left behind by the conversion to the create/activate
model.
2008-04-08 03:06:03 +00:00
guy a45116b80c From Stephen Donnelly: fix some compile errors from the conversion to
the create/activate mode.
2008-04-08 03:00:14 +00:00
guy b95b96d6da For Linux non-mmapped captures, Linux bluetooth captures, and Irix
captures, set the socket buffer size to the value specified by
pcap_set_buffer_size() if a value was set.

Clean up if memory buffer allocation fails on Linux.
2008-04-07 03:57:32 +00:00
guy 3df4925c28 Free the memory allocated for the Wireless Extensions private ioctl list
before returning.
2008-04-07 00:31:47 +00:00
guy 1b2dabbe8d In pcap_activate() on OS X 10.4, if a device isn't an "enN" device, and
we're supposed to open the device in monitor mode, don't just say
"sorry, it doesn't support monitor mode" - first, check whether it even
exists.
2008-04-06 22:15:03 +00:00
guy 0572bae07d Make pcap_datalink_val_to_description.3pcap a link to
pcap_datalink_val_to_name.3pcap.
2008-04-06 20:22:13 +00:00
guy dcc19a4c63 Fix the pcap_datalink_val_to_name() man page. 2008-04-06 20:16:30 +00:00
guy a161340b6e Have a separate pcap_errtostr() routine to turn PCAP_ERROR_ values to
strings; leave pcap_strerror() for UN*X errnos.
2008-04-06 19:55:32 +00:00
guy 9e496cdc75 Add more data types for X2E, requested by Hannes Kaelber. 2008-04-06 18:09:48 +00:00
guy d857c72c2f Add in the new man pages. Just use a single generic entry in
INSTALL.txt for all the man pages for functions.
2008-04-06 17:29:31 +00:00
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