command.c (43888) | command.c (44073) |
---|---|
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.179 1999/01/28 09:40:15 brian Exp $ | 20 * $Id: command.c,v 1.180 1999/02/11 10:14:07 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> --- 85 unchanged lines hidden (view full) --- 114#define VAR_NBNS 22 115#define VAR_MODE 23 116#define VAR_CALLBACK 24 117#define VAR_CBCP 25 118#define VAR_CHOKED 26 119#define VAR_SENDPIPE 27 120#define VAR_RECVPIPE 28 121#define VAR_RADIUS 29 | 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> --- 85 unchanged lines hidden (view full) --- 114#define VAR_NBNS 22 115#define VAR_MODE 23 116#define VAR_CALLBACK 24 117#define VAR_CBCP 25 118#define VAR_CHOKED 26 119#define VAR_SENDPIPE 27 120#define VAR_RECVPIPE 28 121#define VAR_RADIUS 29 |
122#define VAR_CD 30 |
|
122 123/* ``accept|deny|disable|enable'' masks */ 124#define NEG_HISMASK (1) 125#define NEG_MYMASK (2) 126 127/* ``accept|deny|disable|enable'' values */ 128#define NEG_ACFCOMP 40 129#define NEG_CHAP 41 130#define NEG_DEFLATE 42 131#define NEG_LQR 43 132#define NEG_PAP 44 133#define NEG_PPPDDEFLATE 45 134#define NEG_PRED1 46 135#define NEG_PROTOCOMP 47 136#define NEG_SHORTSEQ 48 137#define NEG_VJCOMP 49 138#define NEG_DNS 50 139 | 123 124/* ``accept|deny|disable|enable'' masks */ 125#define NEG_HISMASK (1) 126#define NEG_MYMASK (2) 127 128/* ``accept|deny|disable|enable'' values */ 129#define NEG_ACFCOMP 40 130#define NEG_CHAP 41 131#define NEG_DEFLATE 42 132#define NEG_LQR 43 133#define NEG_PAP 44 134#define NEG_PPPDDEFLATE 45 135#define NEG_PRED1 46 136#define NEG_PROTOCOMP 47 137#define NEG_SHORTSEQ 48 138#define NEG_VJCOMP 49 139#define NEG_DNS 50 140 |
140const char Version[] = "2.1"; 141const char VersionDate[] = "$Date: 1999/01/28 09:40:15 $"; | 141const char Version[] = "2.11"; 142const char VersionDate[] = "$Date: 1999/02/11 10:14:07 $"; |
142 143static int ShowCommand(struct cmdargs const *); 144static int TerminalCommand(struct cmdargs const *); 145static int QuitCommand(struct cmdargs const *); 146static int OpenCommand(struct cmdargs const *); 147static int CloseCommand(struct cmdargs const *); 148static int DownCommand(struct cmdargs const *); 149static int SetCommand(struct cmdargs const *); --- 1556 unchanged lines hidden (view full) --- 1706 } else { 1707 strncpy(arg->bundle->radius.cfg.file, argp, 1708 sizeof arg->bundle->radius.cfg.file - 1); 1709 arg->bundle->radius.cfg.file 1710 [sizeof arg->bundle->radius.cfg.file - 1] = '\0'; 1711 } 1712 break; 1713#endif | 143 144static int ShowCommand(struct cmdargs const *); 145static int TerminalCommand(struct cmdargs const *); 146static int QuitCommand(struct cmdargs const *); 147static int OpenCommand(struct cmdargs const *); 148static int CloseCommand(struct cmdargs const *); 149static int DownCommand(struct cmdargs const *); 150static int SetCommand(struct cmdargs const *); --- 1556 unchanged lines hidden (view full) --- 1707 } else { 1708 strncpy(arg->bundle->radius.cfg.file, argp, 1709 sizeof arg->bundle->radius.cfg.file - 1); 1710 arg->bundle->radius.cfg.file 1711 [sizeof arg->bundle->radius.cfg.file - 1] = '\0'; 1712 } 1713 break; 1714#endif |
1715 1716 case VAR_CD: 1717 if (*argp) { 1718 long_val = atol(argp); 1719 if (long_val < 0) 1720 long_val = 0; 1721 cx->physical->cfg.cd.delay = long_val; 1722 cx->physical->cfg.cd.required = argp[strlen(argp)-1] == '!'; 1723 } else { 1724 cx->physical->cfg.cd.delay = DEF_CDDELAY; 1725 cx->physical->cfg.cd.required = 0; 1726 } 1727 break; |
|
1714 } 1715 1716 return err ? 1 : 0; 1717} 1718 1719static int 1720SetCtsRts(struct cmdargs const *arg) 1721{ --- 22 unchanged lines hidden (view full) --- 1744 {"callback", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, 1745 "callback control", "set callback [none|auth|cbcp|" 1746 "E.164 *|number[,number]...]...", (const void *)VAR_CALLBACK}, 1747 {"cbcp", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, 1748 "CBCP control", "set cbcp [*|phone[,phone...] [delay [timeout]]]", 1749 (const void *)VAR_CBCP}, 1750 {"ccpretry", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX_OPT, 1751 "FSM retry period", "set ccpretry value", (const void *)VAR_CCPRETRY}, | 1728 } 1729 1730 return err ? 1 : 0; 1731} 1732 1733static int 1734SetCtsRts(struct cmdargs const *arg) 1735{ --- 22 unchanged lines hidden (view full) --- 1758 {"callback", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, 1759 "callback control", "set callback [none|auth|cbcp|" 1760 "E.164 *|number[,number]...]...", (const void *)VAR_CALLBACK}, 1761 {"cbcp", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, 1762 "CBCP control", "set cbcp [*|phone[,phone...] [delay [timeout]]]", 1763 (const void *)VAR_CBCP}, 1764 {"ccpretry", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX_OPT, 1765 "FSM retry period", "set ccpretry value", (const void *)VAR_CCPRETRY}, |
1766 {"cd", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, "Carrier delay requirement", 1767 "set cd value[!]", (const void *)VAR_CD}, |
|
1752 {"chapretry", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, 1753 "CHAP retry period", "set chapretry value", (const void *)VAR_CHAPRETRY}, 1754 {"choked", NULL, SetVariable, LOCAL_AUTH, 1755 "choked timeout", "set choked [secs]", (const void *)VAR_CHOKED}, 1756 {"ctsrts", "crtscts", SetCtsRts, LOCAL_AUTH | LOCAL_CX, 1757 "Use hardware flow control", "set ctsrts [on|off]"}, 1758 {"deflate", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX_OPT, 1759 "deflate window sizes", "set deflate out-winsize in-winsize", --- 739 unchanged lines hidden --- | 1768 {"chapretry", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, 1769 "CHAP retry period", "set chapretry value", (const void *)VAR_CHAPRETRY}, 1770 {"choked", NULL, SetVariable, LOCAL_AUTH, 1771 "choked timeout", "set choked [secs]", (const void *)VAR_CHOKED}, 1772 {"ctsrts", "crtscts", SetCtsRts, LOCAL_AUTH | LOCAL_CX, 1773 "Use hardware flow control", "set ctsrts [on|off]"}, 1774 {"deflate", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX_OPT, 1775 "deflate window sizes", "set deflate out-winsize in-winsize", --- 739 unchanged lines hidden --- |