command.c (18531) | command.c (18752) |
---|---|
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.18 1996/06/09 20:40:58 ache Exp $ | 20 * $Id: command.c,v 1.19 1996/09/28 11:25:47 bde 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 "fsm.h" --- 327 unchanged lines hidden (view full) --- 356 if (VarDialTries) 357 printf("%d dial tries", VarDialTries); 358 359 printf("\n"); 360 361 return(1); 362} 363 | 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 "fsm.h" --- 327 unchanged lines hidden (view full) --- 356 if (VarDialTries) 357 printf("%d dial tries", VarDialTries); 358 359 printf("\n"); 360 361 return(1); 362} 363 |
364#ifdef MSEXT 365static int ShowMSExt() 366{ 367 printf(" MS PPP extention values \n" ); 368 printf(" Primary NS : %s\n", inet_ntoa( ns_entries[0] )); 369 printf(" Secondary NS : %s\n", inet_ntoa( ns_entries[1] )); 370 printf(" Primary NBNS : %s\n", inet_ntoa( nbns_entries[0] )); 371 printf(" Secondary NBNS : %s\n", inet_ntoa( nbns_entries[1] )); |
|
364 | 372 |
373 return(1); 374} 375#endif /* MSEXT */ 376 |
|
365extern int ShowIfilter(), ShowOfilter(), ShowDfilter(), ShowAfilter(); 366 367struct cmdtab const ShowCommands[] = { 368 { "afilter", NULL, ShowAfilter, LOCAL_AUTH, 369 "Show keep Alive filters", StrOption}, 370 { "auth", NULL, ShowAuthKey, LOCAL_AUTH, 371 "Show auth name/key", StrNull}, 372 { "ccp", NULL, ReportCcpStatus, LOCAL_AUTH, --- 25 unchanged lines hidden (view full) --- 398 { "proto", NULL, ReportProtStatus, LOCAL_AUTH, 399 "Show protocol summary", StrNull}, 400 { "route", NULL, ShowRoute, LOCAL_AUTH, 401 "Show routing table", StrNull}, 402 { "timeout", NULL, ShowTimeout, LOCAL_AUTH, 403 "Show Idle timeout value", StrNull}, 404 { "redial", NULL, ShowRedial, LOCAL_AUTH, 405 "Show Redial timeout value", StrNull}, | 377extern int ShowIfilter(), ShowOfilter(), ShowDfilter(), ShowAfilter(); 378 379struct cmdtab const ShowCommands[] = { 380 { "afilter", NULL, ShowAfilter, LOCAL_AUTH, 381 "Show keep Alive filters", StrOption}, 382 { "auth", NULL, ShowAuthKey, LOCAL_AUTH, 383 "Show auth name/key", StrNull}, 384 { "ccp", NULL, ReportCcpStatus, LOCAL_AUTH, --- 25 unchanged lines hidden (view full) --- 410 { "proto", NULL, ReportProtStatus, LOCAL_AUTH, 411 "Show protocol summary", StrNull}, 412 { "route", NULL, ShowRoute, LOCAL_AUTH, 413 "Show routing table", StrNull}, 414 { "timeout", NULL, ShowTimeout, LOCAL_AUTH, 415 "Show Idle timeout value", StrNull}, 416 { "redial", NULL, ShowRedial, LOCAL_AUTH, 417 "Show Redial timeout value", StrNull}, |
418#ifdef MSEXT 419 { "msext", NULL, ShowMSExt, LOCAL_AUTH, 420 "Show MS PPP extention values", StrNull}, 421#endif /* MSEXT */ |
|
406 { "version", NULL, ShowVersion, LOCAL_NO_AUTH | LOCAL_AUTH, 407 "Show version string", StrNull}, 408 { "help", "?", HelpCommand, LOCAL_NO_AUTH | LOCAL_AUTH, 409 "Display this message", StrNull, (void *)ShowCommands}, 410 { NULL, NULL, NULL }, 411}; 412 413struct cmdtab * --- 389 unchanged lines hidden (view full) --- 803 804 if ((mode & MODE_AUTO) || 805 ((mode & MODE_DEDICATED) && dstsystem)) { 806 OsSetIpaddress(DefMyAddress.ipaddr, DefHisAddress.ipaddr, ifnetmask); 807 } 808 return(1); 809} 810 | 422 { "version", NULL, ShowVersion, LOCAL_NO_AUTH | LOCAL_AUTH, 423 "Show version string", StrNull}, 424 { "help", "?", HelpCommand, LOCAL_NO_AUTH | LOCAL_AUTH, 425 "Display this message", StrNull, (void *)ShowCommands}, 426 { NULL, NULL, NULL }, 427}; 428 429struct cmdtab * --- 389 unchanged lines hidden (view full) --- 819 820 if ((mode & MODE_AUTO) || 821 ((mode & MODE_DEDICATED) && dstsystem)) { 822 OsSetIpaddress(DefMyAddress.ipaddr, DefHisAddress.ipaddr, ifnetmask); 823 } 824 return(1); 825} 826 |
827#ifdef MSEXT |
|
811 | 828 |
829void 830SetMSEXT(pri_addr, sec_addr, argc, argv) 831struct in_addr *pri_addr; 832struct in_addr *sec_addr; 833int argc; 834char **argv; 835{ 836 int dummyint; 837 struct in_addr dummyaddr; 838 839 pri_addr->s_addr = sec_addr->s_addr = 0L; 840 841 if( argc > 0 ) { 842 ParseAddr(argc, argv++, pri_addr, &dummyaddr, &dummyint); 843 if( --argc > 0 ) 844 ParseAddr(argc, argv++, sec_addr, &dummyaddr, &dummyint); 845 else 846 sec_addr->s_addr = pri_addr->s_addr; 847 } 848 849 /* 850 * if the primary/secondary ns entries are 0.0.0.0 we should 851 * set them to either the localhost's ip, or the values in 852 * /etc/resolv.conf ?? 853 * 854 * up to you if you want to implement this... 855 */ 856 857} 858 859static int 860SetNS(list, argc, argv) 861struct cmdtab *list; 862int argc; 863char **argv; 864{ 865 SetMSEXT(&ns_entries[0], &ns_entries[1], argc, argv); 866 return(1); 867} 868 869static int 870SetNBNS(list, argc, argv) 871struct cmdtab *list; 872int argc; 873char **argv; 874{ 875 SetMSEXT(&nbns_entries[0], &nbns_entries[1], argc, argv); 876 return(1); 877} 878 879#endif /* MS_EXT */ 880 |
|
812#define VAR_AUTHKEY 0 813#define VAR_DIAL 1 814#define VAR_LOGIN 2 815#define VAR_AUTHNAME 3 816#define VAR_DEVICE 4 817#define VAR_ACCMAP 5 818#define VAR_PHONE 6 819 --- 94 unchanged lines hidden (view full) --- 914 { "phone", NULL, SetVariable, LOCAL_AUTH, 915 "Set telephone number(s)", "phone1[:phone2[...]]", (void *)VAR_PHONE }, 916 { "speed", NULL, SetModemSpeed, LOCAL_AUTH, 917 "Set modem speed", "speed"}, 918 { "timeout", NULL, SetIdleTimeout, LOCAL_AUTH, 919 "Set Idle timeout", StrValue}, 920 { "redial", NULL, SetRedialTimeout, LOCAL_AUTH, 921 "Set Redial timeout", "value|random [dial_attempts]"}, | 881#define VAR_AUTHKEY 0 882#define VAR_DIAL 1 883#define VAR_LOGIN 2 884#define VAR_AUTHNAME 3 885#define VAR_DEVICE 4 886#define VAR_ACCMAP 5 887#define VAR_PHONE 6 888 --- 94 unchanged lines hidden (view full) --- 983 { "phone", NULL, SetVariable, LOCAL_AUTH, 984 "Set telephone number(s)", "phone1[:phone2[...]]", (void *)VAR_PHONE }, 985 { "speed", NULL, SetModemSpeed, LOCAL_AUTH, 986 "Set modem speed", "speed"}, 987 { "timeout", NULL, SetIdleTimeout, LOCAL_AUTH, 988 "Set Idle timeout", StrValue}, 989 { "redial", NULL, SetRedialTimeout, LOCAL_AUTH, 990 "Set Redial timeout", "value|random [dial_attempts]"}, |
991#ifdef MSEXT 992 { "ns", NULL, SetNS, LOCAL_AUTH, 993 "Set NameServer", "pri-addr [sec-addr]"}, 994 { "nbns", NULL, SetNBNS, LOCAL_AUTH, 995 "Set NetBIOS NameServer", "pri-addr [sec-addr]"}, 996#endif /* MSEXT */ |
|
922 { "help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH, 923 "Display this message", StrNull, (void *)SetCommands}, 924 { NULL, NULL, NULL }, 925}; 926 927static int 928SetCommand(list, argc, argv) 929struct cmdtab *list; --- 65 unchanged lines hidden --- | 997 { "help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH, 998 "Display this message", StrNull, (void *)SetCommands}, 999 { NULL, NULL, NULL }, 1000}; 1001 1002static int 1003SetCommand(list, argc, argv) 1004struct cmdtab *list; --- 65 unchanged lines hidden --- |