Deleted Added
full compact
command.c (26321) command.c (26326)
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.51 1997/05/29 02:29:12 brian Exp $
20 * $Id: command.c,v 1.52 1997/05/31 16:37:19 brian Exp $
21 *
22 */
23#include <sys/types.h>
24#include <ctype.h>
25#include <termios.h>
26#include <sys/wait.h>
27#include <time.h>
28#include <netdb.h>

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

367}
368
369static int ShowLogList()
370{
371 ListLog();
372 return(1);
373}
374
21 *
22 */
23#include <sys/types.h>
24#include <ctype.h>
25#include <termios.h>
26#include <sys/wait.h>
27#include <time.h>
28#include <netdb.h>

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

367}
368
369static int ShowLogList()
370{
371 ListLog();
372 return(1);
373}
374
375static int ShowInitialMRU()
376{
377 printf(" Initial MRU: %ld\n", VarMRU);
378 return(1);
379}
380
381static int ShowPreferredMTU()
382{
383 if (VarPrefMTU)
384 printf(" Preferred MTU: %ld\n", VarPrefMTU);
385 else
386 printf(" Preferred MTU: unspecified\n");
387 return(1);
388}
389
375static int ShowReconnect()
376{
377 printf(" Reconnect Timer: %d, %d tries\n",
378 VarReconnectTimer, VarReconnectTries);
379 return(1);
380}
381
382static int ShowRedial()

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

446 { "lcp", NULL, ReportLcpStatus, LOCAL_AUTH,
447 "Show LCP status", StrNull},
448 { "log", NULL, ShowLogList, LOCAL_AUTH,
449 "Show log records", StrNull},
450 { "mem", NULL, ShowMemMap, LOCAL_AUTH,
451 "Show memory map", StrNull},
452 { "modem", NULL, ShowModemStatus, LOCAL_AUTH,
453 "Show modem setups", StrNull},
390static int ShowReconnect()
391{
392 printf(" Reconnect Timer: %d, %d tries\n",
393 VarReconnectTimer, VarReconnectTries);
394 return(1);
395}
396
397static int ShowRedial()

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

461 { "lcp", NULL, ReportLcpStatus, LOCAL_AUTH,
462 "Show LCP status", StrNull},
463 { "log", NULL, ShowLogList, LOCAL_AUTH,
464 "Show log records", StrNull},
465 { "mem", NULL, ShowMemMap, LOCAL_AUTH,
466 "Show memory map", StrNull},
467 { "modem", NULL, ShowModemStatus, LOCAL_AUTH,
468 "Show modem setups", StrNull},
469 { "mru", NULL, ShowInitialMRU, LOCAL_AUTH,
470 "Show Initial MRU", StrNull},
471 { "mtu", NULL, ShowPreferredMTU, LOCAL_AUTH,
472 "Show Preferred MTU", StrNull},
454 { "ofilter", NULL, ShowOfilter, LOCAL_AUTH,
455 "Show Output filters", StrOption},
456 { "proto", NULL, ReportProtStatus, LOCAL_AUTH,
457 "Show protocol summary", StrNull},
458 { "reconnect",NULL, ShowReconnect, LOCAL_AUTH,
459 "Show Reconnect timer,tries", StrNull},
460 { "redial", NULL, ShowRedial, LOCAL_AUTH,
461 "Show Redial timeout value", StrNull},

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

