summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/command.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1997-06-25 19:30:05 +0000
committerBrian Somers <brian@FreeBSD.org>1997-06-25 19:30:05 +0000
commit4ef16f24f2988b98735ee55ba3927d36f15650a9 (patch)
tree4675a74c5f5ad74977f1f25afc5fd4a4892ac845 /usr.sbin/ppp/command.c
parent7a1d27b301b474c49539a3d679cdc15729636510 (diff)
downloadsrc-test2-4ef16f24f2988b98735ee55ba3927d36f15650a9.tar.gz
src-test2-4ef16f24f2988b98735ee55ba3927d36f15650a9.zip
Notes
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r--usr.sbin/ppp/command.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index b9ffcfc65cd5..51b2191b33db 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.61 1997/06/23 23:10:07 brian Exp $
+ * $Id: command.c,v 1.62 1997/06/25 02:04:35 brian Exp $
*
*/
#include <sys/types.h>
@@ -49,6 +49,7 @@
#include "chat.h"
#include "os.h"
#include "timeout.h"
+#include "server.h"
extern void Cleanup(), TtyTermMode(), PacketMode();
extern int EnableCommand(), DisableCommand(), DisplayCommand();
@@ -843,6 +844,27 @@ char **argv;
}
static int
+SetServer(list, argc, argv)
+struct cmdtab *list;
+int argc;
+char **argv;
+{
+ int res = -1;
+
+ if (argc == 1)
+ if (strcasecmp(argv[0], "none") == 0) {
+ ServerClose();
+ LogPrintf(LogPHASE, "Disabling server port.\n");
+ res = 0;
+ } else if (*argv[0] == '/')
+ res = ServerLocalOpen(argv[0]);
+ else if (strspn(argv[0], "0123456789") == strlen(argv[0]))
+ res = ServerTcpOpen(atoi(argv[0]));
+
+ return res;
+}
+
+static int
SetModemParity(list, argc, argv)
struct cmdtab *list;
int argc;
@@ -1245,6 +1267,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]"},
+ { "server", "socket", SetServer, LOCAL_AUTH,
+ "Set server port", "set server|socket TcpPort|LocalName|none"},
{ "speed", NULL, SetModemSpeed, LOCAL_AUTH,
"Set modem speed", "set speed value"},
{ "timeout", NULL, SetIdleTimeout, LOCAL_AUTH,