Import bluetooth-tools, a few Bluetooth network tools

derived from FreeBSD.

Help and ok sturm@.
This commit is contained in:
grange 2005-07-16 20:49:46 +00:00
parent 2710f54b83
commit 2867c34305
9 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# $OpenBSD: Makefile,v 1.1.1.1 2005/07/16 20:49:46 grange Exp $
COMMENT= "bluetooth network tools"
DISTNAME= bluetooth-tools-20050716
CATEGORIES= net
MAINTAINER= Alexander Yurchenko <grange@openbsd.org>
# BSD
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= ftp://ftp.erisiandiscord.de/pub/misc/
WANTLIB= c
LIB_DEPENDS= bluetooth.1.0::devel/bluetooth-libs
MAKE_ENV= BINDIR=${TRUEPREFIX}/bin SBINDIR=${TRUEPREFIX}/sbin \
MANDIR=${TRUEPREFIX}/man/cat \
COPTS=-I${LOCALBASE}/include LDADD=-L${LOCALBASE}/lib
NO_REGRESS= Yes
.include <bsd.port.mk>

View File

@ -0,0 +1,4 @@
MD5 (bluetooth-tools-20050716.tar.gz) = 74194befffd64315618ad76190dd4e80
RMD160 (bluetooth-tools-20050716.tar.gz) = e3e7f4afa812ed8ed2d46eafa688bda7223b2794
SHA1 (bluetooth-tools-20050716.tar.gz) = c1137565a641d65bc70ce2fb0b357f953bb61682
SIZE (bluetooth-tools-20050716.tar.gz) = 25717

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-hccontrol_Makefile,v 1.1.1.1 2005/07/16 20:49:46 grange Exp $
--- hccontrol/Makefile.orig Sat Jul 16 01:22:54 2005
+++ hccontrol/Makefile Sat Jul 16 01:23:01 2005
@@ -9,6 +9,6 @@ SRCS= send_recv.c link_policy.c link_co
WARNS?= 2
DPADD= ${LIBBLUETOOTH}
-LDADD= -lbluetooth
+LDADD+= -lbluetooth
.include <bsd.prog.mk>

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-hccontrol_hccontrol_c,v 1.1.1.1 2005/07/16 20:49:46 grange Exp $
--- hccontrol/hccontrol.c.orig Sat Jul 16 01:19:36 2005
+++ hccontrol/hccontrol.c Sat Jul 16 01:20:27 2005
@@ -135,6 +135,7 @@ socket_open(char const *node)
(void * const) &filter, sizeof(filter)) < 0)
err(4, "Could not setsockopt()");
+#ifdef __FreeBSD__
size = (sizeof(mib)/sizeof(mib[0]));
if (sysctlnametomib("net.bluetooth.hci.command_timeout",mib,&size) < 0)
err(5, "Could not sysctlnametomib()");
@@ -142,6 +143,7 @@ socket_open(char const *node)
if (sysctl(mib, sizeof(mib)/sizeof(mib[0]),
(void *) &timeout, &size, NULL, 0) < 0)
err(6, "Could not sysctl()");
+#endif
timeout ++;

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-hccontrol_hccontrol_h,v 1.1.1.1 2005/07/16 20:49:46 grange Exp $
--- hccontrol/hccontrol.h.orig Sat Jul 16 01:18:28 2005
+++ hccontrol/hccontrol.h Sat Jul 16 01:18:56 2005
@@ -32,6 +32,10 @@
#ifndef _HCCONTROL_H_
#define _HCCONTROL_H_
+#ifdef __OpenBSD__
+#define le16toh letoh16
+#endif
+
#define OK 0 /* everything was OK */
#define ERROR 1 /* could not execute command */
#define FAILED 2 /* error was reported */

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-hccontrol_send_recv_c,v 1.1.1.1 2005/07/16 20:49:46 grange Exp $
--- hccontrol/send_recv.c.orig Sat Jul 16 01:05:06 2005
+++ hccontrol/send_recv.c Sat Jul 16 01:05:33 2005
@@ -35,7 +35,11 @@
#include <sys/endian.h>
#include <assert.h>
#include <errno.h>
+#ifdef __FreeBSD__
#include <netgraph/bluetooth/include/ng_hci.h>
+#elif __OpenBSD__
+#include <netbt/hci.h>
+#endif
#include <string.h>
#include <unistd.h>
#include "hccontrol.h"

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-hccontrol_status_c,v 1.1.1.1 2005/07/16 20:49:46 grange Exp $
--- hccontrol/status.c.orig Sat Jul 16 01:13:05 2005
+++ hccontrol/status.c Sat Jul 16 01:13:37 2005
@@ -32,7 +32,11 @@
#include <sys/types.h>
#include <sys/endian.h>
#include <errno.h>
+#ifdef __FreeBSD__
#include <netgraph/bluetooth/include/ng_hci.h>
+#elif __OpenBSD__
+#include <netbt/hci.h>
+#endif
#include <stdio.h>
#include "hccontrol.h"

View File

@ -0,0 +1,5 @@
bluetooth-tools package consists of a few Bluetooth network
tools derived from FreeBSD.
hccontrol program allows to send HCI layer commands directly
to the Bluetooth adapter.

View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2005/07/16 20:49:46 grange Exp $
bin/hccontrol
@man man/cat8/hccontrol.0