]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-usb.c
Don't print timestamps to a buffer and then print the buffer.
[tcpdump] / print-usb.c
index d3018d7aba763b7984b144def083782a905c4b0a..56e6dd4674b9d4ac186b0f6552ad3c95050830cf 100644 (file)
 /* \summary: USB printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include "netdissect.h"
 #include "extract.h"
@@ -135,7 +135,6 @@ typedef struct _usb_isodesc {
        nd_byte         pad[4];
 } usb_isodesc;
 
-static const char tstr[] = "[|usb]";
 
 /* returns direction: 1=inbound 2=outbound -1=invalid */
 static int
@@ -243,8 +242,9 @@ u_int
 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";
        if (h->caplen < sizeof(pcap_usb_header)) {
-               ND_PRINT("%s", tstr);
+               nd_print_trunc(ndo);
                return(sizeof(pcap_usb_header));
        }
 
@@ -266,8 +266,9 @@ u_int
 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";
        if (h->caplen < sizeof(pcap_usb_header_mmapped)) {
-               ND_PRINT("%s", tstr);
+               nd_print_trunc(ndo);
                return(sizeof(pcap_usb_header_mmapped));
        }