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.182 1999/02/18 00:52:12 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> --- 107 unchanged lines hidden (view full) --- 136#define NEG_PPPDDEFLATE 47 137#define NEG_PRED1 48 138#define NEG_PROTOCOMP 49 139#define NEG_SHORTSEQ 50 140#define NEG_VJCOMP 51 141#define NEG_DNS 52 142 143const char Version[] = "2.11"; |
144const char VersionDate[] = "$Date: 1999/02/18 00:52:12 $"; |
145 146static int ShowCommand(struct cmdargs const *); 147static int TerminalCommand(struct cmdargs const *); 148static int QuitCommand(struct cmdargs const *); 149static int OpenCommand(struct cmdargs const *); 150static int CloseCommand(struct cmdargs const *); 151static int DownCommand(struct cmdargs const *); 152static int SetCommand(struct cmdargs const *); --- 1113 unchanged lines hidden (view full) --- 1266 sscanf(*argv++, "%x", &code); 1267 code &= 0xff; 1268 arg->cx->physical->async.cfg.EscMap[code >> 3] |= (1 << (code & 7)); 1269 arg->cx->physical->async.cfg.EscMap[32] = 1; 1270 } 1271 return 0; 1272} 1273 |
1274static int 1275SetInterfaceAddr(struct cmdargs const *arg) 1276{ 1277 struct ipcp *ipcp = &arg->bundle->ncp.ipcp; 1278 const char *hisaddr; 1279 1280 if (arg->argc > arg->argn + 4) 1281 return -1; --- 638 unchanged lines hidden (view full) --- 1920 addrs = 0; 1921 if (strcasecmp(arg->argv[arg->argn], "MYADDR") == 0) { 1922 dest = arg->bundle->ncp.ipcp.my_ip; 1923 addrs = ROUTE_DSTMYADDR; 1924 } else if (strcasecmp(arg->argv[arg->argn], "HISADDR") == 0) { 1925 dest = arg->bundle->ncp.ipcp.peer_ip; 1926 addrs = ROUTE_DSTHISADDR; 1927 } else { |
1928 dest = GetIpAddr(arg->argv[arg->argn]); 1929 if (dest.s_addr == INADDR_NONE) { 1930 log_Printf(LogWARN, "%s: Invalid IP address\n", arg->argv[arg->argn]); 1931 return -1; 1932 } |
1933 addrs = ROUTE_STATIC; 1934 } 1935 none.s_addr = INADDR_ANY; 1936 bundle_SetRoute(arg->bundle, RTM_DELETE, dest, none, none, 1937 arg->cmd->args ? 1 : 0, 0); 1938 route_Delete(&arg->bundle->ncp.ipcp.route, addrs, dest); 1939 } 1940 } else --- 579 unchanged lines hidden --- |