1.\" $NetBSD: btpand.8,v 1.8 2019/01/17 08:53:17 wiz Exp $ 2.\" 3.\" Copyright (c) 2008 Iain Hibbert 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd January 17, 2019 27.Dt BTPAND 8 28.Os 29.Sh NAME 30.Nm btpand 31.Nd Bluetooth PAN daemon 32.Sh SYNOPSIS 33.Nm 34.Op Fl i Ar ifname 35.Op Fl m Ar mode 36.Fl a Ar addr 37.Fl d Ar device 38.Brq Fl s Ar service | Fl S Ar service Op Fl p Ar psm 39.Nm 40.Op Fl c Ar path 41.Op Fl i Ar ifname 42.Op Fl l Ar limit 43.Op Fl m Ar mode 44.Op Fl p Ar psm 45.Fl d Ar device 46.Brq Fl s Ar service | Fl S Ar service 47.Sh DESCRIPTION 48The 49.Nm 50daemon handles Bluetooth Personal Area Networking services 51in the system. 52It can operate in client mode as a Personal Area Networking User 53.Pq PANU 54or in server mode as Network Access Point 55.Pq NAP , 56Group ad-hoc Network 57.Pq GN 58or PANU host. 59.Nm 60connects to the system via a 61.Xr tap 4 62virtual Ethernet device and forwards Ethernet packets to 63remote Bluetooth devices using the Bluetooth Network Encapsulation 64Protocol 65.Pq BNEP . 66.Pp 67The PANU client is the device that uses either the NAP or GN 68service, or can talk directly to a PANU host in a crossover 69cable fashion. 70.Pp 71A GN host forwards Ethernet packets to each of the connected PAN 72users as needed but does not provide access to any additional networks. 73.Pp 74The NAP service provides some of the features of an Ethernet bridge, 75with the NAP host forwarding Ethernet packets between each of the 76connected PAN users, and a different network 77media. 78.Pp 79Note, the only differences between NAP and GN services as implemented by 80.Nm 81are in the SDP service record. 82The bridging of packets by the NAP must be configured separately with 83.Xr brconfig 8 . 84.Pp 85The options are as follows: 86.Bl -tag -width ".Fl a Ar address" 87.It Fl a Ar address 88In client mode, address of remote server. 89May be given as BDADDR or name, in which case 90.Nm 91will attempt to resolve the address via the 92.Xr bt_gethostbyname 3 93call. 94.It Fl c Ar path 95In server mode, specify 96.Ar path 97to the 98.Xr sdpd 8 99control socket. 100The default path is 101.Pa /var/run/sdp . 102.It Fl d Ar device 103Restrict connections to the local 104.Ar device . 105May be given as BDADDR or name, in which case 106.Nm 107will attempt to resolve the address via the 108.Xr bt_devaddr 3 109call. 110.Nm 111will set the 112.Xr tap 4 113interface physical address to the BDADDR 114of the Bluetooth radio. 115.It Fl i Ar ifname 116.Nm 117uses the 118.Xr tap 4 119driver to create a new network interface for use. 120Use this option to select a specific 121.Xr tap 4 122device interface which must already be created. 123.It Fl l Ar limit 124In server mode, limit the number of simultaneous connections. 125The default limit is 7 for NAP and GN servers, 126and 1 for a PANU server. 127.It Fl m Ar mode 128Set L2CAP connection link mode. 129Supported modes are: 130.Pp 131.Bl -tag -compact -width secure 132.It auth 133require devices to be paired. 134.It encrypt 135auth, plus enable encryption. 136.It secure 137encryption, plus change of link key. 138.El 139.It Fl p Ar psm 140Use an alternative L2CAP Protocol/Service Multiplexer 141.Pq PSM 142for server mode or client mode 143.Pq when not using Service Discovery . 144The default PSM for BNEP is 15 145.Pq 0x000f . 146.It Fl s Ar service 147Name of 148.Ar service 149to provide or connect to, the following services are recognised: 150.Pp 151.Bl -tag -compact -width PANU 152.It GN 153Group ad-hoc Network. 154.It NAP 155Network Access Point. 156.It PANU 157Personal Area Networking User. 158.El 159.It Fl S Ar service 160As per 161.Fl s 162except that 163.Nm 164will not use SDP services for connection setup. 165.El 166.Pp 167When providing networking services, the Bluetooth PAN profile says that the 168.Sq Class of Device 169property of the bluetooth controller SHALL include Networking capability 170.Pq set bit 0x020000 . 171See 172.Xr btconfig 8 173for details. 174.Pp 175After 176.Nm 177has set up the client or server connection and opened the 178.Xr tap 4 179interface, it will create a pid file and detach. 180.Sh FILES 181.Bl -tag -compact -width /etc/bluetooth/hosts 182.It Pa /dev/tap 183.It Pa /etc/bluetooth/hosts 184.It Pa /var/run/sdp 185.It Pa /var/run/tap Ns Em N Ns No .pid 186.El 187.Sh EXIT STATUS 188.Ex -std 189.Sh EXAMPLES 190.Dl ifconfig tap1 create 191.Dl btpand -a host -d ubt0 -s NAP -m encrypt -i tap1 192.Dl dhcpcd -q -b tap1 193.Pp 194Will create an encrypted connection to the NAP on 195.Ar host , 196and link that to the 197.Ar tap1 198interface. 199.Pp 200.Dl btpand -d ubt0 -s GN -m auth 201.Pp 202Will create a Group Network requiring authentication to join and register 203the GN service with the local SDP server. 204.Sh SEE ALSO 205.Xr bluetooth 3 , 206.Xr bluetooth 4 , 207.Xr bridge 4 , 208.Xr tap 4 , 209.Xr brconfig 8 , 210.Xr btconfig 8 , 211.Xr dhcpcd 8 , 212.Xr dhcpd 8 , 213.Xr ifconfig 8 , 214.Xr sdpd 8 215.Pp 216The 217.Qq Personal Area Networking Profile 218and 219.Qq Bluetooth Network Encapsulation Protocol 220specifications are available at 221.Lk http://www.bluetooth.com/ 222.Sh AUTHORS 223.An Iain Hibbert 224.Sh BUGS 225There is no way to supply alternative values for the SDP record. 226.Pp 227There is no way to set net type or multicast address filters. 228.Pp 229.Nm 230does not do any address routing except to directly connected 231unicast addresses. 232All other packets are multicast. 233.Pp 234As 235.Nm 236uses the BDADDR of the Bluetooth radio as the physical address 237of the tap, only one instance can be run per radio. 238.Pp 239.Nm 240can only provide a single service. 241