2003-05-10 21:50:37 +00:00
|
|
|
.\" Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com>
|
|
|
|
.\" All rights reserved.
|
2003-05-20 21:01:21 +00:00
|
|
|
.\"
|
2003-05-10 21:50:37 +00:00
|
|
|
.\" 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.
|
2003-05-20 21:01:21 +00:00
|
|
|
.\"
|
2003-05-10 21:50:37 +00:00
|
|
|
.\" 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.
|
2003-05-20 21:01:21 +00:00
|
|
|
.\"
|
2003-10-12 22:04:24 +00:00
|
|
|
.\" $Id: rfcomm_pppd.8,v 1.7 2003/09/07 18:32:11 max Exp $
|
2003-05-10 21:50:37 +00:00
|
|
|
.\" $FreeBSD$
|
2003-05-20 21:01:21 +00:00
|
|
|
.\"
|
2003-05-10 21:50:37 +00:00
|
|
|
.Dd February 4, 2003
|
|
|
|
.Dt RFCOMM_PPPD 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm rfcomm_pppd
|
|
|
|
.Nd RFCOMM PPP daemon
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2003-05-20 21:01:21 +00:00
|
|
|
.Fl c
|
|
|
|
.Op Fl dh
|
2004-08-05 16:32:41 +00:00
|
|
|
.Fl a Ar address
|
2003-05-20 21:01:21 +00:00
|
|
|
.Fl C Ar channel
|
|
|
|
.Fl l Ar label
|
2004-02-23 17:30:59 +00:00
|
|
|
.Fl u Ar N
|
2003-05-20 21:01:21 +00:00
|
|
|
.Nm
|
|
|
|
.Fl s
|
2004-07-27 22:40:42 +00:00
|
|
|
.Op Fl dhS
|
2004-08-05 16:32:41 +00:00
|
|
|
.Op Fl a Ar address
|
2003-05-20 21:01:21 +00:00
|
|
|
.Fl C Ar channel
|
|
|
|
.Fl l Ar label
|
2003-05-10 21:50:37 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2006-11-13 01:13:28 +00:00
|
|
|
daemon is a simple wrapper daemon that allows the use of
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
2006-11-13 01:13:28 +00:00
|
|
|
via an RFCOMM connection.
|
2003-05-20 21:01:21 +00:00
|
|
|
It can operate in two modes: client and server.
|
2003-05-10 21:50:37 +00:00
|
|
|
.Pp
|
2006-11-13 01:13:28 +00:00
|
|
|
In client mode,
|
2003-05-20 21:01:21 +00:00
|
|
|
.Nm
|
2004-06-04 19:22:04 +00:00
|
|
|
opens an RFCOMM connection to the specified server's
|
2003-05-20 21:01:21 +00:00
|
|
|
.Ar BD_ADRR
|
|
|
|
and
|
|
|
|
.Ar channel .
|
2006-11-13 01:13:28 +00:00
|
|
|
Once the RFCOMM connection is established,
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
|
|
|
executes
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
2003-05-10 21:50:37 +00:00
|
|
|
in
|
2003-05-20 21:01:21 +00:00
|
|
|
.Fl direct
|
|
|
|
mode with the specified
|
|
|
|
.Ar label .
|
2006-11-13 01:13:28 +00:00
|
|
|
Likewise,
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
2006-11-13 01:13:28 +00:00
|
|
|
operates over the RFCOMM connection just like it would over a standard serial
|
|
|
|
port, thus allowing a user to
|
2003-05-20 21:01:21 +00:00
|
|
|
.Dq "dial out"
|
2003-05-10 21:50:37 +00:00
|
|
|
and connect to the Internet.
|
|
|
|
.Pp
|
2006-11-13 01:13:28 +00:00
|
|
|
In server mode,
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
2005-07-31 03:30:48 +00:00
|
|
|
opens an RFCOMM socket and listens for incoming connections from remote clients.
|
|
|
|
Once the new incoming connection is accepted,
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
|
|
|
forks and executes
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
2003-05-10 21:50:37 +00:00
|
|
|
in
|
2003-05-20 21:01:21 +00:00
|
|
|
.Fl direct
|
|
|
|
mode with the specified
|
|
|
|
.Ar label .
|
2006-11-13 01:13:28 +00:00
|
|
|
Likewise,
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
2006-11-13 01:13:28 +00:00
|
|
|
operates over the RFCOMM connection just like it would over a standard serial
|
|
|
|
port, thus providing network connectivity to remote clients.
|
2003-05-10 21:50:37 +00:00
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width indent
|
2004-08-05 16:32:41 +00:00
|
|
|
.It Fl a Ar address
|
2006-11-13 01:13:28 +00:00
|
|
|
In client mode, this required option specifies the address of the remote
|
2003-05-20 21:01:21 +00:00
|
|
|
RFCOMM server.
|
2006-11-13 01:13:28 +00:00
|
|
|
In server mode, this option can be used to specify the local
|
2004-08-05 16:32:41 +00:00
|
|
|
address to listen on.
|
2006-11-13 01:13:28 +00:00
|
|
|
By default, in server mode, the daemon will listen on
|
2003-05-10 21:50:37 +00:00
|
|
|
.Dv ANY
|
|
|
|
address.
|
2004-08-05 16:32:41 +00:00
|
|
|
The address can be specified as BD_ADDR or name.
|
2006-11-13 01:13:28 +00:00
|
|
|
If a name was specified, the
|
2004-08-05 16:32:41 +00:00
|
|
|
.Nm
|
|
|
|
utility will attempt to resolve the name via
|
|
|
|
.Xr bt_gethostbyname 3 .
|
2003-05-10 21:50:37 +00:00
|
|
|
.It Fl C Ar channel
|
2006-11-13 01:13:28 +00:00
|
|
|
In both client and server mode, this required option specifies the RFCOMM
|
|
|
|
channel to connect to or listen on.
|
|
|
|
In server mode, the channel should be a number between 1 and 30.
|
|
|
|
In client mode, the channel could either be a number between 1 and 30
|
2004-06-04 19:22:04 +00:00
|
|
|
or a service name.
|
|
|
|
Supported service names are:
|
2003-10-12 22:04:24 +00:00
|
|
|
.Cm DUN
|
2006-11-13 01:13:28 +00:00
|
|
|
(Dial-Up Networking) and
|
2003-10-12 22:04:24 +00:00
|
|
|
.Cm LAN
|
2006-11-13 01:13:28 +00:00
|
|
|
(LAN Access Using PPP).
|
|
|
|
If a service name is used instead of a numeric channel number, then
|
2003-10-12 22:04:24 +00:00
|
|
|
.Nm
|
2006-11-13 01:13:28 +00:00
|
|
|
will try to obtain an RFCOMM channel number via SDP
|
|
|
|
(Service Discovery Protocol).
|
2003-05-20 21:01:21 +00:00
|
|
|
.It Fl c
|
2004-06-04 19:22:04 +00:00
|
|
|
Act as an RFCOMM client.
|
2003-05-20 21:01:21 +00:00
|
|
|
This is the default mode.
|
2003-05-10 21:50:37 +00:00
|
|
|
.It Fl d
|
2003-05-20 21:01:21 +00:00
|
|
|
Do not detach from the controlling terminal, i.e., run in foreground.
|
2003-05-10 21:50:37 +00:00
|
|
|
.It Fl h
|
|
|
|
Display usage message and exit.
|
|
|
|
.It Fl l Ar label
|
2006-11-13 01:13:28 +00:00
|
|
|
In both client and server mode, this required option specifies which
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
|
|
|
label will be used.
|
2004-07-27 22:40:42 +00:00
|
|
|
.It Fl S
|
2006-11-13 01:13:28 +00:00
|
|
|
In server mode, register the
|
|
|
|
.Cm SP
|
|
|
|
(Serial Port) service in addition to the
|
|
|
|
.Cm LAN
|
|
|
|
(LAN Access Using PPP) service.
|
|
|
|
.Pp
|
2005-01-11 11:47:22 +00:00
|
|
|
It appears that some cell phones are using the so-called
|
|
|
|
.Dq "callback mechanism" .
|
|
|
|
In this scenario, the user is trying to connect his cell phone to the Internet,
|
2006-11-13 01:13:28 +00:00
|
|
|
while the user's host computer is acting as the gateway server.
|
2004-07-27 22:40:42 +00:00
|
|
|
It seems that it is not possible to tell the phone to just connect and start
|
2006-11-13 01:13:28 +00:00
|
|
|
using the
|
|
|
|
.Cm LAN
|
|
|
|
service.
|
2005-01-11 11:47:22 +00:00
|
|
|
Instead, the user's host computer must
|
|
|
|
.Dq "jump start"
|
2006-11-13 01:13:28 +00:00
|
|
|
the phone by connecting to the phone's
|
|
|
|
.Cm SP
|
|
|
|
service.
|
2004-07-27 22:40:42 +00:00
|
|
|
What happens next is the phone kills the existing connection and opens another
|
|
|
|
connection back to the user's host computer.
|
2006-11-13 01:13:28 +00:00
|
|
|
The phone really wants to use the
|
|
|
|
.Cm LAN
|
|
|
|
service, but for whatever reason it looks for the
|
|
|
|
.Cm SP
|
|
|
|
service on the user's host computer.
|
|
|
|
This brain-damaged behavior was reported for the Nokia 6600 and the
|
|
|
|
Sony/Ericsson P900.
|
2003-05-10 21:50:37 +00:00
|
|
|
.It Fl s
|
2004-06-04 19:22:04 +00:00
|
|
|
Act as an RFCOMM server.
|
2004-02-23 17:30:59 +00:00
|
|
|
.It Fl u Ar N
|
2006-11-13 01:13:28 +00:00
|
|
|
This option maps directly to the
|
2004-02-23 17:30:59 +00:00
|
|
|
.Fl unit
|
|
|
|
.Xr ppp 8
|
2006-11-13 01:13:28 +00:00
|
|
|
command-line option and tells
|
2004-02-23 17:30:59 +00:00
|
|
|
.Nm
|
|
|
|
to instruct
|
|
|
|
.Xr ppp 8
|
|
|
|
to only attempt to open
|
|
|
|
.Pa /dev/tun Ns Ar N .
|
2006-11-13 01:13:28 +00:00
|
|
|
This option only works in client mode.
|
2003-05-10 21:50:37 +00:00
|
|
|
.El
|
|
|
|
.Sh PPP CONFIGURATION
|
2003-05-20 21:01:21 +00:00
|
|
|
.Ss Important Notes on PPP Configuration
|
|
|
|
Special attention is required when adding new RFCOMM configurations to the
|
|
|
|
existing PPP configuration.
|
|
|
|
Please keep in mind that PPP will
|
2003-05-10 21:50:37 +00:00
|
|
|
.Em always
|
|
|
|
execute commands in the
|
2003-05-20 21:01:21 +00:00
|
|
|
.Dq Li default
|
2003-05-10 21:50:37 +00:00
|
|
|
label of your
|
|
|
|
.Pa /etc/ppp/ppp.conf
|
2003-05-20 21:01:21 +00:00
|
|
|
file.
|
|
|
|
Please make sure that the
|
|
|
|
.Dq Li default
|
|
|
|
label
|
2003-05-10 21:50:37 +00:00
|
|
|
.Em only
|
|
|
|
contains commands that apply to
|
|
|
|
.Em every
|
2003-05-20 21:01:21 +00:00
|
|
|
other label.
|
|
|
|
If you need to use PPP for both dialing out and accepting incoming
|
2003-05-10 21:50:37 +00:00
|
|
|
RFCOMM connections, please make sure you have moved all commands related to
|
|
|
|
dialing out from the
|
2003-05-20 21:01:21 +00:00
|
|
|
.Dq Li default
|
|
|
|
section into an appropriate outgoing label.
|
|
|
|
.Ss RFCOMM Server
|
|
|
|
One of the typical examples is the LAN access.
|
2006-11-13 01:13:28 +00:00
|
|
|
In this example, an RFCOMM connection
|
|
|
|
is used as a null-modem connection between a client and a server.
|
|
|
|
Both client and server will start talking PPP right after the RFCOMM
|
|
|
|
connection has been established.
|
2003-05-10 21:50:37 +00:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
rfcomm-server:
|
|
|
|
set timeout 0
|
|
|
|
set lqrperiod 10
|
|
|
|
set ifaddr 10.0.0.1 10.0.0.2 255.255.255.0
|
|
|
|
enable lqr
|
|
|
|
accept lqr
|
2007-05-13 18:59:22 +00:00
|
|
|
accept dns
|
2003-05-10 21:50:37 +00:00
|
|
|
# Do not use PPP authentication. Assume that
|
|
|
|
# Bluetooth connection was authenticated already
|
|
|
|
disable pap
|
|
|
|
deny pap
|
|
|
|
disable chap
|
|
|
|
deny chap
|
|
|
|
.Ed
|
2003-05-20 21:01:21 +00:00
|
|
|
.Ss RFCOMM Client
|
|
|
|
The
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
2006-11-13 01:13:28 +00:00
|
|
|
utility supports both
|
|
|
|
.Cm LAN
|
|
|
|
(LAN Access Using PPP) and
|
|
|
|
.Cm DUN
|
|
|
|
(Dial-Up Networking) access.
|
|
|
|
The client's configuration for
|
|
|
|
.Cm LAN
|
|
|
|
access is very similar to the server's and might look like this:
|
2003-05-10 21:50:37 +00:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
rfcomm-client:
|
|
|
|
enable lqr
|
|
|
|
accept lqr
|
|
|
|
set dial
|
|
|
|
set timeout 0
|
|
|
|
disable iface-alias
|
|
|
|
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
|
|
|
|
# Do not use PPP authentication. Assume that
|
|
|
|
# Bluetooth connection was authenticated already
|
|
|
|
deny pap
|
|
|
|
disable pap
|
|
|
|
deny chap
|
|
|
|
disable chap
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2006-11-13 01:13:28 +00:00
|
|
|
The client's configuration for
|
|
|
|
.Cm DUN
|
|
|
|
access is different.
|
2003-05-20 21:01:21 +00:00
|
|
|
In this scenario, the client gets connected to the virtual serial port on the
|
|
|
|
server.
|
2006-11-13 01:13:28 +00:00
|
|
|
To open a PPP session, the client must dial a number.
|
2003-05-20 21:01:21 +00:00
|
|
|
Note that by default
|
|
|
|
.Xr ppp 8
|
|
|
|
will not execute any configured chat scripts.
|
|
|
|
The
|
|
|
|
.Ic force-scripts
|
|
|
|
option can be used to override this behavior.
|
2006-11-13 01:13:28 +00:00
|
|
|
An example configuration is shown below:
|
2003-05-10 21:50:37 +00:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
rfcomm-dialup:
|
|
|
|
# This is IMPORTANT option
|
|
|
|
enable force-scripts
|
|
|
|
|
|
|
|
# You might want to change these
|
|
|
|
set authname
|
|
|
|
set authkey
|
|
|
|
set phone "*99***1#"
|
|
|
|
|
2003-05-20 21:01:21 +00:00
|
|
|
# You might want to adjust dial string as well
|
|
|
|
set dial "ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 5 \\
|
2005-12-12 04:19:36 +00:00
|
|
|
\\"\\" AT OK-AT-OK ATE1Q0 OK \\\\dATDT\\\\T TIMEOUT 40 CONNECT"
|
2003-05-10 21:50:37 +00:00
|
|
|
set login
|
|
|
|
set timeout 30
|
|
|
|
enable dns
|
|
|
|
resolv rewrite
|
|
|
|
|
|
|
|
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
|
|
|
|
add default HISADDR
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2006-11-13 01:13:28 +00:00
|
|
|
Note that by adjusting the initialization string, one can make a CSD (Circuit
|
2003-05-10 21:50:37 +00:00
|
|
|
Switched Data), HSCSD (High Speed Circuit Switched Data) or GPRS (General
|
2003-05-20 21:01:21 +00:00
|
|
|
Packet Radio Service) connection.
|
|
|
|
The availability of the particular connection
|
2003-05-10 21:50:37 +00:00
|
|
|
type depends on the phone model and service plan activated on the phone.
|
2005-01-18 20:02:45 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Ex -std
|
2003-05-10 21:50:37 +00:00
|
|
|
.Sh EXAMPLES
|
2003-05-20 21:01:21 +00:00
|
|
|
.Dl "rfcomm_pppd -s -a 00:01:02:03:04:05 -C 1 -l rfcomm-server"
|
2003-05-10 21:50:37 +00:00
|
|
|
.Pp
|
2003-05-20 21:01:21 +00:00
|
|
|
This command will start
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
2003-05-20 21:01:21 +00:00
|
|
|
in the server mode.
|
|
|
|
The RFCOMM server will listen on local address
|
|
|
|
.Li 00:01:02:03:04:05
|
|
|
|
and channel
|
|
|
|
.Li 1 .
|
2005-07-31 03:30:48 +00:00
|
|
|
Once the incoming connection has been accepted,
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
|
|
|
will execute
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
2003-05-10 21:50:37 +00:00
|
|
|
in
|
2003-05-20 21:01:21 +00:00
|
|
|
.Fl direct
|
2006-11-13 01:13:28 +00:00
|
|
|
mode with the
|
2003-05-20 21:01:21 +00:00
|
|
|
.Dq Li rfcomm-server
|
2003-05-10 21:50:37 +00:00
|
|
|
label.
|
|
|
|
.Pp
|
2003-05-20 21:01:21 +00:00
|
|
|
.Dl "rfcomm_pppd -c -a 00:01:02:03:04:05 -C 1 -l rfcomm-client"
|
|
|
|
.Pp
|
|
|
|
This command will start
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
|
|
|
in the client mode.
|
|
|
|
.Nm
|
2003-05-20 21:01:21 +00:00
|
|
|
will try to connect to the RFCOMM server at
|
|
|
|
.Li 00:01:02:03:04:05
|
|
|
|
address and channel
|
|
|
|
.Li 1 .
|
2006-11-13 01:13:28 +00:00
|
|
|
Once connected,
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
|
|
|
will execute
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr ppp 8
|
|
|
|
in
|
|
|
|
.Fl direct
|
2006-11-13 01:13:28 +00:00
|
|
|
mode with the
|
2003-05-20 21:01:21 +00:00
|
|
|
.Dq Li rfcomm-client
|
2003-05-10 21:50:37 +00:00
|
|
|
label.
|
2006-11-13 01:13:28 +00:00
|
|
|
.Sh CAVEATS
|
2003-05-20 21:01:21 +00:00
|
|
|
The
|
2003-05-10 21:50:37 +00:00
|
|
|
.Nm
|
2006-11-13 01:13:28 +00:00
|
|
|
utility in server mode will try to register the Bluetooth LAN Access Over PPP
|
|
|
|
service with the local SPD daemon.
|
|
|
|
If the local SDP daemon is not running,
|
2004-02-23 17:30:59 +00:00
|
|
|
.Nm
|
2006-11-13 01:13:28 +00:00
|
|
|
will exit with an error.
|
2003-05-10 21:50:37 +00:00
|
|
|
.Sh SEE ALSO
|
2003-05-20 21:01:21 +00:00
|
|
|
.Xr rfcomm_sppd 1 ,
|
2004-08-05 16:32:41 +00:00
|
|
|
.Xr bluetooth 3 ,
|
2003-05-10 21:50:37 +00:00
|
|
|
.Xr ng_btsocket 4 ,
|
2004-02-23 17:30:59 +00:00
|
|
|
.Xr ppp 8 ,
|
|
|
|
.Xr sdpcontrol 8 ,
|
|
|
|
.Xr sdpd 8
|
2003-05-10 21:50:37 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
|