FreeBSD/contrib/tcpdump/print-bt.c
/*
 * This is the top level routine of the printer.  'p' points
 * to the bluetooth header of the packet, 'h->ts' is the timestamp,
 * 'h->len' is the length of the packet off the wire, and 'h->caplen'
 * is the number of bytes actually captured.
 */
This is the top level routine of the printer.
This is the top level routine of the printer .
u_int
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) {
		ND_PRINT((ndo, "[|bt]"));
		return (BT_HDRLEN);
	}
	caplen -= BT_HDRLEN;
	length -= BT_HDRLEN;
	p += BT_HDRLEN;
	if (ndo->ndo_eflag)
		ND_PRINT((ndo, "hci length %d, direction %s, ", length, (EXTRACT_32BITS(&hdr->direction)&0x1)?"in":"out"));
	if (!ndo->ndo_suppress_default_print)
		ND_DEFAULTPRINT(p, caplen);
	return (BT_HDRLEN);
}
u_int 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 ) { ND_PRINT ( ( ndo , " " ) ) ; return ( BT_HDRLEN ) ; } caplen -= BT_HDRLEN ; length -= BT_HDRLEN ; p += BT_HDRLEN ; if ( ndo -> ndo_eflag ) ND_PRINT ( ( ndo , " " , length , ( EXTRACT_32BITS ( & hdr -> direction ) & 0x1 ) ? " " : " " ) ) ; if ( ! ndo -> ndo_suppress_default_print ) ND_DEFAULTPRINT ( p , caplen ) ; return ( BT_HDRLEN ) ; }
This is the top level routine of the printer.
This is the top level routine of the printer .