summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/command.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-02-16 00:16:56 +0000
committerbrian <brian@FreeBSD.org>1999-02-16 00:16:56 +0000
commit08a4aed34d2e22f624880ea97ae63faabf7b2b11 (patch)
tree4211103ce551e45ebed22c49672a1e796e9946f4 /usr.sbin/ppp/command.c
parent40ead2b843c4d46a6088c16b62c9f07c3563fab9 (diff)
downloadFreeBSD-src-08a4aed34d2e22f624880ea97ae63faabf7b2b11.zip
FreeBSD-src-08a4aed34d2e22f624880ea97ae63faabf7b2b11.tar.gz
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....
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r--usr.sbin/ppp/command.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 00486af..e53ab98 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 <sys/param.h>
@@ -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,
OpenPOWER on IntegriCloud