dect
/
libpcap
Archived
13
0
Fork 0

From Márton Németh:

The usbmon text interface was moved from
	/sys/kernel/debug/usbmon to /sys/kernel/debug/usb/usbmon as of
	patch

		http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f49ce96f11112a84c16ac217490ebd6f8d9a8977 .

	Please add this new directory also into the search list when
	finding USB devices.

Get rid of older address for Gisle Vanem; convert Love's address to
UTF-8 (as it is in the tcpdump CREDITS file).
This commit is contained in:
Guy Harris 2009-11-03 14:50:40 -08:00
parent 6b414c082f
commit 62b9af0706
2 changed files with 34 additions and 11 deletions

View File

@ -42,7 +42,6 @@ Additional people who have contributed patches:
Gianluca Varenni <varenni at netgroup-serv dot polito dot it>
Gilbert Hoyek <gil_hoyek at hotmail dot com>
Gisle Vanem <gvanem at broadpark dot no>
Gisle Vanem <giva at bgnett dot no>
Graeme Hewson <ghewson at cix dot compulink dot co dot uk>
Greg Stark <gsstark at mit dot edu>
Greg Troxel <gdt at ir dot bbn dot com>
@ -71,7 +70,7 @@ Additional people who have contributed patches:
Krzysztof Halasa <khc at pm dot waw dot pl>
Lorenzo Cavallaro <sullivan at sikurezza dot org>
Loris Degioanni <loris at netgroup-serv dot polito dot it>
Love Hörnquist-Åstrand <lha at stacken dot kth dot se>
Love Hörnquist-Åstrand <lha at stacken dot kth dot se>
Luis Martin Garcia <luis dot mgarc at gmail dot com>
Maciej W. Rozycki <macro at ds2 dot pg dot gda dot pl>
Marcus Felipe Pereira <marcus at task dot com dot br>
@ -79,6 +78,7 @@ Additional people who have contributed patches:
Mark Pizzolato <List-tcpdump-workers at subscriptions dot pizzolato dot net>
Markus Mayer <markus_mayer at sourceforge dot net>
Martin Husemann <martin at netbsd dot org>
Márton Németh <nm127 at freemail dot hu>
Matthew Luckie <mjl at luckie dot org dot nz>
Max Laier <max at love2party dot net>
Mike Frysinger <vapier at gmail dot com>

View File

@ -65,7 +65,8 @@ static const char rcsid[] _U_ =
#endif
#define USB_IFACE "usbmon"
#define USB_TEXT_DIR "/sys/kernel/debug/usbmon"
#define USB_TEXT_DIR_OLD "/sys/kernel/debug/usbmon"
#define USB_TEXT_DIR "/sys/kernel/debug/usb/usbmon"
#define SYS_USB_BUS_DIR "/sys/bus/usb/devices"
#define PROC_USB_BUS_DIR "/proc/bus/usb"
#define USB_LINE_LEN 4096
@ -354,10 +355,21 @@ usb_activate(pcap_t* handle)
handle->fd = open(full_path, O_RDONLY, 0);
if (handle->fd < 0)
{
/* no more fallback, give it up*/
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"Can't open USB bus file %s: %s", full_path, strerror(errno));
return PCAP_ERROR;
if (errno == ENOENT)
{
/*
* Not found at the new location; try
* the old location.
*/
snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%dt", handle->md.ifindex);
handle->fd = open(full_path, O_RDONLY, 0);
}
if (handle->fd < 0) {
/* no more fallback, give it up*/
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"Can't open USB bus file %s: %s", full_path, strerror(errno));
return PCAP_ERROR;
}
}
if (handle->opt.rfmon) {
@ -614,10 +626,21 @@ usb_stats_linux(pcap_t *handle, struct pcap_stat *stats)
fd = open(string, O_RDONLY, 0);
if (fd < 0)
{
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"Can't open USB stats file %s: %s",
string, strerror(errno));
return -1;
if (errno == ENOENT)
{
/*
* Not found at the new location; try the old
* location.
*/
snprintf(string, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%ds", handle->md.ifindex);
fd = open(string, O_RDONLY, 0);
}
if (fd < 0) {
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"Can't open USB stats file %s: %s",
string, strerror(errno));
return -1;
}
}
/* read stats line */