]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bt.c
Fix the pointer tests in the non-ndoified TTEST2() macro as well.
[tcpdump] / print-bt.c
index 03a18dc484ce168568f15e8129b9b3224076e6ab..128daade063f8ade4c449803bbc5422c6a4d785a 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
 #include <tcpdump-stdinc.h>
 
-#include <stdio.h>
-#include <string.h>
-
 #include "interface.h"
 #include "extract.h"
 
  * is the number of bytes actually captured.
  */
 u_int
-bt_if_print(const struct pcap_pkthdr *h, const u_char *p)
+bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int length = h->len;
        u_int caplen = h->caplen;
        const pcap_bluetooth_h4_header* hdr = (const pcap_bluetooth_h4_header*)p;
 
        if (caplen < BT_HDRLEN) {
-               printf("[|bt]");
+               ND_PRINT((ndo, "[|bt]"));
                return (BT_HDRLEN);
        }
        caplen -= BT_HDRLEN;
        length -= BT_HDRLEN;
        p += BT_HDRLEN;
-       if (eflag)
-               (void)printf("hci length %d, direction %s, ", length, (EXTRACT_32BITS(&hdr->direction)&0x1)?"in":"out");
+       if (ndo->ndo_eflag)
+               ND_PRINT((ndo, "hci length %d, direction %s, ", length, (EXTRACT_32BITS(&hdr->direction)&0x1)?"in":"out"));
 
-       if (!suppress_default_print)
-               default_print(p, caplen);
+       if (!ndo->ndo_suppress_default_print)
+               ND_DEFAULTPRINT(p, caplen);
 
        return (BT_HDRLEN);
 }