1.\" Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $Id: rfcomm_pppd.8,v 1.7 2003/09/07 18:32:11 max Exp $ 26.\" $FreeBSD$ 27.\" 28.Dd February 4, 2003 29.Dt RFCOMM_PPPD 8 30.Os 31.Sh NAME 32.Nm rfcomm_pppd 33.Nd RFCOMM PPP daemon 34.Sh SYNOPSIS 35.Nm 36.Fl c 37.Op Fl dh 38.Fl a Ar BD_ADDR 39.Fl C Ar channel 40.Fl l Ar label 41.Fl u Ar N 42.Nm 43.Fl s 44.Op Fl dh 45.Op Fl a Ar BD_ADDR 46.Fl C Ar channel 47.Fl l Ar label 48.Sh DESCRIPTION 49The 50.Nm 51daemon is a simple wrapper daemon that allows to use standard 52.Xr ppp 8 53on RFCOMM connection. 54It can operate in two modes: client and server. 55.Pp 56In the client mode, 57.Nm 58opens an RFCOMM connection to the specified server's 59.Ar BD_ADRR 60and 61.Ar channel . 62Once RFCOMM connection is established, 63.Nm 64executes 65.Xr ppp 8 66in 67.Fl direct 68mode with the specified 69.Ar label . 70The 71.Xr ppp 8 72in its turn operates over the RFCOMM connection just like it would operate 73over the standard serial port thus allowing user to 74.Dq "dial out" 75and connect to the Internet. 76.Pp 77In the server mode, 78.Nm 79opens an RFCOMM socket and listens for incomming connections from remote clients. 80Once the new incomming connection is accepted, 81.Nm 82forks and executes 83.Xr ppp 8 84in 85.Fl direct 86mode with the specified 87.Ar label . 88The 89.Xr ppp 8 90in its turn operates over the RFCOMM connection just like it would operate over 91the standard serial port thus providing network connectivity to remote clients. 92.Pp 93The options are as follows: 94.Bl -tag -width indent 95.It Fl a Ar BD_ADDR 96In the client mode, this required option specifies the remote BD_ADDR of the 97RFCOMM server. 98In the server mode, this option can be used to specify the local 99BD_ADDR to listen on. 100By default, server will listen on 101.Dv ANY 102address. 103.It Fl C Ar channel 104In both client and server modes, this required option specifies RFCOMM channel 105to connect to or listen on. 106In the server mode, RFCOMM channel should be a number between 1 and 30. 107In the client mode, RFCOMM channel could either be a number between 1 and 30 108or a service name. 109Supported service names are: 110.Cm DUN 111(for DialUp Networking service) and 112.Cm LAN 113(for LAN Access Using PPP service). 114If service name was specified instead of numeric RFCOMM channel then 115.Nm 116utility will try to obtain RFCOMM channel for the service via Service 117Discovery Protocol. 118.It Fl c 119Act as an RFCOMM client. 120This is the default mode. 121.It Fl d 122Do not detach from the controlling terminal, i.e., run in foreground. 123.It Fl h 124Display usage message and exit. 125.It Fl l Ar label 126In both client and server modes, this required option specifies which 127.Xr ppp 8 128label will be used. 129.It Fl s 130Act as an RFCOMM server. 131.It Fl u Ar N 132This option maps directly onto 133.Fl unit 134.Xr ppp 8 135command line option and tells 136.Nm 137to instruct 138.Xr ppp 8 139to only attempt to open 140.Pa /dev/tun Ns Ar N . 141This option only works in the client mode. 142.El 143.Sh PPP CONFIGURATION 144.Ss Important Notes on PPP Configuration 145Special attention is required when adding new RFCOMM configurations to the 146existing PPP configuration. 147Please keep in mind that PPP will 148.Em always 149execute commands in the 150.Dq Li default 151label of your 152.Pa /etc/ppp/ppp.conf 153file. 154Please make sure that the 155.Dq Li default 156label 157.Em only 158contains commands that apply to 159.Em every 160other label. 161If you need to use PPP for both dialing out and accepting incoming 162RFCOMM connections, please make sure you have moved all commands related to 163dialing out from the 164.Dq Li default 165section into an appropriate outgoing label. 166.Ss RFCOMM Server 167One of the typical examples is the LAN access. 168In this example, RFCOMM connection 169is used as a null-modem connection between client and server. 170Both client 171and server will start talking PPP right after RFCOMM connection was established. 172.Bd -literal -offset indent 173rfcomm-server: 174 set timeout 0 175 set lqrperiod 10 176 set ifaddr 10.0.0.1 10.0.0.2 255.255.255.0 177 enable lqr 178 accept lqr 179 # Do not use PPP authentication. Assume that 180 # Bluetooth connection was authenticated already 181 disable pap 182 deny pap 183 disable chap 184 deny chap 185.Ed 186.Ss RFCOMM Client 187The 188.Nm 189utility 190supports both LAN and DUN (Dial-Up Networking) access. 191The client's configuration for the LAN access is very similar to server's and 192might look like this. 193.Bd -literal -offset indent 194rfcomm-client: 195 enable lqr 196 accept lqr 197 set dial 198 set timeout 0 199 disable iface-alias 200 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 201 # Do not use PPP authentication. Assume that 202 # Bluetooth connection was authenticated already 203 deny pap 204 disable pap 205 deny chap 206 disable chap 207.Ed 208.Pp 209The client's configuration for the DUN access is different. 210In this scenario, the client gets connected to the virtual serial port on the 211server. 212To open a PPP session, client must dial a number. 213Note that by default 214.Xr ppp 8 215will not execute any configured chat scripts. 216The 217.Ic force-scripts 218option can be used to override this behavior. 219The example of such configuration is shown below. 220.Bd -literal -offset indent 221rfcomm-dialup: 222 # This is IMPORTANT option 223 enable force-scripts 224 225 # You might want to change these 226 set authname 227 set authkey 228 set phone "*99***1#" 229 230 # You might want to adjust dial string as well 231 set dial "ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 5 \\ 232 \\"\\" AT OK-AT-OK ATE1Q0 OK \\\\dATD\\\\T TIMEOUT 40 CONNECT" 233 set login 234 set timeout 30 235 enable dns 236 resolv rewrite 237 238 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 239 add default HISADDR 240.Ed 241.Pp 242Note that by adjusting the initialization string, one can make CSD (Circuit 243Switched Data), HSCSD (High Speed Circuit Switched Data) or GPRS (General 244Packet Radio Service) connection. 245The availability of the particular connection 246type depends on the phone model and service plan activated on the phone. 247.Sh EXAMPLES 248.Dl "rfcomm_pppd -s -a 00:01:02:03:04:05 -C 1 -l rfcomm-server" 249.Pp 250This command will start 251.Nm 252in the server mode. 253The RFCOMM server will listen on local address 254.Li 00:01:02:03:04:05 255and channel 256.Li 1 . 257Once the incomming connection has been accepted, 258.Nm 259will execute 260.Xr ppp 8 261in 262.Fl direct 263mode with 264.Dq Li rfcomm-server 265label. 266.Pp 267.Dl "rfcomm_pppd -c -a 00:01:02:03:04:05 -C 1 -l rfcomm-client" 268.Pp 269This command will start 270.Nm 271in the client mode. 272.Nm 273will try to connect to the RFCOMM server at 274.Li 00:01:02:03:04:05 275address and channel 276.Li 1 . 277Once connected, the 278.Nm 279will execute 280.Xr ppp 8 281in 282.Fl direct 283mode with 284.Dq Li rfcomm-client 285label. 286.Sh DIAGNOSTICS 287.Ex -std 288.Sh CAVEAT 289The 290.Nm 291utility in server mode will try to register Bluetooth LAN Access Over PPP 292service with local SPD daemon. 293If local SDP daemon is not running the 294.Nm 295utility will exit with error. 296.Sh SEE ALSO 297.Xr rfcomm_sppd 1 , 298.Xr ng_btsocket 4 , 299.Xr ppp 8 , 300.Xr sdpcontrol 8 , 301.Xr sdpd 8 302.Sh AUTHORS 303.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com 304