mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
usb: add pcap support.
Log all traffic of a specific usb device to a pcap file for later
inspection. File format is compatible with linux usb monitor.
Usage:
qemu -device usb-${somedevice},pcap=file.pcap
wireshark file.pcap
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210119194452.2148048-1-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
@@ -231,6 +231,9 @@ struct USBDevice {
|
||||
void *opaque;
|
||||
uint32_t flags;
|
||||
|
||||
char *pcap_filename;
|
||||
FILE *pcap;
|
||||
|
||||
/* Actual connected speed */
|
||||
int speed;
|
||||
/* Supported speeds, not in info because it may be variable (hostdevs) */
|
||||
@@ -570,4 +573,9 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
|
||||
uint8_t interface_class, uint8_t interface_subclass,
|
||||
uint8_t interface_protocol);
|
||||
|
||||
/* pcap.c */
|
||||
void usb_pcap_init(FILE *fp);
|
||||
void usb_pcap_ctrl(USBPacket *p, bool setup);
|
||||
void usb_pcap_data(USBPacket *p, bool setup);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user