xref: /freebsd/usr.sbin/bluetooth/btpand/btpand.8 (revision 98e0ffaefb0f241cda3a72395d3be04192ae0d47)
1.\" $NetBSD: btpand.8,v 1.3 2008/08/17 14:43:07 plunky Exp $
2.\" $FreeBSD$
3.\"
4.\" Copyright (c) 2008 Iain Hibbert
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd August 17, 2008
28.Dt BTPAND 8
29.Os
30.Sh NAME
31.Nm btpand
32.Nd Bluetooth PAN daemon
33.Sh SYNOPSIS
34.Nm
35.Op Fl i Ar ifname
36.Op Fl m Ar mode
37.Fl a Ar addr
38.Fl d Ar device
39.Brq Fl s Ar service | Fl S Ar service Op Fl p Ar psm
40.Nm
41.Op Fl c Ar path
42.Op Fl i Ar ifname
43.Op Fl l Ar limit
44.Op Fl m Ar mode
45.Op Fl p Ar psm
46.Fl d Ar device
47.Brq Fl s Ar service | Fl S Ar service
48.Sh DESCRIPTION
49The
50.Nm
51daemon handles Bluetooth Personal Area Networking services
52in the system.
53It can operate in client mode as a Personal Area Networking User
54.Pq PANU
55or in server mode as Network Access Point
56.Pq NAP ,
57Group ad-hoc Network
58.Pq GN
59or PANU host.
60.Nm
61connects to the system via a
62.Xr tap 4
63virtual Ethernet device and forwards Ethernet packets to
64remote Bluetooth devices using the Bluetooth Network Encapsulation
65Protocol
66.Pq BNEP .
67.Pp
68The PANU client is the device that uses either the NAP or GN
69service, or can talk directly to a PANU host in a crossover
70cable fashion.
71.Pp
72A GN host forwards Ethernet packets to each of the connected PAN
73users as needed but does not provide access to any additional networks.
74.Pp
75The NAP service provides some of the features of an Ethernet bridge,
76with the NAP host forwarding Ethernet packets between each of the
77connected PAN users, and a different network
78media.
79.Pp
80Note, the only differences between NAP and GN services as implemented by
81.Nm
82are in the SDP service record.
83The bridging of packets by the NAP must be configured separately.
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 -width 8n -compact
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.Pp
140NOT YET SUPPORTED.
141Use global device settings to set authentication and encryption.
142.It Fl p Ar psm
143Use an alternative L2CAP Protocol/Service Multiplexer
144.Pq PSM
145for server mode or client mode
146.Pq when not using Service Discovery .
147The default PSM for BNEP is 15
148.Pq 0x000f .
149.It Fl s Ar service
150Name of
151.Ar service
152to provide or connect to, the following services are recognised:
153.Pp
154.Bl -tag -width 8n -compact
155.It GN
156Group ad-hoc Network.
157.It NAP
158Network Access Point.
159.It PANU
160Personal Area Networking User.
161.El
162.It Fl S Ar service
163As per
164.Fl s
165except that
166.Nm
167will not use SDP services for connection setup.
168.El
169.Pp
170When providing networking services, the Bluetooth PAN profile says that the
171.Sq Class of Device
172property of the bluetooth controller SHALL include Networking capability
173.Pq set bit 0x020000 .
174See
175.Xr hccontrol 8
176for details.
177.Pp
178After
179.Nm
180has set up the client or server connection and opened the
181.Xr tap 4
182interface, it will create a pid file and detach.
183.Sh FILES
184.Bl -tag -width "Pa /etc/bluetooth/hosts" -compact
185.It Pa /dev/tap
186.It Pa /etc/bluetooth/hosts
187.It Pa /var/run/sdp
188.It Pa /var/run/tap Ns Em N Ns No .pid
189.El
190.Sh EXIT STATUS
191.Ex -std
192.Sh EXAMPLES
193.Dl ifconfig tap1 create
194.Dl btpand -a host -d mydevice -s NAP -i tap1
195.Dl dhclient tap1
196.Pp
197Will create a connection to the NAP on
198.Ar host ,
199and link that to the
200.Ar tap1
201interface.
202.Pp
203.Dl btpand -d mydevice -s GN
204.Pp
205Will create a Group Network and register the GN service with the local
206SDP server.
207.Sh SEE ALSO
208.Xr bluetooth 3 ,
209.Xr bridge 4 ,
210.Xr tap 4 ,
211.Xr dhclient 8 ,
212.Xr hccontrol 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.Dl 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