summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/command.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-08-17 20:45:50 +0000
committerbrian <brian@FreeBSD.org>1997-08-17 20:45:50 +0000
commit48abae6115c5ac6fba0407b546d3c6e31e7f4192 (patch)
treebfaa38bde7ce619383c5ebf2b70cf87cca128280 /usr.sbin/ppp/command.c
parent6f340c20e5d94d59afcee4b5d8fbc86d25acd2dd (diff)
downloadFreeBSD-src-48abae6115c5ac6fba0407b546d3c6e31e7f4192.zip
FreeBSD-src-48abae6115c5ac6fba0407b546d3c6e31e7f4192.tar.gz
Allow the use of a "stopped" timeout via the
"set stopped" directive. If the timeout occurs it will cause a "Down" event, hanging up the line if it's still up. This *isn't* part of the FSM diagram, but I consider it ok as a "higher level implementation specific timeout" as specified in the rfc ;-} Discussed briefly with: joerg
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r--usr.sbin/ppp/command.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 23125bae..223a326 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.66 1997/07/12 19:22:34 brian Exp $
+ * $Id: command.c,v 1.67 1997/07/14 01:41:26 brian Exp $
*
*/
#include <sys/types.h>
@@ -383,6 +383,17 @@ static int ShowTimeout()
return 1;
}
+static int ShowStopped()
+{
+ if (!VarTerm)
+ return 0;
+ if (!VarStoppedTimeout)
+ fprintf(VarTerm, " Stopped Timer: Disabled\n");
+ else
+ fprintf(VarTerm, " Stopped Timer: %d secs\n", VarStoppedTimeout);
+ return 1;
+}
+
static int ShowAuthKey()
{
if (!VarTerm)
@@ -520,6 +531,8 @@ struct cmdtab const ShowCommands[] = {
"Show routing table", "show route"},
{ "timeout", NULL, ShowTimeout, LOCAL_AUTH,
"Show Idle timeout value", "show timeout"},
+ { "stopped", NULL, ShowStopped, LOCAL_AUTH,
+ "Show STOPPED timeout value", "show stopped"},
#ifndef NOMSEXT
{ "msext", NULL, ShowMSExt, LOCAL_AUTH,
"Show MS PPP extentions", "show msext"},
@@ -841,6 +854,19 @@ char **argv;
}
static int
+SetStoppedTimeout(list, argc, argv)
+struct cmdtab *list;
+int argc;
+char **argv;
+{
+ if (argc == 1) {
+ VarStoppedTimeout = atoi(argv[0]);
+ return 0;
+ }
+ return -1;
+}
+
+static int
SetServer(list, argc, argv)
struct cmdtab *list;
int argc;
@@ -1290,6 +1316,8 @@ struct cmdtab const SetCommands[] = {
"Set Reconnect timeout", "set reconnect value ntries"},
{ "redial", NULL, SetRedialTimeout, LOCAL_AUTH,
"Set Redial timeout", "set redial value|random[.value|random] [dial_attempts]"},
+ { "stopped", NULL, SetStoppedTimeout, LOCAL_AUTH,
+ "Set STOPPED timeout", "set stopped value"},
{ "server", "socket", SetServer, LOCAL_AUTH,
"Set server port", "set server|socket TcpPort|LocalName|none [mask]"},
{ "speed", NULL, SetModemSpeed, LOCAL_AUTH,
OpenPOWER on IntegriCloud