X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/49257e55e1e11b0287f88c9e542465b64c9b9139..d2777156522f139a858bd6b5b51e364826bc95a7:/print-usb.c diff --git a/print-usb.c b/print-usb.c index 07a0a5d1..3f5937ba 100644 --- a/print-usb.c +++ b/print-usb.c @@ -27,6 +27,7 @@ #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "extract.h" @@ -247,19 +248,15 @@ 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 -usb_linux_48_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, - const u_char *p) +void +usb_linux_48_byte_if_print(netdissect_options *ndo, + const struct pcap_pkthdr *h _U_, const u_char *p) { - ndo->ndo_protocol = "usb_linux_48_byte_if"; - if (h->caplen < sizeof(pcap_usb_header)) { - nd_print_trunc(ndo); - return(sizeof(pcap_usb_header)); - } + ndo->ndo_protocol = "usb_linux_48_byte"; + ND_TCHECK_LEN(p, sizeof(pcap_usb_header)); + ndo->ndo_ll_hdr_len += sizeof (pcap_usb_header); usb_header_print(ndo, (const pcap_usb_header *) p); - - return(sizeof(pcap_usb_header)); } #ifdef DLT_USB_LINUX_MMAPPED @@ -271,19 +268,15 @@ 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 -usb_linux_64_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, - const u_char *p) +void +usb_linux_64_byte_if_print(netdissect_options *ndo, + const struct pcap_pkthdr *h _U_, const u_char *p) { - ndo->ndo_protocol = "usb_linux_64_byte_if"; - if (h->caplen < sizeof(pcap_usb_header_mmapped)) { - nd_print_trunc(ndo); - return(sizeof(pcap_usb_header_mmapped)); - } + ndo->ndo_protocol = "usb_linux_64_byte"; + ND_TCHECK_LEN(p, sizeof(pcap_usb_header_mmapped)); + ndo->ndo_ll_hdr_len += sizeof (pcap_usb_header_mmapped); usb_header_print(ndo, (const pcap_usb_header *) p); - - return(sizeof(pcap_usb_header_mmapped)); } #endif /* DLT_USB_LINUX_MMAPPED */