Deleted Added
full compact
command.c (29696) command.c (29840)
1/*
2 * PPP User command processing module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
1/*
2 * PPP User command processing module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * $Id: command.c,v 1.83 1997/09/21 13:07:57 brian Exp $
20 * $Id: command.c,v 1.84 1997/09/22 00:46:51 brian Exp $
21 *
22 */
23#include <sys/types.h>
24#include <sys/stat.h>
25#include <ctype.h>
26#include <termios.h>
27#include <sys/wait.h>
28#include <time.h>

--- 433 unchanged lines hidden (view full) ---

462
463static int
464ShowAuthKey()
465{
466 if (!VarTerm)
467 return 0;
468 fprintf(VarTerm, "AuthName = %s\n", VarAuthName);
469 fprintf(VarTerm, "AuthKey = %s\n", VarAuthKey);
21 *
22 */
23#include <sys/types.h>
24#include <sys/stat.h>
25#include <ctype.h>
26#include <termios.h>
27#include <sys/wait.h>
28#include <time.h>

--- 433 unchanged lines hidden (view full) ---

462
463static int
464ShowAuthKey()
465{
466 if (!VarTerm)
467 return 0;
468 fprintf(VarTerm, "AuthName = %s\n", VarAuthName);
469 fprintf(VarTerm, "AuthKey = %s\n", VarAuthKey);
470 fprintf(VarTerm, "Encrypt = %s\n", VarEncMD4 ? "MD4" : "MD5" );
470#ifdef HAVE_DES
471 fprintf(VarTerm, "Encrypt = %s\n", VarMSChap ? "MSChap" : "MD5" );
472#endif
471 return 1;
472}
473
474static int
475ShowVersion()
476{
477 extern char VarVersion[];
478 extern char VarLocalVersion[];

--- 761 unchanged lines hidden (view full) ---

1240 VarPhoneList[sizeof(VarPhoneList) - 1] = '\0';
1241 strcpy(VarPhoneCopy, VarPhoneList);
1242 VarNextPhone = VarPhoneCopy;
1243 break;
1244 case VAR_HANGUP:
1245 strncpy(VarHangupScript, arg, sizeof(VarHangupScript) - 1);
1246 VarHangupScript[sizeof(VarHangupScript) - 1] = '\0';
1247 break;
473 return 1;
474}
475
476static int
477ShowVersion()
478{
479 extern char VarVersion[];
480 extern char VarLocalVersion[];

--- 761 unchanged lines hidden (view full) ---

1242 VarPhoneList[sizeof(VarPhoneList) - 1] = '\0';
1243 strcpy(VarPhoneCopy, VarPhoneList);
1244 VarNextPhone = VarPhoneCopy;
1245 break;
1246 case VAR_HANGUP:
1247 strncpy(VarHangupScript, arg, sizeof(VarHangupScript) - 1);
1248 VarHangupScript[sizeof(VarHangupScript) - 1] = '\0';
1249 break;
1250#ifdef HAVE_DES
1248 case VAR_ENC:
1251 case VAR_ENC:
1249 VarEncMD4 = !strcasecmp(arg, "md4");
1252 VarMSChap = !strcasecmp(arg, "mschap");
1250 break;
1253 break;
1254#endif
1251 }
1252 return 0;
1253}
1254
1255static int
1256SetCtsRts(struct cmdtab const * list, int argc, char **argv)
1257{
1258 if (argc > 0) {

--- 38 unchanged lines hidden (view full) ---

1297 {"ctsrts", NULL, SetCtsRts, LOCAL_AUTH,
1298 "Use CTS/RTS modem signalling", "set ctsrts [on|off]"},
1299 {"device", "line", SetVariable, LOCAL_AUTH,
1300 "Set modem device name", "set device|line device-name", (void *) VAR_DEVICE},
1301 {"dfilter", NULL, SetDfilter, LOCAL_AUTH,
1302 "Set demand filter", "set dfilter ..."},
1303 {"dial", NULL, SetVariable, LOCAL_AUTH,
1304 "Set dialing script", "set dial chat-script", (void *) VAR_DIAL},
1255 }
1256 return 0;
1257}
1258
1259static int
1260SetCtsRts(struct cmdtab const * list, int argc, char **argv)
1261{
1262 if (argc > 0) {

--- 38 unchanged lines hidden (view full) ---

1301 {"ctsrts", NULL, SetCtsRts, LOCAL_AUTH,
1302 "Use CTS/RTS modem signalling", "set ctsrts [on|off]"},
1303 {"device", "line", SetVariable, LOCAL_AUTH,
1304 "Set modem device name", "set device|line device-name", (void *) VAR_DEVICE},
1305 {"dfilter", NULL, SetDfilter, LOCAL_AUTH,
1306 "Set demand filter", "set dfilter ..."},
1307 {"dial", NULL, SetVariable, LOCAL_AUTH,
1308 "Set dialing script", "set dial chat-script", (void *) VAR_DIAL},
1309#ifdef HAVE_DES
1305 {"encrypt", NULL, SetVariable, LOCAL_AUTH,
1310 {"encrypt", NULL, SetVariable, LOCAL_AUTH,
1306 "Set CHAP encryption algorithm", "set encrypt MD4|MD5", (void *) VAR_ENC},
1311 "Set CHAP encryption algorithm", "set encrypt MSChap|MD5", (void *) VAR_ENC},
1312#endif
1307 {"escape", NULL, SetEscape, LOCAL_AUTH,
1308 "Set escape characters", "set escape hex-digit ..."},
1309 {"hangup", NULL, SetVariable, LOCAL_AUTH,
1310 "Set hangup script", "set hangup chat-script", (void *) VAR_HANGUP},
1311 {"ifaddr", NULL, SetInterfaceAddr, LOCAL_AUTH,
1312 "Set destination address", "set ifaddr [src-addr [dst-addr [netmask [trg-addr]]]]"},
1313 {"ifilter", NULL, SetIfilter, LOCAL_AUTH,
1314 "Set input filter", "set ifilter ..."},

--- 202 unchanged lines hidden ---
1313 {"escape", NULL, SetEscape, LOCAL_AUTH,
1314 "Set escape characters", "set escape hex-digit ..."},
1315 {"hangup", NULL, SetVariable, LOCAL_AUTH,
1316 "Set hangup script", "set hangup chat-script", (void *) VAR_HANGUP},
1317 {"ifaddr", NULL, SetInterfaceAddr, LOCAL_AUTH,
1318 "Set destination address", "set ifaddr [src-addr [dst-addr [netmask [trg-addr]]]]"},
1319 {"ifilter", NULL, SetIfilter, LOCAL_AUTH,
1320 "Set input filter", "set ifilter ..."},

--- 202 unchanged lines hidden ---