summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorplunky <plunky>2014-12-27 11:59:22 +0000
committerplunky <plunky>2014-12-27 11:59:22 +0000
commitbd993cf4f680aec2d296ff727252b7e54162b2ce (patch)
treee6c6d51ba0c6106bd607d01e3fca7e8e3e361ed8
parentd90eb1d3f903a24d0cfd20f0bc5b7c708c6f7056 (diff)
downloadpkgsrc_2011Q3.tar.gz
re-add these files. (previous commit my mistake, wrong tag)pkgsrc_2011Q3
-rw-r--r--sysutils/netbt-hcidump/DESCR7
-rw-r--r--sysutils/netbt-hcidump/Makefile38
-rw-r--r--sysutils/netbt-hcidump/PLIST4
-rw-r--r--sysutils/netbt-hcidump/distinfo22
-rw-r--r--sysutils/netbt-hcidump/patches/patch-aa9
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ab74
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ac41
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ad50
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ae20
-rw-r--r--sysutils/netbt-hcidump/patches/patch-af13
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ah13
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ai14
-rw-r--r--sysutils/netbt-hcidump/patches/patch-aj15
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ak21
-rw-r--r--sysutils/netbt-hcidump/patches/patch-al63
-rw-r--r--sysutils/netbt-hcidump/patches/patch-am122
-rw-r--r--sysutils/netbt-hcidump/patches/patch-an13
-rw-r--r--sysutils/netbt-hcidump/patches/patch-ao135
18 files changed, 674 insertions, 0 deletions
diff --git a/sysutils/netbt-hcidump/DESCR b/sysutils/netbt-hcidump/DESCR
new file mode 100644
index 00000000000..aa98e54d3b8
--- /dev/null
+++ b/sysutils/netbt-hcidump/DESCR
@@ -0,0 +1,7 @@
+HCIdump reads raw HCI data coming from and going to a Bluetooth device and
+prints to screen commands, events and data in a human-readable form.
+Optionally, the dump can be written to a file rather than parsed, and the dump
+file can be parsed in a subsequent moment.
+
+This is a patched standalone version not requiring bluez-libs, suitable
+for use with the netbt Bluetooth stack [originating] in NetBSD.
diff --git a/sysutils/netbt-hcidump/Makefile b/sysutils/netbt-hcidump/Makefile
new file mode 100644
index 00000000000..4d6f0bd2086
--- /dev/null
+++ b/sysutils/netbt-hcidump/Makefile
@@ -0,0 +1,38 @@
+# $NetBSD: Makefile,v 1.4.4.2 2014/12/27 11:59:22 plunky Exp $
+
+DISTNAME= netbt-hcidump-2.1
+PKGREVISION= 1
+CATEGORIES= sysutils
+MASTER_SITES= http://www.kernel.org/pub/linux/bluetooth/
+DISTFILES= bluez-hcidump-2.1.tar.gz \
+ bluez-4.94.tar.gz
+
+MAINTAINER= plunky@rya-online.net
+HOMEPAGE= http://www.bluez.org/
+COMMENT= Bluetooth packet analyzer (netbt version)
+LICENSE= gnu-gpl-v2
+
+ONLY_FOR_PLATFORM= NetBSD-[4-9].*-*
+CONFLICTS+= hcidump-[0-9]* bluez-hcidump-[0-9]*
+
+INSTALLATION_DIRS= sbin ${PKGMANDIR}/cat8 ${PKGMANDIR}/man8
+
+WRKSRC= ${WRKDIR}/bluez-hcidump-2.1
+LIBSRC= ${WRKDIR}/bluez-4.94
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+CPPFLAGS+= -DVERSION=\""2.1-netbt"\"
+
+USE_BSD_MAKEFILE= yes
+
+post-extract:
+ mkdir ${WRKSRC}/bluetooth
+ cp ${LIBSRC}/lib/bluetooth.h ${WRKSRC}/bluetooth
+ cp ${LIBSRC}/lib/hci.h ${WRKSRC}/bluetooth
+ cp ${LIBSRC}/lib/hci_lib.h ${WRKSRC}/bluetooth
+ cp ${LIBSRC}/lib/l2cap.h ${WRKSRC}/bluetooth
+ cp ${LIBSRC}/lib/bluetooth.c ${WRKSRC}/src/bt_lib.c
+ cp ${LIBSRC}/lib/hci.c ${WRKSRC}/src/hci_lib.c
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/netbt-hcidump/PLIST b/sysutils/netbt-hcidump/PLIST
new file mode 100644
index 00000000000..f4c855a7c8f
--- /dev/null
+++ b/sysutils/netbt-hcidump/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+man/cat8/hcidump.0
+man/man8/hcidump.8
+sbin/hcidump
diff --git a/sysutils/netbt-hcidump/distinfo b/sysutils/netbt-hcidump/distinfo
new file mode 100644
index 00000000000..a67387f5f4b
--- /dev/null
+++ b/sysutils/netbt-hcidump/distinfo
@@ -0,0 +1,22 @@
+$NetBSD: distinfo,v 1.5.4.2 2014/12/27 11:59:22 plunky Exp $
+
+SHA1 (bluez-4.94.tar.gz) = 5a6ac6dfe6074e002a517f6e841623f0ded66e41
+RMD160 (bluez-4.94.tar.gz) = 20010e0db361fce9e08c0342d092f8397e478551
+Size (bluez-4.94.tar.gz) = 1152526 bytes
+SHA1 (bluez-hcidump-2.1.tar.gz) = d797000ac0f840803abecdae5e44db88c5e5dbe8
+RMD160 (bluez-hcidump-2.1.tar.gz) = cf26c5ea4f68abc6dee1135a0a9b35cac45ebb7f
+Size (bluez-hcidump-2.1.tar.gz) = 154630 bytes
+SHA1 (patch-aa) = 6e30f3bd8e06e152bd2b65b32e173de039320787
+SHA1 (patch-ab) = e313255f11be98686f40af27c6a18550656759ea
+SHA1 (patch-ac) = adbc1e33996e61ccc5c016154bee3c4af72d784d
+SHA1 (patch-ad) = b7007a6c55011ac6a1da2fd1883f953532d75ea5
+SHA1 (patch-ae) = e59424e971879f368c09adae894088952612f1be
+SHA1 (patch-af) = 7748d6d83ce118eff90b9d8158badd0664faa308
+SHA1 (patch-ah) = b5a190251ccb9e55d2ac8460a436df3026d6be3d
+SHA1 (patch-ai) = 46239a7931f8fecee9216b13f98227711c69c54d
+SHA1 (patch-aj) = 3ef708a26e82ea209ef66c556889ba0cb9c9dd86
+SHA1 (patch-ak) = bbdb271ca8ff39b57082659ceceb9435273ab5ac
+SHA1 (patch-al) = 0a7330fbc9b38c13797aae1a46ecc07b2eca8643
+SHA1 (patch-am) = 7de396188d6c519e4d7b95eb5134cb1464dfb865
+SHA1 (patch-an) = 35d9fd1b0d82addf0688e2997fdf589fbc89d921
+SHA1 (patch-ao) = 9572764ecba59a92f69996f5601fe14d4ebe3b23
diff --git a/sysutils/netbt-hcidump/patches/patch-aa b/sysutils/netbt-hcidump/patches/patch-aa
new file mode 100644
index 00000000000..73aa708050e
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-aa
@@ -0,0 +1,9 @@
+$NetBSD: patch-aa,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- Makefile.orig 2009-11-30 19:29:18.000000000 +0000
++++ Makefile
+@@ -0,0 +1,4 @@
++
++SUBDIR+= src
++
++.include <bsd.subdir.mk>
diff --git a/sysutils/netbt-hcidump/patches/patch-ab b/sysutils/netbt-hcidump/patches/patch-ab
new file mode 100644
index 00000000000..27262b4853f
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ab
@@ -0,0 +1,74 @@
+$NetBSD: patch-ab,v 1.3.4.2 2014/12/27 11:59:22 plunky Exp $
+
+--- bluetooth/bluetooth.h.orig 2011-06-19 12:38:18.000000000 +0000
++++ bluetooth/bluetooth.h
+@@ -30,6 +30,7 @@
+ extern "C" {
+ #endif
+
++#if 0
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <string.h>
+@@ -103,6 +104,17 @@ enum {
+ #else
+ #error "Unknown byte order"
+ #endif
++#else
++#include <bluetooth.h>
++#include <string.h>
++
++#define SOL_HCI BTPROTO_HCI
++
++#define htobs(d) htole16(d)
++#define htobl(d) htole32(d)
++#define btohs(d) le16toh(d)
++#define btohl(d) le32toh(d)
++#endif
+
+ /* Bluetooth unaligned access */
+ #define bt_get_unaligned(ptr) \
+@@ -121,6 +133,7 @@ do { \
+ __p->__v = (val); \
+ } while(0)
+
++#if 0
+ /* BD Address */
+ typedef struct {
+ uint8_t b[6];
+@@ -129,6 +142,7 @@ typedef struct {
+ #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
+ #define BDADDR_ALL (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}})
+ #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
++#endif
+
+ /* Copy, swap, convert BD Address */
+ static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2)
+@@ -141,9 +155,12 @@ static inline void bacpy(bdaddr_t *dst,
+ }
+
+ void baswap(bdaddr_t *dst, const bdaddr_t *src);
++#if 0
+ bdaddr_t *strtoba(const char *str);
+ char *batostr(const bdaddr_t *ba);
++#endif
+ int ba2str(const bdaddr_t *ba, char *str);
++#if 0
+ int str2ba(const char *str, bdaddr_t *ba);
+ int ba2oui(const bdaddr_t *ba, char *oui);
+ int bachk(const char *str);
+@@ -152,11 +169,14 @@ int baprintf(const char *format, ...);
+ int bafprintf(FILE *stream, const char *format, ...);
+ int basprintf(char *str, const char *format, ...);
+ int basnprintf(char *str, size_t size, const char *format, ...);
++#endif
+
+ void *bt_malloc(size_t size);
+ void bt_free(void *ptr);
+
++#if 0
+ int bt_error(uint16_t code);
++#endif
+ char *bt_compidtostr(int id);
+
+ typedef struct {
diff --git a/sysutils/netbt-hcidump/patches/patch-ac b/sysutils/netbt-hcidump/patches/patch-ac
new file mode 100644
index 00000000000..83f7d7dc730
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ac
@@ -0,0 +1,41 @@
+$NetBSD: patch-ac,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- bluetooth/hci.h.orig 2010-09-30 08:53:08.000000000 +0000
++++ bluetooth/hci.h
+@@ -39,6 +39,7 @@ extern "C" {
+ #define HCI_MAX_EVENT_SIZE 260
+ #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4)
+
++#if 0
+ /* HCI dev events */
+ #define HCI_DEV_REG 1
+ #define HCI_DEV_UNREG 2
+@@ -101,6 +102,7 @@ enum {
+ #define HCIUNBLOCKADDR _IOW('H', 231, int)
+
+ #define HCIINQUIRY _IOR('H', 240, int)
++#endif
+
+ #ifndef __NO_HCI_DEFS
+
+@@ -2232,6 +2234,7 @@ typedef struct {
+
+ #endif /* _NO_HCI_DEFS */
+
++#if 0
+ /* HCI Socket options */
+ #define HCI_DATA_DIR 1
+ #define HCI_FILTER 2
+@@ -2339,6 +2342,12 @@ struct hci_inquiry_req {
+ uint8_t num_rsp;
+ };
+ #define IREQ_CACHE_FLUSH 0x0001
++#else
++#define HCI_CMSG_DIR SCM_HCI_DIRECTION
++#define HCI_CMSG_TSTAMP SCM_TIMESTAMP
++#define HCI_DEV_NONE NULL
++#define HCI_DATA_DIR SO_HCI_DIRECTION
++#endif
+
+ #ifdef __cplusplus
+ }
diff --git a/sysutils/netbt-hcidump/patches/patch-ad b/sysutils/netbt-hcidump/patches/patch-ad
new file mode 100644
index 00000000000..dcdb289762e
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ad
@@ -0,0 +1,50 @@
+$NetBSD: patch-ad,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- bluetooth/hci_lib.h.orig 2010-09-30 08:53:08.000000000 +0000
++++ bluetooth/hci_lib.h
+@@ -30,6 +30,7 @@
+ extern "C" {
+ #endif
+
++#if 0
+ struct hci_request {
+ uint16_t ogf;
+ uint16_t ocf;
+@@ -135,11 +136,15 @@ char *hci_bustostr(int bus);
+ char *hci_typetostr(int type);
+ char *hci_dtypetostr(int type);
+ char *hci_dflagstostr(uint32_t flags);
++#endif
+ char *hci_ptypetostr(unsigned int ptype);
++#if 0
+ int hci_strtoptype(char *str, unsigned int *val);
+ char *hci_scoptypetostr(unsigned int ptype);
+ int hci_strtoscoptype(char *str, unsigned int *val);
++#endif
+ char *hci_lptostr(unsigned int ptype);
++#if 0
+ int hci_strtolp(char *str, unsigned int *val);
+ char *hci_lmtostr(unsigned int ptype);
+ int hci_strtolm(char *str, unsigned int *val);
+@@ -147,9 +152,13 @@ int hci_strtolm(char *str, unsigned int
+ char *hci_cmdtostr(unsigned int cmd);
+ char *hci_commandstostr(uint8_t *commands, char *pref, int width);
+
++#endif
+ char *hci_vertostr(unsigned int ver);
++#if 0
+ int hci_strtover(char *str, unsigned int *ver);
++#endif
+ char *lmp_vertostr(unsigned int ver);
++#if 0
+ int lmp_strtover(char *str, unsigned int *ver);
+
+ char *lmp_featurestostr(uint8_t *features, char *pref, int width);
+@@ -218,6 +227,7 @@ static inline int hci_filter_test_opcode
+ {
+ return (f->opcode == opcode);
+ }
++#endif
+
+ #ifdef __cplusplus
+ }
diff --git a/sysutils/netbt-hcidump/patches/patch-ae b/sysutils/netbt-hcidump/patches/patch-ae
new file mode 100644
index 00000000000..770f4fd2bdf
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ae
@@ -0,0 +1,20 @@
+$NetBSD: patch-ae,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- bluetooth/l2cap.h.orig 2009-11-30 19:29:17.000000000 +0000
++++ bluetooth/l2cap.h
+@@ -30,6 +30,7 @@
+ extern "C" {
+ #endif
+
++#if 0
+ #include <sys/socket.h>
+
+ /* L2CAP defaults */
+@@ -66,6 +67,7 @@ struct l2cap_conninfo {
+ #define L2CAP_LM_TRUSTED 0x0008
+ #define L2CAP_LM_RELIABLE 0x0010
+ #define L2CAP_LM_SECURE 0x0020
++#endif
+
+ /* L2CAP command codes */
+ #define L2CAP_COMMAND_REJ 0x01
diff --git a/sysutils/netbt-hcidump/patches/patch-af b/sysutils/netbt-hcidump/patches/patch-af
new file mode 100644
index 00000000000..838a180e124
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-af
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- parser/bnep.c.orig 2007-02-18 03:39:02.000000000 +0000
++++ parser/bnep.c
+@@ -33,7 +33,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+
+-#include <net/ethernet.h>
++#include <net/ethertypes.h>
+
+ #include "parser.h"
+
diff --git a/sysutils/netbt-hcidump/patches/patch-ah b/sysutils/netbt-hcidump/patches/patch-ah
new file mode 100644
index 00000000000..3b1a2d34087
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ah
@@ -0,0 +1,13 @@
+$NetBSD: patch-ah,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- parser/parser.h.orig 2007-02-18 03:39:02.000000000 +0000
++++ parser/parser.h
+@@ -35,7 +35,7 @@ struct frame {
+ uint32_t data_len;
+ void *ptr;
+ uint32_t len;
+- uint16_t dev_id;
++ char *dev_id;
+ uint8_t in;
+ uint8_t master;
+ uint16_t handle;
diff --git a/sysutils/netbt-hcidump/patches/patch-ai b/sysutils/netbt-hcidump/patches/patch-ai
new file mode 100644
index 00000000000..44826336f78
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ai
@@ -0,0 +1,14 @@
+$NetBSD: patch-ai,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- parser/rfcomm.h.orig 2007-02-18 03:39:02.000000000 +0000
++++ parser/rfcomm.h
+@@ -25,7 +25,9 @@
+ #ifndef __RFCOMM_H
+ #define __RFCOMM_H
+
++#if 0
+ #include <endian.h>
++#endif
+
+ #define RFCOMM_PSM 3
+
diff --git a/sysutils/netbt-hcidump/patches/patch-aj b/sysutils/netbt-hcidump/patches/patch-aj
new file mode 100644
index 00000000000..f1ceb8f03a7
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-aj
@@ -0,0 +1,15 @@
+$NetBSD: patch-aj,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- parser/tcpip.c.orig 2007-02-18 03:39:02.000000000 +0000
++++ parser/tcpip.c
+@@ -32,8 +32,9 @@
+ #include <string.h>
+ #include <sys/types.h>
+
+-#include <net/ethernet.h>
++#include <net/if.h>
+ #include <netinet/in.h>
++#include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+ #include <netinet/ip6.h>
+ #include <netinet/if_ether.h>
diff --git a/sysutils/netbt-hcidump/patches/patch-ak b/sysutils/netbt-hcidump/patches/patch-ak
new file mode 100644
index 00000000000..4d363ec1c1c
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ak
@@ -0,0 +1,21 @@
+$NetBSD: patch-ak,v 1.2.4.2 2014/12/27 11:59:22 plunky Exp $
+
+--- src/Makefile.orig 2011-06-19 12:48:50.000000000 +0000
++++ src/Makefile
+@@ -0,0 +1,16 @@
++.PATH: ../parser
++
++PROG= hcidump
++MAN= hcidump.8
++
++BINDIR= ${PREFIX}/sbin
++
++SRCS= hcidump.c bt_lib.c hci_lib.c \
++ att.c avctp.c avdtp.c bnep.c bpa.c capi.c cmtp.c csr.c \
++ ericsson.c hci.c hcrp.c hidp.c l2cap.c lmp.c obex.c \
++ parser.c ppp.c rfcomm.c sdp.c smp.c tcpip.c
++
++CPPFLAGS+= -I..
++LDADD+= -lbluetooth
++
++.include <bsd.prog.mk>
diff --git a/sysutils/netbt-hcidump/patches/patch-al b/sysutils/netbt-hcidump/patches/patch-al
new file mode 100644
index 00000000000..d1d60070862
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-al
@@ -0,0 +1,63 @@
+$NetBSD: patch-al,v 1.2.4.2 2014/12/27 11:59:22 plunky Exp $
+
+--- src/bt_lib.c.orig 2011-06-19 12:38:18.000000000 +0000
++++ src/bt_lib.c
+@@ -35,8 +35,8 @@
+ #include <string.h>
+ #include <sys/socket.h>
+
+-#include "bluetooth.h"
+-#include "hci.h"
++#include <bluetooth/bluetooth.h>
++#include <bluetooth/hci.h>
+
+ void baswap(bdaddr_t *dst, const bdaddr_t *src)
+ {
+@@ -48,6 +48,7 @@ void baswap(bdaddr_t *dst, const bdaddr_
+ d[i] = s[5-i];
+ }
+
++#if 0
+ char *batostr(const bdaddr_t *ba)
+ {
+ char *str = bt_malloc(18);
+@@ -73,6 +74,7 @@ bdaddr_t *strtoba(const char *str)
+
+ return ba;
+ }
++#endif
+
+ int ba2str(const bdaddr_t *ba, char *str)
+ {
+@@ -80,6 +82,7 @@ int ba2str(const bdaddr_t *ba, char *str
+ ba->b[5], ba->b[4], ba->b[3], ba->b[2], ba->b[1], ba->b[0]);
+ }
+
++#if 0
+ int str2ba(const char *str, bdaddr_t *ba)
+ {
+ bdaddr_t b;
+@@ -175,6 +178,7 @@ int basnprintf(char *str, size_t size, c
+
+ return len;
+ }
++#endif
+
+ void *bt_malloc(size_t size)
+ {
+@@ -186,6 +190,7 @@ void bt_free(void *ptr)
+ free(ptr);
+ }
+
++#if 0
+ /* Bluetooth error codes to Unix errno mapping */
+ int bt_error(uint16_t code)
+ {
+@@ -260,6 +265,7 @@ int bt_error(uint16_t code)
+ return ENOSYS;
+ }
+ }
++#endif
+
+ char *bt_compidtostr(int compid)
+ {
diff --git a/sysutils/netbt-hcidump/patches/patch-am b/sysutils/netbt-hcidump/patches/patch-am
new file mode 100644
index 00000000000..83a714aee66
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-am
@@ -0,0 +1,122 @@
+$NetBSD: patch-am,v 1.2.4.2 2014/12/27 11:59:22 plunky Exp $
+
+--- src/hci_lib.c.orig 2011-06-19 12:48:50.000000000 +0000
++++ src/hci_lib.c
+@@ -41,9 +41,9 @@
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+
+-#include "bluetooth.h"
+-#include "hci.h"
+-#include "hci_lib.h"
++#include <bluetooth/bluetooth.h>
++#include <bluetooth/hci.h>
++#include <bluetooth/hci_lib.h>
+
+ #ifndef MIN
+ #define MIN(x, y) ((x) < (y) ? (x) : (y))
+@@ -71,6 +71,7 @@ static char *hci_bit2str(hci_map *m, uns
+ return str;
+ }
+
++#if 0
+ static int hci_str2bit(hci_map *map, char *str, unsigned int *val)
+ {
+ char *t, *ptr;
+@@ -94,6 +95,7 @@ static int hci_str2bit(hci_map *map, cha
+
+ return set;
+ }
++#endif
+
+ static char *hci_uint2str(hci_map *m, unsigned int val)
+ {
+@@ -114,6 +116,7 @@ static char *hci_uint2str(hci_map *m, un
+ return str;
+ }
+
++#if 0
+ static int hci_str2uint(hci_map *map, char *str, unsigned int *val)
+ {
+ char *t, *ptr;
+@@ -213,6 +216,7 @@ char *hci_dflagstostr(uint32_t flags)
+ }
+ return str;
+ }
++#endif
+
+ /* HCI packet type mapping */
+ static hci_map pkt_type_map[] = {
+@@ -234,6 +238,7 @@ static hci_map pkt_type_map[] = {
+ { NULL }
+ };
+
++#if 0
+ static hci_map sco_ptype_map[] = {
+ { "HV1", 0x0001 },
+ { "HV2", 0x0002 },
+@@ -247,12 +252,15 @@ static hci_map sco_ptype_map[] = {
+ { "3-EV5", HCI_3EV5 },
+ { NULL }
+ };
++#endif
+
+ char *hci_ptypetostr(unsigned int ptype)
+ {
++ ptype ^= (HCI_2DH1|HCI_2DH3|HCI_2DH5|HCI_3DH1|HCI_3DH3|HCI_3DH5);
+ return hci_bit2str(pkt_type_map, ptype);
+ }
+
++#if 0
+ int hci_strtoptype(char *str, unsigned int *val)
+ {
+ return hci_str2bit(pkt_type_map, str, val);
+@@ -267,6 +275,7 @@ int hci_strtoscoptype(char *str, unsigne
+ {
+ return hci_str2bit(sco_ptype_map, str, val);
+ }
++#endif
+
+ /* Link policy mapping */
+ static hci_map link_policy_map[] = {
+@@ -283,6 +292,7 @@ char *hci_lptostr(unsigned int lp)
+ return hci_bit2str(link_policy_map, lp);
+ }
+
++#if 0
+ int hci_strtolp(char *str, unsigned int *val)
+ {
+ return hci_str2bit(link_policy_map, str, val);
+@@ -639,6 +649,7 @@ char *hci_commandstostr(uint8_t *command
+
+ return str;
+ }
++#endif
+
+ /* Version mapping */
+ static hci_map ver_map[] = {
+@@ -657,16 +668,19 @@ char *hci_vertostr(unsigned int ver)
+ return hci_uint2str(ver_map, ver);
+ }
+
++#if 0
+ int hci_strtover(char *str, unsigned int *ver)
+ {
+ return hci_str2uint(ver_map, str, ver);
+ }
++#endif
+
+ char *lmp_vertostr(unsigned int ver)
+ {
+ return hci_uint2str(ver_map, ver);
+ }
+
++#if 0
+ int lmp_strtover(char *str, unsigned int *ver)
+ {
+ return hci_str2uint(ver_map, str, ver);
+@@ -2911,3 +2925,4 @@ int hci_le_conn_update(int dd, uint16_t
+
+ return 0;
+ }
++#endif
diff --git a/sysutils/netbt-hcidump/patches/patch-an b/sysutils/netbt-hcidump/patches/patch-an
new file mode 100644
index 00000000000..d1bf1c8f8b6
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.1.1.1.8.2 2014/12/27 11:59:22 plunky Exp $
+
+--- src/hcidump.8.orig 2007-07-26 08:34:58.000000000 +0100
++++ src/hcidump.8
+@@ -28,7 +28,7 @@ which must be the name of an installed B
+ and if
+ .B
+ -r
+-option is not set, data is read from the first available Bluetooth device.
++option is not set, data is read from all available Bluetooth devices.
+ .TP
+ .BI -l " <len>" "\fR,\fP \-\^\-snap-len=" "<len>"
+ Sets max length of processed packets to
diff --git a/sysutils/netbt-hcidump/patches/patch-ao b/sysutils/netbt-hcidump/patches/patch-ao
new file mode 100644
index 00000000000..758ebb9be30
--- /dev/null
+++ b/sysutils/netbt-hcidump/patches/patch-ao
@@ -0,0 +1,135 @@
+$NetBSD: patch-ao,v 1.4.4.2 2014/12/27 11:59:22 plunky Exp $
+
+--- src/hcidump.c.orig 2011-06-13 01:54:33.000000000 +0000
++++ src/hcidump.c
+@@ -50,6 +50,10 @@
+ #include "parser/parser.h"
+ #include "parser/sdp.h"
+
++#ifndef AI_ADDRCONFIG
++#define AI_ADDRCONFIG 0
++#endif
++
+ #define SNAP_LEN HCI_MAX_FRAME_SIZE
+ #define DEFAULT_PORT "10839";
+
+@@ -146,7 +150,7 @@ static inline int write_n(int fd, char *
+ return t;
+ }
+
+-static int process_frames(int dev, int sock, int fd, unsigned long flags)
++static int process_frames(char *dev, int sock, int fd, unsigned long flags)
+ {
+ struct cmsghdr *cmsg;
+ struct msghdr msg;
+@@ -188,7 +192,7 @@ static int process_frames(int dev, int s
+ if (dev == HCI_DEV_NONE)
+ printf("system: ");
+ else
+- printf("device: hci%d ", dev);
++ printf("device: %s ", dev);
+
+ printf("snap_len: %d filter: 0x%lx\n", snap_len, parser.filter);
+
+@@ -530,10 +534,13 @@ static int open_file(char *file, int mod
+ return fd;
+ }
+
+-static int open_socket(int dev, unsigned long flags)
++static int open_socket(char *dev, unsigned long flags)
+ {
+- struct sockaddr_hci addr;
++ struct sockaddr_bt addr;
+ struct hci_filter flt;
++#if 1
++ int sk, opt;
++#else
+ struct hci_dev_info di;
+ int sk, dd, opt;
+
+@@ -559,6 +566,7 @@ static int open_socket(int dev, unsigned
+
+ hci_close_dev(dd);
+ }
++#endif
+
+ /* Create HCI socket */
+ sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
+@@ -574,12 +582,13 @@ static int open_socket(int dev, unsigned
+ }
+
+ opt = 1;
+- if (setsockopt(sk, SOL_HCI, HCI_TIME_STAMP, &opt, sizeof(opt)) < 0) {
++ if (setsockopt(sk, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)) < 0) {
+ perror("Can't enable time stamp");
+ return -1;
+ }
+
+ /* Setup filter */
++#if 0
+ hci_filter_clear(&flt);
+ hci_filter_all_ptypes(&flt);
+ hci_filter_all_events(&flt);
+@@ -587,13 +596,34 @@ static int open_socket(int dev, unsigned
+ perror("Can't set filter");
+ return -1;
+ }
++#else
++ memset(&flt, 0xff, sizeof(flt));
++ if (setsockopt(sk, BTPROTO_HCI, SO_HCI_EVT_FILTER, &flt, sizeof(flt)) < 0) {
++ perror("Can't set event filter");
++ exit(1);
++ }
++
++ if (setsockopt(sk, BTPROTO_HCI, SO_HCI_PKT_FILTER, &flt, sizeof(flt)) < 0) {
++ perror("Can't set packet filter");
++ exit(1);
++ }
++#endif
+
+ /* Bind socket to the HCI device */
+ memset(&addr, 0, sizeof(addr));
++#if 0
+ addr.hci_family = AF_BLUETOOTH;
+ addr.hci_dev = dev;
++#else
++ addr.bt_len = sizeof(addr);
++ addr.bt_family = AF_BLUETOOTH;
++ if (dev != HCI_DEV_NONE && !bt_devaddr(dev, &addr.bt_bdaddr)) {
++ perror("device");
++ exit(1);
++ }
++#endif
+ if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+- printf("Can't attach to device hci%d. %s(%d)\n",
++ printf("Can't attach to device %s. %s(%d)\n",
+ dev, strerror(errno), errno);
+ return -1;
+ }
+@@ -770,7 +800,7 @@ static int wait_connection(char *addr, c
+ return -1;
+ }
+
+-static int run_server(int dev, char *addr, char *port, unsigned long flags)
++static int run_server(char *dev, char *addr, char *port, unsigned long flags)
+ {
+ while (1) {
+ int dd, sk;
+@@ -902,7 +932,7 @@ int main(int argc, char *argv[])
+ {
+ unsigned long flags = 0;
+ unsigned long filter = 0;
+- int device = 0;
++ char *device = HCI_DEV_NONE;
+ int defpsm = 0;
+ int defcompid = DEFAULT_COMPID;
+ int opt, pppdump_fd = -1, audio_fd = -1;
+@@ -911,7 +941,7 @@ int main(int argc, char *argv[])
+ switch(opt) {
+ case 'i':
+ if (strcasecmp(optarg, "none") && strcasecmp(optarg, "system"))
+- device = atoi(optarg + 3);
++ device = optarg;
+ else
+ device = HCI_DEV_NONE;
+ break;