xref: /freebsd/usr.sbin/bluetooth/btpand/btpand.8 (revision 4b9d6057)
1.\" $NetBSD: btpand.8,v 1.3 2008/08/17 14:43:07 plunky 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 August 17, 2008
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.
83.Pp
84The options are as follows:
85.Bl -tag -width ".Fl a Ar address"
86.It Fl a Ar address
87In client mode, address of remote server.
88May be given as BDADDR or name, in which case
89.Nm
90will attempt to resolve the address via the
91.Xr bt_gethostbyname 3
92call.
93.It Fl c Ar path
94In server mode, specify
95.Ar path
96to the
97.Xr sdpd 8
98control socket.
99The default path is
100.Pa /var/run/sdp .
101.It Fl d Ar device
102Restrict connections to the local
103.Ar device .
104May be given as BDADDR or name, in which case
105.Nm
106will attempt to resolve the address via the
107.Xr bt_devaddr 3
108call.
109.Nm
110will set the
111.Xr tap 4
112interface physical address to the BDADDR
113of the Bluetooth radio.
114.It Fl i Ar ifname
115.Nm
116uses the
117.Xr tap 4
118driver to create a new network interface for use.
119Use this option to select a specific
120.Xr tap 4
121device interface which must already be created.
122.It Fl l Ar limit
123In server mode, limit the number of simultaneous connections.
124The default limit is 7 for NAP and GN servers,
125and 1 for a PANU server.
126.It Fl m Ar mode
127Set L2CAP connection link mode.
128Supported modes are:
129.Pp
130.Bl -tag -width 8n -compact
131.It auth
132require devices to be paired.
133.It encrypt
134auth, plus enable encryption.
135.It secure
136encryption, plus change of link key.
137.El
138.Pp
139NOT YET SUPPORTED.
140Use global device settings to set authentication and encryption.
141.It Fl p Ar psm
142Use an alternative L2CAP Protocol/Service Multiplexer
143.Pq PSM
144for server mode or client mode
145.Pq when not using Service Discovery .
146The default PSM for BNEP is 15
147.Pq 0x000f .
148.It Fl s Ar service
149Name of
150.Ar service
151to provide or connect to, the following services are recognised:
152.Pp
153.Bl -tag -width 8n -compact
154.It GN
155Group ad-hoc Network.
156.It NAP
157Network Access Point.
158.It PANU
159Personal Area Networking User.
160.El
161.It Fl S Ar service
162As per
163.Fl s
164except that
165.Nm
166will not use SDP services for connection setup.
167.El
168.Pp
169When providing networking services, the Bluetooth PAN profile says that the
170.Sq Class of Device
171property of the bluetooth controller SHALL include Networking capability
172.Pq set bit 0x020000 .
173See
174.Xr hccontrol 8
175for details.
176.Pp
177After
178.Nm
179has set up the client or server connection and opened the
180.Xr tap 4
181interface, it will create a pid file and detach.
182.Sh FILES
183.Bl -tag -width "Pa /etc/bluetooth/hosts" -compact
184.It Pa /dev/tap
185.It Pa /etc/bluetooth/hosts
186.It Pa /var/run/sdp
187.It Pa /var/run/tap Ns Em N Ns No .pid
188.El
189.Sh EXIT STATUS
190.Ex -std
191.Sh EXAMPLES
192.Dl ifconfig tap1 create
193.Dl btpand -a host -d mydevice -s NAP -i tap1
194.Dl dhclient tap1
195.Pp
196Will create a connection to the NAP on
197.Ar host ,
198and link that to the
199.Ar tap1
200interface.
201.Pp
202.Dl btpand -d mydevice -s GN
203.Pp
204Will create a Group Network and register the GN service with the local
205SDP server.
206.Sh SEE ALSO
207.Xr bluetooth 3 ,
208.Xr bridge 4 ,
209.Xr tap 4 ,
210.Xr dhclient 8 ,
211.Xr hccontrol 8 ,
212.Xr ifconfig 8 ,
213.Xr sdpd 8
214.Pp
215The
216.Qq Personal Area Networking Profile
217and
218.Qq Bluetooth Network Encapsulation Protocol
219specifications are available at
220.Dl http://www.bluetooth.com/
221.Sh AUTHORS
222.An Iain Hibbert
223.Sh BUGS
224There is no way to supply alternative values for the SDP record.
225.Pp
226There is no way to set net type or multicast address filters.
227.Pp
228.Nm
229does not do any address routing except to directly connected
230unicast addresses.
231All other packets are multicast.
232.Pp
233As
234.Nm
235uses the BDADDR of the Bluetooth radio as the physical address
236of the tap, only one instance can be run per radio.
237.Pp
238.Nm
239can only provide a single service.
240