command.c (37009) | command.c (37018) |
---|---|
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.143 1998/06/15 19:05:40 brian Exp $ | 20 * $Id: command.c,v 1.144 1998/06/15 19:06:04 brian Exp $ |
21 * 22 */ 23#include <sys/types.h> 24#include <netinet/in_systm.h> 25#include <netinet/in.h> 26#include <netinet/ip.h> 27#include <arpa/inet.h> 28#include <sys/socket.h> --- 90 unchanged lines hidden (view full) --- 119#define NEG_PPPDDEFLATE 45 120#define NEG_PRED1 46 121#define NEG_PROTOCOMP 47 122#define NEG_SHORTSEQ 48 123#define NEG_VJCOMP 49 124#define NEG_DNS 50 125 126const char Version[] = "2.0-beta"; | 21 * 22 */ 23#include <sys/types.h> 24#include <netinet/in_systm.h> 25#include <netinet/in.h> 26#include <netinet/ip.h> 27#include <arpa/inet.h> 28#include <sys/socket.h> --- 90 unchanged lines hidden (view full) --- 119#define NEG_PPPDDEFLATE 45 120#define NEG_PRED1 46 121#define NEG_PROTOCOMP 47 122#define NEG_SHORTSEQ 48 123#define NEG_VJCOMP 49 124#define NEG_DNS 50 125 126const char Version[] = "2.0-beta"; |
127const char VersionDate[] = "$Date: 1998/06/15 19:05:40 $"; | 127const char VersionDate[] = "$Date: 1998/06/15 19:06:04 $"; |
128 129static int ShowCommand(struct cmdargs const *); 130static int TerminalCommand(struct cmdargs const *); 131static int QuitCommand(struct cmdargs const *); 132static int OpenCommand(struct cmdargs const *); 133static int CloseCommand(struct cmdargs const *); 134static int DownCommand(struct cmdargs const *); 135static int AllowCommand(struct cmdargs const *); --- 761 unchanged lines hidden (view full) --- 897 return -1; 898 899 return 0; 900} 901 902static int 903DownCommand(struct cmdargs const *arg) 904{ | 128 129static int ShowCommand(struct cmdargs const *); 130static int TerminalCommand(struct cmdargs const *); 131static int QuitCommand(struct cmdargs const *); 132static int OpenCommand(struct cmdargs const *); 133static int CloseCommand(struct cmdargs const *); 134static int DownCommand(struct cmdargs const *); 135static int AllowCommand(struct cmdargs const *); --- 761 unchanged lines hidden (view full) --- 897 return -1; 898 899 return 0; 900} 901 902static int 903DownCommand(struct cmdargs const *arg) 904{ |
905 if (arg->argc == arg->argn || 906 (arg->argc == arg->argn+1 && !strcasecmp(arg->argv[arg->argn], "lcp"))) { 907 if (arg->cx) 908 datalink_Down(arg->cx, CLOSE_STAYDOWN); 909 else 910 bundle_Down(arg->bundle); 911 } else if (arg->argc == arg->argn+1 && 912 !strcasecmp(arg->argv[arg->argn], "ccp")) { 913 struct fsm *fp = arg->cx ? &arg->cx->physical->link.ccp.fsm : 914 &arg->bundle->ncp.mp.link.ccp.fsm; 915 fsm_Down(fp); 916 fsm_Close(fp); | 905 if (arg->argc == arg->argn) { 906 if (arg->cx) 907 datalink_Down(arg->cx, CLOSE_STAYDOWN); 908 else 909 bundle_Down(arg->bundle, CLOSE_STAYDOWN); 910 } else if (arg->argc == arg->argn + 1) { 911 if (!strcasecmp(arg->argv[arg->argn], "lcp")) { 912 if (arg->cx) 913 datalink_Down(arg->cx, CLOSE_LCP); 914 else 915 bundle_Down(arg->bundle, CLOSE_LCP); 916 } else if (!strcasecmp(arg->argv[arg->argn], "ccp")) { 917 struct fsm *fp = arg->cx ? &arg->cx->physical->link.ccp.fsm : 918 &arg->bundle->ncp.mp.link.ccp.fsm; 919 fsm_Down(fp); 920 fsm_Close(fp); 921 } else 922 return -1; |
917 } else 918 return -1; 919 920 return 0; 921} 922 923static int 924SetModemSpeed(struct cmdargs const *arg) --- 1154 unchanged lines hidden --- | 923 } else 924 return -1; 925 926 return 0; 927} 928 929static int 930SetModemSpeed(struct cmdargs const *arg) --- 1154 unchanged lines hidden --- |