summaryrefslogtreecommitdiff
path: root/pcap-bt-linux.c
Commit message (Collapse)AuthorAgeFilesLines
* Copy over a whitespace fix from the trunk.libpcap_1_4rel0Guy Harris2013-03-261-1/+1
|
* Cope with Bluetooth API breakage in some Linux 3.x(?) kernel.Guy Harris2013-03-251-0/+3
| | | | | | | | | | | In the 2.6.32.4 kernel, struct sockaddr_hci has no hci_channel member. In the 3.0.4 kernel, struct sockaddr_hci has an hci_channel member, and it has to get set in order for binds of AF_BLUETOOTH/BTPROTO_HCI sockets to work. Cope with this API breakage by checking whether struct sockaddr_hci has an hci_channel member and, if it does, set it to HCI_CHANNEL_RAW.
* And un-constify some others.Guy Harris2012-06-111-1/+2
|
* Constify some variables.Guy Harris2012-06-111-1/+1
|
* Have non-interface modules take responsibility for identifying their devices.Guy Harris2012-06-111-2/+31
| | | | | | | | | | | | | | Have a table of routines to do pcap_create() for devices that aren't regular network interfaces. Try each of those in succession until one says "it's mine" (whether it succeeds or fails); if none do, do a pcap_create() for a regular interface. Have those routines do more stringent tests of the name - don't just accept any name that has a particular substring anywhere in it. That reduces the likelihood of a false match (as happened with the CANbus module when somebody renamed their Ethernet interface "canopy"). Have the table also include routines for pcap_findalldevs().
* recvmsg() returns an ssize_t; put its return value into an ssize_t.Guy Harris2011-11-301-22/+26
| | | | | | | | | This makes the check for a negative value valid. Thanks to Michal Sekletar for catching this. While we're at it, don't use the numerical value of errno in error messages.
* Fix typos in the Bluetooth capture code.Jakub Zawadzki2011-06-141-2/+2
| | | | | | | | | The "set the buffer size" code check for a zero, rather than a non-zero, opt.buffer_size when deciding whether to explicitly set the buffer size. Fix a typo in a comment. Reviewed-By: Guy Harris <guy@alum.mit.edu>
* Do filtering on USB and Bluetooth capturing.Guy Harris2010-06-041-13/+11
| | | | | | | | | | Do the standard userland filtering on USB and Bluetooth captures, rather than returning "success" when the filter is installed without doing anything with the filter. Also, squelch some "dereferencing type-punned pointer will break strict-aliasing rules" warnings in pcap-bt-linux.c, by using memcpy rather than pointer-casting.
* Get rid of declaration of non-existent routine.guy2008-07-011-2/+1
|
* Fix typoes (sigh, using both "p" and "handle" for the pcap_t pointer inguy2008-04-141-3/+3
| | | | different modules can lead to confusion).
* Turn close_op into cleanup_op; the routine that handles it can also beguy2008-04-141-12/+12
| | | | | | | | | | | | | | | | | | | | | | | 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.
* For Linux non-mmapped captures, Linux bluetooth captures, and Irixguy2008-04-071-4/+18
| | | | | | | 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.
* From Paolo Abeni and me: split pcap_open_live() into a "get a pcap_tguy2008-04-041-45/+45
| | | | | | | | | | | | | | | | 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.
* Use %zu to print something with the type size_t - I think most if notguy2008-02-141-2/+2
| | | | | all versions of glibc support it, and it handles both 32-bit and 64-bit size_t.
* From Paolo Abeni:guy2007-09-221-9/+18
| | | | | | | | | | | | | Fix the copyright notice. Use the new DLT_BLUETOOTH_HCI_H4_WITH_PHDR DLT, and add a direction indication. Now that we have a direction indication, support pcap_setdirection(). Update FILES and INSTALL.txt appropriately, and fix some problems in INSTALL.txt.
* Fix a message to speak of Bluetooth rather than USB.guy2007-08-181-2/+2
|
* Add RCS IDs.guy2007-04-011-0/+4
|
* From Paolo Abeni: fix a printf.guy2007-01-141-1/+1
|
* From Paolo Abeni: add support for the binary USB sniffing interface inguy2006-12-201-1/+1
| | | | | | | | 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.
* From Paolo Abeni: don't treate an EAFNOSUPPORT error when trying to openguy2006-12-051-3/+6
| | | | | | | | a Bluetooth socket as an error - it just means there's no Bluetooth support in the kernel, and thus there are no Bluetooth devices. Clean up error messages a bit, including indications that these are from the Bluetooth code.
* Capitalize "Bluetooth".guy2006-12-041-1/+1
|
* Move the Linux Bluetooth and USB declarations to a header file.guy2006-10-131-1/+2
| | | | | | | | 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.
* From Paolo Abeni: Bluetooth support.guy2006-10-131-0/+342