829}
830
831static int
832SetInitialMRU(list, argc, argv)
833struct cmdtab *list;
834int argc;
835char **argv;
836{
473 { "ofilter", NULL, ShowOfilter, LOCAL_AUTH,
474 "Show Output filters", StrOption},
475 { "proto", NULL, ReportProtStatus, LOCAL_AUTH,
476 "Show protocol summary", StrNull},
477 { "reconnect",NULL, ShowReconnect, LOCAL_AUTH,
478 "Show Reconnect timer,tries", StrNull},
479 { "redial", NULL, ShowRedial, LOCAL_AUTH,
480 "Show Redial timeout value", StrNull},

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

848}
849
850static int
851SetInitialMRU(list, argc, argv)
852struct cmdtab *list;
853int argc;
854char **argv;
855{
837 int mru;
856 long mru;
838
839 if (argc > 0) {
857
858 if (argc > 0) {
840 mru = atoi(*argv);
841 if (mru < 100)
842 printf("given value is too small.\n");
859 mru = atol(*argv);
860 if (mru < MIN_MRU)
861 printf("Given MRU value (%ld) is too small.\n", mru);
843 else if (mru > MAX_MRU)
862 else if (mru > MAX_MRU)
844 printf("given value is too big.\n");
863 printf("Given MRU value (%ld) is too big.\n", mru);
845 else
846 VarMRU = mru;
864 else
865 VarMRU = mru;
847 }
866 } else
867 printf("Usage: %s %s\n", list->name, list->syntax);
868
848 return(1);
849}
850
851static int
869 return(1);
870}
871
872static int
873SetPreferredMTU(list, argc, argv)
874struct cmdtab *list;
875int argc;
876char **argv;
877{
878 long mtu;
879
880 if (argc > 0) {
881 mtu = atol(*argv);
882 if (mtu == 0)
883 VarPrefMTU = 0;
884 else if (mtu < MIN_MTU)
885 printf("Given MTU value (%ld) is too small.\n", mtu);
886 else if (mtu > MAX_MTU)
887 printf("Given MTU value (%ld) is too big.\n", mtu);
888 else
889 VarPrefMTU = mtu;
890 } else
891 printf("Usage: %s %s\n", list->name, list->syntax);
892
893 return(1);
894}
895
896static int
852SetIdleTimeout(list, argc, argv)
853struct cmdtab *list;
854int argc;
855char **argv;
856{
857 if (argc-- > 0) {
858 VarIdleTimeout = atoi(*argv++);
859 if (argc-- > 0) {

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

1112 { "ifaddr", NULL, SetInterfaceAddr, LOCAL_AUTH,
1113 "Set destination address", "[src-addr [dst-addr [netmask [trg-addr]]]]"},
1114 { "ifilter", NULL, SetIfilter, LOCAL_AUTH,
1115 "Set input filter", "..."},
1116 { "login", NULL, SetVariable, LOCAL_AUTH,
1117 "Set login script", StrChatStr, (void *)VAR_LOGIN },
1118 { "mru", NULL, SetInitialMRU, LOCAL_AUTH,
1119 "Set Initial MRU value", StrValue },
897SetIdleTimeout(list, argc, argv)
898struct cmdtab *list;
899int argc;
900char **argv;
901{
902 if (argc-- > 0) {
903 VarIdleTimeout = atoi(*argv++);
904 if (argc-- > 0) {

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

1157 { "ifaddr", NULL, SetInterfaceAddr, LOCAL_AUTH,
1158 "Set destination address", "[src-addr [dst-addr [netmask [trg-addr]]]]"},
1159 { "ifilter", NULL, SetIfilter, LOCAL_AUTH,
1160 "Set input filter", "..."},
1161 { "login", NULL, SetVariable, LOCAL_AUTH,
1162 "Set login script", StrChatStr, (void *)VAR_LOGIN },
1163 { "mru", NULL, SetInitialMRU, LOCAL_AUTH,
1164 "Set Initial MRU value", StrValue },
1165 { "mtu", NULL, SetPreferredMTU, LOCAL_AUTH,
1166 "Set Preferred MTU value", StrValue },
1120 { "ofilter", NULL, SetOfilter, LOCAL_AUTH,
1121 "Set output filter", "..." },
1122 { "openmode", NULL, SetOpenMode, LOCAL_AUTH,
1123 "Set open mode", "[active|passive]"},
1124 { "parity", NULL, SetModemParity, LOCAL_AUTH,
1125 "Set modem parity", "[odd|even|none]"},
1126 { "phone", NULL, SetVariable, LOCAL_AUTH,
1127 "Set telephone number(s)", "phone1[:phone2[...]]", (void *)VAR_PHONE },

--- 185 unchanged lines hidden ---
1167 { "ofilter", NULL, SetOfilter, LOCAL_AUTH,
1168 "Set output filter", "..." },
1169 { "openmode", NULL, SetOpenMode, LOCAL_AUTH,
1170 "Set open mode", "[active|passive]"},
1171 { "parity", NULL, SetModemParity, LOCAL_AUTH,
1172 "Set modem parity", "[odd|even|none]"},
1173 { "phone", NULL, SetVariable, LOCAL_AUTH,
1174 "Set telephone number(s)", "phone1[:phone2[...]]", (void *)VAR_PHONE },

--- 185 unchanged lines hidden ---