dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

1149 Commits

Author SHA1 Message Date
guy 83206d9b13 Fix more patches@tcpdump.org references to point to the SourceForge
site.
2008-05-30 01:43:21 +00:00
guy 757827db5f packaging/pcap.spec is generated from packaging/pcap.spec.in; don't
check in the generated version, and don't put it into the distribution.

Fix a bunch of references to tcpdump-workers@tcpdump.org to refer to the
new address, tcpdump-workers@lists.tcpdump.org.

Fix a reference to the pcap man page from the pcap-filter(4) man page.

Note that patches should be submitted on the SourceForge site, not sent
to the spam-trap patches@tcpdump.org list.
2008-05-30 01:35:33 +00:00
guy d9e031714d Get rid of the AUTHORS and BUGS section; only the main pcap(3PCAP) man
page should have that (no other pages for particular functions have it).
2008-05-30 01:32:34 +00:00
guy f8c1a3770e Add a script to change the permissions of /dev/bpf*, and a launchd plist
for it, for Mac OS X 10.4 and later.  (The script could be useful for
BPF-based systems that don't use devfs as well.) We're not installing it
at this point; that might happen later.
2008-05-28 02:14:10 +00:00
guy 720a1e8328 Don't echo the commands for "make releasetar" (they were echoed when
debugging, but they're not supposed to be echoed).
2008-05-27 07:17:04 +00:00
guy e2da3dba8c Add a missing file to EXTRA_DIST. 2008-05-26 21:12:23 +00:00
guy f2054ca165 FILES isn't used to make the tarball any more; get rid of it.
Update HDR in Makefile.in to include all headers.

Add pcap_activate.3pcap to the list of man pages in the 3PCAP section.

Add an EXTRA_DIST variable to include all the files that should go into
the tarball and that aren't in CSRC, HDR, MAN3PCAP, or MAN4.

Use CSRC, HDR, MAN3PCAP, MAN4, and EXTRA_DIST to determine what goes
into the tarball, rather than doing a "make distclean" and putting
everything into the tarball; that way, you can do "make releasetar"
without cleaning out the current directory.

Given that we're not just tarring up the entire source directory, we can
make the tarball directory as a subdirectory of the current directory and
put the tarball into the current directory, rather than putting it into
a (not-entirely-obvious) ../n directory.  Clean out the tarball
directory when we're done.
2008-05-26 21:05:47 +00:00
guy d592f692d0 Add pcap_free_datalinks() - on Windows, something allocated in Vegas^Wa
library has to be freed by the library, as an application or other
library using that library might have been built with a different
version of the C runtime library.
2008-05-26 19:58:06 +00:00
gianluca c975220bd1 pcap_create() should accept UNICODE device names as well as ASCII ones
on Windows.
2008-05-21 22:15:25 +00:00
guy 1f93b0fda9 Pick up pcap_offline_filter() from WinPcap.
Add pcap_compile() to the SEE ALSO section for pcap_setfilter().
2008-05-13 15:19:56 +00:00
gianluca cab77babbb Fixed a couple initializations related to the buffer sizes. Removed some duplicated
code.
2008-04-25 20:03:34 +00:00
guy 59e8b67528 From Gisle Vanem:
* gnuc.h not needed.

* sys/pack*.h was renamed in a recent Watt-32 distro.
2008-04-22 17:20:25 +00:00
guy 86b399c3ca From Gisle Vanem:
Update his e-mail address.

	Make a table const.
2008-04-22 17:16:30 +00:00
guy 9545f44f88 Expand a comment with more information on getting interface names. 2008-04-20 18:19:02 +00:00
guy ddfa7ac185 From Gisle Vanem and me: fix some typoes of mine in the conversion to
the new pcap_create/pcap_activate model, use pcap->opt.source rather
than pcap->md.device in the activate routine (pcap->md.device isn't
set), don't free the pcap_t if the activate routine fails, fix the
error return code paths not to set handle_to_device, fix references to
pcap_close_dos() to refer to pcap_cleanup_dos() as we renamed the
routine.
2008-04-19 17:49:21 +00:00
guy 3fdd4aeaf4 Update a comment. 2008-04-17 19:17:08 +00:00
guy 2198f5dc5b Fix a typo. 2008-04-17 19:09:13 +00:00
guy a4aaa6f939 Use SIOCGIFDESCR to get the interface description if we have
SIOCGIFDESCR.
2008-04-17 18:56:51 +00:00
guy 30b39d84b7 Fix typoes (sigh, using both "p" and "handle" for the pcap_t pointer in
different modules can lead to confusion).
2008-04-14 21:06:09 +00:00
guy f35ab115a6 Fix a typo (sigh, using both "p" and "handle" for the pcap_t pointer in
different modules can lead to confusion).
2008-04-14 21:04:51 +00:00
guy 2527d1ac88 Turn close_op into cleanup_op; the routine that handles it can also be
used to clean up after a failed pcap_activate() call.  Convert the
existing close_op routines to cleanup_op routines, and use them to clean
up; rename pcap_close_common() to pcap_cleanup_live_common(), and use it
directly if there's no platform-dependent cleanup needed.  That means we
don't have to write the same cleanup code twice (and possibly forget
stuff in the version done on a failed pcap_activate() call).

Have the cleanup routines do whatever is necessary to indicate that
cleanup has been done, and not do any particular cleaning up if it's
already been done (i.e., don't free something if the pointer to it is
null and null out the pointer once it's been freed, don't close an FD if
it's -1 and set it to -1 once it's been closed, etc.).

For device types/platforms where we don't support monitor mode, check
for it and return PCAP_ERROR_RFMON_NOTSUP - but do so after we've
checked whether we can open the device, so we return "no such device" or
"permission denied" rather than "that device doesn't support monitor
mode" if we can't open the device in the first place.

Fix a comment.
2008-04-14 20:40:58 +00:00
guy 0fdc174e4c Plug some leaks. 2008-04-10 03:10:33 +00:00
guy 4506350ab5 Add commands use to configure capture privileges to the SEE ALSO list. 2008-04-10 01:56:24 +00:00
guy f873417558 Copy information about privileges need to capture from the tcpdump man
page here, and update the information on Solaris to talk about the
net_rawaccess privileges.
2008-04-10 01:52:44 +00:00
guy 1fd4389877 Report PCAP_ERROR_PERM_DENIED if you don't have permission to open a
PF_PACKET socket.
2008-04-10 01:26:43 +00:00
guy 65f9878991 Catch another place where you could get told "no, you may not open that
device" and arrange that PCAP_ERROR_PERM_DENIED be returned.
2008-04-10 00:50:34 +00:00
guy 8dc3233229 Fix an sprintf call. 2008-04-09 22:02:44 +00:00
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