CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: wiz Date: Thu Jan 17 08:53:18 UTC 2019 Modified Files: src/usr.sbin/btpand: btpand.8 Log Message: Add missing width argument to Bl. Remove Pp before It. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btpand/btpand.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: wiz Date: Thu Jan 17 08:53:18 UTC 2019 Modified Files: src/usr.sbin/btpand: btpand.8 Log Message: Add missing width argument to Bl. Remove Pp before It. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btpand/btpand.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/btpand.8 diff -u src/usr.sbin/btpand/btpand.8:1.7 src/usr.sbin/btpand/btpand.8:1.8 --- src/usr.sbin/btpand/btpand.8:1.7 Thu Jan 17 05:52:21 2019 +++ src/usr.sbin/btpand/btpand.8 Thu Jan 17 08:53:17 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: btpand.8,v 1.7 2019/01/17 05:52:21 gutteridge Exp $ +.\" $NetBSD: btpand.8,v 1.8 2019/01/17 08:53:17 wiz Exp $ .\" .\" Copyright (c) 2008 Iain Hibbert .\" All rights reserved. @@ -128,7 +128,7 @@ and 1 for a PANU server. Set L2CAP connection link mode. Supported modes are: .Pp -.Bl -tag -compact +.Bl -tag -compact -width secure .It auth require devices to be paired. .It encrypt @@ -148,7 +148,7 @@ Name of .Ar service to provide or connect to, the following services are recognised: .Pp -.Bl -tag -compact +.Bl -tag -compact -width PANU .It GN Group ad-hoc Network. .It NAP @@ -156,7 +156,6 @@ Network Access Point. .It PANU Personal Area Networking User. .El -.Pp .It Fl S Ar service As per .Fl s @@ -179,7 +178,7 @@ has set up the client or server connecti .Xr tap 4 interface, it will create a pid file and detach. .Sh FILES -.Bl -tag -compact +.Bl -tag -compact -width /etc/bluetooth/hosts .It Pa /dev/tap .It Pa /etc/bluetooth/hosts .It Pa /var/run/sdp
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: gutteridge Date: Thu Jan 17 05:52:22 UTC 2019 Modified Files: src/usr.sbin/btpand: btpand.8 Log Message: btpand(8): replace dhclient(8) references with dhcpcd(8) Addresses part of PR misc/53669. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/btpand.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/btpand.8 diff -u src/usr.sbin/btpand/btpand.8:1.6 src/usr.sbin/btpand/btpand.8:1.7 --- src/usr.sbin/btpand/btpand.8:1.6 Thu Mar 15 22:35:03 2012 +++ src/usr.sbin/btpand/btpand.8 Thu Jan 17 05:52:21 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: btpand.8,v 1.6 2012/03/15 22:35:03 njoly Exp $ +.\" $NetBSD: btpand.8,v 1.7 2019/01/17 05:52:21 gutteridge Exp $ .\" .\" Copyright (c) 2008 Iain Hibbert .\" All rights reserved. @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 17, 2008 +.Dd January 17, 2019 .Dt BTPAND 8 .Os .Sh NAME @@ -190,7 +190,7 @@ interface, it will create a pid file and .Sh EXAMPLES .Dl ifconfig tap1 create .Dl btpand -a host -d ubt0 -s NAP -m encrypt -i tap1 -.Dl dhclient -q -o -w -nw tap1 +.Dl dhcpcd -q -b tap1 .Pp Will create an encrypted connection to the NAP on .Ar host , @@ -209,7 +209,7 @@ the GN service with the local SDP server .Xr tap 4 , .Xr brconfig 8 , .Xr btconfig 8 , -.Xr dhclient 8 , +.Xr dhcpcd 8 , .Xr dhcpd 8 , .Xr ifconfig 8 , .Xr sdpd 8
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: gutteridge Date: Thu Jan 17 05:52:22 UTC 2019 Modified Files: src/usr.sbin/btpand: btpand.8 Log Message: btpand(8): replace dhclient(8) references with dhcpcd(8) Addresses part of PR misc/53669. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/btpand.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: joerg Date: Tue Oct 4 21:40:31 UTC 2016 Modified Files: src/usr.sbin/btpand: bnep.c btpand.h Log Message: The last argument before ... must not be default promoted, otherwise the result is undefined behavior. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/btpand/bnep.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/btpand.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/bnep.c diff -u src/usr.sbin/btpand/bnep.c:1.11 src/usr.sbin/btpand/bnep.c:1.12 --- src/usr.sbin/btpand/bnep.c:1.11 Sat Aug 27 22:30:44 2011 +++ src/usr.sbin/btpand/bnep.c Tue Oct 4 21:40:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.11 2011/08/27 22:30:44 joerg Exp $ */ +/* $NetBSD: bnep.c,v 1.12 2016/10/04 21:40:31 joerg Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include -__RCSID("$NetBSD: bnep.c,v 1.11 2011/08/27 22:30:44 joerg Exp $"); +__RCSID("$NetBSD: bnep.c,v 1.12 2016/10/04 21:40:31 joerg Exp $"); #include #include @@ -587,7 +587,7 @@ bnep_recv_filter_multi_addr_rsp(channel_ } void -bnep_send_control(channel_t *chan, uint8_t type, ...) +bnep_send_control(channel_t *chan, int type, ...) { packet_t *pkt; uint8_t *p; Index: src/usr.sbin/btpand/btpand.h diff -u src/usr.sbin/btpand/btpand.h:1.4 src/usr.sbin/btpand/btpand.h:1.5 --- src/usr.sbin/btpand/btpand.h:1.4 Sun Oct 14 08:35:45 2012 +++ src/usr.sbin/btpand/btpand.h Tue Oct 4 21:40:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: btpand.h,v 1.4 2012/10/14 08:35:45 plunky Exp $ */ +/* $NetBSD: btpand.h,v 1.5 2016/10/04 21:40:31 joerg Exp $ */ /*- * Copyright (c) 2008-2009 Iain Hibbert @@ -168,7 +168,7 @@ b2eaddr(void *dst, bdaddr_t *src) /* bnep.c */ bool bnep_send(channel_t *, packet_t *); bool bnep_recv(packet_t *); -void bnep_send_control(channel_t *, uint8_t, ...); +void bnep_send_control(channel_t *, int, ...); /* channel.c */ void channel_init(void);
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: joerg Date: Tue Oct 4 21:40:31 UTC 2016 Modified Files: src/usr.sbin/btpand: bnep.c btpand.h Log Message: The last argument before ... must not be default promoted, otherwise the result is undefined behavior. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/btpand/bnep.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/btpand.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: christos Date: Sat Jun 21 17:50:01 UTC 2014 Modified Files: src/usr.sbin/btpand: btpand.c Log Message: add NOTREACHED comment To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/btpand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/btpand.c diff -u src/usr.sbin/btpand/btpand.c:1.6 src/usr.sbin/btpand/btpand.c:1.7 --- src/usr.sbin/btpand/btpand.c:1.6 Mon Aug 29 16:38:55 2011 +++ src/usr.sbin/btpand/btpand.c Sat Jun 21 13:50:01 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: btpand.c,v 1.6 2011/08/29 20:38:55 joerg Exp $ */ +/* $NetBSD: btpand.c,v 1.7 2014/06/21 17:50:01 christos Exp $ */ /*- * Copyright (c) 2008-2009 Iain Hibbert @@ -27,7 +27,7 @@ #include sys/cdefs.h __COPYRIGHT(@(#) Copyright (c) 2008-2009 Iain Hibbert. All rights reserved.); -__RCSID($NetBSD: btpand.c,v 1.6 2011/08/29 20:38:55 joerg Exp $); +__RCSID($NetBSD: btpand.c,v 1.7 2014/06/21 17:50:01 christos Exp $); #include sys/wait.h @@ -213,6 +213,7 @@ main(int argc, char *argv[]) switch(fork()) { case -1: /* bad */ err(EXIT_FAILURE, fork() failed); + /*NOTREACHED*/ case 0: /* child */ openlog(getprogname(), LOG_NDELAY | LOG_PERROR | LOG_PID, LOG_DAEMON);
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: christos Date: Sat Jun 21 17:50:01 UTC 2014 Modified Files: src/usr.sbin/btpand: btpand.c Log Message: add NOTREACHED comment To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/btpand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Sun Oct 14 08:31:35 UTC 2012 Modified Files: src/usr.sbin/btpand: client.c server.c Log Message: add code to ensure that SO_SNDBUF is large enough on client connections, as was previously done for server mode To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/client.c cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btpand/server.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/client.c diff -u src/usr.sbin/btpand/client.c:1.6 src/usr.sbin/btpand/client.c:1.7 --- src/usr.sbin/btpand/client.c:1.6 Mon Aug 29 20:38:55 2011 +++ src/usr.sbin/btpand/client.c Sun Oct 14 08:31:35 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: client.c,v 1.6 2011/08/29 20:38:55 joerg Exp $ */ +/* $NetBSD: client.c,v 1.7 2012/10/14 08:31:35 plunky Exp $ */ /*- * Copyright (c) 2008-2009 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: client.c,v 1.6 2011/08/29 20:38:55 joerg Exp $); +__RCSID($NetBSD: client.c,v 1.7 2012/10/14 08:31:35 plunky Exp $); #include bluetooth.h #include errno.h @@ -45,7 +45,7 @@ client_init(void) struct sockaddr_bt sa; channel_t *chan; socklen_t len; - int fd, bufsize; + int fd, n; uint16_t mru, mtu; if (bdaddr_any(remote_bdaddr)) @@ -102,17 +102,15 @@ client_init(void) exit(EXIT_FAILURE); } - len = sizeof(bufsize); - if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, len) == -1) { + len = sizeof(n); + if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, n, len) == -1) { log_err(Could not read SO_RCVBUF); exit(EXIT_FAILURE); } - if (bufsize 10 * mru) { - bufsize = 10 * mru; - if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, - sizeof(bufsize)) == -1) - log_info(Could not increase SO_RCVBUF (from %d), - bufsize); + if (n 10 * mru) { + n = 10 * mru; + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, n, sizeof(n)) == -1) + log_info(Could not increase SO_RCVBUF (to %d), n); } len = sizeof(mtu); @@ -125,6 +123,27 @@ client_init(void) exit(EXIT_FAILURE); } + len = sizeof(n); + if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, n, len) == -1) { + log_err(Could not get socket send buffer size: %m); + close(fd); + return; + } + if (n (mtu * 2)) { + n = mtu * 2; + if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, n, sizeof(n)) == -1) { + log_err(Could not set socket send buffer size (%d): %m, n); + close(fd); + return; + } + } + n = mtu; + if (setsockopt(fd, SOL_SOCKET, SO_SNDLOWAT, n, sizeof(n)) == -1) { + log_err(Could not set socket low water mark (%d): %m, n); + close(fd); + return; + } + chan = channel_alloc(); if (chan == NULL) exit(EXIT_FAILURE); Index: src/usr.sbin/btpand/server.c diff -u src/usr.sbin/btpand/server.c:1.7 src/usr.sbin/btpand/server.c:1.8 --- src/usr.sbin/btpand/server.c:1.7 Tue Feb 8 21:59:50 2011 +++ src/usr.sbin/btpand/server.c Sun Oct 14 08:31:35 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: server.c,v 1.7 2011/02/08 21:59:50 plunky Exp $ */ +/* $NetBSD: server.c,v 1.8 2012/10/14 08:31:35 plunky Exp $ */ /*- * Copyright (c) 2008-2009 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: server.c,v 1.7 2011/02/08 21:59:50 plunky Exp $); +__RCSID($NetBSD: server.c,v 1.8 2012/10/14 08:31:35 plunky Exp $); #include sys/ioctl.h @@ -134,7 +134,7 @@ server_read(int s, short ev, void *arg) struct sockaddr_bt ra, la; channel_t *chan; socklen_t len; - int fd, n, bufsize; + int fd, n; uint16_t mru, mtu; assert(server_count server_limit); @@ -163,18 +163,16 @@ server_read(int s, short ev, void *arg) return; } - len = sizeof(bufsize); - if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, len) == -1) { + len = sizeof(n); + if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, n, len) == -1) { log_err(Could not read SO_RCVBUF); close(fd); return; } - if (bufsize 10 * mru) { - bufsize = 10 * mru; - if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, - sizeof(bufsize)) == -1) - log_info(Could not increase SO_RCVBUF (from %d), - bufsize); + if (n 10 * mru) { + n = 10 * mru; + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, n, sizeof(n)) == -1) + log_info(Could not increase SO_RCVBUF (to %d), n); } len = sizeof(mtu); @@ -195,7 +193,6 @@ server_read(int s, short ev, void *arg) close(fd); return; } - if (n (mtu * 2)) { n = mtu * 2; if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, n, sizeof(n)) == -1) { @@ -204,7 +201,6 @@ server_read(int s, short ev, void *arg) return; } } - n = mtu; if (setsockopt(fd, SOL_SOCKET, SO_SNDLOWAT, n, sizeof(n)) == -1) { log_err(Could not set socket low water mark (%d): %m, n);
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Sun Oct 14 08:35:45 UTC 2012 Modified Files: src/usr.sbin/btpand: btpand.h Log Message: no trailing comma on enum To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/btpand.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/btpand.h diff -u src/usr.sbin/btpand/btpand.h:1.3 src/usr.sbin/btpand/btpand.h:1.4 --- src/usr.sbin/btpand/btpand.h:1.3 Tue May 12 21:50:38 2009 +++ src/usr.sbin/btpand/btpand.h Sun Oct 14 08:35:45 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: btpand.h,v 1.3 2009/05/12 21:50:38 plunky Exp $ */ +/* $NetBSD: btpand.h,v 1.4 2012/10/14 08:35:45 plunky Exp $ */ /*- * Copyright (c) 2008-2009 Iain Hibbert @@ -56,7 +56,7 @@ enum channel_state { CHANNEL_CLOSED, CHANNEL_WAIT_CONNECT_REQ, CHANNEL_WAIT_CONNECT_RSP, - CHANNEL_OPEN, + CHANNEL_OPEN }; #define CHANNEL_MAXQLEN 128
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Sun Oct 14 08:31:35 UTC 2012 Modified Files: src/usr.sbin/btpand: client.c server.c Log Message: add code to ensure that SO_SNDBUF is large enough on client connections, as was previously done for server mode To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/client.c cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btpand/server.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Sun Oct 14 08:35:45 UTC 2012 Modified Files: src/usr.sbin/btpand: btpand.h Log Message: no trailing comma on enum To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/btpand.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: joerg Date: Sat Aug 27 22:30:44 UTC 2011 Modified Files: src/usr.sbin/btpand: bnep.c Log Message: Sprinkle const To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/btpand/bnep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/bnep.c diff -u src/usr.sbin/btpand/bnep.c:1.10 src/usr.sbin/btpand/bnep.c:1.11 --- src/usr.sbin/btpand/bnep.c:1.10 Tue Feb 8 21:43:45 2011 +++ src/usr.sbin/btpand/bnep.c Sat Aug 27 22:30:44 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.10 2011/02/08 21:43:45 plunky Exp $ */ +/* $NetBSD: bnep.c,v 1.11 2011/08/27 22:30:44 joerg Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: bnep.c,v 1.10 2011/02/08 21:43:45 plunky Exp $); +__RCSID($NetBSD: bnep.c,v 1.11 2011/08/27 22:30:44 joerg Exp $); #include bluetooth.h #include sdp.h @@ -49,7 +49,7 @@ static bool bnep_pfilter(channel_t *, packet_t *); static bool bnep_mfilter(channel_t *, packet_t *); -static uint8_t NAP_UUID[] = { +static const uint8_t NAP_UUID[] = { 0x00, 0x00, 0x11, 0x16, 0x00, 0x00, 0x10, 0x00, @@ -57,7 +57,7 @@ 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb }; -static uint8_t GN_UUID[] = { +static const uint8_t GN_UUID[] = { 0x00, 0x00, 0x11, 0x17, 0x00, 0x00, 0x10, 0x00, @@ -65,7 +65,7 @@ 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb, }; -static uint8_t PANU_UUID[] = { +static const uint8_t PANU_UUID[] = { 0x00, 0x00, 0x11, 0x15, 0x00, 0x00, 0x10, 0x00,
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: joerg Date: Sat Aug 27 22:30:44 UTC 2011 Modified Files: src/usr.sbin/btpand: bnep.c Log Message: Sprinkle const To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/btpand/bnep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: wiz Date: Fri Apr 29 10:31:02 UTC 2011 Modified Files: src/usr.sbin/btpand: btpand.8 Log Message: Sort sections, SEE ALSO, and fix xref. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/btpand.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/btpand.8 diff -u src/usr.sbin/btpand/btpand.8:1.4 src/usr.sbin/btpand/btpand.8:1.5 --- src/usr.sbin/btpand/btpand.8:1.4 Sat Oct 24 12:22:24 2009 +++ src/usr.sbin/btpand/btpand.8 Fri Apr 29 10:31:02 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: btpand.8,v 1.4 2009/10/24 12:22:24 reed Exp $ +.\ $NetBSD: btpand.8,v 1.5 2011/04/29 10:31:02 wiz Exp $ .\ .\ Copyright (c) 2008 Iain Hibbert .\ All rights reserved. @@ -80,7 +80,7 @@ .Nm are in the SDP service record. The bridging of packets by the NAP must be configured separately with -.Xr brconfig 4 . +.Xr brconfig 8 . .Pp The options are as follows: .Bl -tag -width .Fl a Ar address @@ -178,8 +178,6 @@ has set up the client or server connection and opened the .Xr tap 4 interface, it will create a pid file and detach. -.Sh EXIT STATUS -.Ex -std .Sh FILES .Bl -tag -compact .It Pa /dev/tap @@ -187,6 +185,8 @@ .It Pa /var/run/sdp .It Pa /var/run/tap Ns Em N Ns No .pid .El +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES .Dl ifconfig tap1 create .Dl btpand -a host -d ubt0 -s NAP -m encrypt -i tap1 @@ -205,10 +205,10 @@ .Sh SEE ALSO .Xr bluetooth 3 , .Xr bluetooth 4 , -.Xr tap 4 , .Xr bridge 4 , -.Xr btconfig 8 , +.Xr tap 4 , .Xr brconfig 8 , +.Xr btconfig 8 , .Xr dhclient 8 , .Xr dhcpd 8 , .Xr ifconfig 8 ,
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: wiz Date: Fri Apr 29 10:31:02 UTC 2011 Modified Files: src/usr.sbin/btpand: btpand.8 Log Message: Sort sections, SEE ALSO, and fix xref. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/btpand.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue Feb 8 21:43:45 UTC 2011 Modified Files: src/usr.sbin/btpand: bnep.c bnep.h Log Message: check number of filters received against max possible To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/btpand/bnep.c cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/btpand/bnep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/bnep.c diff -u src/usr.sbin/btpand/bnep.c:1.9 src/usr.sbin/btpand/bnep.c:1.10 --- src/usr.sbin/btpand/bnep.c:1.9 Thu Jan 27 12:19:48 2011 +++ src/usr.sbin/btpand/bnep.c Tue Feb 8 21:43:45 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.9 2011/01/27 12:19:48 plunky Exp $ */ +/* $NetBSD: bnep.c,v 1.10 2011/02/08 21:43:45 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: bnep.c,v 1.9 2011/01/27 12:19:48 plunky Exp $); +__RCSID($NetBSD: bnep.c,v 1.10 2011/02/08 21:43:45 plunky Exp $); #include bluetooth.h #include sdp.h @@ -429,6 +429,10 @@ } nf = len / 4; + if (nf BNEP_MAX_NET_TYPE_FILTERS) { + rsp = BNEP_FILTER_TOO_MANY_FILTERS; + goto done; + } pf = malloc(nf * sizeof(pfilter_t)); if (pf == NULL) { rsp = BNEP_FILTER_TOO_MANY_FILTERS; @@ -511,6 +515,10 @@ } nf = len / (ETHER_ADDR_LEN * 2); + if (nf BNEP_MAX_MULTI_ADDR_FILTERS) { + rsp = BNEP_FILTER_TOO_MANY_FILTERS; + goto done; + } mf = malloc(nf * sizeof(mfilter_t)); if (mf == NULL) { rsp = BNEP_FILTER_TOO_MANY_FILTERS; Index: src/usr.sbin/btpand/bnep.h diff -u src/usr.sbin/btpand/bnep.h:1.1 src/usr.sbin/btpand/bnep.h:1.2 --- src/usr.sbin/btpand/bnep.h:1.1 Sun Aug 17 13:20:57 2008 +++ src/usr.sbin/btpand/bnep.h Tue Feb 8 21:43:45 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.h,v 1.1 2008/08/17 13:20:57 plunky Exp $ */ +/* $NetBSD: bnep.h,v 1.2 2011/02/08 21:43:45 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -36,6 +36,9 @@ #define BNEP_TYPE(x) ((x) 0x7f) #define BNEP_TYPE_EXT(x) (((x) BNEP_EXT) == BNEP_EXT) +#define BNEP_MAX_NET_TYPE_FILTERS 421 +#define BNEP_MAX_MULTI_ADDR_FILTERS 120 + /* BNEP packet types */ #define BNEP_GENERAL_ETHERNET 0x00 #define BNEP_CONTROL0x01
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue Feb 8 21:59:50 UTC 2011 Modified Files: src/usr.sbin/btpand: client.c server.c Log Message: the default socket rcvbuf for L2CAP is only 4Kbytes which is only 2 and a bit ethernet packets. Check and increase SO_RCVBUF on startup so that we have buffers for 10 complete packets, should solve a reported problem with overruns at higher connection speeds (our L2CAP does not have any flow control). (the default can still be adjusted upwards using sysctl) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/client.c cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/server.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/client.c diff -u src/usr.sbin/btpand/client.c:1.4 src/usr.sbin/btpand/client.c:1.5 --- src/usr.sbin/btpand/client.c:1.4 Tue May 12 21:50:38 2009 +++ src/usr.sbin/btpand/client.c Tue Feb 8 21:59:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: client.c,v 1.4 2009/05/12 21:50:38 plunky Exp $ */ +/* $NetBSD: client.c,v 1.5 2011/02/08 21:59:50 plunky Exp $ */ /*- * Copyright (c) 2008-2009 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: client.c,v 1.4 2009/05/12 21:50:38 plunky Exp $); +__RCSID($NetBSD: client.c,v 1.5 2011/02/08 21:59:50 plunky Exp $); #include bluetooth.h #include errno.h @@ -45,7 +45,7 @@ struct sockaddr_bt sa; channel_t *chan; socklen_t len; - int fd; + int fd, bufsize; uint16_t mru, mtu; if (bdaddr_any(remote_bdaddr)) @@ -102,6 +102,19 @@ exit(EXIT_FAILURE); } + len = sizeof(bufsize); + if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, len) == -1) { + log_err(Could not read SO_RCVBUF); + exit(EXIT_FAILURE); + } + if (bufsize 10 * mru) { + bufsize = 10 * mru; + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, + sizeof(bufsize)) == -1) + log_info(Could not increase SO_RCVBUF (from %d), + bufsize); + } + len = sizeof(mtu); if (getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_OMTU, mtu, len) == -1) { log_err(Could not get L2CAP OMTU: %m); Index: src/usr.sbin/btpand/server.c diff -u src/usr.sbin/btpand/server.c:1.6 src/usr.sbin/btpand/server.c:1.7 --- src/usr.sbin/btpand/server.c:1.6 Sun Oct 25 19:28:45 2009 +++ src/usr.sbin/btpand/server.c Tue Feb 8 21:59:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: server.c,v 1.6 2009/10/25 19:28:45 plunky Exp $ */ +/* $NetBSD: server.c,v 1.7 2011/02/08 21:59:50 plunky Exp $ */ /*- * Copyright (c) 2008-2009 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: server.c,v 1.6 2009/10/25 19:28:45 plunky Exp $); +__RCSID($NetBSD: server.c,v 1.7 2011/02/08 21:59:50 plunky Exp $); #include sys/ioctl.h @@ -134,7 +134,7 @@ struct sockaddr_bt ra, la; channel_t *chan; socklen_t len; - int fd, n; + int fd, n, bufsize; uint16_t mru, mtu; assert(server_count server_limit); @@ -163,6 +163,20 @@ return; } + len = sizeof(bufsize); + if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, len) == -1) { + log_err(Could not read SO_RCVBUF); + close(fd); + return; + } + if (bufsize 10 * mru) { + bufsize = 10 * mru; + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, bufsize, + sizeof(bufsize)) == -1) + log_info(Could not increase SO_RCVBUF (from %d), + bufsize); + } + len = sizeof(mtu); if (getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_OMTU, mtu, len) == -1) { log_err(Could not get L2CAP OMTU: %m);
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue Feb 8 21:43:45 UTC 2011 Modified Files: src/usr.sbin/btpand: bnep.c bnep.h Log Message: check number of filters received against max possible To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/btpand/bnep.c cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/btpand/bnep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue Feb 8 21:59:50 UTC 2011 Modified Files: src/usr.sbin/btpand: client.c server.c Log Message: the default socket rcvbuf for L2CAP is only 4Kbytes which is only 2 and a bit ethernet packets. Check and increase SO_RCVBUF on startup so that we have buffers for 10 complete packets, should solve a reported problem with overruns at higher connection speeds (our L2CAP does not have any flow control). (the default can still be adjusted upwards using sysctl) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/client.c cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/server.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Thu Jan 27 11:14:00 UTC 2011 Modified Files: src/usr.sbin/btpand: channel.c Log Message: style nit To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/channel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/channel.c diff -u src/usr.sbin/btpand/channel.c:1.3 src/usr.sbin/btpand/channel.c:1.4 --- src/usr.sbin/btpand/channel.c:1.3 Tue May 12 21:08:30 2009 +++ src/usr.sbin/btpand/channel.c Thu Jan 27 11:13:59 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: channel.c,v 1.3 2009/05/12 21:08:30 plunky Exp $ */ +/* $NetBSD: channel.c,v 1.4 2011/01/27 11:13:59 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: channel.c,v 1.3 2009/05/12 21:08:30 plunky Exp $); +__RCSID($NetBSD: channel.c,v 1.4 2011/01/27 11:13:59 plunky Exp $); #include sys/ioctl.h @@ -312,7 +312,7 @@ channel_tick = tick; } - if (channel_tick != 0 evtimer_add(arg, tv) 0) { + if (channel_tick != 0 evtimer_add(arg, tv) == -1) { log_err(Could not add watchdog event: %m); exit(EXIT_FAILURE); }
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Thu Jan 27 12:19:48 UTC 2011 Modified Files: src/usr.sbin/btpand: bnep.c Log Message: when a BNEP channel is opened, clear any NetType or MulticastAddress filters that may be in effect at the remote side. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btpand/bnep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/bnep.c diff -u src/usr.sbin/btpand/bnep.c:1.8 src/usr.sbin/btpand/bnep.c:1.9 --- src/usr.sbin/btpand/bnep.c:1.8 Tue May 12 21:08:30 2009 +++ src/usr.sbin/btpand/bnep.c Thu Jan 27 12:19:48 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.8 2009/05/12 21:08:30 plunky Exp $ */ +/* $NetBSD: bnep.c,v 1.9 2011/01/27 12:19:48 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: bnep.c,v 1.8 2009/05/12 21:08:30 plunky Exp $); +__RCSID($NetBSD: bnep.c,v 1.9 2011/01/27 12:19:48 plunky Exp $); #include bluetooth.h #include sdp.h @@ -370,6 +370,10 @@ ether_ntoa((struct ether_addr *)chan-raddr), rsp); bnep_send_control(chan, BNEP_SETUP_CONNECTION_RESPONSE, rsp); + if (rsp == BNEP_SETUP_SUCCESS) { + bnep_send_control(chan, BNEP_FILTER_NET_TYPE_SET); + bnep_send_control(chan, BNEP_FILTER_MULTI_ADDR_SET); + } return (len * 2 + 1); } @@ -394,6 +398,8 @@ if (rsp == BNEP_SETUP_SUCCESS) { chan-state = CHANNEL_OPEN; channel_timeout(chan, 0); + bnep_send_control(chan, BNEP_FILTER_NET_TYPE_SET); + bnep_send_control(chan, BNEP_FILTER_MULTI_ADDR_SET); } else { chan-down(chan); } @@ -480,7 +486,6 @@ log_err(filter_net_type: addr %s response 0x%2.2x, ether_ntoa((struct ether_addr *)chan-raddr), rsp); - /* we did not send any filter_net_type_set message */ return 2; } @@ -570,7 +575,6 @@ log_err(filter_multi_addr: addr %s response 0x%2.2x, ether_ntoa((struct ether_addr *)chan-raddr), rsp); - /* we did not send any filter_multi_addr_set message */ return 2; } @@ -613,8 +617,12 @@ p += 2; break; - case BNEP_FILTER_NET_TYPE_SET: /* TODO */ - case BNEP_FILTER_MULTI_ADDR_SET: /* TODO */ + case BNEP_FILTER_NET_TYPE_SET: + case BNEP_FILTER_MULTI_ADDR_SET: + be16enc(p, 0); /* just clear filters for now */ + p += 2; + break; + default: log_err(Can't send control type 0x%2.2x, type); break;
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Thu Jan 27 11:14:00 UTC 2011 Modified Files: src/usr.sbin/btpand: channel.c Log Message: style nit To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/channel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Thu Jan 27 12:19:48 UTC 2011 Modified Files: src/usr.sbin/btpand: bnep.c Log Message: when a BNEP channel is opened, clear any NetType or MulticastAddress filters that may be in effect at the remote side. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btpand/bnep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: reed Date: Sat Oct 24 12:22:24 UTC 2009 Modified Files: src/usr.sbin/btpand: btpand.8 Log Message: Fix man page reference from non-existent dhcp(8) to dhcpd(8). Hope this was what was intended. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/btpand.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/btpand.8 diff -u src/usr.sbin/btpand/btpand.8:1.3 src/usr.sbin/btpand/btpand.8:1.4 --- src/usr.sbin/btpand/btpand.8:1.3 Sun Aug 17 14:43:07 2008 +++ src/usr.sbin/btpand/btpand.8 Sat Oct 24 12:22:24 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: btpand.8,v 1.3 2008/08/17 14:43:07 plunky Exp $ +.\ $NetBSD: btpand.8,v 1.4 2009/10/24 12:22:24 reed Exp $ .\ .\ Copyright (c) 2008 Iain Hibbert .\ All rights reserved. @@ -210,7 +210,7 @@ .Xr btconfig 8 , .Xr brconfig 8 , .Xr dhclient 8 , -.Xr dhcp 8 , +.Xr dhcpd 8 , .Xr ifconfig 8 , .Xr sdpd 8 .Pp
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue May 12 13:11:18 UTC 2009 Modified Files: src/usr.sbin/btpand: Makefile Log Message: no longer needs libsdp To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/Makefile diff -u src/usr.sbin/btpand/Makefile:1.3 src/usr.sbin/btpand/Makefile:1.4 --- src/usr.sbin/btpand/Makefile:1.3 Thu May 7 18:08:55 2009 +++ src/usr.sbin/btpand/Makefile Tue May 12 13:11:18 2009 @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.3 2009/05/07 18:08:55 plunky Exp $ +# $NetBSD: Makefile,v 1.4 2009/05/12 13:11:18 plunky Exp $ # PROG= btpand MAN= btpand.8 SRCS= btpand.c bnep.c channel.c client.c packet.c server.c sdp.c tap.c -DPADD+= ${LIBBLUETOOTH} ${LIBSDP} ${LIBEVENT} ${LIBUTIL} -LDADD+= -lbluetooth -lsdp -levent -lutil +DPADD+= ${LIBBLUETOOTH} ${LIBEVENT} ${LIBUTIL} +LDADD+= -lbluetooth -levent -lutil CPPFLAGS+= -DSDP_COMPAT
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue May 12 19:57:59 UTC 2009 Modified Files: src/usr.sbin/btpand: bnep.c Log Message: rather than debug message, exclaim in error for failed set filter To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/btpand/bnep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/bnep.c diff -u src/usr.sbin/btpand/bnep.c:1.6 src/usr.sbin/btpand/bnep.c:1.7 --- src/usr.sbin/btpand/bnep.c:1.6 Sun May 3 07:24:55 2009 +++ src/usr.sbin/btpand/bnep.c Tue May 12 19:57:59 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.6 2009/05/03 07:24:55 kefren Exp $ */ +/* $NetBSD: bnep.c,v 1.7 2009/05/12 19:57:59 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: bnep.c,v 1.6 2009/05/03 07:24:55 kefren Exp $); +__RCSID($NetBSD: bnep.c,v 1.7 2009/05/12 19:57:59 plunky Exp $); #include bluetooth.h #include sdp.h @@ -476,9 +476,9 @@ } rsp = be16dec(ptr); - - log_debug(addr %s response 0x%2.2x, - ether_ntoa((struct ether_addr *)chan-raddr), rsp); + if (rsp != BNEP_FILTER_SUCCESS) + log_err(filter_net_type: addr %s response 0x%2.2x, + ether_ntoa((struct ether_addr *)chan-raddr), rsp); /* we did not send any filter_net_type_set message */ return 2; @@ -566,8 +566,9 @@ } rsp = be16dec(ptr); - log_debug(addr %s response 0x%2.2x, - ether_ntoa((struct ether_addr *)chan-raddr), rsp); + if (rsp != BNEP_FILTER_SUCCESS) + log_err(filter_multi_addr: addr %s response 0x%2.2x, + ether_ntoa((struct ether_addr *)chan-raddr), rsp); /* we did not send any filter_multi_addr_set message */ return 2;
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue May 12 21:21:23 UTC 2009 Modified Files: src/usr.sbin/btpand: tap.c Log Message: add an exit hook at the tap so that on the way out (for whatever reason), btpand will mark down the interface. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/tap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/tap.c diff -u src/usr.sbin/btpand/tap.c:1.4 src/usr.sbin/btpand/tap.c:1.5 --- src/usr.sbin/btpand/tap.c:1.4 Tue May 12 21:08:30 2009 +++ src/usr.sbin/btpand/tap.c Tue May 12 21:21:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tap.c,v 1.4 2009/05/12 21:08:30 plunky Exp $ */ +/* $NetBSD: tap.c,v 1.5 2009/05/12 21:21:23 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: tap.c,v 1.4 2009/05/12 21:08:30 plunky Exp $); +__RCSID($NetBSD: tap.c,v 1.5 2009/05/12 21:21:23 plunky Exp $); #include sys/ioctl.h #include sys/uio.h @@ -40,6 +40,7 @@ #include btpand.h +static void tap_exit(void); static bool tap_send(channel_t *, packet_t *); static bool tap_recv(packet_t *); static void tap_down(channel_t *); @@ -64,6 +65,8 @@ log_err(Could not get interface name: %m); exit(EXIT_FAILURE); } + interface_name = strndup(ifr.ifr_name, IFNAMSIZ); + atexit(tap_exit); s = socket(PF_LINK, SOCK_DGRAM, 0); if (s == -1) { @@ -123,6 +126,35 @@ log_err(pidfile not made); } +static void +tap_exit(void) +{ + struct ifreq ifr; + int s; + + s = socket(PF_LINK, SOCK_DGRAM, 0); + if (s == -1) { + log_err(Could not open PF_LINK socket: %m); + return; + } + + strncpy(ifr.ifr_name, interface_name, IFNAMSIZ); + if (ioctl(s, SIOCGIFFLAGS, ifr) == -1) { + log_err(Could not get interface flags: %m); + return; + } + + if ((ifr.ifr_flags IFF_UP)) { + ifr.ifr_flags = ~IFF_UP; + if (ioctl(s, SIOCSIFFLAGS, ifr) == -1) { + log_err(Could not clear IFF_UP: %m); + return; + } + } + + close(s); +} + static bool tap_send(channel_t *chan, packet_t *pkt) {
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Tue May 12 21:50:38 UTC 2009 Modified Files: src/usr.sbin/btpand: Makefile btpand.c btpand.h client.c server.c Removed Files: src/usr.sbin/btpand: sdp.c sdp.h Log Message: update to use the new Service Discovery API To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/Makefile cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/btpand.c \ src/usr.sbin/btpand/client.c src/usr.sbin/btpand/server.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/btpand/btpand.h cvs rdiff -u -r1.2 -r0 src/usr.sbin/btpand/sdp.c src/usr.sbin/btpand/sdp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/Makefile diff -u src/usr.sbin/btpand/Makefile:1.4 src/usr.sbin/btpand/Makefile:1.5 --- src/usr.sbin/btpand/Makefile:1.4 Tue May 12 13:11:18 2009 +++ src/usr.sbin/btpand/Makefile Tue May 12 21:50:38 2009 @@ -1,13 +1,11 @@ -# $NetBSD: Makefile,v 1.4 2009/05/12 13:11:18 plunky Exp $ +# $NetBSD: Makefile,v 1.5 2009/05/12 21:50:38 plunky Exp $ # PROG= btpand MAN= btpand.8 -SRCS= btpand.c bnep.c channel.c client.c packet.c server.c sdp.c tap.c +SRCS= btpand.c bnep.c channel.c client.c packet.c server.c tap.c DPADD+= ${LIBBLUETOOTH} ${LIBEVENT} ${LIBUTIL} LDADD+= -lbluetooth -levent -lutil -CPPFLAGS+= -DSDP_COMPAT - .include bsd.prog.mk Index: src/usr.sbin/btpand/btpand.c diff -u src/usr.sbin/btpand/btpand.c:1.3 src/usr.sbin/btpand/btpand.c:1.4 --- src/usr.sbin/btpand/btpand.c:1.3 Tue May 12 21:08:30 2009 +++ src/usr.sbin/btpand/btpand.c Tue May 12 21:50:38 2009 @@ -1,7 +1,7 @@ -/* $NetBSD: btpand.c,v 1.3 2009/05/12 21:08:30 plunky Exp $ */ +/* $NetBSD: btpand.c,v 1.4 2009/05/12 21:50:38 plunky Exp $ */ /*- - * Copyright (c) 2008 Iain Hibbert + * Copyright (c) 2008-2009 Iain Hibbert * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,8 +26,8 @@ */ #include sys/cdefs.h -__COPYRIGHT(@(#) Copyright (c) 2008 Iain Hibbert. All rights reserved.); -__RCSID($NetBSD: btpand.c,v 1.3 2009/05/12 21:08:30 plunky Exp $); +__COPYRIGHT(@(#) Copyright (c) 2008-2009 Iain Hibbert. All rights reserved.); +__RCSID($NetBSD: btpand.c,v 1.4 2009/05/12 21:50:38 plunky Exp $); #include sys/wait.h @@ -47,24 +47,35 @@ /* global variables */ const char * control_path; /* -c path */ const char * interface_name; /* -i ifname */ -const char * service_name; /* -s service */ +const char * service_type; /* -s service */ uint16_t service_class; +const char * service_name; +const char * service_desc; bdaddr_t local_bdaddr; /* -d addr */ bdaddr_t remote_bdaddr; /* -a addr */ uint16_t l2cap_psm; /* -p psm */ int l2cap_mode; /* -m mode */ - int server_limit; /* -n limit */ static const struct { - const char * name; + const char * type; uint16_t class; + const char * name; const char * desc; } services[] = { - { PANU, SDP_SERVICE_CLASS_PANU, Personal Area Networking User }, - { NAP, SDP_SERVICE_CLASS_NAP, Network Acess Point }, - { GN, SDP_SERVICE_CLASS_GN, Group Network }, + { PANU, SDP_SERVICE_CLASS_PANU, + Personal Ad-hoc User Service, + Personal Ad-hoc User Service + }, + { NAP, SDP_SERVICE_CLASS_NAP, + Network Acess Point, + Personal Ad-hoc Network Service + }, + { GN, SDP_SERVICE_CLASS_GN, + Group Ad-hoc Network, + Personal Group Ad-hoc Network Service + }, }; static void main_exit(int); @@ -139,18 +150,21 @@ || ul 0x || L2CAP_PSM_INVALID(ul)) errx(EXIT_FAILURE, %s: invalid PSM, optarg); - l2cap_psm = ul; + l2cap_psm = (uint16_t)ul; break; case 's': /* service */ case 'S': /* service (no SDP) */ - for (ul = 0; strcasecmp(optarg, services[ul].name); ul++) { + for (ul = 0; strcasecmp(optarg, services[ul].type); ul++) { if (ul == __arraycount(services)) errx(EXIT_FAILURE, %s: unknown service, optarg); } - if (ch == 's') + if (ch == 's') { +service_type = services[ul].type; service_name = services[ul].name; +service_desc = services[ul].desc; + } service_class = services[ul].class; break; @@ -169,7 +183,7 @@ usage(); if (!bdaddr_any(remote_bdaddr) (server_limit != 0 || - control_path != 0 || (service_name != NULL l2cap_psm != 0))) + control_path != 0 || (service_type != NULL l2cap_psm != 0))) usage(); /* default options */ @@ -261,7 +275,7 @@ usage(void) { const char *p = getprogname(); - int n = strlen(p); + size_t n = strlen(p); fprintf(stderr, usage: %s [-i ifname] [-m mode] -a address -d device\n @@ -283,8 +297,8 @@ Known services:\n , p, n, , p, n, ); - for (n = 0; n (int)__arraycount(services); n++) - fprintf(stderr, \t%s\t%s\n, services[n].name, services[n].desc); + for (n = 0; n __arraycount(services); n++) + fprintf(stderr, \t%s\t%s\n, services[n].type, services[n].name);
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Sat May 2 20:13:44 UTC 2009 Modified Files: src/usr.sbin/btpand: bnep.c Log Message: add a noisy debug message for overlong packets (I do get them from my phone) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/bnep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/bnep.c diff -u src/usr.sbin/btpand/bnep.c:1.4 src/usr.sbin/btpand/bnep.c:1.5 --- src/usr.sbin/btpand/bnep.c:1.4 Sat May 2 20:07:51 2009 +++ src/usr.sbin/btpand/bnep.c Sat May 2 20:13:44 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.4 2009/05/02 20:07:51 plunky Exp $ */ +/* $NetBSD: bnep.c,v 1.5 2009/05/02 20:13:44 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: bnep.c,v 1.4 2009/05/02 20:07:51 plunky Exp $); +__RCSID($NetBSD: bnep.c,v 1.5 2009/05/02 20:13:44 plunky Exp $); #include bluetooth.h #include sdp.h @@ -168,6 +168,11 @@ || pkt-chan-state != CHANNEL_OPEN) return false; /* no forwarding */ + if (pkt-len ETHER_MAX_LEN) + log_debug(received long packet + (type=0x%2.2x, proto=0x%4.4x, len=%d), + type, be16dec(pkt-type), pkt-len); + return true; }
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: lukem Date: Wed Apr 15 00:38:07 UTC 2009 Modified Files: src/usr.sbin/btpand: btpand.c Log Message: Fix -Wsign-compare issue To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/btpand/btpand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/btpand/btpand.c diff -u src/usr.sbin/btpand/btpand.c:1.1 src/usr.sbin/btpand/btpand.c:1.2 --- src/usr.sbin/btpand/btpand.c:1.1 Sun Aug 17 13:20:57 2008 +++ src/usr.sbin/btpand/btpand.c Wed Apr 15 00:38:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $ */ +/* $NetBSD: btpand.c,v 1.2 2009/04/15 00:38:07 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -27,7 +27,7 @@ #include sys/cdefs.h __COPYRIGHT(@(#) Copyright (c) 2008 Iain Hibbert. All rights reserved.); -__RCSID($NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $); +__RCSID($NetBSD: btpand.c,v 1.2 2009/04/15 00:38:07 lukem Exp $); #include sys/wait.h @@ -283,7 +283,7 @@ Known services:\n , p, n, , p, n, ); - for (n = 0; n __arraycount(services); n++) + for (n = 0; n (int)__arraycount(services); n++) fprintf(stderr, \t%s\t%s\n, services[n].name, services[n].desc); exit(EXIT_FAILURE);