xref: /netbsd-src/usr.sbin/btpand/btpand.8 (revision 845dfb2f5e073fe48ac36b854a4be4888fb387c4)
1*845dfb2fSwiz.\" $NetBSD: btpand.8,v 1.8 2019/01/17 08:53:17 wiz Exp $
21fc74d21Splunky.\"
31fc74d21Splunky.\" Copyright (c) 2008 Iain Hibbert
41fc74d21Splunky.\" All rights reserved.
51fc74d21Splunky.\"
61fc74d21Splunky.\" Redistribution and use in source and binary forms, with or without
71fc74d21Splunky.\" modification, are permitted provided that the following conditions
81fc74d21Splunky.\" are met:
91fc74d21Splunky.\" 1. Redistributions of source code must retain the above copyright
101fc74d21Splunky.\"    notice, this list of conditions and the following disclaimer.
111fc74d21Splunky.\" 2. Redistributions in binary form must reproduce the above copyright
121fc74d21Splunky.\"    notice, this list of conditions and the following disclaimer in the
131fc74d21Splunky.\"    documentation and/or other materials provided with the distribution.
141fc74d21Splunky.\"
151fc74d21Splunky.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
161fc74d21Splunky.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
171fc74d21Splunky.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
181fc74d21Splunky.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
191fc74d21Splunky.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
201fc74d21Splunky.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
211fc74d21Splunky.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
221fc74d21Splunky.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
231fc74d21Splunky.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
241fc74d21Splunky.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251fc74d21Splunky.\"
26e5663ad9Sgutteridge.Dd January 17, 2019
27a2cc8bdaSplunky.Dt BTPAND 8
281fc74d21Splunky.Os
291fc74d21Splunky.Sh NAME
301fc74d21Splunky.Nm btpand
311fc74d21Splunky.Nd Bluetooth PAN daemon
321fc74d21Splunky.Sh SYNOPSIS
331fc74d21Splunky.Nm
341fc74d21Splunky.Op Fl i Ar ifname
351fc74d21Splunky.Op Fl m Ar mode
361fc74d21Splunky.Fl a Ar addr
371fc74d21Splunky.Fl d Ar device
381fc74d21Splunky.Brq Fl s Ar service | Fl S Ar service Op Fl p Ar psm
391fc74d21Splunky.Nm
401fc74d21Splunky.Op Fl c Ar path
411fc74d21Splunky.Op Fl i Ar ifname
421fc74d21Splunky.Op Fl l Ar limit
431fc74d21Splunky.Op Fl m Ar mode
441fc74d21Splunky.Op Fl p Ar psm
451fc74d21Splunky.Fl d Ar device
461fc74d21Splunky.Brq Fl s Ar service | Fl S Ar service
471fc74d21Splunky.Sh DESCRIPTION
481fc74d21SplunkyThe
491fc74d21Splunky.Nm
501fc74d21Splunkydaemon handles Bluetooth Personal Area Networking services
511fc74d21Splunkyin the system.
521fc74d21SplunkyIt can operate in client mode as a Personal Area Networking User
531fc74d21Splunky.Pq PANU
54eee3cf23Sceggeror in server mode as Network Access Point
551fc74d21Splunky.Pq NAP ,
561fc74d21SplunkyGroup ad-hoc Network
571fc74d21Splunky.Pq GN
581fc74d21Splunkyor PANU host.
591fc74d21Splunky.Nm
601fc74d21Splunkyconnects to the system via a
611fc74d21Splunky.Xr tap 4
621fc74d21Splunkyvirtual Ethernet device and forwards Ethernet packets to
631fc74d21Splunkyremote Bluetooth devices using the Bluetooth Network Encapsulation
641fc74d21SplunkyProtocol
651fc74d21Splunky.Pq BNEP .
661fc74d21Splunky.Pp
671fc74d21SplunkyThe PANU client is the device that uses either the NAP or GN
681fc74d21Splunkyservice, or can talk directly to a PANU host in a crossover
691fc74d21Splunkycable fashion.
701fc74d21Splunky.Pp
711fc74d21SplunkyA GN host forwards Ethernet packets to each of the connected PAN
721fc74d21Splunkyusers as needed but does not provide access to any additional networks.
731fc74d21Splunky.Pp
741fc74d21SplunkyThe NAP service provides some of the features of an Ethernet bridge,
751fc74d21Splunkywith the NAP host forwarding Ethernet packets between each of the
761fc74d21Splunkyconnected PAN users, and a different network
771fc74d21Splunkymedia.
781fc74d21Splunky.Pp
791fc74d21SplunkyNote, the only differences between NAP and GN services as implemented by
801fc74d21Splunky.Nm
811fc74d21Splunkyare in the SDP service record.
821fc74d21SplunkyThe bridging of packets by the NAP must be configured separately with
83613716bdSwiz.Xr brconfig 8 .
841fc74d21Splunky.Pp
851fc74d21SplunkyThe options are as follows:
861fc74d21Splunky.Bl -tag -width ".Fl a Ar address"
871fc74d21Splunky.It Fl a Ar address
881fc74d21SplunkyIn client mode, address of remote server.
891fc74d21SplunkyMay be given as BDADDR or name, in which case
901fc74d21Splunky.Nm
911fc74d21Splunkywill attempt to resolve the address via the
921fc74d21Splunky.Xr bt_gethostbyname 3
931fc74d21Splunkycall.
941fc74d21Splunky.It Fl c Ar path
951fc74d21SplunkyIn server mode, specify
961fc74d21Splunky.Ar path
971fc74d21Splunkyto the
981fc74d21Splunky.Xr sdpd 8
991fc74d21Splunkycontrol socket.
1001fc74d21SplunkyThe default path is
1011fc74d21Splunky.Pa /var/run/sdp .
1021fc74d21Splunky.It Fl d Ar device
1031fc74d21SplunkyRestrict connections to the local
1041fc74d21Splunky.Ar device .
1051fc74d21SplunkyMay be given as BDADDR or name, in which case
1061fc74d21Splunky.Nm
1071fc74d21Splunkywill attempt to resolve the address via the
1081fc74d21Splunky.Xr bt_devaddr 3
1091fc74d21Splunkycall.
1101fc74d21Splunky.Nm
1111fc74d21Splunkywill set the
1121fc74d21Splunky.Xr tap 4
1131fc74d21Splunkyinterface physical address to the BDADDR
1141fc74d21Splunkyof the Bluetooth radio.
1151fc74d21Splunky.It Fl i Ar ifname
1161fc74d21Splunky.Nm
1171fc74d21Splunkyuses the
1181fc74d21Splunky.Xr tap 4
1191fc74d21Splunkydriver to create a new network interface for use.
1201fc74d21SplunkyUse this option to select a specific
1211fc74d21Splunky.Xr tap 4
1221fc74d21Splunkydevice interface which must already be created.
1231fc74d21Splunky.It Fl l Ar limit
1241fc74d21SplunkyIn server mode, limit the number of simultaneous connections.
1251fc74d21SplunkyThe default limit is 7 for NAP and GN servers,
1261fc74d21Splunkyand 1 for a PANU server.
1271fc74d21Splunky.It Fl m Ar mode
1281fc74d21SplunkySet L2CAP connection link mode.
1291fc74d21SplunkySupported modes are:
1301fc74d21Splunky.Pp
131*845dfb2fSwiz.Bl -tag -compact -width secure
1321fc74d21Splunky.It auth
1331fc74d21Splunkyrequire devices to be paired.
1341fc74d21Splunky.It encrypt
1351fc74d21Splunkyauth, plus enable encryption.
1361fc74d21Splunky.It secure
1371fc74d21Splunkyencryption, plus change of link key.
1381fc74d21Splunky.El
1391fc74d21Splunky.It Fl p Ar psm
1401fc74d21SplunkyUse an alternative L2CAP Protocol/Service Multiplexer
1411fc74d21Splunky.Pq PSM
1421fc74d21Splunkyfor server mode or client mode
1431fc74d21Splunky.Pq when not using Service Discovery .
1441fc74d21SplunkyThe default PSM for BNEP is 15
1451fc74d21Splunky.Pq 0x000f .
1461fc74d21Splunky.It Fl s Ar service
1471fc74d21SplunkyName of
1481fc74d21Splunky.Ar service
1491fc74d21Splunkyto provide or connect to, the following services are recognised:
1501fc74d21Splunky.Pp
151*845dfb2fSwiz.Bl -tag -compact -width PANU
1521fc74d21Splunky.It GN
1531fc74d21SplunkyGroup ad-hoc Network.
1541fc74d21Splunky.It NAP
1551fc74d21SplunkyNetwork Access Point.
1561fc74d21Splunky.It PANU
1571fc74d21SplunkyPersonal Area Networking User.
1581fc74d21Splunky.El
1591fc74d21Splunky.It Fl S Ar service
1601fc74d21SplunkyAs per
1611fc74d21Splunky.Fl s
1621fc74d21Splunkyexcept that
1631fc74d21Splunky.Nm
1641fc74d21Splunkywill not use SDP services for connection setup.
1651fc74d21Splunky.El
1661fc74d21Splunky.Pp
1671fc74d21SplunkyWhen providing networking services, the Bluetooth PAN profile says that the
1681fc74d21Splunky.Sq Class of Device
1691fc74d21Splunkyproperty of the bluetooth controller SHALL include Networking capability
1701fc74d21Splunky.Pq set bit 0x020000 .
1711fc74d21SplunkySee
1721fc74d21Splunky.Xr btconfig 8
1731fc74d21Splunkyfor details.
1741fc74d21Splunky.Pp
1751fc74d21SplunkyAfter
1761fc74d21Splunky.Nm
1771fc74d21Splunkyhas set up the client or server connection and opened the
1781fc74d21Splunky.Xr tap 4
1791fc74d21Splunkyinterface, it will create a pid file and detach.
1801fc74d21Splunky.Sh FILES
181*845dfb2fSwiz.Bl -tag -compact -width /etc/bluetooth/hosts
1821fc74d21Splunky.It Pa /dev/tap
1831fc74d21Splunky.It Pa /etc/bluetooth/hosts
1841fc74d21Splunky.It Pa /var/run/sdp
1851fc74d21Splunky.It Pa /var/run/tap Ns Em N Ns No .pid
1861fc74d21Splunky.El
187613716bdSwiz.Sh EXIT STATUS
188613716bdSwiz.Ex -std
1891fc74d21Splunky.Sh EXAMPLES
1901fc74d21Splunky.Dl ifconfig tap1 create
1911fc74d21Splunky.Dl btpand -a host -d ubt0 -s NAP -m encrypt -i tap1
192e5663ad9Sgutteridge.Dl dhcpcd -q -b tap1
1931fc74d21Splunky.Pp
1941fc74d21SplunkyWill create an encrypted connection to the NAP on
1951fc74d21Splunky.Ar host ,
1961fc74d21Splunkyand link that to the
1971fc74d21Splunky.Ar tap1
1981fc74d21Splunkyinterface.
1991fc74d21Splunky.Pp
2001fc74d21Splunky.Dl btpand -d ubt0 -s GN -m auth
2011fc74d21Splunky.Pp
2021fc74d21SplunkyWill create a Group Network requiring authentication to join and register
2031fc74d21Splunkythe GN service with the local SDP server.
2041fc74d21Splunky.Sh SEE ALSO
2051fc74d21Splunky.Xr bluetooth 3 ,
2061fc74d21Splunky.Xr bluetooth 4 ,
2071fc74d21Splunky.Xr bridge 4 ,
208613716bdSwiz.Xr tap 4 ,
2091fc74d21Splunky.Xr brconfig 8 ,
210613716bdSwiz.Xr btconfig 8 ,
211e5663ad9Sgutteridge.Xr dhcpcd 8 ,
212f20256f2Sreed.Xr dhcpd 8 ,
2131fc74d21Splunky.Xr ifconfig 8 ,
2141fc74d21Splunky.Xr sdpd 8
2151fc74d21Splunky.Pp
2161fc74d21SplunkyThe
2171fc74d21Splunky.Qq Personal Area Networking Profile
2181fc74d21Splunkyand
2191fc74d21Splunky.Qq Bluetooth Network Encapsulation Protocol
2201fc74d21Splunkyspecifications are available at
221d0e00679Snjoly.Lk http://www.bluetooth.com/
2221fc74d21Splunky.Sh AUTHORS
2231fc74d21Splunky.An Iain Hibbert
2241fc74d21Splunky.Sh BUGS
2251fc74d21SplunkyThere is no way to supply alternative values for the SDP record.
2261fc74d21Splunky.Pp
2271fc74d21SplunkyThere is no way to set net type or multicast address filters.
2281fc74d21Splunky.Pp
2291fc74d21Splunky.Nm
2301fc74d21Splunkydoes not do any address routing except to directly connected
2311fc74d21Splunkyunicast addresses.
2321fc74d21SplunkyAll other packets are multicast.
2331fc74d21Splunky.Pp
2341fc74d21SplunkyAs
2351fc74d21Splunky.Nm
2361fc74d21Splunkyuses the BDADDR of the Bluetooth radio as the physical address
2371fc74d21Splunkyof the tap, only one instance can be run per radio.
2381fc74d21Splunky.Pp
2391fc74d21Splunky.Nm
2401fc74d21Splunkycan only provide a single service.
241