summaryrefslogtreecommitdiffstats
path: root/usr.sbin/usbdump
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2011-10-17 15:54:20 +0000
committerhselasky <hselasky@FreeBSD.org>2011-10-17 15:54:20 +0000
commitcccdd4e8750dbdd9df44ec7d7756f93895b3aaa3 (patch)
tree145145d83c183ea2addcd40350a42df36b3defae /usr.sbin/usbdump
parenta1d20730a3f22cfa2ecb21acd512afea7c70a376 (diff)
downloadFreeBSD-src-cccdd4e8750dbdd9df44ec7d7756f93895b3aaa3.zip
FreeBSD-src-cccdd4e8750dbdd9df44ec7d7756f93895b3aaa3.tar.gz
Make the usbdump utility work again by using the correct BPF structures.
MFC after: 3 days
Diffstat (limited to 'usr.sbin/usbdump')
-rw-r--r--usr.sbin/usbdump/usbdump.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/usbdump/usbdump.c b/usr.sbin/usbdump/usbdump.c
index f32104a..582bf94 100644
--- a/usr.sbin/usbdump/usbdump.c
+++ b/usr.sbin/usbdump/usbdump.c
@@ -283,7 +283,7 @@ hexdump(const uint8_t *region, uint32_t len)
}
static void
-print_apacket(const struct bpf_xhdr *hdr, const uint8_t *ptr, int ptr_len)
+print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len)
{
struct tm *tm;
struct usbpf_pkthdr up_temp;
@@ -318,8 +318,8 @@ print_apacket(const struct bpf_xhdr *hdr, const uint8_t *ptr, int ptr_len)
up->up_packet_count = le32toh(up->up_packet_count);
up->up_endpoint = le32toh(up->up_endpoint);
- tv.tv_sec = hdr->bh_tstamp.bt_sec;
- tv.tv_usec = hdr->bh_tstamp.bt_frac;
+ tv.tv_sec = hdr->bh_tstamp.tv_sec;
+ tv.tv_usec = hdr->bh_tstamp.tv_usec;
tm = localtime(&tv.tv_sec);
len = strftime(buf, sizeof(buf), "%H:%M:%S", tm);
@@ -386,12 +386,12 @@ print_apacket(const struct bpf_xhdr *hdr, const uint8_t *ptr, int ptr_len)
static void
print_packets(uint8_t *data, const int datalen)
{
- const struct bpf_xhdr *hdr;
+ const struct bpf_hdr *hdr;
uint8_t *ptr;
uint8_t *next;
for (ptr = data; ptr < (data + datalen); ptr = next) {
- hdr = (const struct bpf_xhdr *)ptr;
+ hdr = (const struct bpf_hdr *)ptr;
next = ptr + BPF_WORDALIGN(hdr->bh_hdrlen + hdr->bh_caplen);
if (w_arg == NULL) {
OpenPOWER on IntegriCloud