/* \summary: Bluetooth printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "extract.h"
{
u_int length = h->len;
u_int caplen = h->caplen;
- const bluetooth_h4_header* hdr = (const bluetooth_h4_header*)p;
+ const bluetooth_h4_header *hdr = (const bluetooth_h4_header *)p;
ndo->ndo_protocol = "bluetooth";
nd_print_protocol(ndo);
- if (caplen < BT_HDRLEN) {
- ndo->ndo_ll_header_length += caplen;
- nd_print_trunc(ndo);
- return;
- }
- ndo->ndo_ll_header_length += BT_HDRLEN;
+ ND_TCHECK_LEN(p, BT_HDRLEN);
+ ndo->ndo_ll_hdr_len += BT_HDRLEN;
caplen -= BT_HDRLEN;
length -= BT_HDRLEN;
p += BT_HDRLEN;
if (!ndo->ndo_suppress_default_print)
ND_DEFAULTPRINT(p, caplen);
- return;
}
#endif