From 6b4286e0f546e248c78cebda8bb680bf51b26ca0 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Tue, 16 Feb 1999 00:16:56 +0000 Subject: Wait by default for one second after the login script is complete before checking carrier. If it's there, the device supports carrier. If it's not it doesn't. Add the ``set cd'' command for deciding how soon to check for carrier, and for deciding if carrier is REQUIRED. The default has changed: Pre 2.0 versions of ppp waited for 1 second. Version 2 didn't wait, but this causes problems with some (few?) modems that don't assert carrier immediately on reporting CONNECT. The one second delay is back now and can be removed with ``set cd 0''. Bump the ppp version number in case this needs to be changed again.... --- usr.sbin/ppp/command.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'usr.sbin/ppp/command.c') diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 00486af68625..e53ab98a1516 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.179 1999/01/28 09:40:15 brian Exp $ + * $Id: command.c,v 1.180 1999/02/11 10:14:07 brian Exp $ * */ #include @@ -119,6 +119,7 @@ #define VAR_SENDPIPE 27 #define VAR_RECVPIPE 28 #define VAR_RADIUS 29 +#define VAR_CD 30 /* ``accept|deny|disable|enable'' masks */ #define NEG_HISMASK (1) @@ -137,8 +138,8 @@ #define NEG_VJCOMP 49 #define NEG_DNS 50 -const char Version[] = "2.1"; -const char VersionDate[] = "$Date: 1999/01/28 09:40:15 $"; +const char Version[] = "2.11"; +const char VersionDate[] = "$Date: 1999/02/11 10:14:07 $"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); @@ -1711,6 +1712,19 @@ SetVariable(struct cmdargs const *arg) } break; #endif + + case VAR_CD: + if (*argp) { + long_val = atol(argp); + if (long_val < 0) + long_val = 0; + cx->physical->cfg.cd.delay = long_val; + cx->physical->cfg.cd.required = argp[strlen(argp)-1] == '!'; + } else { + cx->physical->cfg.cd.delay = DEF_CDDELAY; + cx->physical->cfg.cd.required = 0; + } + break; } return err ? 1 : 0; @@ -1749,6 +1763,8 @@ static struct cmdtab const SetCommands[] = { (const void *)VAR_CBCP}, {"ccpretry", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX_OPT, "FSM retry period", "set ccpretry value", (const void *)VAR_CCPRETRY}, + {"cd", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, "Carrier delay requirement", + "set cd value[!]", (const void *)VAR_CD}, {"chapretry", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, "CHAP retry period", "set chapretry value", (const void *)VAR_CHAPRETRY}, {"choked", NULL, SetVariable, LOCAL_AUTH, -- cgit v1.3