|
From: Mattias A. <mat...@us...> - 2001-03-21 20:48:07
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
fixed communication with IPA server
added option -i, --hwinit to set initial baud rate on physdev
made strings used for building pppd options static
added SIGTERM in sighandler to handle atexit() functionality
fixed some warnings & minor changes
The diff of the modified file(s):
--- btd.c 2001/03/13 22:21:17 1.4
+++ btd.c 2001/03/21 20:48:04 1.5
@@ -50,6 +50,10 @@
=20=09=20=20=20=20=20
options:=20
=20=20=20
+ -i, --hwinit=20
+=09
+ default: ttyS0
+=20=20
-u, --physdev <uart device>
Sets which uart device that will be used by the stack
default: ttyS0
@@ -106,6 +110,8 @@
#include "bt_if.h"
#include "bt_ipa.h"
=20
+#define D(x) //x
+
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* PPPD stuff */
=20
@@ -129,13 +135,22 @@
struct peer_struct peerlist[BT_NBR_DATAPORTS];
struct ip_set ipsetlist[BT_NBR_DATAPORTS];
=20
+static unsigned char dev[20];
+static unsigned char ip_addresses[35];
+static unsigned char ms_dns1[35];
+static unsigned char ms_dns2[35];
+static unsigned char ms_wins1[35];
+static unsigned char ms_wins2[35];
+static unsigned char netmask[35];
+
static fd_set rfd;
static struct timeval tv;
=20
#define PEER(line) (peerlist[line])
+#define IPSET(line) (ipsetlist[line])
#define STATE(line) (peerlist[line].state)
=20
-char *pppd_options[32];
+static unsigned char *pppd_options[32];
=20
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* IPA stuff */
@@ -145,7 +160,7 @@
static struct ipa_msg *msg;
static unsigned char ipa_buf[256];
static int parse_ipa_response(struct ipa_msg *msg);
-static int ipa_sendrequest(int line, unsigned char bd[6],
+static int ipa_sendrequest(int line, unsigned char *bd,
unsigned short type);
#endif
=20
@@ -165,6 +180,7 @@
static char local_name[LOCAL_NAME_LENGTH+1]; /* 'friendly' name in HW modu=
le */
static int do_hwinit =3D 1; /* do vendor specific initialization */
static int do_reset =3D 0; /* reset hw using I/O pins */
+static int init_hw_speed =3D 0; /* not set */
static int modem_emul =3D 1; /* default modem emulation is enabled */
static int phys_fd =3D -1; /* physical device e.g ttyS0 */
static jmp_buf jmpbuffer; /* used to jump back in program after doing rese=
t */
@@ -189,7 +205,7 @@
static void btd_killchilds(void);
static void sighandler(int sig);
=20
-static void handle_new_connections(int bt_cfd);
+static void discover_connections(int bt_cfd);
static void build_pppdopts(int line, char **opts);
static int start_pppd(int line, char *speedstr, char **opts);
=20
@@ -210,13 +226,19 @@
}
=20=20=20
/* now parse options */
-#define OPTIONS_STRING "mnRs:u:"
+#define OPTIONS_STRING "i:m:nRs:u:"
=20=20=20
while ((opt =3D getopt_long(argc, argv, OPTIONS_STRING,
long_options, &option_index)) !=3D -1)
{
switch(opt)
{
+ case 'i':
+ /* uart device */
+ init_hw_speed =3D atoi(optarg);
+ syslog(LOG_INFO, "init_hw_speed %d baud\n", init_hw_speed);
+ break;
+
case 'm':
/* uart device */
modem_emul =3D atoi(optarg);
@@ -270,12 +292,16 @@
exit(1);
}
=20=20=20
+ /* Sets initial HW baudrate */
+ if (init_hw_speed !=3D 0)
+ fd_setup(phys_fd, init_hw_speed, 1);
+ else
init_phys(phys_fd);
=20=20=20
/* Set the current tty to the bluetooth discpline */
set_bt_line_disc(phys_fd, bt_disc, physdev);
=20=20=20
- bt_cfd =3D open(BT_CTRL_TTY, O_RDWR | O_NOCTTY);
+ bt_cfd =3D bt_openctrl();
=20=20=20
init_stack(bt_cfd, atoi(speedstr));
=20=20=20
@@ -284,24 +310,22 @@
=20=20=20
/* All initialized and ready to accept connections */
=20=20=20
- bt_waitnewconnections(bt_cfd);
- syslog(LOG_INFO, "handle_new_connections");
- handle_new_connections(bt_cfd);
+ while (1)
+ {
+ int i, waiting_iparsp =3D 0;
+ tv.tv_sec =3D 1;
+ tv.tv_usec =3D 0;
=20=20=20
FD_ZERO(&rfd);=20=20
FD_SET(ipa_fd, &rfd);
FD_SET(0, &rfd);
=20=20=20
- while (1)
- {
- int i;
- tv.tv_sec =3D 2;
- tv.tv_usec =3D 0;
result =3D select(FD_SETSIZE, &rfd, (fd_set*)0,=20
(fd_set*)0, &tv);
switch (result)
{
case 0:
+ {
/* Timeout, check for new rfcomm cons */
=20=20=20=20=20=20=20
/* Check for outstanding IPA requests */
@@ -310,38 +334,42 @@
{
if ((STATE(i) =3D=3D WAITING_PPPCONF) ||
(STATE(i) =3D=3D WAITING_RETURN_PPPCONF))
- break;=20=20
+ {
+ D(syslog(LOG_INFO, "Waiting for IPA response\n"));
+ waiting_iparsp =3D 1;
+ }
i++;
}
-=20=20=20=20=20=20
- /* If no outstanding IPA req, simply wait for new rfcomm */
- if (i =3D=3D BT_NBR_DATAPORTS)
- bt_waitnewconnections(bt_cfd);=20=20=20=20=20
=20=20=20=20=20=20=20
- handle_new_connections(bt_cfd);
+ if (waiting_iparsp)
+ break;
=20=20=20=20=20=20=20
+ discover_connections(bt_cfd);
+ }
break;
=20=20=20=20=20=20=20
case -1:
+ {=20=20
/* Error */
perror("select");
+
+ /* FIXME -- e.g if ipa server restarts !!! */
+ }
break;
=20=20=20=20=20=20=20
default:
{
/* Got data on some fd */
int i;=20=20=20=20=20=20=20=20
+=20
for (i=3D0; i < result; i++)=20
{
-=20
#ifdef USE_IPASSIGN
/* IPA response */
if (FD_ISSET(ipa_fd, &rfd))
{
msg =3D (struct ipa_msg*) ipa_buf;
-=20=20=20=20=20=20=20=20=20=20=20=20
/* Got response from IPA, if ok then start pppd or modem emul =
*/
- syslog(LOG_INFO, "IPA data\n");=20=20=20=20=20=20=20=20=20=20=
=20=20
ipa_read(ipa_fd, msg);
parse_ipa_response(msg);
}
@@ -357,41 +385,44 @@
} /* main */
=20=20
/* Checks for new connections and starts pppd/modememulator */
-static void handle_new_connections(int bt_cfd)
+static void discover_connections(int bt_cfd)
{
int line;
=20=20=20
- syslog(LOG_INFO, "handle_new_connections");
+ D(syslog(LOG_INFO, "discover_connections"));
for (line =3D 0; line < BT_NBR_DATAPORTS; line++)
{
-
if ((STATE(line) =3D=3D NOCONNECTION) &&=20
bt_isconnected(bt_cfd, line))
{
- syslog(LOG_INFO, "We got a new connection on line : %d !\n", line);
+ syslog(LOG_INFO, "Found connection on line : %d !\n", line);
STATE(line) =3D CONNECTED;
=20=20=20=20=20=20=20
read_remote_bd(bt_cfd, PEER(line).remote_bd);
print_bd_addr("remote bd ", PEER(line).remote_bd);
=20=20=20=20=20=20=20
#ifdef USE_IPASSIGN
- syslog(LOG_INFO, "Sending IPA request\n");
+ D(syslog(LOG_INFO, "Sending IPA request\n"));
+=20=20=20=20=20=20
+ PEER(line).ipset =3D &IPSET(line);
+
STATE(line) =3D WAITING_PPPCONF;
- if (ipa_sendrequest(line, PEER(line).remote_bd, IPAREQ_GETIPSET) < 0)
+ if (ipa_sendrequest(line, (unsigned char *)&PEER(line).remote_bd,=20
+ IPAREQ_GETIPSET) < 0)
{
syslog(LOG_INFO, "IPA request failed or no IPA server");
=20
/* Build without IPA anyway */
STATE(line) =3D PPPCONF_DONE;
- build_pppdopts(line, pppd_options);=20=20=20=20=20=20
- start_pppd(line, speedstr, pppd_options);=20=20=20=20=20
+ build_pppdopts(line, (char**)pppd_options);=20=20=20=20=20=20
+ start_pppd(line, speedstr, (char**)pppd_options);=20=20=20=20=20
}
else
- syslog(LOG_INFO, "IPA request sent");
+ D(syslog(LOG_INFO, "IPA request sent"));
#else
STATE(line) =3D PPPCONF_DONE;
- build_pppdopts(line, pppd_options);=20=20=20=20=20=20
- start_pppd(line, speedstr, pppd_options);=20=20=20=20=20
+ build_pppdopts(line, (char**)pppd_options);=20=20=20=20=20=20
+ start_pppd(line, speedstr, (char**)pppd_options);=20=20=20=20=20
#endif=20=20
}
}
@@ -400,35 +431,28 @@
/* only server */
void build_pppdopts(int line, char **opts)
{
-=20=20
int i=3D0;
- char dev[20];
- char ip_addresses[35];
- char ms_dns1[35];
- char ms_dns2[35];
- char ms_wins1[35];
- char ms_wins2[35];
- char netmask[35];
struct ip_set *ipset =3D PEER(line).ipset;
+ char local_ip[20];
=20=20=20
#ifdef USE_IPASSIGN
show_ipset(ipset, line);
#endif
=20=20=20
- syslog(LOG_INFO, "build_pppdopts\n");
+ D(syslog(LOG_INFO, "build_pppdopts\n"));
=20=20=20
sprintf(dev, "/dev/ttyBT%d",line);
=20=20=20
/* general options */
- pppd_options[i++] =3D (char*)PPPDCMD;
- pppd_options[i++] =3D dev;
- pppd_options[i++] =3D speedstr;
+ opts[i++] =3D (char*)PPPDCMD;
+ opts[i++] =3D dev;
+ opts[i++] =3D speedstr;
=20=20=20
/* move these to options file ? */
- pppd_options[i++] =3D "crtscts";
- pppd_options[i++] =3D "nopersist";
- pppd_options[i++] =3D "silent";
- pppd_options[i++] =3D "passive";
+ opts[i++] =3D "crtscts";
+ opts[i++] =3D "nopersist";
+ opts[i++] =3D "silent";
+ opts[i++] =3D "passive";
=20=20=20
/* check if we have used IPA */
if (ipset)
@@ -439,75 +463,80 @@
/* Use radius ? */
if (ipset->useradius)
{
- pppd_options[i++] =3D "useradius";
- pppd_options[i++] =3D "auth";
- pppd_options[i++] =3D "login";
+ opts[i++] =3D "useradius";
+ opts[i++] =3D "auth";
+ opts[i++] =3D "login";
=20=20=20=20=20=20=20
if (ipset->useradiusip)
{
- pppd_options[i++] =3D "useautoip";
+ opts[i++] =3D "useautoip";
}=20=20=20
}=20=20
else=20
{
- pppd_options[i++] =3D "noauth";
+ opts[i++] =3D "noauth";
}=20=20
=20=20=20=20=20
if (ipset->proxyarp)
{
- pppd_options[i++] =3D "proxyarp";
+ opts[i++] =3D "proxyarp";
/* ktune only works on pppd version > 2.3.10 */
/* similar as doing ' echo 1 > /proc/sys/net/ipv4/ip_forward */
- pppd_options[i++] =3D "ktune"; /* enables ip_forwarding */
+ opts[i++] =3D "ktune"; /* enables ip_forwarding */
}=20=20
=20
+ get_local_addr(local_ip);
/* local/remote ip */
- sprintf(ip_addresses, "%s:%s", get_local_addr(),=20
+ sprintf(ip_addresses, "%s:%s", local_ip,=20
inet_ntoa(ipset->ip));
=20=20=20=20=20
printf("IP used : %s\n", ip_addresses);
=20=20=20=20=20
+ opts[i++] =3D ip_addresses;
+=20=20=20=20
/* DNS */
if (ipset->nbr_of_dns > 0)
{
- /* at lease one... */
- pppd_options[i++] =3D "ms-dns";
+ /* at least one... */
+ opts[i++] =3D "ms-dns";
sprintf(ms_dns1, "%s", inet_ntoa(ipset->dns[0]));
- pppd_options[i++] =3D ms_dns1;
+ opts[i++] =3D ms_dns1;
=20=20=20=20=20=20=20
if (ipset->nbr_of_dns > 1)
{
- pppd_options[i++] =3D "ms-dns";
+ opts[i++] =3D "ms-dns";
sprintf(ms_dns2, "%s", inet_ntoa(ipset->dns[1]));
- pppd_options[i++] =3D ms_dns2;
+ opts[i++] =3D ms_dns2;
}
}
=20=20=20=20=20
/* WINS */
if (ipset->nbr_of_wins > 0)
{
- /* at lease one... */
- pppd_options[i++] =3D "ms-wins";
+ /* at least one... */
+ opts[i++] =3D "ms-wins";
sprintf(ms_wins1, "%s", inet_ntoa(ipset->wins[0]));
- pppd_options[i++] =3D ms_wins1;
+ opts[i++] =3D ms_wins1;
=20=20=20=20=20=20=20
if (ipset->nbr_of_wins > 1)
{
- pppd_options[i++] =3D "ms-wins";
- sprintf(ms_dns2, "%s", inet_ntoa(ipset->wins[1]));
- pppd_options[i++] =3D ms_wins2;
+ opts[i++] =3D "ms-wins";
+ sprintf(ms_wins2, "%s", inet_ntoa(ipset->wins[1]));
+ opts[i++] =3D ms_wins2;
}
}
=20=20=20=20=20
/* Netmask */=20=20=20=20=20=20
- pppd_options[i++] =3D "netmask";
+ opts[i++] =3D "netmask";
sprintf(netmask, "%s", inet_ntoa(ipset->netmask));
- pppd_options[i++] =3D netmask;
+ opts[i++] =3D netmask;
}
else
{
- /* local ip */
- sprintf(ip_addresses, "%s:", get_local_addr());
+ get_local_addr(local_ip);
+=20=20=20=20
+ /* local IP */
+ sprintf(ip_addresses, "%s:", local_ip);
=20=20=20=20=20
/* Use /etc/ppp/options file for remote ppp settings.
IPA is needed for correct multipoint setting or use a=20
@@ -515,26 +544,28 @@
options.ttyBT1 which contains the remote IP address,=20
dns, wins etc*/
=20=20=20=20=20
- syslog(LOG_INFO, "WARNING NO REMOTE IP SET, only local %s\n",=20
+ syslog(LOG_INFO, "WARNING No remote ip addr set, only local %s",=20
ip_addresses);
- printf("WARNING NO REMOTE IP SET, only local %s\n", ip_addresses);
=20
+ opts[i++] =3D ip_addresses;
+
/* always do proxyarp */=20
- pppd_options[i++] =3D "proxyarp";
+ opts[i++] =3D "proxyarp";
=20
/* ktune only works on pppd version > 2.3.10 */
/* similar as doing ' echo 1 > /proc/sys/net/ipv4/ip_forward */
- pppd_options[i++] =3D "ktune"; /* enables ip_forwarding */
- }
+ opts[i++] =3D "ktune"; /* enables ip_forwarding */
=20=20=20
- pppd_options[i] =3D NULL;
+ } /* end -- no ipa */
=20=20=20
-#if 1
+ opts[i] =3D NULL;
+=20=20
+#if 0
/* print pppd_options */
i =3D 0;
syslog(LOG_INFO, "pppd options used :");
- while (pppd_options[i])
- syslog(LOG_INFO, "%s", pppd_options[i++]);
+ while (opts[i])
+ syslog(LOG_INFO, "%s", opts[i++]);
#endif
}
=20
@@ -543,18 +574,16 @@
char dev[20];
=20=20=20
sprintf(dev, "/dev/ttyBT%d",line);
- printf("start_pppd on %s at %s baud\n", dev, speedstr);
=20=20=20
/* check state */
if (STATE(line) !=3D PPPCONF_DONE)
{
- syslog(LOG_INFO, "Warning : ppp config not done!!!\n");
+ syslog(LOG_INFO, "Warning : ppp config not done (%d)\n", STATE(line));
return -1;
}
=20=20=20
if (PEER(line).do_modememul)=20
{
- printf("Starting modem emulator...\n");
STATE(line) =3D MODEM_STARTED;
=20=20=20=20=20
/* run modem emulator in a child */
@@ -565,9 +594,9 @@
/* replace first arg with MODEMEMULCMD (is handled by=20
modem emulator) */
=20=20=20=20=20=20=20
- pppd_options[0]=3D (char*)MODEMEMULCMD;=20=20=20=20=20=20
+ opts[0]=3D (char*)MODEMEMULCMD;
=20=20=20=20=20=20=20
- execvp(MODEMEMULCMD, pppd_options);
+ execvp(MODEMEMULCMD, opts);
=20=20=20=20=20=20=20
fprintf(stderr, "%s: no such file or directory\n", MODEMEMULCMD);
=20=20=20=20=20=20=20
@@ -578,14 +607,13 @@
}
else
{
- printf("Starting pppd...\n");
STATE(line) =3D PPPD_STARTED;
if (!(PEER(line).pppd_pid =3D vfork()))
{
syslog(LOG_INFO, "Starting pppd on %s", dev);
=20=20=20=20=20=20=20
- /* FIXME -- use opts inparam and not static pppd_options */
- execvp(PPPDCMD, pppd_options);
+ /* FIXME -- use opts inparam and not static opts */
+ execvp(PPPDCMD, opts);
=20=20=20=20=20=20=20
fprintf(stderr, "%s: no such file or directory\n", PPPDCMD);
=20=20=20=20=20=20=20
@@ -617,7 +645,7 @@
static void
sighandler(int sig)
{
- printf("Sighandler : %d\n", sig);
+ syslog(LOG_INFO, "Sighandler got signal : %d\n", sig);
=20=20=20
if (sig =3D=3D SIGUSR1)
{
@@ -629,9 +657,16 @@
{=20=20=20=20
/* Close down phys dev, run hw_upgrade and restart btd */
btd_cleanup();
- /* execvp(hw_upgrade_prog) */
+=20
+ /* FIXME -- execvp(hw_upgrade_prog) */
+=20=20=20=20
longjmp(jmpbuffer, 1);
}
+ else if (sig =3D=3D SIGTERM) /* ? */
+ {=20
+ syslog(LOG_INFO, "Got SIGTERM, now exiting");
+ exit(0);
+ }
else if (sig =3D=3D SIGCHLD)=20=20
{
int line =3D 0, pid, status;
@@ -665,18 +700,21 @@
syslog(LOG_INFO, "PPP line %d was shutdown\n", line);
=20=20=20=20=20
#ifdef USE_IPASSIGN
- /* FIXME -- Now release IPA settings */
- if (ipa_sendrequest(line, PEER(line).remote_bd, IPAREQ_RELEASEIPSET) <=
0)
+ STATE(line) =3D WAITING_RETURN_PPPCONF;
+
+ if (ipa_sendrequest(line, (unsigned char *)&PEER(line).remote_bd,=20
+ IPAREQ_RELEASEIPSET) < 0)
{
syslog(LOG_INFO, "IPA request failed or no IPA server");
- /* check if still connected first ? */
+ /* put peer into state NOCONNECTION, if still connected this
+ will be discovered in timout */
STATE(line) =3D NOCONNECTION;=20=20=20=20
}=20=20=20=20
#else
- /* check if still connected first ? */
STATE(line) =3D NOCONNECTION;=20=20=20=20
#endif
=20=20=20=20=20
+ PEER(line).ipset =3D NULL;
PEER(line).pppd_pid =3D -1;
=20=20=20=20=20
return;
@@ -691,6 +729,7 @@
static void init()
{=20
int i;
+
btd_pid =3D write_pidfile(PID_FILE);=20=20
init_sighandler();
=20=20=20
@@ -714,6 +753,7 @@
if (ipa_fd < 0)
{
printf("Found no IPA server\n");
+ exit(1);=20
}
#endif
=20=20=20
@@ -762,7 +802,6 @@
printf("btd_killchilds\n");
if (sdpsrv_pid > 0)
{
- printf("btd_killchilds SDP server\n");
syslog(LOG_INFO, "Killing SDP server\n");
kill(sdpsrv_pid, SIGTERM);
=20=20=20=20=20
@@ -777,7 +816,6 @@
{
if (STATE(line) =3D=3D PPPD_STARTED)
{
- printf("btd_killchilds PPP server on line %d\n", line);
syslog(LOG_INFO, "Killing pppd on line %d\n", line);
kill(PEER(line).pppd_pid, SIGTERM);
if (waitpid(PEER(line).pppd_pid, NULL, 0) < 0)
@@ -792,20 +830,20 @@
=20
#ifdef USE_IPASSIGN
=20
-static int ipa_sendrequest(int line, unsigned char bd[6], unsigned short t=
ype)
+static int ipa_sendrequest(int line, unsigned char *bd, unsigned short typ=
e)
{
unsigned char buf[IPA_MSG_MAXSIZE];
struct ipa_msg *msg;
struct ipa_request *req;
=20=20=20
- printf("ipa_request : type %d\n", type);
+ D(syslog(LOG_INFO, "ipa_request : type %d\n", type));
=20=20=20
msg =3D (struct ipa_msg*)buf;
msg->type =3D type;
msg->len =3D sizeof(struct ipa_request);
req =3D (struct ipa_request*)msg->msg;
req->id =3D line;
- memcpy(&req->remote_bd, &bd, 6);=20
+ memcpy(&req->remote_bd, bd, 6);=20
return ipa_write(ipa_fd, msg);
}
=20
@@ -816,20 +854,28 @@
case IPARSP_STATUS:
{
ipa_status *rsp =3D (struct ipa_status*)(msg->msg);
- syslog(LOG_INFO, "ipa_parse_msg : got status %d on line\n",=20
- rsp->status, rsp->id);=20=20
+ D(syslog(LOG_INFO, "ipa_parse_msg : got status %d on line\n",=20
+ rsp->status, rsp->id));
=20=20=20=20=20=20=20
/* Check status */
if (rsp->status =3D=3D IPA_STATUSFAILED)
- printf("parse_ipa_response : request failed [line:%d]\n", rsp->id);
+ syslog(LOG_INFO, "parse_ipa_response : request failed [line:%d]\n"=
,=20
+ rsp->id);
+ else
+ D(syslog(LOG_INFO, "parse_ipa_response : request succeeded [line:%d]\n", =
rsp->id));
=20=20=20=20=20=20=20
+ /* put peer into NOCONNECTION, if still connected this will=20
+ be discovered from timeout */
+
+ STATE(rsp->id) =3D NOCONNECTION;
+
return rsp->status;
}
=20=20=20=20=20
case IPARSP_PEERSETTINGS:
{
ipa_response* rsp =3D (struct ipa_response*)(msg->msg);
- syslog(LOG_INFO, "ipa_parse_msg : got client settings\n");=20=20=20=
=20=20=20
+ D(syslog(LOG_INFO, "ipa_parse_msg : got client settings\n"));
=20=20=20=20=20=20=20
/* Check status */
if (rsp->status =3D=3D IPA_STATUSFAILED)
@@ -842,12 +888,17 @@
/* Store ipa settings in peer struct */
memcpy(PEER(rsp->id).ipset, &rsp->set, msg->len);
=20=20=20=20=20=20=20
- /* print settings ! */
- show_ipset(PEER(rsp->id).ipset, rsp->id);
+ /* Now proceed to next state */
+ if (PEER(rsp->id).state =3D=3D WAITING_PPPCONF)
+ {
+ PEER(rsp->id).state =3D PPPCONF_DONE;
+ }=20=20=20=20=20=20
+ else
+ syslog(LOG_INFO, "Warning : Wrong state on line %d, should have been WAIT=
ING_PPPCONF", rsp->id);
=20=20=20=20=20=20=20
/* Build options and start ppp */
- build_pppdopts(rsp->id, pppd_options);
- start_pppd(rsp->id, speedstr, pppd_options);
+ build_pppdopts(rsp->id, (char**)pppd_options);
+ start_pppd(rsp->id, speedstr, (char**)pppd_options);
return 0;
}=20
=20=20=20=20=20
|