xref: /netbsd-src/usr.sbin/sdpd/sdpd.8 (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1.\" $NetBSD: sdpd.8,v 1.11 2014/03/18 18:20:47 riastradh Exp $
2.\"
3.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4.\" Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com>
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 AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" $FreeBSD: src/usr.sbin/bluetooth/sdpd/sdpd.8,v 1.5 2005/12/06 17:56:36 emax Exp $
29.\"
30.Dd May 7, 2009
31.Dt SDPD 8
32.Os
33.Sh NAME
34.Nm sdpd
35.Nd Bluetooth Service Discovery Protocol daemon
36.Sh SYNOPSIS
37.Nm
38.Op Fl dh
39.Op Fl c Ar path
40.Op Fl G Ar group
41.Op Fl g Ar group
42.Op Fl u Ar user
43.Sh DESCRIPTION
44The
45.Nm
46daemon keeps a database of Bluetooth Service Records registered on
47the host and responds to Service Discovery inquiries from remote
48Bluetooth devices.
49.Pp
50In order to discover services, remote Bluetooth devices send Service
51Search and Service Attribute or Service Search Attribute requests over
52Bluetooth L2CAP connections on the SDP PSM (0x0001).
53The
54.Nm
55daemon will try to find matching Service Records in its Service Database
56and will return the requested record extracts for the remote device to
57interpret.
58The remote device will then make a separate connection in order to
59access the service.
60.Pp
61Bluetooth applications, running on the host, are able to insert, remove
62and update Service Records with the
63.Nm
64daemon via the control socket.
65It is possible to query entire contents of the Service Database locally with
66.Xr sdpquery 1
67using the
68.Fl l
69option.
70.Pp
71The command line options are as follows:
72.Bl -tag -width indent
73.It Fl c Ar path
74Specify path to the control socket.
75The default path is
76.Pa /var/run/sdp .
77.It Fl d
78Do not detach from the controlling terminal.
79.It Fl G Ar group
80Grant permission to members of the
81.Ar group
82to modify the
83.Nm
84Service Database.
85.It Fl g Ar group
86Specifies the group the
87.Nm
88should run as after it initializes.
89The value specified may be either a group name or a numeric group ID.
90This only works if
91.Nm
92was started as root.
93The default group name is
94.Dq Li _sdpd .
95.It Fl h
96Display usage message and exit.
97.It Fl u Ar user
98Specifies the user the
99.Nm
100should run as after it initializes.
101The value specified may be either a user name or a numeric user ID.
102This only works if
103.Nm
104was started as root.
105The default user name is
106.Dq Li _sdpd .
107.El
108.Sh FILES
109.Bl -tag -width ".Pa /var/run/sdp" -compact
110.It Pa /var/run/sdp
111.El
112.Sh SEE ALSO
113.Xr sdpquery 1 ,
114.Xr sdp 3
115.Pp
116The
117.Qq Service Discovery Protocol
118section of the Bluetooth Core specifications, available at
119.Lk http://www.bluetooth.com/
120.Sh HISTORY
121The original
122.Nm
123daemon first appeared in
124.Fx 5.3
125and was imported into
126.Nx 4.0
127by
128.An Iain Hibbert
129under the sponsorship of
130.An Itronix, Inc.
131This version was rewritten by
132.An Iain Hibbert
133for
134.Nx 6.0
135in order to allow Bluetooth applications to fully specify
136service records.
137.Sh AUTHORS
138.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
139.An Iain Hibbert
140.Sh CAVEATS
141The
142.Nm
143daemon
144will listen for incoming L2CAP connections on a wildcard BD_ADDR.
145.Pp
146In case of multiple Bluetooth controllers connected to the same host
147it is possible to limit visibility of Service Records according to
148the controller the connection is made through.
149.Pp
150Requests to insert, remove or update service records can only be made
151via the control socket.
152The
153.Nm
154daemon will check the peer's credentials and will only accept the request
155when the peer is the superuser, of if the peer is a member of the group
156specified with the
157.Fl G
158option.
159.Pp
160The
161.Nm
162daemon does not check for duplicated Service Records and only
163performs minimal validation of the record data sent in the Insert/Update
164Record requests.
165It is assumed that application must obtain all required resources such
166as RFCOMM channels etc., before registering the service.
167.Sh BUGS
168.Nm
169only ever generates 16-bit sequence headers, so if a response was
170to grow over
171.Dv UINT16_MAX ,
172the sequence header will be wrong.
173.Pp
174There is no way for clients to discover the maximum packet size that
175.Nm
176will accept on the local socket.
177Currently this is
178.Dv SDP_LOCAL_MTU
179as defined in
180.In bluetooth/sdp.h .
181