command.c (49976) | command.c (49978) |
---|---|
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.205 1999/08/05 10:32:09 brian Exp $ | 20 * $Id: command.c,v 1.206 1999/08/17 14:59:05 brian Exp $ |
21 * 22 */ 23#include <sys/param.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> --- 110 unchanged lines hidden (view full) --- 139#define NEG_PAP 48 140#define NEG_PPPDDEFLATE 49 141#define NEG_PRED1 50 142#define NEG_PROTOCOMP 51 143#define NEG_SHORTSEQ 52 144#define NEG_VJCOMP 53 145 146const char Version[] = "2.23"; | 21 * 22 */ 23#include <sys/param.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> --- 110 unchanged lines hidden (view full) --- 139#define NEG_PAP 48 140#define NEG_PPPDDEFLATE 49 141#define NEG_PRED1 50 142#define NEG_PROTOCOMP 51 143#define NEG_SHORTSEQ 52 144#define NEG_VJCOMP 53 145 146const char Version[] = "2.23"; |
147const char VersionDate[] = "$Date: 1999/08/05 10:32:09 $"; | 147const char VersionDate[] = "$Date: 1999/08/17 14:59:05 $"; |
148 149static int ShowCommand(struct cmdargs const *); 150static int TerminalCommand(struct cmdargs const *); 151static int QuitCommand(struct cmdargs const *); 152static int OpenCommand(struct cmdargs const *); 153static int CloseCommand(struct cmdargs const *); 154static int DownCommand(struct cmdargs const *); 155static int SetCommand(struct cmdargs const *); --- 1444 unchanged lines hidden (view full) --- 1600 break; 1601 1602 case VAR_HANGUP: 1603 strncpy(cx->cfg.script.hangup, argp, sizeof cx->cfg.script.hangup - 1); 1604 cx->cfg.script.hangup[sizeof cx->cfg.script.hangup - 1] = '\0'; 1605 break; 1606 1607 case VAR_IDLETIMEOUT: | 148 149static int ShowCommand(struct cmdargs const *); 150static int TerminalCommand(struct cmdargs const *); 151static int QuitCommand(struct cmdargs const *); 152static int OpenCommand(struct cmdargs const *); 153static int CloseCommand(struct cmdargs const *); 154static int DownCommand(struct cmdargs const *); 155static int SetCommand(struct cmdargs const *); --- 1444 unchanged lines hidden (view full) --- 1600 break; 1601 1602 case VAR_HANGUP: 1603 strncpy(cx->cfg.script.hangup, argp, sizeof cx->cfg.script.hangup - 1); 1604 cx->cfg.script.hangup[sizeof cx->cfg.script.hangup - 1] = '\0'; 1605 break; 1606 1607 case VAR_IDLETIMEOUT: |
1608 if (arg->argc > arg->argn+1) | 1608 if (arg->argc > arg->argn+2) |
1609 err = "Too many idle timeout values\n"; | 1609 err = "Too many idle timeout values\n"; |
1610 else if (arg->argc == arg->argn+1) 1611 bundle_SetIdleTimer(arg->bundle, atoi(argp)); | 1610 else if (arg->argc == arg->argn) 1611 err = "Too few idle timeout values\n"; 1612 else { 1613 int timeout, min; 1614 1615 timeout = atoi(argp); 1616 min = arg->argc == arg->argn + 2 ? atoi(arg->argv[arg->argn + 1]) : -1; 1617 bundle_SetIdleTimer(arg->bundle, timeout, min); 1618 } |
1612 if (err) 1613 log_Printf(LogWARN, err); 1614 break; 1615 1616 case VAR_LQRPERIOD: 1617 long_val = atol(argp); 1618 if (long_val < MIN_LQRPERIOD) { 1619 log_Printf(LogWARN, "%ld: Invalid lqr period - min %d\n", --- 977 unchanged lines hidden --- | 1619 if (err) 1620 log_Printf(LogWARN, err); 1621 break; 1622 1623 case VAR_LQRPERIOD: 1624 long_val = atol(argp); 1625 if (long_val < MIN_LQRPERIOD) { 1626 log_Printf(LogWARN, "%ld: Invalid lqr period - min %d\n", --- 977 unchanged lines hidden --- |