diff options
author | brian <brian@FreeBSD.org> | 1999-08-17 17:22:46 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-08-17 17:22:46 +0000 |
commit | 69ab84d0b3235628f1a0921b3208fcee2f13c1ea (patch) | |
tree | cc2c2d7ee69dc3570f75879e36d93e0a21fce566 /usr.sbin/ppp/command.c | |
parent | b5a42c5efbe05b3f948f1810d95c2ff049d841fd (diff) | |
download | FreeBSD-src-69ab84d0b3235628f1a0921b3208fcee2f13c1ea.zip FreeBSD-src-69ab84d0b3235628f1a0921b3208fcee2f13c1ea.tar.gz |
Implement a minimum idle time value as an optional second argument
to ``set timeout''.
This is useful for situations where your minimum call charge is (say)
5 minutes (like mine is)
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r-- | usr.sbin/ppp/command.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 6c37b10..1a9008e 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.205 1999/08/05 10:32:09 brian Exp $ + * $Id: command.c,v 1.206 1999/08/17 14:59:05 brian Exp $ * */ #include <sys/param.h> @@ -144,7 +144,7 @@ #define NEG_VJCOMP 53 const char Version[] = "2.23"; -const char VersionDate[] = "$Date: 1999/08/05 10:32:09 $"; +const char VersionDate[] = "$Date: 1999/08/17 14:59:05 $"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); @@ -1605,10 +1605,17 @@ SetVariable(struct cmdargs const *arg) break; case VAR_IDLETIMEOUT: - if (arg->argc > arg->argn+1) + if (arg->argc > arg->argn+2) err = "Too many idle timeout values\n"; - else if (arg->argc == arg->argn+1) - bundle_SetIdleTimer(arg->bundle, atoi(argp)); + else if (arg->argc == arg->argn) + err = "Too few idle timeout values\n"; + else { + int timeout, min; + + timeout = atoi(argp); + min = arg->argc == arg->argn + 2 ? atoi(arg->argv[arg->argn + 1]) : -1; + bundle_SetIdleTimer(arg->bundle, timeout, min); + } if (err) log_Printf(LogWARN, err); break; |