NetBSD/usr.sbin/bthcid/bthcid.8

171 lines
5.7 KiB
Groff

.\" $NetBSD: bthcid.8,v 1.8 2013/07/20 21:40:01 wiz Exp $
.\"
.\" Copyright (c) 2006 Itronix Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of Itronix Inc. may not be used to endorse
.\" or promote products derived from this software without specific
.\" prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
.\" ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\"
.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id: bthcid.8,v 1.8 2013/07/20 21:40:01 wiz Exp $
.\" $FreeBSD: src/usr.sbin/bluetooth/hcsecd/hcsecd.8,v 1.6 2006/02/11 15:36:37 markus Exp $
.\"
.Dd September 29, 2006
.Dt BTHCID 8
.Os
.Sh NAME
.Nm bthcid
.Nd Bluetooth Link Key/PIN Code Manager
.Sh SYNOPSIS
.Nm
.Op Fl fn
.Op Fl d Ar device
.Op Fl m Ar mode
.Op Fl s Ar socket_name
.Nm
.Op Fl h
.Sh DESCRIPTION
The
.Nm
daemon handles Link Key and PIN code requests for Bluetooth devices.
It opens a raw HCI socket and listens for the following HCI events.
.Pp
.Bl -tag -width XXXX -compact
.It Dv Link_Key_Request
.Nm
scans the
.Pa /var/db/bthcid.keys
file for a cached link key matching the remote device BD_ADDR and, if
found, the
.Dv Link_Key_Request_Reply
will be sent back to the device, otherwise the
.Dv Link_Key_Request_Negative_Reply
will be sent.
.Pp
.It Dv Link_Key_Notification
When a new link key is created by the device, it will be cached for future
use in the
.Pa /var/db/bthcid.keys
link keys file, which will be created if it does not already exist.
.Pp
.It Dv PIN_Code_Request
The
.Nm
daemon checks its PIN cache for a matching remote device entry.
If no PIN is found, the
.Nm
daemon will send a message to any PIN clients that have
registered, with the device details and a timeout value.
When no clients are available or the timeout has expired,
.Nm
will send a
.Dv PIN_Code_Request_Negative_Reply
back to the device.
When a PIN is found, or if a client responds within the timeout period, a
.Dv PIN_Code_Request_Reply
will be sent back to the device.
.Pp
PINs received from clients will be cached for 5 minutes until used, and may be added
to the cache prior to pairing with the
.Xr btpin 1
utility.
.El
.Pp
Some of the functionality of
.Nm
can be handled by the Bluetooth controller directly, and cached Link
Keys may be examined, deleted or moved to device storage using the
.Xr btkey 1
program.
.Pp
The command line options are as follows:
.Bl -tag -width XXXX
.It Fl d Ar device
Specify the local Bluetooth device address.
The default is BDADDR_ANY.
.It Fl f
Run in foreground (do not detach).
.It Fl h
Display usage message and exit.
.It Fl m
Specify the file mode access bits for the PIN client socket.
The default is to allow readwrite access to user and group (0660).
.It Fl n
Do not listen for PIN clients.
.It Fl s Ar socket_name
Specify the socket name to listen on for PIN clients.
The default path is
.Pa /var/run/bthcid .
.El
.Sh FILES
.Bl -tag -compact
.It Pa /var/db/bthcid.keys
.It Pa /var/run/bthcid
.It Pa /var/run/bthcid.pid
.El
.Sh SEE ALSO
.Xr btkey 1 ,
.Xr btpin 1 ,
.Xr bluetooth 4 ,
.Xr btconfig 8
.Sh HISTORY
The
.Nm
daemon first appeared in
.Fx 5.3
as
.Ic hcsecd .
It was ported to
.Nx 4.0
with its present name and extended to support PIN clients by
.An Iain Hibbert
under the sponsorship of Itronix, Inc.
.Sh AUTHORS
.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
.An Iain Hibbert