11a63eb31SJulian Elischer.\" Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com> 21a63eb31SJulian Elischer.\" All rights reserved. 31a63eb31SJulian Elischer.\" 41a63eb31SJulian Elischer.\" Redistribution and use in source and binary forms, with or without 51a63eb31SJulian Elischer.\" modification, are permitted provided that the following conditions 61a63eb31SJulian Elischer.\" are met: 71a63eb31SJulian Elischer.\" 1. Redistributions of source code must retain the above copyright 81a63eb31SJulian Elischer.\" notice, this list of conditions and the following disclaimer. 91a63eb31SJulian Elischer.\" 2. Redistributions in binary form must reproduce the above copyright 101a63eb31SJulian Elischer.\" notice, this list of conditions and the following disclaimer in the 111a63eb31SJulian Elischer.\" documentation and/or other materials provided with the distribution. 121a63eb31SJulian Elischer.\" 131a63eb31SJulian Elischer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 141a63eb31SJulian Elischer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 151a63eb31SJulian Elischer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 161a63eb31SJulian Elischer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 171a63eb31SJulian Elischer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 181a63eb31SJulian Elischer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 191a63eb31SJulian Elischer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 201a63eb31SJulian Elischer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 211a63eb31SJulian Elischer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 221a63eb31SJulian Elischer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 231a63eb31SJulian Elischer.\" SUCH DAMAGE. 241a63eb31SJulian Elischer.\" 250986ab12SMaksim Yevmenkin.\" $Id: rfcomm_pppd.8,v 1.7 2003/09/07 18:32:11 max Exp $ 261a63eb31SJulian Elischer.\" $FreeBSD$ 2772f00208SRuslan Ermilov.\" 281a63eb31SJulian Elischer.Dd February 4, 2003 291a63eb31SJulian Elischer.Dt RFCOMM_PPPD 8 301a63eb31SJulian Elischer.Os 311a63eb31SJulian Elischer.Sh NAME 321a63eb31SJulian Elischer.Nm rfcomm_pppd 331a63eb31SJulian Elischer.Nd RFCOMM PPP daemon 341a63eb31SJulian Elischer.Sh SYNOPSIS 351a63eb31SJulian Elischer.Nm 3672f00208SRuslan Ermilov.Fl c 3772f00208SRuslan Ermilov.Op Fl dh 382aa65cf7SMaksim Yevmenkin.Fl a Ar address 3972f00208SRuslan Ermilov.Fl C Ar channel 4072f00208SRuslan Ermilov.Fl l Ar label 4113706e45SMaksim Yevmenkin.Fl u Ar N 4272f00208SRuslan Ermilov.Nm 4372f00208SRuslan Ermilov.Fl s 441985a3a3SMaksim Yevmenkin.Op Fl dhS 452aa65cf7SMaksim Yevmenkin.Op Fl a Ar address 4672f00208SRuslan Ermilov.Fl C Ar channel 4772f00208SRuslan Ermilov.Fl l Ar label 481a63eb31SJulian Elischer.Sh DESCRIPTION 491a63eb31SJulian ElischerThe 501a63eb31SJulian Elischer.Nm 511a63eb31SJulian Elischerdaemon is a simple wrapper daemon that allows to use standard 5272f00208SRuslan Ermilov.Xr ppp 8 5372f00208SRuslan Ermilovon RFCOMM connection. 5472f00208SRuslan ErmilovIt can operate in two modes: client and server. 551a63eb31SJulian Elischer.Pp 5672f00208SRuslan ErmilovIn the client mode, 571a63eb31SJulian Elischer.Nm 589b90f236SRuslan Ermilovopens an RFCOMM connection to the specified server's 5972f00208SRuslan Ermilov.Ar BD_ADRR 6072f00208SRuslan Ermilovand 6172f00208SRuslan Ermilov.Ar channel . 6272f00208SRuslan ErmilovOnce RFCOMM connection is established, 631a63eb31SJulian Elischer.Nm 641a63eb31SJulian Elischerexecutes 6572f00208SRuslan Ermilov.Xr ppp 8 661a63eb31SJulian Elischerin 6772f00208SRuslan Ermilov.Fl direct 6872f00208SRuslan Ermilovmode with the specified 6972f00208SRuslan Ermilov.Ar label . 7072f00208SRuslan ErmilovThe 7172f00208SRuslan Ermilov.Xr ppp 8 721a63eb31SJulian Elischerin its turn operates over the RFCOMM connection just like it would operate 731a63eb31SJulian Elischerover the standard serial port thus allowing user to 7472f00208SRuslan Ermilov.Dq "dial out" 751a63eb31SJulian Elischerand connect to the Internet. 761a63eb31SJulian Elischer.Pp 7772f00208SRuslan ErmilovIn the server mode, 781a63eb31SJulian Elischer.Nm 799b90f236SRuslan Ermilovopens an RFCOMM socket and listens for incomming connections from remote clients. 8072f00208SRuslan ErmilovOnce the new incomming connection is accepted, 811a63eb31SJulian Elischer.Nm 821a63eb31SJulian Elischerforks and executes 8372f00208SRuslan Ermilov.Xr ppp 8 841a63eb31SJulian Elischerin 8572f00208SRuslan Ermilov.Fl direct 8672f00208SRuslan Ermilovmode with the specified 8772f00208SRuslan Ermilov.Ar label . 8872f00208SRuslan ErmilovThe 8972f00208SRuslan Ermilov.Xr ppp 8 901a63eb31SJulian Elischerin its turn operates over the RFCOMM connection just like it would operate over 911a63eb31SJulian Elischerthe standard serial port thus providing network connectivity to remote clients. 921a63eb31SJulian Elischer.Pp 931a63eb31SJulian ElischerThe options are as follows: 941a63eb31SJulian Elischer.Bl -tag -width indent 952aa65cf7SMaksim Yevmenkin.It Fl a Ar address 962aa65cf7SMaksim YevmenkinIn the client mode, this required option specifies the address of the remote 9772f00208SRuslan ErmilovRFCOMM server. 9872f00208SRuslan ErmilovIn the server mode, this option can be used to specify the local 992aa65cf7SMaksim Yevmenkinaddress to listen on. 10072f00208SRuslan ErmilovBy default, server will listen on 1011a63eb31SJulian Elischer.Dv ANY 1021a63eb31SJulian Elischeraddress. 1032aa65cf7SMaksim YevmenkinThe address can be specified as BD_ADDR or name. 1042aa65cf7SMaksim YevmenkinIf name was specified then the 1052aa65cf7SMaksim Yevmenkin.Nm 1062aa65cf7SMaksim Yevmenkinutility will attempt to resolve the name via 1072aa65cf7SMaksim Yevmenkin.Xr bt_gethostbyname 3 . 1081a63eb31SJulian Elischer.It Fl C Ar channel 1099b90f236SRuslan ErmilovIn both client and server modes, this required option specifies RFCOMM channel 1101a63eb31SJulian Elischerto connect to or listen on. 1119b90f236SRuslan ErmilovIn the server mode, RFCOMM channel should be a number between 1 and 30. 1129b90f236SRuslan ErmilovIn the client mode, RFCOMM channel could either be a number between 1 and 30 1139b90f236SRuslan Ermilovor a service name. 1149b90f236SRuslan ErmilovSupported service names are: 1150986ab12SMaksim Yevmenkin.Cm DUN 1169b90f236SRuslan Ermilov(for DialUp Networking service) and 1170986ab12SMaksim Yevmenkin.Cm LAN 1189b90f236SRuslan Ermilov(for LAN Access Using PPP service). 1190986ab12SMaksim YevmenkinIf service name was specified instead of numeric RFCOMM channel then 1200986ab12SMaksim Yevmenkin.Nm 1210986ab12SMaksim Yevmenkinutility will try to obtain RFCOMM channel for the service via Service 1220986ab12SMaksim YevmenkinDiscovery Protocol. 12372f00208SRuslan Ermilov.It Fl c 1249b90f236SRuslan ErmilovAct as an RFCOMM client. 12572f00208SRuslan ErmilovThis is the default mode. 1261a63eb31SJulian Elischer.It Fl d 12772f00208SRuslan ErmilovDo not detach from the controlling terminal, i.e., run in foreground. 1281a63eb31SJulian Elischer.It Fl h 1291a63eb31SJulian ElischerDisplay usage message and exit. 1301a63eb31SJulian Elischer.It Fl l Ar label 1319b90f236SRuslan ErmilovIn both client and server modes, this required option specifies which 13272f00208SRuslan Ermilov.Xr ppp 8 13372f00208SRuslan Ermilovlabel will be used. 1341985a3a3SMaksim Yevmenkin.It Fl S 1351985a3a3SMaksim YevmenkinIn the server mode register the Serial Port (SP) service in addition to the 1361985a3a3SMaksim YevmenkinLAN Access Using PPP (LAN) service. 1371985a3a3SMaksim YevmenkinIt appears that some cell phones are using so called 1381985a3a3SMaksim Yevmenkin.Dq callback mechanism . 1391985a3a3SMaksim YevmenkinIn this scenario the user is trying to connect his cell phone to the Internet, 1401985a3a3SMaksim Yevmenkinand, user's host computer is acting as the gateway server. 1411985a3a3SMaksim YevmenkinIt seems that it is not possible to tell the phone to just connect and start 1421985a3a3SMaksim Yevmenkinusing the LAN service. 1431985a3a3SMaksim YevmenkinInstead the user's host computer must 1441985a3a3SMaksim Yevmenkin.Dq jump start 1451985a3a3SMaksim Yevmenkinthe phone by connecting to the phone's SP service. 1461985a3a3SMaksim YevmenkinWhat happens next is the phone kills the existing connection and opens another 1471985a3a3SMaksim Yevmenkinconnection back to the user's host computer. 1481985a3a3SMaksim YevmenkinThe phone really wants to use LAN service, but for whatever reason it looks 1491985a3a3SMaksim Yevmenkinfor the SP service on the user's host computer. 1501985a3a3SMaksim YevmenkinThis brain damaged behavior was reported for Nokia 6600 and Sony/Ericsson P900. 1511a63eb31SJulian Elischer.It Fl s 1529b90f236SRuslan ErmilovAct as an RFCOMM server. 15313706e45SMaksim Yevmenkin.It Fl u Ar N 15413706e45SMaksim YevmenkinThis option maps directly onto 15513706e45SMaksim Yevmenkin.Fl unit 15613706e45SMaksim Yevmenkin.Xr ppp 8 15713706e45SMaksim Yevmenkincommand line option and tells 15813706e45SMaksim Yevmenkin.Nm 15913706e45SMaksim Yevmenkinto instruct 16013706e45SMaksim Yevmenkin.Xr ppp 8 16113706e45SMaksim Yevmenkinto only attempt to open 16213706e45SMaksim Yevmenkin.Pa /dev/tun Ns Ar N . 16313706e45SMaksim YevmenkinThis option only works in the client mode. 1641a63eb31SJulian Elischer.El 1651a63eb31SJulian Elischer.Sh PPP CONFIGURATION 16672f00208SRuslan Ermilov.Ss Important Notes on PPP Configuration 1671a63eb31SJulian ElischerSpecial attention is required when adding new RFCOMM configurations to the 16872f00208SRuslan Ermilovexisting PPP configuration. 16972f00208SRuslan ErmilovPlease keep in mind that PPP will 1701a63eb31SJulian Elischer.Em always 1711a63eb31SJulian Elischerexecute commands in the 17272f00208SRuslan Ermilov.Dq Li default 1731a63eb31SJulian Elischerlabel of your 1741a63eb31SJulian Elischer.Pa /etc/ppp/ppp.conf 17572f00208SRuslan Ermilovfile. 17672f00208SRuslan ErmilovPlease make sure that the 17772f00208SRuslan Ermilov.Dq Li default 1781a63eb31SJulian Elischerlabel 1791a63eb31SJulian Elischer.Em only 1801a63eb31SJulian Elischercontains commands that apply to 1811a63eb31SJulian Elischer.Em every 18272f00208SRuslan Ermilovother label. 18372f00208SRuslan ErmilovIf you need to use PPP for both dialing out and accepting incoming 1841a63eb31SJulian ElischerRFCOMM connections, please make sure you have moved all commands related to 1851a63eb31SJulian Elischerdialing out from the 18672f00208SRuslan Ermilov.Dq Li default 18772f00208SRuslan Ermilovsection into an appropriate outgoing label. 18872f00208SRuslan Ermilov.Ss RFCOMM Server 18972f00208SRuslan ErmilovOne of the typical examples is the LAN access. 19072f00208SRuslan ErmilovIn this example, RFCOMM connection 19172f00208SRuslan Ermilovis used as a null-modem connection between client and server. 19272f00208SRuslan ErmilovBoth client 1931a63eb31SJulian Elischerand server will start talking PPP right after RFCOMM connection was established. 1941a63eb31SJulian Elischer.Bd -literal -offset indent 1951a63eb31SJulian Elischerrfcomm-server: 1961a63eb31SJulian Elischer set timeout 0 1971a63eb31SJulian Elischer set lqrperiod 10 1981a63eb31SJulian Elischer set ifaddr 10.0.0.1 10.0.0.2 255.255.255.0 1991a63eb31SJulian Elischer enable lqr 2001a63eb31SJulian Elischer accept lqr 2011a63eb31SJulian Elischer # Do not use PPP authentication. Assume that 2021a63eb31SJulian Elischer # Bluetooth connection was authenticated already 2031a63eb31SJulian Elischer disable pap 2041a63eb31SJulian Elischer deny pap 2051a63eb31SJulian Elischer disable chap 2061a63eb31SJulian Elischer deny chap 2071a63eb31SJulian Elischer.Ed 20872f00208SRuslan Ermilov.Ss RFCOMM Client 20972f00208SRuslan ErmilovThe 2101a63eb31SJulian Elischer.Nm 21172f00208SRuslan Ermilovutility 21272f00208SRuslan Ermilovsupports both LAN and DUN (Dial-Up Networking) access. 21372f00208SRuslan ErmilovThe client's configuration for the LAN access is very similar to server's and 21472f00208SRuslan Ermilovmight look like this. 2151a63eb31SJulian Elischer.Bd -literal -offset indent 2161a63eb31SJulian Elischerrfcomm-client: 2171a63eb31SJulian Elischer enable lqr 2181a63eb31SJulian Elischer accept lqr 2191a63eb31SJulian Elischer set dial 2201a63eb31SJulian Elischer set timeout 0 2211a63eb31SJulian Elischer disable iface-alias 2221a63eb31SJulian Elischer set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 2231a63eb31SJulian Elischer # Do not use PPP authentication. Assume that 2241a63eb31SJulian Elischer # Bluetooth connection was authenticated already 2251a63eb31SJulian Elischer deny pap 2261a63eb31SJulian Elischer disable pap 2271a63eb31SJulian Elischer deny chap 2281a63eb31SJulian Elischer disable chap 2291a63eb31SJulian Elischer.Ed 2301a63eb31SJulian Elischer.Pp 23172f00208SRuslan ErmilovThe client's configuration for the DUN access is different. 23272f00208SRuslan ErmilovIn this scenario, the client gets connected to the virtual serial port on the 23372f00208SRuslan Ermilovserver. 23472f00208SRuslan ErmilovTo open a PPP session, client must dial a number. 23572f00208SRuslan ErmilovNote that by default 23672f00208SRuslan Ermilov.Xr ppp 8 23772f00208SRuslan Ermilovwill not execute any configured chat scripts. 23872f00208SRuslan ErmilovThe 23972f00208SRuslan Ermilov.Ic force-scripts 24072f00208SRuslan Ermilovoption can be used to override this behavior. 24172f00208SRuslan ErmilovThe example of such configuration is shown below. 2421a63eb31SJulian Elischer.Bd -literal -offset indent 2431a63eb31SJulian Elischerrfcomm-dialup: 2441a63eb31SJulian Elischer # This is IMPORTANT option 2451a63eb31SJulian Elischer enable force-scripts 2461a63eb31SJulian Elischer 2471a63eb31SJulian Elischer # You might want to change these 2481a63eb31SJulian Elischer set authname 2491a63eb31SJulian Elischer set authkey 2501a63eb31SJulian Elischer set phone "*99***1#" 2511a63eb31SJulian Elischer 2521a63eb31SJulian Elischer # You might want to adjust dial string as well 25372f00208SRuslan Ermilov set dial "ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 5 \\ 2541a63eb31SJulian Elischer \\"\\" AT OK-AT-OK ATE1Q0 OK \\\\dATD\\\\T TIMEOUT 40 CONNECT" 2551a63eb31SJulian Elischer set login 2561a63eb31SJulian Elischer set timeout 30 2571a63eb31SJulian Elischer enable dns 2581a63eb31SJulian Elischer resolv rewrite 2591a63eb31SJulian Elischer 2601a63eb31SJulian Elischer set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 2611a63eb31SJulian Elischer add default HISADDR 2621a63eb31SJulian Elischer.Ed 2631a63eb31SJulian Elischer.Pp 26472f00208SRuslan ErmilovNote that by adjusting the initialization string, one can make CSD (Circuit 2651a63eb31SJulian ElischerSwitched Data), HSCSD (High Speed Circuit Switched Data) or GPRS (General 26672f00208SRuslan ErmilovPacket Radio Service) connection. 26772f00208SRuslan ErmilovThe availability of the particular connection 2681a63eb31SJulian Elischertype depends on the phone model and service plan activated on the phone. 2691a63eb31SJulian Elischer.Sh EXAMPLES 27072f00208SRuslan Ermilov.Dl "rfcomm_pppd -s -a 00:01:02:03:04:05 -C 1 -l rfcomm-server" 2711a63eb31SJulian Elischer.Pp 27272f00208SRuslan ErmilovThis command will start 2731a63eb31SJulian Elischer.Nm 27472f00208SRuslan Ermilovin the server mode. 27572f00208SRuslan ErmilovThe RFCOMM server will listen on local address 27672f00208SRuslan Ermilov.Li 00:01:02:03:04:05 2771a63eb31SJulian Elischerand channel 27872f00208SRuslan Ermilov.Li 1 . 27972f00208SRuslan ErmilovOnce the incomming connection has been accepted, 2801a63eb31SJulian Elischer.Nm 2811a63eb31SJulian Elischerwill execute 28272f00208SRuslan Ermilov.Xr ppp 8 2831a63eb31SJulian Elischerin 28472f00208SRuslan Ermilov.Fl direct 2851a63eb31SJulian Elischermode with 28672f00208SRuslan Ermilov.Dq Li rfcomm-server 2871a63eb31SJulian Elischerlabel. 2881a63eb31SJulian Elischer.Pp 28972f00208SRuslan Ermilov.Dl "rfcomm_pppd -c -a 00:01:02:03:04:05 -C 1 -l rfcomm-client" 29072f00208SRuslan Ermilov.Pp 29172f00208SRuslan ErmilovThis command will start 2921a63eb31SJulian Elischer.Nm 2931a63eb31SJulian Elischerin the client mode. 2941a63eb31SJulian Elischer.Nm 2951a63eb31SJulian Elischerwill try to connect to the RFCOMM server at 29672f00208SRuslan Ermilov.Li 00:01:02:03:04:05 2971a63eb31SJulian Elischeraddress and channel 29872f00208SRuslan Ermilov.Li 1 . 29972f00208SRuslan ErmilovOnce connected, the 3001a63eb31SJulian Elischer.Nm 3011a63eb31SJulian Elischerwill execute 30272f00208SRuslan Ermilov.Xr ppp 8 3031a63eb31SJulian Elischerin 30472f00208SRuslan Ermilov.Fl direct 3051a63eb31SJulian Elischermode with 30672f00208SRuslan Ermilov.Dq Li rfcomm-client 3071a63eb31SJulian Elischerlabel. 3081a63eb31SJulian Elischer.Sh DIAGNOSTICS 3091a63eb31SJulian Elischer.Ex -std 31013706e45SMaksim Yevmenkin.Sh CAVEAT 31172f00208SRuslan ErmilovThe 3121a63eb31SJulian Elischer.Nm 31313706e45SMaksim Yevmenkinutility in server mode will try to register Bluetooth LAN Access Over PPP 3149b90f236SRuslan Ermilovservice with local SPD daemon. 3159b90f236SRuslan ErmilovIf local SDP daemon is not running the 31613706e45SMaksim Yevmenkin.Nm 31713706e45SMaksim Yevmenkinutility will exit with error. 3181a63eb31SJulian Elischer.Sh SEE ALSO 31972f00208SRuslan Ermilov.Xr rfcomm_sppd 1 , 3202aa65cf7SMaksim Yevmenkin.Xr bluetooth 3 , 3211a63eb31SJulian Elischer.Xr ng_btsocket 4 , 32213706e45SMaksim Yevmenkin.Xr ppp 8 , 32313706e45SMaksim Yevmenkin.Xr sdpcontrol 8 , 32413706e45SMaksim Yevmenkin.Xr sdpd 8 3251a63eb31SJulian Elischer.Sh AUTHORS 3261a63eb31SJulian Elischer.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com 327