aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-01-10Merge branch 'master' of git://bpf.tcpdump.org/libpcapHEADmasterPatrick McHardy17-230/+675
Conflicts: pcap/bpf.h Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-12-28Interface IDs are 0-origin.Guy Harris1-1/+1
That means that if an interface ID is greater than *or equal to* the number of Interface Description Blocks we've seen, we haven't seen an IDB for that interface.
2010-11-30Fix alignment of Love's name.Guy Harris1-1/+1
2010-11-30Use spaces for all entries. Fix Luis MartinGarcia's name.Luis MartinGarcia1-138/+138
Reviewed-By: Guy Harris <guy@alum.mit.edu>
2010-11-30Use config.status to generate pcap-config.Mike Frysinger2-17/+20
Rather than use a custom sed script to replace things in pcap-config, use the already existing config.status script. This keeps people from having to update the Makefile.in every time they want to add a new var to the file. Also, clean up the pcap-config.in script a bit to set local vars at the top of the file and then refer to those rather than replacing all things through out. This makes it easier to tweak on the fly as there is only line to change rather than trying and figure out all the locations. Reviewed-By: Guy Harris <guy@alum.mit.edu>
2010-11-30In test programs, just as in pcap-usb-linux.c, if we haveGuy Harris2-0/+6
<linux/compiler.h> we (probably need to include it before including <linux/usbdevice_fs.h>, otherwise the test may fail when it shouldn't.
2010-11-25Check whether we have <linux/compiler.h>.Guy Harris4-4/+229
Not all distributions have it in /usr/include; I guess the ones that don't have it have versions of other kernel headers that don't require it.
2010-11-25Include <linux/compiler.h> before including <linux/usbdevice_fs.h>.Guy Harris1-0/+5
Some versions of the Linux kernel require that.
2010-11-15Add DLT_DBUS, for raw D-Bus messages.Guy Harris2-0/+39
2010-11-14Libnl 2.x returns its own error codes, not errnos; handle that.Guy Harris1-42/+34
While we're at it, don't special-case ENFILE for "delete monitor device" operations; that's not like "add monitor device", where we want to drive on if a device with that name already exists.
2010-11-13Add support for libnl 2.x, adapted from a newer version of the iw command.Guy Harris4-25/+184
2010-10-15Another fix for the compilation of WinPcap under MINGW32/MINGW64.Gianluca Varenni1-1/+1
2010-10-15Fixes to compile WinPcap under MINGW32 and MINGW64.Gianluca Varenni6-7/+23
2010-10-15Import pcap-dect-linuxPatrick McHardy11-11/+415
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-09-21Treat either EPERM or EACCES as "no soup for you".Guy Harris2-5/+8
2010-09-21Return PCAP_ERROR_PROMISC_PERM_DENIED if you have permission to open theGuy Harris5-57/+105
DLPI device but don't have permission to put the interface in promiscuous mode; some systems using DLPI work that way. Change the libdlpi code to return a warning if you *are* using physical promiscuous mode and you fail to turn on SAP promiscuous mode, not if you *aren't* using physical promiscuous mode and you fail to turn on SAP promiscuous mode; that matches with the no-libdlpi code does, and matches what the comment says. Pull dlattachreq up into dl_doattach().
2010-09-01Fix a problem that shows up with a max packet count passed to pcap_dispatch().Guy Harris1-4/+23
If the last record read in by a read() from a BPF device isn't a multiple of the alignment value for BPF_WORDALIGN(), we could increment bp past ep; handle that case. While we're at it, properly set p->bp and p->cc in the case where we break out of the loop due to a pcap_breakloop() call.
2010-08-23Give the names, as well as the #defines, for time stamp types.Guy Harris1-7/+13
2010-08-23Fixes from Scott Mcmillan.Guy Harris3-4/+4
2010-08-23Clean up handling of the "net" symlink made by the configure script.Guy Harris2-1/+2
In "make distclean", get rid of it; in .gitignore, ignore it.
2010-08-22If the specified time stamp type isn't supported, treat that as a warning.Guy Harris5-72/+164
2010-08-22Add support for setting the time stamp type for a capture.Guy Harris10-103/+596
Based on a patch from Scott Mcmillan <scott.a.mcmillan@intel.com>. (Second part of the commit.)
2010-08-22Give Scott McMillan credit for the initial time stamp patch.Guy Harris1-0/+1
2010-08-22Add support for setting the time stamp type for a capture.Guy Harris5-0/+349
Based on a patch from Scott Mcmillan <scott.a.mcmillan@intel.com>.
2010-08-22Consistently use "link-layer header type".Guy Harris5-17/+17
Use "link-layer header type" as the term for DLT_ values; it doesn't necessarily correspond to the actual data link type of the device (802.11 devices, for example, can supply Ethernet headers).
2010-08-22Add some additional SEE ALSO references.Guy Harris4-6/+9
In the pcap_list_datalinks() man page, refer to the pcap_datalink_val_to_name() man page, as the routines described there can be used to print out names and descriptive text for the values returned by pcap_list_datalinks(). In the pcap_set_datalink() man page, refer to the pcap_datalink_name_to_val() man page, as pcap_datalink_name_to_val() can be used to convert a name for a link-layer header type into a value to be handed to pcap_set_datalink(). Update the change date on some man pages while we're at it.
2010-08-22Combine documentation for allocate and free routines.Guy Harris5-92/+25
Pull the documentation for pcap_freealldevs() into the pcap_findalldevs() man page, and pull the documentation for pcap_free_datalinks() into the pcap_list_datalinks() man page.
2010-08-20Fix handling of close of zerocopy BPF; based on a patch from Christian Peron.Guy Harris1-76/+62
2010-08-06Fix previous checkin.Guy Harris1-8/+7
2010-08-06Mention the 802.15.4 changes.Guy Harris1-1/+2
2010-08-06Use DLT_IEEE802_15_4_NOFCS for 802.15.4 interfaces.Jon Smirl1-0/+7
Reviewed-By: Guy Harris <guy@alum.mit.edu>
2010-08-06New DLT_IEEE802_15_4_NOFCS for 802.15.4 without FCS.Guy Harris4-3/+34
Requested by Jon Smirl.
2010-07-20List the fixes we've checked in so far.Guy Harris1-0/+29
2010-07-20Oops - should convert the LINKTYPE_ value in pcap-ng InterfaceGuy Harris1-1/+1
Description Blocks to a DLT_ value in the pcap_t, as applications expect pcap_linktype() to return a DLT_ value.
2010-07-03Add support for "wlan ra" and "wlan ta".Guy Harris5-3/+133
The RA field is absent from management frames (addr1 is DA there), and addr1 in other frames. The TA field is absent from management frames (addr2 is SA there), and addr2, if present, in other frames. While we're at it, fix a font glitch in the pcap-filter man page.
2010-07-03More "don't crash if "wlan addr{1,2,3,4}" are used without 802.11 headers".Guy Harris1-3/+19
2010-07-03Don't crash if "wlan addr{1,2,3,4}" are used without 802.11 headers.Guy Harris1-0/+64
2010-06-04Do filtering on USB and Bluetooth capturing.Guy Harris2-30/+36
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.
2010-05-29On FreeBSD/SPARC64, use -fPIC - it's apparently necessary.Guy Harris2-2/+36
2010-05-29Check for valid port numbers (fit in a 16-bit unsigned field).Guy Harris1-0/+19
2010-05-28Reject attempts to put savefiles into non-blocking mode.Guy Harris1-3/+9
Don't ignore them, reject them, so applications know that non-blocking mode didn't get turned on, if they're expecting non-blocking reads from a pipe, for example.
2010-05-18Check for "no such device" for the "get the media types" ioctl in *BSD.Guy Harris1-5/+16
This lets us return PCAP_ERROR_NO_SUCH_DEVICE if we've done a pcap_create() on a non-existent device and asked whether it supports monitor mode.
2010-05-18Improve error messages from bpf_open(), and let it do the error handling.Guy Harris1-17/+50
bpf_open() already handles returning the right PCAP_ERROR_ value and setting p->errbuf; let it do its thing. Enhance its thing so that it tries to do a better job of figuring out what the problem is (no BPF devices at all, all BPF devices busy, no permission to open BPF device, something else).
2010-05-18Return more specific errors from pcap_can_set_rfmon(); fix documentation.Guy Harris2-6/+31
Have pcap_can_set_rfmon() return PCAP_ERROR_PERM_DENIED if you don't have permission to check the device and PCAP_ERROR_NO_SUCH_DEVICE if there's no such device, at least on Mac OS X. Other platforms need to be fixed as well. Update the documentatation to reflect that it can return PCAP_ERROR_PERM_DENIED, fix a typo, and speak of capture sources rather than devices.
2010-05-18Clean up indentation.Guy Harris1-41/+40
2010-04-28Update description fetching code for FreeBSD, fix code for OpenBSD.Guy Harris1-11/+39
Update from Jason (Xin) Li to reflect changes to the FreeBSD SIOCGIFDESCR implementation - it now doesn't return an error if the buffer is too short, it sets the buffer pointer to NULL. No FreeBSD release has SIOCGIFDESCR, so this doesn't break on any release. The loop, trying to increase the buffer size until it's big enough, works only on FreeBSD, as that's the only OS where you get told what length to use; OpenBSD clamps the description length at IFDESCRSIZE, so we just use that.
2010-04-27Ignore /sys/net/dev files if we get ENODEV for them, not just ENXIO.andy-12-1/+2
Both of them are indications that there's no such interface, so the file probably corresponds to something other than a device. Reviewed-By: Guy Harris <guy@alum.mit.edu>
2010-04-21Fix check for a constant 0 argument to BPF_DIV.Guy Harris1-1/+1
BPV_RVAL() is the macro to check the type of the return value of a "ret" instruction; it tests more bits than are appropriate for a "div" instruction, and the test fails.
2010-04-16Use the right version of ar when cross-building.Alon Bar-Lev3-3/+103
Reviewed-By: Guy Harris <guy@alum.mit.edu>
2010-04-16Free any filter set on a savefile when the savefile is closed.nvercamm2-0/+2
Reviewed-By: Guy Harris <guy@alum.mit.edu>