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.
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.
hopefully I'm inferring correctly from the mon_bin_poll() routine that,
even with purely-mmapped access, you can use select() or poll() to wait
for packets to arrive.
some sscanf() calls:
The first change involves a sscanf() that has '%n' in the format
string, which shouldn't be checked for in the return value
(stored in "ntok"). This is done correctly elsewhere in the code
(and even commented on) such that the return value is checked for
everything but the %n modifier.
And a few lines after this, a sscanf() is done for '%d' and the
return value is stored in "ret". However, the same exact line
from the above mishap is used here, not even checking the right
variable or number of conversions! It checks "ntok" for 2 when
it should check "ret" for 1.
The attached patch cleans up usb_platform_finddevs(), removing
the dependency on debugfs. There are also some other minor
cleanups in the pcap-usb-linux.c file (unused variables removed
and indentation fix).
Linux. The USB sniffing code for Linux now supplies a per-packet header
based on the one supplied by the Linux binary sniffing interface, so we
add a new DLT_ value and use that.
Fix his e-mail address, and add him to the credits.
The attached patch fix an off by one in current usb sniffing
code. It also substitute the kernel-provided timestamp with
gettimeofday. The kernel provided timestamp use 32 bits to
represent a struct timeval (8 bits for tv_sec and 24 for
tv_usec), so it's content is quite misleading.
Clean up some comments.
Protect all references to the USB stuff from the common Linux code with
PCAP_SUPPORT_USB, just as references to the Bluetooth code are protected
with PCAP_SUPPORT_BT.
The attached patch fix the parsing of setup data fields in current
implementation of usb_read_data.
Currently the "setup header is present" field is not marked so the
relevant fields are ignored from caller.
The patch contains also a little indentation fix, always in the same
function.
source directory and the target include directory, and have include
files at the top-level directory to include those headers, for backwards
compatibility.
Update the FILES and INSTALL.txt files to reflect current reality.