Index: rfcomm_pppd.8 =================================================================== RCS file: /home/ncvs/src/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8,v retrieving revision 1.14 diff -u -r1.14 rfcomm_pppd.8 --- rfcomm_pppd.8 13 May 2007 18:59:22 -0000 1.14 +++ rfcomm_pppd.8 5 Mar 2008 17:46:04 -0000 @@ -41,7 +41,7 @@ .Fl u Ar N .Nm .Fl s -.Op Fl dhS +.Op Fl dDhS .Op Fl a Ar address .Fl C Ar channel .Fl l Ar label @@ -125,6 +125,15 @@ This is the default mode. .It Fl d Do not detach from the controlling terminal, i.e., run in foreground. +.It Fl D +In server mode, register the +.Cm DUN +(Dial-Up Networking) service in addition to the +.Cm LAN +(LAN Access Using PPP) service. +AT-command exchange can be faked with +.Xr ppp 8 +chat script. .It Fl h Display usage message and exit. .It Fl l Ar label Index: rfcomm_pppd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c,v retrieving revision 1.6 diff -u -r1.6 rfcomm_pppd.c --- rfcomm_pppd.c 21 Sep 2006 02:32:28 -0000 1.6 +++ rfcomm_pppd.c 5 Mar 2008 17:46:04 -0000 @@ -62,7 +62,8 @@ struct sockaddr_rfcomm sock_addr; char *label = NULL, *unit = NULL, *ep = NULL; bdaddr_t addr; - int s, channel, detach, server, service, regsp; + int s, channel, detach, server, service, + regdun, regsp; pid_t pid; memcpy(&addr, NG_HCI_BDADDR_ANY, sizeof(addr)); @@ -70,10 +71,11 @@ detach = 1; server = 0; service = 0; + regdun = 0; regsp = 0; /* Parse command line arguments */ - while ((s = getopt(argc, argv, "a:cC:dhl:sSu:")) != -1) { + while ((s = getopt(argc, argv, "a:cC:dDhl:sSu:")) != -1) { switch (s) { case 'a': /* BDADDR */ if (!bt_aton(optarg, &addr)) { @@ -110,6 +112,10 @@ detach = 0; break; + case 'D': /* Register DUN service as well as LAN service */ + regdun = 1; + break; + case 'l': /* PPP label */ label = optarg; break; @@ -265,6 +271,31 @@ } /* + * Register DUN (Dial-Up Networking) service on the same + * RFCOMM channel if requested. There is really no good reason + * to not to support this. AT-command exchange can be faked + * with chat script in ppp.conf + */ + + if (regdun) { + sdp_dun_profile_t dun; + + memset(&dun, 0, sizeof(dun)); + dun.server_channel = channel; + + if (sdp_register_service(ss, + SDP_SERVICE_CLASS_DIALUP_NETWORKING, + &addr, (void *) &dun, sizeof(dun), + NULL) != 0) { + syslog(LOG_ERR, "Unable to register DUN " \ + "service with local SDP daemon. " \ + "%s (%d)", strerror(sdp_error(ss)), + sdp_error(ss)); + exit(1); + } + } + + /* * Register SP (Serial Port) service on the same RFCOMM channel * if requested. It appears that some cell phones are using so * called "callback mechanism". In this scenario user is trying