summaryrefslogtreecommitdiff
path: root/print-usb.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-02-07 15:39:55 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-02-07 20:36:20 +0100
commit65577c96191eba7bc33b8bf3a79df7419b465c10 (patch)
treee04a76ae7990fefff212b921e669cc616c8ca0e6 /print-usb.c
parent337875c269ad1022c763948666eadaf4d9364d20 (diff)
downloadtcpdump-65577c96191eba7bc33b8bf3a79df7419b465c10.tar.gz
USB: Update the link-layer dissector to a void function
Moreover: Remove trailing "_if" from protocol names.
Diffstat (limited to 'print-usb.c')
-rw-r--r--print-usb.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/print-usb.c b/print-usb.c
index 07a0a5d1..dc697f5f 100644
--- a/print-usb.c
+++ b/print-usb.c
@@ -247,19 +247,21 @@ usb_header_print(netdissect_options *ndo, const pcap_usb_header *uh)
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
usb_linux_48_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
const u_char *p)
{
- ndo->ndo_protocol = "usb_linux_48_byte_if";
+ ndo->ndo_protocol = "usb_linux_48_byte";
if (h->caplen < sizeof(pcap_usb_header)) {
+ ndo->ndo_ll_header_length += h->caplen;
nd_print_trunc(ndo);
- return(sizeof(pcap_usb_header));
+ return;
}
+ ndo->ndo_ll_header_length += sizeof (pcap_usb_header);
usb_header_print(ndo, (const pcap_usb_header *) p);
- return(sizeof(pcap_usb_header));
+ return;
}
#ifdef DLT_USB_LINUX_MMAPPED
@@ -271,19 +273,21 @@ usb_linux_48_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
usb_linux_64_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
const u_char *p)
{
- ndo->ndo_protocol = "usb_linux_64_byte_if";
+ ndo->ndo_protocol = "usb_linux_64_byte";
if (h->caplen < sizeof(pcap_usb_header_mmapped)) {
+ ndo->ndo_ll_header_length += h->caplen;
nd_print_trunc(ndo);
- return(sizeof(pcap_usb_header_mmapped));
+ return;
}
+ ndo->ndo_ll_header_length += sizeof (pcap_usb_header_mmapped);
usb_header_print(ndo, (const pcap_usb_header *) p);
- return(sizeof(pcap_usb_header_mmapped));
+ return;
}
#endif /* DLT_USB_LINUX_MMAPPED */