Fix prototypes.
Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall).
This commit is contained in:
parent
9822c98d98
commit
b6e82f33ef
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31343
@ -1,12 +1,12 @@
|
||||
# $Id: Makefile,v 1.30 1997/11/16 22:15:02 brian Exp $
|
||||
# $Id: Makefile,v 1.31 1997/11/18 14:52:03 brian Exp $
|
||||
|
||||
PROG= ppp
|
||||
SRCS= alias_cmd.c arp.c async.c auth.c ccp.c chap.c chat.c \
|
||||
SRCS= arp.c async.c auth.c ccp.c chap.c chat.c \
|
||||
command.c defs.c filter.c fsm.c hdlc.c id.c ip.c ipcp.c lcp.c \
|
||||
loadalias.c log.c lqr.c main.c mbuf.c modem.c os.c pap.c phase.c \
|
||||
log.c lqr.c main.c mbuf.c modem.c os.c pap.c phase.c \
|
||||
pred.c route.c server.c sig.c slcompress.c systems.c throughput.c \
|
||||
timer.c tun.c vars.c vjcomp.c
|
||||
CFLAGS+=-Wall -Wmissing-prototypes
|
||||
CFLAGS+=-Wall
|
||||
LDADD+= -lmd -lcrypt -lutil
|
||||
DPADD+= ${LIBMD} ${LIBCRYPT} ${LIBUTIL}
|
||||
MAN8= ppp.8
|
||||
@ -14,6 +14,12 @@ BINMODE=4550
|
||||
BINOWN= root
|
||||
BINGRP= network
|
||||
|
||||
.if defined(NOALIAS)
|
||||
CFLAGS+=-DNOALIAS
|
||||
.else
|
||||
SRCS+= alias_cmd.c loadalias.c
|
||||
.endif
|
||||
|
||||
.if exists(${.CURDIR}/../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
CFLAGS+=-DHAVE_DES
|
||||
SRCS+= chap_ms.c
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: $
|
||||
* $Id: alias_cmd.c,v 1.6 1997/10/26 01:02:00 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -13,29 +13,29 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "alias_cmd.h"
|
||||
|
||||
|
||||
static int StrToAddr(char *, struct in_addr *);
|
||||
static int StrToPort(char *, u_short *, char *);
|
||||
static int StrToAddrAndPort(char *, struct in_addr *, u_short *, char *);
|
||||
static int StrToAddr(const char *, struct in_addr *);
|
||||
static int StrToPort(const char *, u_short *, const char *);
|
||||
static int StrToAddrAndPort(const char *, struct in_addr *, u_short *, const char *);
|
||||
|
||||
|
||||
int
|
||||
AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
AliasRedirectPort(struct cmdargs const *arg)
|
||||
{
|
||||
if (!(mode & MODE_ALIAS)) {
|
||||
if (VarTerm)
|
||||
fprintf(VarTerm, "Alias not enabled\n");
|
||||
} else if (argc == 3) {
|
||||
} else if (arg->argc == 3) {
|
||||
char proto_constant;
|
||||
char *proto;
|
||||
const char *proto;
|
||||
u_short local_port;
|
||||
u_short alias_port;
|
||||
int error;
|
||||
@ -43,7 +43,7 @@ AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
struct in_addr null_addr;
|
||||
struct alias_link *link;
|
||||
|
||||
proto = argv[0];
|
||||
proto = arg->argv[0];
|
||||
if (strcmp(proto, "tcp") == 0) {
|
||||
proto_constant = IPPROTO_TCP;
|
||||
} else if (strcmp(proto, "udp") == 0) {
|
||||
@ -51,25 +51,25 @@ AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
} else {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "port redirect: protocol must be tcp or udp\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name,
|
||||
list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name,
|
||||
arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
error = StrToAddrAndPort(argv[1], &local_addr, &local_port, proto);
|
||||
error = StrToAddrAndPort(arg->argv[1], &local_addr, &local_port, proto);
|
||||
if (error) {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "port redirect: error reading local addr:port\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
error = StrToPort(argv[2], &alias_port, proto);
|
||||
error = StrToPort(arg->argv[2], &alias_port, proto);
|
||||
if (error) {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "port redirect: error reading alias port\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -84,52 +84,52 @@ AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
fprintf(VarTerm, "port redirect: error returned by packed"
|
||||
" aliasing engine (code=%d)\n", error);
|
||||
} else if (VarTerm)
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
AliasRedirectAddr(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
AliasRedirectAddr(struct cmdargs const *arg)
|
||||
{
|
||||
if (!(mode & MODE_ALIAS)) {
|
||||
if (VarTerm)
|
||||
fprintf(VarTerm, "alias not enabled\n");
|
||||
} else if (argc == 2) {
|
||||
} else if (arg->argc == 2) {
|
||||
int error;
|
||||
struct in_addr local_addr;
|
||||
struct in_addr alias_addr;
|
||||
struct alias_link *link;
|
||||
|
||||
error = StrToAddr(argv[0], &local_addr);
|
||||
error = StrToAddr(arg->argv[0], &local_addr);
|
||||
if (error) {
|
||||
if (VarTerm)
|
||||
fprintf(VarTerm, "address redirect: invalid local address\n");
|
||||
return 1;
|
||||
}
|
||||
error = StrToAddr(argv[1], &alias_addr);
|
||||
error = StrToAddr(arg->argv[1], &alias_addr);
|
||||
if (error) {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "address redirect: invalid alias address\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
link = VarPacketAliasRedirectAddr(local_addr, alias_addr);
|
||||
if (link == NULL && VarTerm) {
|
||||
fprintf(VarTerm, "address redirect: packet aliasing engine error\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
} else if (VarTerm)
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
StrToAddr(char *str, struct in_addr *addr)
|
||||
StrToAddr(const char *str, struct in_addr *addr)
|
||||
{
|
||||
struct hostent *hp;
|
||||
|
||||
@ -147,7 +147,7 @@ StrToAddr(char *str, struct in_addr *addr)
|
||||
|
||||
|
||||
static int
|
||||
StrToPort(char *str, u_short *port, char *proto)
|
||||
StrToPort(const char *str, u_short *port, const char *proto)
|
||||
{
|
||||
int iport;
|
||||
struct servent *sp;
|
||||
@ -169,22 +169,23 @@ StrToPort(char *str, u_short *port, char *proto)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
StrToAddrAndPort(char *str, struct in_addr *addr, u_short *port, char *proto)
|
||||
static int
|
||||
StrToAddrAndPort(const char *str, struct in_addr *addr, u_short *port, const char *proto)
|
||||
{
|
||||
char *ptr;
|
||||
char *colon;
|
||||
int res;
|
||||
|
||||
ptr = strchr(str, ':');
|
||||
if (!ptr) {
|
||||
LogPrintf(LogWARN, "StrToAddrAndPort: %s is missing port number.\n",
|
||||
str);
|
||||
colon = strchr(str, ':');
|
||||
if (!colon) {
|
||||
LogPrintf(LogWARN, "StrToAddrAndPort: %s is missing port number.\n", str);
|
||||
return -1;
|
||||
}
|
||||
*ptr = '\0';
|
||||
++ptr;
|
||||
|
||||
if (StrToAddr(str, addr) != 0)
|
||||
*colon = '\0'; /* Cheat the const-ness ! */
|
||||
res = StrToAddr(str, addr);
|
||||
*colon = ':'; /* Cheat the const-ness ! */
|
||||
if (res != 0)
|
||||
return -1;
|
||||
|
||||
return StrToPort(ptr, port, proto);
|
||||
return StrToPort(colon+1, port, proto);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* $Id: $
|
||||
* $Id: alias_cmd.h,v 1.3 1997/10/26 01:02:01 brian Exp $
|
||||
*/
|
||||
|
||||
extern int AliasRedirectPort(struct cmdtab *, int, char **, void *);
|
||||
extern int AliasRedirectAddr(struct cmdtab *, int, char **, void *);
|
||||
extern int AliasRedirectPort(struct cmdargs const *);
|
||||
extern int AliasRedirectAddr(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: arp.c,v 1.16 1997/10/26 01:02:03 brian Exp $
|
||||
* $Id: arp.c,v 1.17 1997/11/09 06:22:38 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -29,7 +29,9 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/route.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <netinet/in.h>
|
||||
@ -45,6 +47,7 @@
|
||||
#include <sys/uio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "id.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: async.c,v 1.12 1997/10/26 01:02:05 brian Exp $
|
||||
* $Id: async.c,v 1.13 1997/10/29 01:19:38 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -27,6 +27,7 @@
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -37,7 +38,6 @@
|
||||
#include "lcpproto.h"
|
||||
#include "modem.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "os.h"
|
||||
#include "async.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: auth.c,v 1.22 1997/11/11 22:58:09 brian Exp $
|
||||
* $Id: auth.c,v 1.23 1997/11/17 00:42:37 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Implement check against with registered IP addresses.
|
||||
@ -29,6 +29,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -37,7 +38,6 @@
|
||||
#include "lcpproto.h"
|
||||
#include "ipcp.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "filter.h"
|
||||
#include "auth.h"
|
||||
@ -67,7 +67,7 @@ LocalAuthInit()
|
||||
}
|
||||
|
||||
LOCAL_AUTH_VALID
|
||||
LocalAuthValidate(char *fname, char *system, char *key)
|
||||
LocalAuthValidate(const char *fname, const char *system, const char *key)
|
||||
{
|
||||
FILE *fp;
|
||||
int n;
|
||||
@ -102,7 +102,7 @@ LocalAuthValidate(char *fname, char *system, char *key)
|
||||
}
|
||||
|
||||
int
|
||||
AuthValidate(char *fname, char *system, char *key)
|
||||
AuthValidate(const char *fname, const char *system, const char *key)
|
||||
{
|
||||
FILE *fp;
|
||||
int n;
|
||||
@ -128,7 +128,7 @@ AuthValidate(char *fname, char *system, char *key)
|
||||
memset(&DefHisAddress, '\0', sizeof(DefHisAddress));
|
||||
n -= 2;
|
||||
if (n > 0) {
|
||||
if (ParseAddr(n--, &vector[2],
|
||||
if (ParseAddr(n--, (char const *const *)(vector+2),
|
||||
&DefHisAddress.ipaddr,
|
||||
&DefHisAddress.mask,
|
||||
&DefHisAddress.width) == 0) {
|
||||
@ -145,7 +145,7 @@ AuthValidate(char *fname, char *system, char *key)
|
||||
}
|
||||
|
||||
char *
|
||||
AuthGetSecret(char *fname, char *system, int len, int setaddr)
|
||||
AuthGetSecret(const char *fname, const char *system, int len, int setaddr)
|
||||
{
|
||||
FILE *fp;
|
||||
int n;
|
||||
@ -172,7 +172,7 @@ AuthGetSecret(char *fname, char *system, int len, int setaddr)
|
||||
n -= 2;
|
||||
if (n > 0 && setaddr) {
|
||||
LogPrintf(LogDEBUG, "AuthGetSecret: n = %d, %s\n", n, vector[2]);
|
||||
if (ParseAddr(n--, &vector[2],
|
||||
if (ParseAddr(n--, (char const *const *)(vector+2),
|
||||
&DefHisAddress.ipaddr,
|
||||
&DefHisAddress.mask,
|
||||
&DefHisAddress.width) != 0)
|
||||
@ -186,9 +186,10 @@ AuthGetSecret(char *fname, char *system, int len, int setaddr)
|
||||
}
|
||||
|
||||
static void
|
||||
AuthTimeout(struct authinfo *authp)
|
||||
AuthTimeout(void *vauthp)
|
||||
{
|
||||
struct pppTimer *tp;
|
||||
struct authinfo *authp = (struct authinfo *)vauthp;
|
||||
|
||||
tp = &authp->authtimer;
|
||||
StopTimer(tp);
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: auth.h,v 1.8 1997/09/04 00:38:18 brian Exp $
|
||||
* $Id: auth.h,v 1.9 1997/10/26 01:02:09 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -27,15 +27,15 @@ typedef enum {
|
||||
} LOCAL_AUTH_VALID;
|
||||
|
||||
struct authinfo {
|
||||
void (*ChallengeFunc) ();
|
||||
void (*ChallengeFunc) (int);
|
||||
struct pppTimer authtimer;
|
||||
int retry;
|
||||
int id;
|
||||
};
|
||||
|
||||
extern LOCAL_AUTH_VALID LocalAuthValidate(char *, char *, char *);
|
||||
extern LOCAL_AUTH_VALID LocalAuthValidate(const char *, const char *, const char *);
|
||||
extern void StopAuthTimer(struct authinfo *);
|
||||
extern void StartAuthChallenge(struct authinfo *);
|
||||
extern void LocalAuthInit(void);
|
||||
extern int AuthValidate(char *, char *, char *);
|
||||
extern char *AuthGetSecret(char *, char *, int, int);
|
||||
extern int AuthValidate(const char *, const char *, const char *);
|
||||
extern char *AuthGetSecret(const char *, const char *, int, int);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ccp.c,v 1.18 1997/11/08 00:28:06 brian Exp $
|
||||
* $Id: ccp.c,v 1.19 1997/11/14 15:39:14 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Support other compression protocols
|
||||
@ -28,6 +28,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -38,7 +39,6 @@
|
||||
#include "ccp.h"
|
||||
#include "phase.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "pred.h"
|
||||
|
||||
@ -91,14 +91,14 @@ static char const *cftypes[] = {
|
||||
"STAC", /* 17: Stac Electronics LZS */
|
||||
"MSPPC", /* 18: Microsoft PPC */
|
||||
"GAND", /* 19: Gandalf FZA */
|
||||
"V42BIS", /* 20: V.42bis compression */
|
||||
"V42BIS", /* 20: ARG->DATA.42bis compression */
|
||||
"BSD", /* BSD LZW Compress */
|
||||
};
|
||||
|
||||
#define NCFTYPES (sizeof(cftypes)/sizeof(char *))
|
||||
|
||||
int
|
||||
ReportCcpStatus()
|
||||
ReportCcpStatus(struct cmdargs const *arg)
|
||||
{
|
||||
struct ccpstate *icp = &CcpInfo;
|
||||
struct fsm *fp = &CcpFsm;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ccp.h,v 1.7 1997/08/25 00:29:06 brian Exp $
|
||||
* $Id: ccp.h,v 1.8 1997/10/26 01:02:12 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -53,4 +53,4 @@ extern void CcpInput(struct mbuf *);
|
||||
extern void CcpUp(void);
|
||||
extern void CcpOpen(void);
|
||||
extern void CcpInit(void);
|
||||
extern int ReportCcpStatus(void);
|
||||
extern int ReportCcpStatus(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: chap.c,v 1.24 1997/10/26 01:02:16 brian Exp $
|
||||
* $Id: chap.c,v 1.25 1997/11/09 03:55:27 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -41,6 +41,7 @@
|
||||
#endif
|
||||
#include <utmp.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -53,16 +54,15 @@
|
||||
#include "hdlc.h"
|
||||
#include "phase.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "auth.h"
|
||||
|
||||
static char *chapcodes[] = {
|
||||
static const char *chapcodes[] = {
|
||||
"???", "CHALLENGE", "RESPONSE", "SUCCESS", "FAILURE"
|
||||
};
|
||||
|
||||
static void
|
||||
ChapOutput(u_int code, u_int id, u_char * ptr, int count)
|
||||
ChapOutput(u_int code, u_int id, const u_char * ptr, int count)
|
||||
{
|
||||
int plen;
|
||||
struct fsmheader lh;
|
||||
|
@ -19,7 +19,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: $
|
||||
* $Id: chap_ms.c,v 1.2 1997/10/26 01:02:20 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "timer.h"
|
||||
#include "chap.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
* Columbus, OH 43221
|
||||
* (614)451-1883
|
||||
*
|
||||
* $Id: chat.c,v 1.37 1997/11/09 06:22:39 brian Exp $
|
||||
* $Id: chat.c,v 1.38 1997/11/09 14:18:36 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Support more UUCP compatible control sequences.
|
||||
@ -43,16 +43,15 @@
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "chat.h"
|
||||
#include "sig.h"
|
||||
#include "chat.h"
|
||||
#include "modem.h"
|
||||
|
||||
#ifndef isblank
|
||||
@ -140,7 +139,7 @@ MakeArgs(char *script, char **pvect, int maxargs)
|
||||
* \U Auth User
|
||||
*/
|
||||
char *
|
||||
ExpandString(char *str, char *result, int reslen, int sendmode)
|
||||
ExpandString(const char *str, char *result, int reslen, int sendmode)
|
||||
{
|
||||
int addcr = 0;
|
||||
char *phone;
|
||||
@ -240,14 +239,14 @@ static char logbuff[MAXLOGBUFF];
|
||||
static int loglen = 0;
|
||||
|
||||
static void
|
||||
clear_log()
|
||||
clear_log(void)
|
||||
{
|
||||
memset(logbuff, 0, MAXLOGBUFF);
|
||||
loglen = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
flush_log()
|
||||
flush_log(void)
|
||||
{
|
||||
if (LogIsKept(LogCONNECT))
|
||||
LogPrintf(LogCONNECT, "%s\n", logbuff);
|
||||
@ -258,7 +257,7 @@ flush_log()
|
||||
}
|
||||
|
||||
static void
|
||||
connect_log(char *str, int single_p)
|
||||
connect_log(const char *str, int single_p)
|
||||
{
|
||||
int space = MAXLOGBUFF - loglen - 1;
|
||||
|
||||
@ -276,7 +275,7 @@ connect_log(char *str, int single_p)
|
||||
}
|
||||
|
||||
static int
|
||||
WaitforString(char *estr)
|
||||
WaitforString(const char *estr)
|
||||
{
|
||||
struct timeval timeout;
|
||||
char *s, *str, ch;
|
||||
@ -292,7 +291,7 @@ WaitforString(char *estr)
|
||||
omask = sigblock(sigmask(SIGALRM));
|
||||
#endif
|
||||
clear_log();
|
||||
(void) ExpandString(estr, buff, sizeof(buff), 0);
|
||||
ExpandString(estr, buff, sizeof(buff), 0);
|
||||
LogPrintf(LogCHAT, "Wait for (%d): %s --> %s\n", TimeoutSec, estr, buff);
|
||||
str = buff;
|
||||
inp = inbuff;
|
||||
@ -417,7 +416,7 @@ ExecStr(char *command, char *out)
|
||||
{
|
||||
int pid;
|
||||
int fids[2];
|
||||
char *vector[20];
|
||||
char *vector[MAXARGS];
|
||||
int stat, nb;
|
||||
char *cp;
|
||||
char tmp[300];
|
||||
@ -434,7 +433,7 @@ ExecStr(char *command, char *out)
|
||||
LogPrintf(LogCHAT, "Too long string to ExecStr: \"%s\"\n", command);
|
||||
return;
|
||||
}
|
||||
(void) MakeArgs(tmp, vector, VECSIZE(vector));
|
||||
MakeArgs(tmp, vector, VECSIZE(vector));
|
||||
|
||||
if (pipe(fids) < 0) {
|
||||
LogPrintf(LogCHAT, "Unable to create pipe in ExecStr: %s\n",
|
||||
@ -462,7 +461,7 @@ ExecStr(char *command, char *out)
|
||||
}
|
||||
setuid(geteuid());
|
||||
LogPrintf(LogCHAT, "exec: %s\n", command);
|
||||
pid = execvp(command, vector);
|
||||
pid = execvp(command, (char **)vector);
|
||||
LogPrintf(LogCHAT, "execvp failed for (%d/%d): %s\n", pid, errno, command);
|
||||
exit(127);
|
||||
} else {
|
||||
@ -481,7 +480,7 @@ ExecStr(char *command, char *out)
|
||||
}
|
||||
|
||||
static void
|
||||
SendString(char *str)
|
||||
SendString(const char *str)
|
||||
{
|
||||
char *cp;
|
||||
int on;
|
||||
@ -498,10 +497,10 @@ SendString(char *str)
|
||||
TimeoutSec = 30;
|
||||
} else {
|
||||
if (*str == '!') {
|
||||
(void) ExpandString(str + 1, buff + 2, sizeof(buff) - 2, 0);
|
||||
ExpandString(str + 1, buff + 2, sizeof(buff) - 2, 0);
|
||||
ExecStr(buff + 2, buff + 2);
|
||||
} else {
|
||||
(void) ExpandString(str, buff + 2, sizeof(buff) - 2, 1);
|
||||
ExpandString(str, buff + 2, sizeof(buff) - 2, 1);
|
||||
}
|
||||
if (strstr(str, "\\P")) /* Do not log the password itself. */
|
||||
LogPrintf(LogCHAT, "sending: %s\n", str);
|
||||
@ -544,8 +543,10 @@ ExpectString(char *str)
|
||||
}
|
||||
}
|
||||
if (*minus == '-') { /* We have sub-send-expect. */
|
||||
*minus++ = '\0';
|
||||
*minus = '\0'; /* XXX: Cheat with the const string */
|
||||
state = WaitforString(str);
|
||||
*minus = '-'; /* XXX: Cheat with the const string */
|
||||
minus++;
|
||||
if (state != NOMATCH)
|
||||
return (state);
|
||||
|
||||
@ -560,9 +561,10 @@ ExpectString(char *str)
|
||||
}
|
||||
}
|
||||
if (*minus == '-') {
|
||||
*minus++ = '\0';
|
||||
*minus = '\0'; /* XXX: Cheat with the const string */
|
||||
SendString(str);
|
||||
str = minus;
|
||||
*minus = '-'; /* XXX: Cheat with the const string */
|
||||
str = ++minus;
|
||||
} else {
|
||||
SendString(str);
|
||||
return (MATCH);
|
||||
@ -591,8 +593,8 @@ StopDial(int sig)
|
||||
int
|
||||
DoChat(char *script)
|
||||
{
|
||||
char *vector[40];
|
||||
char **argv;
|
||||
char *vector[MAXARGS];
|
||||
char *const *argv;
|
||||
int argc, n, state;
|
||||
|
||||
if (!script || !*script)
|
||||
@ -613,8 +615,7 @@ DoChat(char *script)
|
||||
numaborts = 0;
|
||||
|
||||
memset(vector, '\0', sizeof(vector));
|
||||
n = MakeArgs(script, vector, VECSIZE(vector));
|
||||
argc = n;
|
||||
argc = MakeArgs(script, vector, VECSIZE(vector));
|
||||
argv = vector;
|
||||
TimeoutSec = 30;
|
||||
while (*argv) {
|
||||
|
@ -18,12 +18,12 @@
|
||||
* Columbus, OH 43221
|
||||
* (614)451-1883
|
||||
*
|
||||
* $Id: chat.h,v 1.7 1997/08/25 00:29:07 brian Exp $
|
||||
* $Id: chat.h,v 1.8 1997/10/26 01:02:23 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#define VECSIZE(v) (sizeof(v) / sizeof(v[0]))
|
||||
|
||||
extern char *ExpandString(char *, char *, int, int);
|
||||
extern int MakeArgs(char *, char **, int);
|
||||
extern int DoChat(char *);
|
||||
extern char *ExpandString(const char *, char *, int, int);
|
||||
extern int MakeArgs(char *, char **, int); /* Mangles the first arg ! */
|
||||
extern int DoChat(char *); /* passes arg to MakeArgs() */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,19 +15,28 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: command.h,v 1.10 1997/11/11 22:58:10 brian Exp $
|
||||
* $Id: command.h,v 1.11 1997/11/13 14:43:15 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
|
||||
struct cmdtab;
|
||||
|
||||
struct cmdargs {
|
||||
struct cmdtab const *cmd;
|
||||
int argc;
|
||||
char const *const *argv;
|
||||
const void *data;
|
||||
};
|
||||
|
||||
struct cmdtab {
|
||||
char *name;
|
||||
char *alias;
|
||||
int (*func) ();
|
||||
const char *name;
|
||||
const char *alias;
|
||||
int (*func) (struct cmdargs const *);
|
||||
u_char lauth;
|
||||
char *helpmes;
|
||||
char *syntax;
|
||||
void *args;
|
||||
const char *helpmes;
|
||||
const char *syntax;
|
||||
const void *args;
|
||||
};
|
||||
|
||||
#define VAR_AUTHKEY 0
|
||||
@ -45,9 +54,9 @@ struct cmdtab {
|
||||
extern struct in_addr ifnetmask;
|
||||
extern int aft_cmd;
|
||||
|
||||
extern int SetVariable(struct cmdtab const *, int, char **, int);
|
||||
extern int SetVariable(struct cmdargs const *);
|
||||
extern void Prompt(void);
|
||||
extern int IsInteractive(int);
|
||||
extern void InterpretCommand(char *, int, int *, char ***);
|
||||
extern void RunCommand(int, char **, const char *label);
|
||||
extern void RunCommand(int, char const *const *, const char *label);
|
||||
extern void DecodeCommand(char *, int, const char *label);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: defs.c,v 1.3 1997/11/17 00:42:38 brian Exp $
|
||||
* $Id: defs.c,v 1.4 1997/11/18 00:19:30 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -9,13 +9,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defs.h"
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
|
||||
int mode = MODE_INTER;
|
||||
@ -45,12 +46,16 @@ GetLabel()
|
||||
void
|
||||
randinit()
|
||||
{
|
||||
#ifdef __FreeBSD__
|
||||
static int initdone;
|
||||
|
||||
if (!initdone) {
|
||||
initdone = 1;
|
||||
srandomdev();
|
||||
}
|
||||
#else
|
||||
srandom(time(NULL)^getpid());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: defs.h,v 1.26 1997/11/17 00:42:39 brian Exp $
|
||||
* $Id: defs.h,v 1.27 1997/11/18 00:19:31 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -45,6 +45,7 @@
|
||||
#define NEXT_REDIAL_PERIOD 3 /* Default Hold time to next number redial */
|
||||
#define SCRIPT_LEN 512 /* Size of login scripts */
|
||||
#define LINE_LEN SCRIPT_LEN /* Size of login scripts */
|
||||
#define MAXARGS 40 /* How many args per config line */
|
||||
|
||||
#define CONFFILE "ppp.conf"
|
||||
#define LINKUPFILE "ppp.linkup"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: filter.c,v 1.17 1997/11/09 14:18:38 brian Exp $
|
||||
* $Id: filter.c,v 1.18 1997/11/12 18:47:30 brian Exp $
|
||||
*
|
||||
* TODO: Shoud send ICMP error message when we discard packets.
|
||||
*/
|
||||
@ -62,31 +62,40 @@ static u_long netmasks[33] = {
|
||||
|
||||
int
|
||||
ParseAddr(int argc,
|
||||
char **argv,
|
||||
char const *const *argv,
|
||||
struct in_addr * paddr,
|
||||
struct in_addr * pmask,
|
||||
int *pwidth)
|
||||
{
|
||||
int bits;
|
||||
char *cp, *wp;
|
||||
int bits, len;
|
||||
char *wp;
|
||||
const char *cp;
|
||||
|
||||
if (argc < 1) {
|
||||
LogPrintf(LogWARN, "ParseAddr: address/mask is expected.\n");
|
||||
return (0);
|
||||
}
|
||||
pmask->s_addr = 0xffffffff; /* Assume 255.255.255.255 as default */
|
||||
|
||||
cp = strchr(*argv, '/');
|
||||
if (cp)
|
||||
*cp++ = '\0';
|
||||
if (strcasecmp(*argv, "HISADDR") == 0)
|
||||
len = cp ? cp - *argv : strlen(*argv);
|
||||
|
||||
if (strncasecmp(*argv, "HISADDR", len) == 0)
|
||||
*paddr = IpcpInfo.his_ipaddr;
|
||||
else if (strcasecmp(*argv, "MYADDR") == 0)
|
||||
else if (strncasecmp(*argv, "MYADDR", len) == 0)
|
||||
*paddr = IpcpInfo.want_ipaddr;
|
||||
else if (inet_aton(*argv, paddr) == 0) {
|
||||
else if (len > 15)
|
||||
LogPrintf(LogWARN, "ParseAddr: %s: Bad address\n", *argv);
|
||||
return (0);
|
||||
else {
|
||||
char s[16];
|
||||
strncpy(s, *argv, len);
|
||||
s[len] = '\0';
|
||||
if (inet_aton(s, paddr) == 0) {
|
||||
LogPrintf(LogWARN, "ParseAddr: %s: Bad address\n", s);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
if (cp && *cp) {
|
||||
if (cp && *++cp) {
|
||||
bits = strtol(cp, &wp, 0);
|
||||
if (cp == wp || bits < 0 || bits > 32) {
|
||||
LogPrintf(LogWARN, "ParseAddr: bad mask width.\n");
|
||||
@ -104,7 +113,7 @@ ParseAddr(int argc,
|
||||
}
|
||||
|
||||
static int
|
||||
ParseProto(int argc, char **argv)
|
||||
ParseProto(int argc, char const *const *argv)
|
||||
{
|
||||
int proto;
|
||||
|
||||
@ -123,9 +132,10 @@ ParseProto(int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
ParsePort(char *service, int proto)
|
||||
ParsePort(const char *service, int proto)
|
||||
{
|
||||
char *protocol_name, *cp;
|
||||
const char *protocol_name;
|
||||
char *cp;
|
||||
struct servent *servent;
|
||||
int port;
|
||||
|
||||
@ -157,7 +167,7 @@ ParsePort(char *service, int proto)
|
||||
* ICMP Syntax: src eq icmp_message_type
|
||||
*/
|
||||
static int
|
||||
ParseIcmp(int argc, char **argv)
|
||||
ParseIcmp(int argc, char const *const *argv)
|
||||
{
|
||||
int type;
|
||||
char *cp;
|
||||
@ -186,7 +196,7 @@ ParseIcmp(int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
ParseOp(char *cp)
|
||||
ParseOp(const char *cp)
|
||||
{
|
||||
int op = OP_NONE;
|
||||
|
||||
@ -203,7 +213,7 @@ ParseOp(char *cp)
|
||||
* UDP Syntax: [src op port] [dst op port]
|
||||
*/
|
||||
static int
|
||||
ParseUdpOrTcp(int argc, char **argv, int proto)
|
||||
ParseUdpOrTcp(int argc, char const *const *argv, int proto)
|
||||
{
|
||||
filterdata.opt.srcop = filterdata.opt.dstop = OP_NONE;
|
||||
filterdata.opt.estab = 0;
|
||||
@ -254,10 +264,10 @@ ParseUdpOrTcp(int argc, char **argv, int proto)
|
||||
return (0);
|
||||
}
|
||||
|
||||
char *opname[] = {"none", "eq", "gt", NULL, "lt"};
|
||||
const char *opname[] = {"none", "eq", "gt", NULL, "lt"};
|
||||
|
||||
static int
|
||||
Parse(int argc, char **argv, struct filterent * ofp)
|
||||
Parse(int argc, char const *const *argv, struct filterent * ofp)
|
||||
{
|
||||
int action, proto;
|
||||
int val;
|
||||
@ -377,52 +387,47 @@ Parse(int argc, char **argv, struct filterent * ofp)
|
||||
}
|
||||
|
||||
int
|
||||
SetIfilter(struct cmdtab *list, int argc, char **argv)
|
||||
SetIfilter(struct cmdargs const *arg)
|
||||
{
|
||||
if (argc > 0) {
|
||||
(void) Parse(argc, argv, ifilters);
|
||||
if (arg->argc > 0) {
|
||||
Parse(arg->argc, arg->argv, ifilters);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
SetOfilter(struct cmdtab *list, int argc, char **argv)
|
||||
SetOfilter(struct cmdargs const *arg)
|
||||
{
|
||||
if (argc > 0) {
|
||||
(void) Parse(argc, argv, ofilters);
|
||||
if (arg->argc > 0) {
|
||||
(void) Parse(arg->argc, arg->argv, ofilters);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
SetDfilter(struct cmdtab *list, int argc, char **argv)
|
||||
SetDfilter(struct cmdargs const *arg)
|
||||
{
|
||||
if (argc > 0) {
|
||||
(void) Parse(argc, argv, dfilters);
|
||||
if (arg->argc > 0) {
|
||||
(void) Parse(arg->argc, arg->argv, dfilters);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
SetAfilter(struct cmdtab *list, int argc, char **argv)
|
||||
SetAfilter(struct cmdargs const *arg)
|
||||
{
|
||||
if (argc > 0) {
|
||||
(void) Parse(argc, argv, afilters);
|
||||
if (arg->argc > 0) {
|
||||
(void) Parse(arg->argc, arg->argv, afilters);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static char *protoname[] = {
|
||||
"none", "tcp", "udp", "icmp",
|
||||
};
|
||||
|
||||
static char *actname[] = {
|
||||
"none ", "permit ", "deny ",
|
||||
};
|
||||
static const char *protoname[] = { "none", "tcp", "udp", "icmp" };
|
||||
static const char *actname[] = { "none ", "permit ", "deny " };
|
||||
|
||||
static void
|
||||
ShowFilter(struct filterent * fp)
|
||||
@ -462,28 +467,28 @@ ShowFilter(struct filterent * fp)
|
||||
}
|
||||
|
||||
int
|
||||
ShowIfilter(struct cmdtab * list, int argc, char **argv)
|
||||
ShowIfilter(struct cmdargs const *arg)
|
||||
{
|
||||
ShowFilter(ifilters);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ShowOfilter(struct cmdtab * list, int argc, char **argv)
|
||||
ShowOfilter(struct cmdargs const *arg)
|
||||
{
|
||||
ShowFilter(ofilters);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ShowDfilter(struct cmdtab * list, int argc, char **argv)
|
||||
ShowDfilter(struct cmdargs const *arg)
|
||||
{
|
||||
ShowFilter(dfilters);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ShowAfilter(struct cmdtab * list, int argc, char **argv)
|
||||
ShowAfilter(struct cmdargs const *arg)
|
||||
{
|
||||
ShowFilter(afilters);
|
||||
return 0;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: filter.h,v 1.9 1997/08/25 00:29:11 brian Exp $
|
||||
* $Id: filter.h,v 1.10 1997/10/26 01:02:35 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -76,12 +76,12 @@ extern struct filterent ofilters[MAXFILTERS]; /* outgoing packet filter */
|
||||
extern struct filterent dfilters[MAXFILTERS]; /* dial-out packet filter */
|
||||
extern struct filterent afilters[MAXFILTERS]; /* keep-alive packet filter */
|
||||
|
||||
extern int ParseAddr(int, char **, struct in_addr *, struct in_addr *, int *);
|
||||
extern int ShowIfilter(struct cmdtab *, int, char **);
|
||||
extern int ShowOfilter(struct cmdtab *, int, char **);
|
||||
extern int ShowDfilter(struct cmdtab *, int, char **);
|
||||
extern int ShowAfilter(struct cmdtab *, int, char **);
|
||||
extern int SetIfilter(struct cmdtab *, int, char **);
|
||||
extern int SetOfilter(struct cmdtab *, int, char **);
|
||||
extern int SetDfilter(struct cmdtab *, int, char **);
|
||||
extern int SetAfilter(struct cmdtab *, int, char **);
|
||||
extern int ParseAddr(int, char const *const *, struct in_addr *, struct in_addr *, int *);
|
||||
extern int ShowIfilter(struct cmdargs const *);
|
||||
extern int ShowOfilter(struct cmdargs const *);
|
||||
extern int ShowDfilter(struct cmdargs const *);
|
||||
extern int ShowAfilter(struct cmdargs const *);
|
||||
extern int SetIfilter(struct cmdargs const *);
|
||||
extern int SetOfilter(struct cmdargs const *);
|
||||
extern int SetDfilter(struct cmdargs const *);
|
||||
extern int SetAfilter(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: fsm.c,v 1.20 1997/10/26 01:02:37 brian Exp $
|
||||
* $Id: fsm.c,v 1.21 1997/11/11 23:23:11 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Refer loglevel for log output
|
||||
@ -30,6 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -42,7 +43,6 @@
|
||||
#include "ccp.h"
|
||||
#include "modem.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "pred.h"
|
||||
|
||||
@ -64,8 +64,10 @@ char const *StateNames[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
StoppedTimeout(struct fsm * fp)
|
||||
StoppedTimeout(void *v)
|
||||
{
|
||||
struct fsm *fp = (struct fsm *)v;
|
||||
|
||||
LogPrintf(fp->LogLevel, "Stopped timer expired\n");
|
||||
if (modem != -1)
|
||||
DownConnection();
|
||||
@ -283,8 +285,10 @@ FsmSendConfigNak(struct fsm * fp,
|
||||
* Timeout actions
|
||||
*/
|
||||
static void
|
||||
FsmTimeout(struct fsm * fp)
|
||||
FsmTimeout(void *v)
|
||||
{
|
||||
struct fsm *fp = (struct fsm *)v;
|
||||
|
||||
if (fp->restart) {
|
||||
switch (fp->state) {
|
||||
case ST_CLOSING:
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: fsm.h,v 1.10 1997/08/25 00:29:12 brian Exp $
|
||||
* $Id: fsm.h,v 1.11 1997/10/26 01:02:39 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -46,7 +46,7 @@
|
||||
#define OPEN_PASSIVE 1
|
||||
|
||||
struct fsm {
|
||||
char *name; /* Name of protocol */
|
||||
const char *name; /* Name of protocol */
|
||||
u_short proto; /* Protocol number */
|
||||
u_short max_code;
|
||||
int open_mode;
|
||||
@ -105,7 +105,7 @@ struct fsmheader {
|
||||
|
||||
struct fsmcodedesc {
|
||||
void (*action) (struct fsm *, struct fsmheader *, struct mbuf *);
|
||||
char *name;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct fsmconfig {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: hdlc.c,v 1.20 1997/10/26 01:02:43 brian Exp $
|
||||
* $Id: hdlc.c,v 1.21 1997/10/26 12:42:10 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -28,6 +28,7 @@
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -41,9 +42,9 @@
|
||||
#include "pap.h"
|
||||
#include "chap.h"
|
||||
#include "lcp.h"
|
||||
#include "async.h"
|
||||
#include "lqr.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "pred.h"
|
||||
#include "modem.h"
|
||||
@ -64,44 +65,22 @@ static int ifInOctets;
|
||||
|
||||
struct protostat {
|
||||
u_short number;
|
||||
char *name;
|
||||
const char *name;
|
||||
u_long in_count;
|
||||
u_long out_count;
|
||||
} ProtocolStat[] = {
|
||||
|
||||
{
|
||||
PROTO_IP, "IP"
|
||||
},
|
||||
{
|
||||
PROTO_VJUNCOMP, "VJ_UNCOMP"
|
||||
},
|
||||
{
|
||||
PROTO_VJCOMP, "VJ_COMP"
|
||||
},
|
||||
{
|
||||
PROTO_COMPD, "COMPD"
|
||||
},
|
||||
{
|
||||
PROTO_LCP, "LCP"
|
||||
},
|
||||
{
|
||||
PROTO_IPCP, "IPCP"
|
||||
},
|
||||
{
|
||||
PROTO_CCP, "CCP"
|
||||
},
|
||||
{
|
||||
PROTO_PAP, "PAP"
|
||||
},
|
||||
{
|
||||
PROTO_LQR, "LQR"
|
||||
},
|
||||
{
|
||||
PROTO_CHAP, "CHAP"
|
||||
},
|
||||
{
|
||||
0, "Others"
|
||||
},
|
||||
{ PROTO_IP, "IP" },
|
||||
{ PROTO_VJUNCOMP, "VJ_UNCOMP" },
|
||||
{ PROTO_VJCOMP, "VJ_COMP" },
|
||||
{ PROTO_COMPD, "COMPD" },
|
||||
{ PROTO_LCP, "LCP" },
|
||||
{ PROTO_IPCP, "IPCP" },
|
||||
{ PROTO_CCP, "CCP" },
|
||||
{ PROTO_PAP, "PAP" },
|
||||
{ PROTO_LQR, "LQR" },
|
||||
{ PROTO_CHAP, "CHAP" },
|
||||
{ 0, "Others" }
|
||||
};
|
||||
|
||||
static u_short const fcstab[256] = {
|
||||
@ -297,7 +276,7 @@ DecodePacket(u_short proto, struct mbuf * bp)
|
||||
}
|
||||
|
||||
int
|
||||
ReportProtStatus()
|
||||
ReportProtStatus(struct cmdargs const *arg)
|
||||
{
|
||||
struct protostat *statp;
|
||||
int cnt;
|
||||
@ -321,7 +300,7 @@ ReportProtStatus()
|
||||
}
|
||||
|
||||
int
|
||||
ReportHdlcStatus()
|
||||
ReportHdlcStatus(struct cmdargs const *arg)
|
||||
{
|
||||
struct hdlcstat *hp = &HdlcStat;
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: hdlc.h,v 1.10 1997/08/25 00:29:13 brian Exp $
|
||||
* $Id: hdlc.h,v 1.11 1997/10/26 01:02:45 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -61,8 +61,7 @@ extern void HdlcInit(void);
|
||||
extern void HdlcErrorCheck(void);
|
||||
extern void HdlcInput(struct mbuf *);
|
||||
extern void HdlcOutput(int, u_short, struct mbuf *bp);
|
||||
extern void AsyncOutput(int, struct mbuf *, int);
|
||||
extern u_short HdlcFcs(u_short, u_char *, int);
|
||||
extern void DecodePacket(u_short, struct mbuf *);
|
||||
extern int ReportHdlcStatus(void);
|
||||
extern int ReportProtStatus(void);
|
||||
extern int ReportHdlcStatus(struct cmdargs const *);
|
||||
extern int ReportProtStatus(struct cmdargs const *);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: id.c,v 1.1 1997/11/09 06:22:40 brian Exp $
|
||||
* $Id: id.c,v 1.2 1997/11/13 17:31:52 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -12,6 +12,7 @@
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "main.h"
|
||||
@ -37,7 +38,7 @@ ID0init()
|
||||
}
|
||||
|
||||
static void
|
||||
ID0setuser()
|
||||
ID0setuser(void)
|
||||
{
|
||||
if (seteuid(uid) == -1) {
|
||||
LogPrintf(LogERROR, "ID0setuser: Unable to seteuid!\n");
|
||||
@ -52,7 +53,7 @@ ID0realuid()
|
||||
}
|
||||
|
||||
static void
|
||||
ID0set0()
|
||||
ID0set0(void)
|
||||
{
|
||||
if (seteuid(euid) == -1) {
|
||||
LogPrintf(LogERROR, "ID0set0: Unable to seteuid!\n");
|
||||
@ -121,25 +122,25 @@ ID0open(const char *path, int flags)
|
||||
}
|
||||
|
||||
int
|
||||
ID0uu_lock(const char *ttyname)
|
||||
ID0uu_lock(const char *basettyname)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ID0set0();
|
||||
ret = uu_lock(ttyname);
|
||||
LogPrintf(LogID0, "%d = uu_lock(\"%s\")\n", ret, ttyname);
|
||||
ret = uu_lock(basettyname);
|
||||
LogPrintf(LogID0, "%d = uu_lock(\"%s\")\n", ret, basettyname);
|
||||
ID0setuser();
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
ID0uu_unlock(const char *ttyname)
|
||||
ID0uu_unlock(const char *basettyname)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ID0set0();
|
||||
ret = uu_unlock(ttyname);
|
||||
LogPrintf(LogID0, "%d = uu_unlock(\"%s\")\n", ret, ttyname);
|
||||
ret = uu_unlock(basettyname);
|
||||
LogPrintf(LogID0, "%d = uu_unlock(\"%s\")\n", ret, basettyname);
|
||||
ID0setuser();
|
||||
return ret;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ip.c,v 1.30 1997/11/16 22:15:03 brian Exp $
|
||||
* $Id: ip.c,v 1.31 1997/11/18 14:52:04 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Return ICMP message for filterd packet
|
||||
@ -35,10 +35,14 @@
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/if_tun.h>
|
||||
|
||||
#ifndef NOALIAS
|
||||
#include <alias.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -46,6 +50,7 @@
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -54,10 +59,8 @@
|
||||
#include "lcpproto.h"
|
||||
#include "hdlc.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "filter.h"
|
||||
#include "log.h"
|
||||
#include "os.h"
|
||||
#include "ipcp.h"
|
||||
#include "vjcomp.h"
|
||||
@ -69,7 +72,7 @@
|
||||
static struct pppTimer IdleTimer;
|
||||
|
||||
static void
|
||||
IdleTimeout()
|
||||
IdleTimeout(void *v)
|
||||
{
|
||||
LogPrintf(LogPHASE, "Idle timer expired.\n");
|
||||
reconnect(RECON_FALSE);
|
||||
@ -109,7 +112,7 @@ StopIdleTimer()
|
||||
* If any IP layer traffic is detected, refresh IdleTimer.
|
||||
*/
|
||||
static void
|
||||
RestartIdleTimer()
|
||||
RestartIdleTimer(void)
|
||||
{
|
||||
if (!(mode & (MODE_DEDICATED | MODE_DDIAL)) && ipKeepAlive) {
|
||||
StartTimer(&IdleTimer);
|
||||
@ -117,18 +120,16 @@ RestartIdleTimer()
|
||||
}
|
||||
}
|
||||
|
||||
static u_short interactive_ports[32] = {
|
||||
static const u_short interactive_ports[32] = {
|
||||
544, 513, 514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 21, 22, 23, 0, 0, 0, 0, 0, 0, 0, 543,
|
||||
};
|
||||
|
||||
#define INTERACTIVE(p) (interactive_ports[(p) & 0x1F] == (p))
|
||||
|
||||
static char *TcpFlags[] = {
|
||||
"FIN", "SYN", "RST", "PSH", "ACK", "URG",
|
||||
};
|
||||
static const char *TcpFlags[] = { "FIN", "SYN", "RST", "PSH", "ACK", "URG" };
|
||||
|
||||
static char *Direction[] = {"INP", "OUT", "OUT", "IN/OUT"};
|
||||
static const char *Direction[] = {"INP", "OUT", "OUT", "IN/OUT"};
|
||||
static struct filterent *Filters[] = {ifilters, ofilters, dfilters, afilters};
|
||||
|
||||
static int
|
||||
@ -376,7 +377,7 @@ IpInput(struct mbuf * bp)
|
||||
u_char *cp;
|
||||
struct mbuf *wp;
|
||||
int nb, nw;
|
||||
struct tun_data tun, *frag;
|
||||
struct tun_data tun;
|
||||
|
||||
tun_fill_header(tun, AF_INET);
|
||||
cp = tun.data;
|
||||
@ -387,7 +388,9 @@ IpInput(struct mbuf * bp)
|
||||
nb += wp->cnt;
|
||||
}
|
||||
|
||||
#ifndef NOALIAS
|
||||
if (mode & MODE_ALIAS) {
|
||||
struct tun_data *frag;
|
||||
int iresult;
|
||||
char *fptr;
|
||||
|
||||
@ -445,7 +448,9 @@ IpInput(struct mbuf * bp)
|
||||
VarPacketAliasSaveFragment(frag->data);
|
||||
}
|
||||
}
|
||||
} else { /* no aliasing */
|
||||
} else
|
||||
#endif /* #ifndef NOALIAS */
|
||||
{ /* no aliasing */
|
||||
if (PacketCheck(tun.data, nb, FL_IN) < 0) {
|
||||
pfree(bp);
|
||||
return;
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ipcp.c,v 1.36 1997/11/14 15:39:14 brian Exp $
|
||||
* $Id: ipcp.c,v 1.37 1997/11/18 14:52:04 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o More RFC1772 backwoard compatibility
|
||||
@ -36,6 +36,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -48,7 +49,6 @@
|
||||
#include "os.h"
|
||||
#include "phase.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "vjcomp.h"
|
||||
#include "ip.h"
|
||||
@ -101,7 +101,7 @@ struct fsm IpcpFsm = {
|
||||
IpcpDecodeConfig,
|
||||
};
|
||||
|
||||
static char *cftypes[] = {
|
||||
static const char *cftypes[] = {
|
||||
/* Check out the latest ``Assigned numbers'' rfc (rfc1700.txt) */
|
||||
"???",
|
||||
"IPADDRS", /* 1: IP-Addresses */ /* deprecated */
|
||||
@ -111,7 +111,7 @@ static char *cftypes[] = {
|
||||
|
||||
#define NCFTYPES (sizeof(cftypes)/sizeof(char *))
|
||||
|
||||
static char *cftypes128[] = {
|
||||
static const char *cftypes128[] = {
|
||||
/* Check out the latest ``Assigned numbers'' rfc (rfc1700.txt) */
|
||||
"???",
|
||||
"PRIDNS", /* 129: Primary DNS Server Address */
|
||||
@ -137,7 +137,7 @@ IpcpAddOutOctets(int n)
|
||||
}
|
||||
|
||||
int
|
||||
ReportIpcpStatus()
|
||||
ReportIpcpStatus(struct cmdargs const *arg)
|
||||
{
|
||||
struct ipcpstate *icp = &IpcpInfo;
|
||||
struct fsm *fp = &IpcpFsm;
|
||||
@ -303,8 +303,10 @@ IpcpLayerUp(struct fsm * fp)
|
||||
LogPrintf(LogERROR, "IpcpLayerUp: unable to set ip address\n");
|
||||
return;
|
||||
}
|
||||
#ifndef NOALIAS
|
||||
if (mode & MODE_ALIAS)
|
||||
VarPacketAliasSetAddress(IpcpInfo.want_ipaddr);
|
||||
#endif
|
||||
OsLinkup();
|
||||
throughput_start(&throughput);
|
||||
StartIdleTimer();
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ipcp.h,v 1.12 1997/10/26 12:42:11 brian Exp $
|
||||
* $Id: ipcp.h,v 1.13 1997/11/18 14:52:05 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -68,13 +68,12 @@ extern struct in_range DefHisAddress;
|
||||
extern struct in_addr TriggerAddress;
|
||||
extern int HaveTriggerAddress;
|
||||
extern struct fsm IpcpFsm;
|
||||
extern struct pppTimer IpcpReportTimer;
|
||||
|
||||
extern void IpcpInit(void);
|
||||
extern void IpcpDefAddress(void);
|
||||
extern void IpcpUp(void);
|
||||
extern void IpcpOpen(void);
|
||||
extern int ReportIpcpStatus(void);
|
||||
extern int ReportIpcpStatus(struct cmdargs const *);
|
||||
extern void IpcpInput(struct mbuf *);
|
||||
extern void IpcpAddInOctets(int);
|
||||
extern void IpcpAddOutOctets(int);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lcp.c,v 1.46 1997/11/16 22:15:04 brian Exp $
|
||||
* $Id: lcp.c,v 1.47 1997/11/18 14:52:05 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Validate magic number received from peer.
|
||||
@ -30,7 +30,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/if_tun.h>
|
||||
|
||||
#include <signal.h>
|
||||
@ -41,6 +43,7 @@
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -55,7 +58,6 @@
|
||||
#include "lqr.h"
|
||||
#include "phase.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "auth.h"
|
||||
#include "pap.h"
|
||||
@ -80,7 +82,7 @@ static void LcpLayerFinish(struct fsm *);
|
||||
|
||||
#define REJECTED(p, x) (p->his_reject & (1<<x))
|
||||
|
||||
static char *cftypes[] = {
|
||||
static const char *cftypes[] = {
|
||||
/* Check out the latest ``Assigned numbers'' rfc (rfc1700.txt) */
|
||||
"???",
|
||||
"MRU", /* 1: Maximum-Receive-Unit */
|
||||
@ -137,7 +139,7 @@ static struct pppTimer LcpReportTimer;
|
||||
static int LcpFailedMagic;
|
||||
|
||||
static void
|
||||
LcpReportTime()
|
||||
LcpReportTime(void *data)
|
||||
{
|
||||
if (LogIsKept(LogDEBUG)) {
|
||||
time_t t;
|
||||
@ -152,7 +154,7 @@ LcpReportTime()
|
||||
}
|
||||
|
||||
int
|
||||
ReportLcpStatus()
|
||||
ReportLcpStatus(struct cmdargs const *arg)
|
||||
{
|
||||
struct lcpstate *lcp = &LcpInfo;
|
||||
struct fsm *fp = &LcpFsm;
|
||||
@ -180,7 +182,7 @@ ReportLcpStatus()
|
||||
* Generate random number which will be used as magic number.
|
||||
*/
|
||||
static u_long
|
||||
GenerateMagic()
|
||||
GenerateMagic(void)
|
||||
{
|
||||
randinit();
|
||||
return (random());
|
||||
@ -222,8 +224,8 @@ LcpInitRestartCounter(struct fsm * fp)
|
||||
}
|
||||
|
||||
void
|
||||
PutConfValue(int level, u_char ** cpp, char **types, u_char type, int len,
|
||||
u_long val)
|
||||
PutConfValue(int level, u_char ** cpp, const char **types, u_char type,
|
||||
int len, u_long val)
|
||||
{
|
||||
u_char *cp;
|
||||
struct in_addr ina;
|
||||
@ -329,7 +331,7 @@ LcpLayerStart(struct fsm * fp)
|
||||
}
|
||||
|
||||
static void
|
||||
StopAllTimers()
|
||||
StopAllTimers(void)
|
||||
{
|
||||
StopTimer(&LcpReportTimer);
|
||||
StopIdleTimer();
|
||||
@ -420,7 +422,7 @@ LcpClose()
|
||||
static void
|
||||
LcpDecodeConfig(u_char * cp, int plen, int mode_type)
|
||||
{
|
||||
char *request;
|
||||
const char *request;
|
||||
int type, length, mru, mtu;
|
||||
u_long *lp, magic, accmap;
|
||||
u_short *sp, proto;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lcp.h,v 1.11 1997/11/08 00:28:08 brian Exp $
|
||||
* $Id: lcp.h,v 1.12 1997/11/14 15:39:15 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -73,6 +73,6 @@ extern void LcpSendProtoRej(u_char *, int);
|
||||
extern void LcpOpen(int);
|
||||
extern void LcpClose(void);
|
||||
extern void LcpDown(void);
|
||||
extern void PutConfValue(int, u_char **, char **, u_char, int, u_long);
|
||||
extern int ReportLcpStatus(void);
|
||||
extern void PutConfValue(int, u_char **, const char **, u_char, int, u_long);
|
||||
extern int ReportLcpStatus(struct cmdargs const *);
|
||||
extern void LcpInput(struct mbuf *);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: loadalias.c,v 1.9 1997/11/09 06:22:41 brian Exp $
|
||||
* $Id: loadalias.c,v 1.10 1997/11/09 14:18:40 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -13,9 +13,9 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "systems.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "systems.h"
|
||||
#include "id.h"
|
||||
#include "loadalias.h"
|
||||
#include "defs.h"
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
static struct {
|
||||
int offset;
|
||||
char *name;
|
||||
const char *name;
|
||||
} map[] = {
|
||||
entry(PacketAliasGetFragment),
|
||||
entry(PacketAliasInit),
|
||||
@ -48,8 +48,8 @@ static void *dl;
|
||||
int
|
||||
loadAliasHandlers(struct aliasHandlers * h)
|
||||
{
|
||||
char *path;
|
||||
char *env;
|
||||
const char *path;
|
||||
const char *env;
|
||||
int i;
|
||||
|
||||
path = _PATH_ALIAS;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: log.c,v 1.20 1997/11/09 14:18:41 brian Exp $
|
||||
* $Id: log.c,v 1.21 1997/11/11 12:26:34 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -10,14 +10,14 @@
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "defs.h"
|
||||
#include "vars.h"
|
||||
|
||||
static char *LogNames[] = {
|
||||
static const char *LogNames[] = {
|
||||
"Async",
|
||||
"Carrier",
|
||||
"CCP",
|
||||
@ -138,7 +138,7 @@ LogClose()
|
||||
}
|
||||
|
||||
void
|
||||
LogPrintf(int lev, char *fmt,...)
|
||||
LogPrintf(int lev, const char *fmt,...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@ -169,7 +169,7 @@ LogPrintf(int lev, char *fmt,...)
|
||||
}
|
||||
|
||||
void
|
||||
LogDumpBp(int lev, char *hdr, struct mbuf * bp)
|
||||
LogDumpBp(int lev, const char *hdr, const struct mbuf * bp)
|
||||
{
|
||||
if (LogIsKept(lev)) {
|
||||
char buf[50];
|
||||
@ -203,7 +203,7 @@ LogDumpBp(int lev, char *hdr, struct mbuf * bp)
|
||||
}
|
||||
|
||||
void
|
||||
LogDumpBuff(int lev, char *hdr, u_char * ptr, int n)
|
||||
LogDumpBuff(int lev, const char *hdr, const u_char * ptr, int n)
|
||||
{
|
||||
if (LogIsKept(lev)) {
|
||||
char buf[50];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: log.h,v 1.15 1997/11/04 01:17:01 brian Exp $
|
||||
* $Id: log.h,v 1.16 1997/11/09 06:22:42 brian Exp $
|
||||
*/
|
||||
|
||||
#define LogMIN (1)
|
||||
@ -39,6 +39,6 @@ extern int LogIsKept(int);
|
||||
extern void LogOpen(const char *);
|
||||
extern void LogSetTun(int);
|
||||
extern void LogClose(void);
|
||||
extern void LogPrintf(int, char *,...);
|
||||
extern void LogDumpBp(int, char *, struct mbuf *);
|
||||
extern void LogDumpBuff(int, char *, u_char *, int);
|
||||
extern void LogPrintf(int, const char *,...);
|
||||
extern void LogDumpBp(int, const char *, const struct mbuf *);
|
||||
extern void LogDumpBuff(int, const char *, const u_char *, int);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lqr.c,v 1.18 1997/08/31 22:59:35 brian Exp $
|
||||
* $Id: lqr.c,v 1.19 1997/10/26 01:03:08 brian Exp $
|
||||
*
|
||||
* o LQR based on RFC1333
|
||||
*
|
||||
@ -30,6 +30,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -40,7 +41,6 @@
|
||||
#include "hdlc.h"
|
||||
#include "lcp.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "main.h"
|
||||
|
||||
@ -62,7 +62,7 @@ struct echolqr {
|
||||
#define SIGNATURE 0x594e4f54
|
||||
|
||||
static void
|
||||
SendEchoReq()
|
||||
SendEchoReq(void)
|
||||
{
|
||||
struct fsm *fp = &LcpFsm;
|
||||
struct echolqr *lqr, lqrdata;
|
||||
@ -107,7 +107,7 @@ LqrChangeOrder(struct lqrdata * src, struct lqrdata * dst)
|
||||
}
|
||||
|
||||
static void
|
||||
SendLqrReport()
|
||||
SendLqrReport(void *v)
|
||||
{
|
||||
struct mbuf *bp;
|
||||
|
||||
@ -182,7 +182,7 @@ LqrInput(struct mbuf * bp)
|
||||
*/
|
||||
if (LqrTimer.load == 0 || lastpeerin == HisLqrData.PeerInLQRs) {
|
||||
lqmmethod |= LQM_LQR;
|
||||
SendLqrReport();
|
||||
SendLqrReport(0);
|
||||
}
|
||||
lastpeerin = HisLqrData.PeerInLQRs;
|
||||
}
|
||||
@ -218,7 +218,7 @@ StartLqm()
|
||||
LqrTimer.state = TIMER_STOPPED;
|
||||
LqrTimer.load = period * SECTICKS / 100;
|
||||
LqrTimer.func = SendLqrReport;
|
||||
SendLqrReport();
|
||||
SendLqrReport(0);
|
||||
StartTimer(&LqrTimer);
|
||||
LogPrintf(LogLQM, "Will send LQR every %d.%d secs\n",
|
||||
period / 100, period % 100);
|
||||
@ -244,13 +244,13 @@ StopLqr(int method)
|
||||
LogPrintf(LogLQM, "Stop sending LCP ECHO.\n");
|
||||
lqmmethod &= ~method;
|
||||
if (lqmmethod)
|
||||
SendLqrReport();
|
||||
SendLqrReport(0);
|
||||
else
|
||||
StopTimer(&LqrTimer);
|
||||
}
|
||||
|
||||
void
|
||||
LqrDump(char *message, struct lqrdata * lqr)
|
||||
LqrDump(const char *message, const struct lqrdata * lqr)
|
||||
{
|
||||
if (LogIsKept(LogLQM)) {
|
||||
LogPrintf(LogLQM, "%s:\n", message);
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lqr.h,v 1.8 1997/10/26 01:03:10 brian Exp $
|
||||
* $Id: lqr.h,v 1.9 1997/10/26 12:42:12 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -55,7 +55,7 @@ struct lqrsave HisLqrSave;
|
||||
#define LQM_LQR 1
|
||||
#define LQM_ECHO 2
|
||||
|
||||
extern void LqrDump(char *, struct lqrdata *);
|
||||
extern void LqrDump(const char *, const struct lqrdata *);
|
||||
extern void LqrChangeOrder(struct lqrdata *, struct lqrdata *);
|
||||
extern void StartLqm(void);
|
||||
extern void StopLqr(int);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.103 1997/11/18 07:33:23 brian Exp $
|
||||
* $Id: main.c,v 1.104 1997/11/18 18:17:25 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Add commands for traffic summary, version display, etc.
|
||||
@ -33,7 +33,9 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <net/if.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/if_tun.h>
|
||||
|
||||
#include <errno.h>
|
||||
@ -49,6 +51,7 @@
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -62,7 +65,6 @@
|
||||
#include "lcp.h"
|
||||
#include "ipcp.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "auth.h"
|
||||
#include "filter.h"
|
||||
@ -76,6 +78,7 @@
|
||||
#include "async.h"
|
||||
#include "pathnames.h"
|
||||
#include "tun.h"
|
||||
#include "route.h"
|
||||
|
||||
#ifndef O_NONBLOCK
|
||||
#ifdef O_NDELAY
|
||||
@ -94,7 +97,7 @@ static int dial_up;
|
||||
|
||||
static void DoLoop(void);
|
||||
static void TerminalStop(int);
|
||||
static char *ex_desc(int);
|
||||
static const char *ex_desc(int);
|
||||
|
||||
static void
|
||||
TtyInit(int DontWantInt)
|
||||
@ -230,7 +233,7 @@ CloseSession(int signo)
|
||||
}
|
||||
|
||||
static void
|
||||
TerminalCont()
|
||||
TerminalCont(int signo)
|
||||
{
|
||||
pending_signal(SIGCONT, SIG_DFL);
|
||||
pending_signal(SIGTSTP, TerminalStop);
|
||||
@ -266,13 +269,14 @@ BringDownServer(int signo)
|
||||
ServerClose();
|
||||
}
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
ex_desc(int ex)
|
||||
{
|
||||
static char num[12];
|
||||
static char *desc[] = {"normal", "start", "sock",
|
||||
"modem", "dial", "dead", "done", "reboot", "errdead",
|
||||
"hangup", "term", "nodial", "nologin"};
|
||||
static const char *desc[] = {
|
||||
"normal", "start", "sock", "modem", "dial", "dead", "done",
|
||||
"reboot", "errdead", "hangup", "term", "nodial", "nologin"
|
||||
};
|
||||
|
||||
if (ex >= 0 && ex < sizeof(desc) / sizeof(*desc))
|
||||
return desc[ex];
|
||||
@ -281,10 +285,14 @@ ex_desc(int ex)
|
||||
}
|
||||
|
||||
static void
|
||||
Usage()
|
||||
Usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: ppp [-auto | -background | -direct | -dedicated | -ddial ] [ -alias ] [system]\n");
|
||||
"Usage: ppp [-auto | -background | -direct | -dedicated | -ddial ]"
|
||||
#ifndef NOALIAS
|
||||
" [ -alias ]"
|
||||
#endif
|
||||
" [system]\n");
|
||||
exit(EX_START);
|
||||
}
|
||||
|
||||
@ -313,12 +321,14 @@ ProcessArgs(int argc, char **argv)
|
||||
} else if (strcmp(cp, "ddial") == 0) {
|
||||
mode |= MODE_DDIAL;
|
||||
mode &= ~MODE_INTER;
|
||||
#ifndef NOALIAS
|
||||
} else if (strcmp(cp, "alias") == 0) {
|
||||
if (loadAliasHandlers(&VarAliasHandlers) == 0)
|
||||
mode |= MODE_ALIAS;
|
||||
else
|
||||
LogPrintf(LogWARN, "Cannot load alias library\n");
|
||||
optc--; /* this option isn't exclusive */
|
||||
#endif
|
||||
} else
|
||||
Usage();
|
||||
optc++;
|
||||
@ -339,7 +349,7 @@ ProcessArgs(int argc, char **argv)
|
||||
}
|
||||
|
||||
static void
|
||||
Greetings()
|
||||
Greetings(void)
|
||||
{
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "User Process PPP. Written by Toshiharu OHNO.\n");
|
||||
@ -572,7 +582,7 @@ PacketMode()
|
||||
}
|
||||
|
||||
static void
|
||||
ShowHelp()
|
||||
ShowHelp(void)
|
||||
{
|
||||
fprintf(stderr, "The following commands are available:\r\n");
|
||||
fprintf(stderr, " ~p\tEnter Packet mode\r\n");
|
||||
@ -585,7 +595,7 @@ ShowHelp()
|
||||
}
|
||||
|
||||
static void
|
||||
ReadTty()
|
||||
ReadTty(void)
|
||||
{
|
||||
int n;
|
||||
char ch;
|
||||
@ -649,7 +659,7 @@ ReadTty()
|
||||
}
|
||||
case 'm':
|
||||
if (LogIsKept(LogDEBUG)) {
|
||||
ShowMemMap();
|
||||
ShowMemMap(NULL);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -668,7 +678,7 @@ ReadTty()
|
||||
* Here, we'll try to detect HDLC frame
|
||||
*/
|
||||
|
||||
static char *FrameHeaders[] = {
|
||||
static const char *FrameHeaders[] = {
|
||||
"\176\377\003\300\041",
|
||||
"\176\377\175\043\300\041",
|
||||
"\176\177\175\043\100\041",
|
||||
@ -677,10 +687,10 @@ static char *FrameHeaders[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static u_char *
|
||||
static const u_char *
|
||||
HdlcDetect(u_char * cp, int n)
|
||||
{
|
||||
char *ptr, *fp, **hp;
|
||||
const char *ptr, *fp, **hp;
|
||||
|
||||
cp[n] = '\0'; /* be sure to null terminated */
|
||||
ptr = NULL;
|
||||
@ -692,13 +702,13 @@ HdlcDetect(u_char * cp, int n)
|
||||
if (ptr)
|
||||
break;
|
||||
}
|
||||
return ((u_char *) ptr);
|
||||
return ((const u_char *) ptr);
|
||||
}
|
||||
|
||||
static struct pppTimer RedialTimer;
|
||||
|
||||
static void
|
||||
RedialTimeout()
|
||||
RedialTimeout(void *v)
|
||||
{
|
||||
StopTimer(&RedialTimer);
|
||||
LogPrintf(LogPHASE, "Redialing timer expired.\n");
|
||||
@ -727,14 +737,14 @@ StartRedialTimer(int Timeout)
|
||||
|
||||
|
||||
static void
|
||||
DoLoop()
|
||||
DoLoop(void)
|
||||
{
|
||||
fd_set rfds, wfds, efds;
|
||||
int pri, i, n, wfd, nfds;
|
||||
struct sockaddr_in hisaddr;
|
||||
struct timeval timeout, *tp;
|
||||
int ssize = sizeof(hisaddr);
|
||||
u_char *cp;
|
||||
const u_char *cp;
|
||||
int tries;
|
||||
int qlen;
|
||||
int res;
|
||||
@ -835,7 +845,7 @@ DoLoop()
|
||||
|
||||
if ((res = DialModem()) == EX_DONE) {
|
||||
nointr_sleep(1); /* little pause to allow peer starts */
|
||||
ModemTimeout();
|
||||
ModemTimeout(NULL);
|
||||
PacketMode();
|
||||
dial_up = 0;
|
||||
reconnectState = RECON_UNKNOWN;
|
||||
@ -1031,10 +1041,12 @@ DoLoop()
|
||||
if (pri >= 0) {
|
||||
struct mbuf *bp;
|
||||
|
||||
#ifndef NOALIAS
|
||||
if (mode & MODE_ALIAS) {
|
||||
VarPacketAliasIn(rbuff, sizeof rbuff);
|
||||
n = ntohs(((struct ip *) rbuff)->ip_len);
|
||||
}
|
||||
#endif
|
||||
bp = mballoc(n, MB_IPIN);
|
||||
memcpy(MBUF_CTOP(bp), rbuff, n);
|
||||
IpInput(bp);
|
||||
@ -1052,10 +1064,12 @@ DoLoop()
|
||||
if (LcpFsm.state <= ST_CLOSED && (mode & MODE_AUTO)) {
|
||||
pri = PacketCheck(rbuff, n, FL_DIAL);
|
||||
if (pri >= 0) {
|
||||
#ifndef NOALIAS
|
||||
if (mode & MODE_ALIAS) {
|
||||
VarPacketAliasOut(rbuff, sizeof rbuff);
|
||||
n = ntohs(((struct ip *) rbuff)->ip_len);
|
||||
}
|
||||
#endif
|
||||
IpEnqueue(pri, rbuff, n);
|
||||
dial_up = 1; /* XXX */
|
||||
}
|
||||
@ -1063,10 +1077,12 @@ DoLoop()
|
||||
}
|
||||
pri = PacketCheck(rbuff, n, FL_OUT);
|
||||
if (pri >= 0) {
|
||||
#ifndef NOALIAS
|
||||
if (mode & MODE_ALIAS) {
|
||||
VarPacketAliasOut(rbuff, sizeof rbuff);
|
||||
n = ntohs(((struct ip *) rbuff)->ip_len);
|
||||
}
|
||||
#endif
|
||||
IpEnqueue(pri, rbuff, n);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.h,v 1.6 1997/09/25 00:52:35 brian Exp $
|
||||
* $Id: main.h,v 1.7 1997/10/26 01:03:15 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -28,5 +28,4 @@ extern void Cleanup(int);
|
||||
extern void TtyTermMode(void);
|
||||
extern void PacketMode(void);
|
||||
extern void TtyOldMode(void);
|
||||
extern void TtyTermMode(void);
|
||||
extern void TtyCommandMode(int);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: mbuf.c,v 1.9 1997/08/25 00:29:20 brian Exp $
|
||||
* $Id: mbuf.c,v 1.10 1997/10/26 01:03:16 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -28,11 +28,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "server.h"
|
||||
|
||||
@ -150,7 +150,7 @@ mbwrite(struct mbuf * bp, u_char * ptr, int cnt)
|
||||
}
|
||||
|
||||
int
|
||||
ShowMemMap()
|
||||
ShowMemMap(struct cmdargs const *arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: mbuf.h,v 1.7 1997/10/26 01:03:18 brian Exp $
|
||||
* $Id: mbuf.h,v 1.8 1997/10/26 12:42:13 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -60,4 +60,4 @@ extern void mbwrite(struct mbuf *, u_char *, int);
|
||||
extern struct mbuf *mbread(struct mbuf *, u_char *, int);
|
||||
extern void DumpBp(struct mbuf *);
|
||||
extern void LogMemory(void);
|
||||
extern int ShowMemMap(void);
|
||||
extern int ShowMemMap(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: modem.c,v 1.65 1997/11/18 08:49:03 brian Exp $
|
||||
* $Id: modem.c,v 1.66 1997/11/18 14:52:06 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -40,6 +40,7 @@
|
||||
#include <unistd.h>
|
||||
#include <utmp.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -51,7 +52,6 @@
|
||||
#include "ip.h"
|
||||
#include "modem.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "main.h"
|
||||
#include "chat.h"
|
||||
@ -232,7 +232,7 @@ DownConnection()
|
||||
*
|
||||
*/
|
||||
void
|
||||
ModemTimeout()
|
||||
ModemTimeout(void *data)
|
||||
{
|
||||
int ombits = mbits;
|
||||
int change;
|
||||
@ -275,7 +275,7 @@ ModemTimeout()
|
||||
}
|
||||
|
||||
static void
|
||||
StartModemTimer()
|
||||
StartModemTimer(void)
|
||||
{
|
||||
StopTimer(&ModemTimer);
|
||||
ModemTimer.state = TIMER_STOPPED;
|
||||
@ -286,25 +286,18 @@ StartModemTimer()
|
||||
}
|
||||
|
||||
struct parity {
|
||||
char *name;
|
||||
char *name1;
|
||||
const char *name;
|
||||
const char *name1;
|
||||
int set;
|
||||
} validparity[] = {
|
||||
|
||||
{
|
||||
"even", "P_EVEN", CS7 | PARENB
|
||||
}, {
|
||||
"odd", "P_ODD", CS7 | PARENB | PARODD
|
||||
},
|
||||
{
|
||||
"none", "P_ZERO", CS8
|
||||
}, {
|
||||
NULL, 0
|
||||
},
|
||||
} validparity[] = {
|
||||
{ "even", "P_EVEN", CS7 | PARENB },
|
||||
{ "odd", "P_ODD", CS7 | PARENB | PARODD },
|
||||
{ "none", "P_ZERO", CS8 },
|
||||
{ NULL, 0 },
|
||||
};
|
||||
|
||||
static int
|
||||
GetParityValue(char *str)
|
||||
GetParityValue(const char *str)
|
||||
{
|
||||
struct parity *pp;
|
||||
|
||||
@ -318,7 +311,7 @@ GetParityValue(char *str)
|
||||
}
|
||||
|
||||
int
|
||||
ChangeParity(char *str)
|
||||
ChangeParity(const char *str)
|
||||
{
|
||||
struct termios rstio;
|
||||
int val;
|
||||
@ -382,7 +375,7 @@ OpenConnection(char *host, char *port)
|
||||
static char fn[MAXPATHLEN];
|
||||
|
||||
static int
|
||||
LockModem()
|
||||
LockModem(void)
|
||||
{
|
||||
int res;
|
||||
FILE *lockfile;
|
||||
@ -411,7 +404,7 @@ LockModem()
|
||||
}
|
||||
|
||||
static void
|
||||
UnlockModem()
|
||||
UnlockModem(void)
|
||||
{
|
||||
if (*VarDevice != '/')
|
||||
return;
|
||||
@ -425,7 +418,7 @@ UnlockModem()
|
||||
}
|
||||
|
||||
static void
|
||||
HaveModem()
|
||||
HaveModem(void)
|
||||
{
|
||||
throughput_start(&throughput);
|
||||
connect_count++;
|
||||
@ -439,16 +432,22 @@ OpenModem()
|
||||
{
|
||||
struct termios rstio;
|
||||
int oldflag;
|
||||
char *host, *cp, *port;
|
||||
char *host, *port;
|
||||
char *cp;
|
||||
|
||||
if (modem >= 0)
|
||||
LogPrintf(LogDEBUG, "OpenModem: Modem is already open!\n");
|
||||
/* We're going back into "term" mode */
|
||||
else if (mode & MODE_DIRECT) {
|
||||
struct cmdargs arg;
|
||||
arg.cmd = NULL;
|
||||
arg.data = (const void *)VAR_DEVICE;
|
||||
if (isatty(0)) {
|
||||
LogPrintf(LogDEBUG, "OpenModem(direct): Modem is a tty\n");
|
||||
cp = ttyname(0);
|
||||
SetVariable(0, 1, &cp, VAR_DEVICE);
|
||||
arg.argc = 1;
|
||||
arg.argv = (char const *const *)&cp;
|
||||
SetVariable(&arg);
|
||||
if (LockModem() == -1) {
|
||||
close(0);
|
||||
return -1;
|
||||
@ -457,7 +456,9 @@ OpenModem()
|
||||
HaveModem();
|
||||
} else {
|
||||
LogPrintf(LogDEBUG, "OpenModem(direct): Modem is not a tty\n");
|
||||
SetVariable(0, 0, 0, VAR_DEVICE);
|
||||
arg.argc = 0;
|
||||
arg.argv = NULL;
|
||||
SetVariable(&arg);
|
||||
/* We don't call ModemTimeout() with this type of connection */
|
||||
HaveModem();
|
||||
return modem = 0;
|
||||
@ -479,7 +480,7 @@ OpenModem()
|
||||
/* PPP over TCP */
|
||||
cp = strchr(VarDevice, ':');
|
||||
if (cp) {
|
||||
*cp = 0;
|
||||
*cp = '\0';
|
||||
host = VarDevice;
|
||||
port = cp + 1;
|
||||
if (*host && *port) {
|
||||
@ -608,7 +609,7 @@ RawModem()
|
||||
}
|
||||
|
||||
static void
|
||||
UnrawModem()
|
||||
UnrawModem(void)
|
||||
{
|
||||
int oldflag;
|
||||
|
||||
@ -634,7 +635,7 @@ ModemAddOutOctets(int n)
|
||||
}
|
||||
|
||||
static void
|
||||
ClosePhysicalModem()
|
||||
ClosePhysicalModem(void)
|
||||
{
|
||||
LogPrintf(LogDEBUG, "ClosePhysicalModem\n");
|
||||
close(modem);
|
||||
@ -699,7 +700,7 @@ HangupModem(int flag)
|
||||
}
|
||||
|
||||
static void
|
||||
CloseLogicalModem()
|
||||
CloseLogicalModem(void)
|
||||
{
|
||||
LogPrintf(LogDEBUG, "CloseLogicalModem\n");
|
||||
if (modem >= 0) {
|
||||
@ -724,7 +725,7 @@ CloseLogicalModem()
|
||||
* to the line when ModemStartOutput() is called.
|
||||
*/
|
||||
void
|
||||
WriteModem(int pri, char *ptr, int count)
|
||||
WriteModem(int pri, const char *ptr, int count)
|
||||
{
|
||||
struct mbuf *bp;
|
||||
|
||||
@ -842,7 +843,7 @@ DialModem()
|
||||
LogPrintf(LogWARN, "DialModem: login failed.\n");
|
||||
excode = EX_NOLOGIN;
|
||||
}
|
||||
ModemTimeout(); /* Dummy call to check modem status */
|
||||
ModemTimeout(NULL); /* Dummy call to check modem status */
|
||||
} else if (excode == -1)
|
||||
excode = EX_SIG;
|
||||
else {
|
||||
@ -854,9 +855,9 @@ DialModem()
|
||||
}
|
||||
|
||||
int
|
||||
ShowModemStatus()
|
||||
ShowModemStatus(struct cmdargs const *arg)
|
||||
{
|
||||
char *dev;
|
||||
const char *dev;
|
||||
#ifdef TIOCOUTQ
|
||||
int nb;
|
||||
#endif
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: modem.h,v 1.12 1997/10/29 01:19:45 brian Exp $
|
||||
* $Id: modem.h,v 1.13 1997/11/08 00:28:10 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -23,19 +23,19 @@
|
||||
extern int RawModem(void);
|
||||
extern void UpModem(int);
|
||||
extern void DownModem(int);
|
||||
extern void WriteModem(int, char *, int);
|
||||
extern void WriteModem(int, const char *, int);
|
||||
extern void ModemStartOutput(int);
|
||||
extern int OpenModem(void);
|
||||
extern int ModemSpeed(void);
|
||||
extern int ModemQlen(void);
|
||||
extern int DialModem(void);
|
||||
extern speed_t IntToSpeed(int);
|
||||
extern void ModemTimeout(void);
|
||||
extern void ModemTimeout(void *v);
|
||||
extern void DownConnection(void);
|
||||
extern void ModemOutput(int, struct mbuf *);
|
||||
extern int ChangeParity(char *);
|
||||
extern int ChangeParity(const char *);
|
||||
extern void HangupModem(int);
|
||||
extern int ShowModemStatus(void);
|
||||
extern int ShowModemStatus(struct cmdargs const *);
|
||||
extern void Enqueue(struct mqueue *, struct mbuf *);
|
||||
extern struct mbuf *Dequeue(struct mqueue *);
|
||||
extern void ModemAddInOctets(int);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: $
|
||||
* $Id: alias_cmd.c,v 1.6 1997/10/26 01:02:00 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -13,29 +13,29 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "alias_cmd.h"
|
||||
|
||||
|
||||
static int StrToAddr(char *, struct in_addr *);
|
||||
static int StrToPort(char *, u_short *, char *);
|
||||
static int StrToAddrAndPort(char *, struct in_addr *, u_short *, char *);
|
||||
static int StrToAddr(const char *, struct in_addr *);
|
||||
static int StrToPort(const char *, u_short *, const char *);
|
||||
static int StrToAddrAndPort(const char *, struct in_addr *, u_short *, const char *);
|
||||
|
||||
|
||||
int
|
||||
AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
AliasRedirectPort(struct cmdargs const *arg)
|
||||
{
|
||||
if (!(mode & MODE_ALIAS)) {
|
||||
if (VarTerm)
|
||||
fprintf(VarTerm, "Alias not enabled\n");
|
||||
} else if (argc == 3) {
|
||||
} else if (arg->argc == 3) {
|
||||
char proto_constant;
|
||||
char *proto;
|
||||
const char *proto;
|
||||
u_short local_port;
|
||||
u_short alias_port;
|
||||
int error;
|
||||
@ -43,7 +43,7 @@ AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
struct in_addr null_addr;
|
||||
struct alias_link *link;
|
||||
|
||||
proto = argv[0];
|
||||
proto = arg->argv[0];
|
||||
if (strcmp(proto, "tcp") == 0) {
|
||||
proto_constant = IPPROTO_TCP;
|
||||
} else if (strcmp(proto, "udp") == 0) {
|
||||
@ -51,25 +51,25 @@ AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
} else {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "port redirect: protocol must be tcp or udp\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name,
|
||||
list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name,
|
||||
arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
error = StrToAddrAndPort(argv[1], &local_addr, &local_port, proto);
|
||||
error = StrToAddrAndPort(arg->argv[1], &local_addr, &local_port, proto);
|
||||
if (error) {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "port redirect: error reading local addr:port\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
error = StrToPort(argv[2], &alias_port, proto);
|
||||
error = StrToPort(arg->argv[2], &alias_port, proto);
|
||||
if (error) {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "port redirect: error reading alias port\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -84,52 +84,52 @@ AliasRedirectPort(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
fprintf(VarTerm, "port redirect: error returned by packed"
|
||||
" aliasing engine (code=%d)\n", error);
|
||||
} else if (VarTerm)
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
AliasRedirectAddr(struct cmdtab *list, int argc, char **argv, void *param)
|
||||
AliasRedirectAddr(struct cmdargs const *arg)
|
||||
{
|
||||
if (!(mode & MODE_ALIAS)) {
|
||||
if (VarTerm)
|
||||
fprintf(VarTerm, "alias not enabled\n");
|
||||
} else if (argc == 2) {
|
||||
} else if (arg->argc == 2) {
|
||||
int error;
|
||||
struct in_addr local_addr;
|
||||
struct in_addr alias_addr;
|
||||
struct alias_link *link;
|
||||
|
||||
error = StrToAddr(argv[0], &local_addr);
|
||||
error = StrToAddr(arg->argv[0], &local_addr);
|
||||
if (error) {
|
||||
if (VarTerm)
|
||||
fprintf(VarTerm, "address redirect: invalid local address\n");
|
||||
return 1;
|
||||
}
|
||||
error = StrToAddr(argv[1], &alias_addr);
|
||||
error = StrToAddr(arg->argv[1], &alias_addr);
|
||||
if (error) {
|
||||
if (VarTerm) {
|
||||
fprintf(VarTerm, "address redirect: invalid alias address\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
link = VarPacketAliasRedirectAddr(local_addr, alias_addr);
|
||||
if (link == NULL && VarTerm) {
|
||||
fprintf(VarTerm, "address redirect: packet aliasing engine error\n");
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
}
|
||||
} else if (VarTerm)
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", list->name, list->syntax);
|
||||
fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
StrToAddr(char *str, struct in_addr *addr)
|
||||
StrToAddr(const char *str, struct in_addr *addr)
|
||||
{
|
||||
struct hostent *hp;
|
||||
|
||||
@ -147,7 +147,7 @@ StrToAddr(char *str, struct in_addr *addr)
|
||||
|
||||
|
||||
static int
|
||||
StrToPort(char *str, u_short *port, char *proto)
|
||||
StrToPort(const char *str, u_short *port, const char *proto)
|
||||
{
|
||||
int iport;
|
||||
struct servent *sp;
|
||||
@ -169,22 +169,23 @@ StrToPort(char *str, u_short *port, char *proto)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
StrToAddrAndPort(char *str, struct in_addr *addr, u_short *port, char *proto)
|
||||
static int
|
||||
StrToAddrAndPort(const char *str, struct in_addr *addr, u_short *port, const char *proto)
|
||||
{
|
||||
char *ptr;
|
||||
char *colon;
|
||||
int res;
|
||||
|
||||
ptr = strchr(str, ':');
|
||||
if (!ptr) {
|
||||
LogPrintf(LogWARN, "StrToAddrAndPort: %s is missing port number.\n",
|
||||
str);
|
||||
colon = strchr(str, ':');
|
||||
if (!colon) {
|
||||
LogPrintf(LogWARN, "StrToAddrAndPort: %s is missing port number.\n", str);
|
||||
return -1;
|
||||
}
|
||||
*ptr = '\0';
|
||||
++ptr;
|
||||
|
||||
if (StrToAddr(str, addr) != 0)
|
||||
*colon = '\0'; /* Cheat the const-ness ! */
|
||||
res = StrToAddr(str, addr);
|
||||
*colon = ':'; /* Cheat the const-ness ! */
|
||||
if (res != 0)
|
||||
return -1;
|
||||
|
||||
return StrToPort(ptr, port, proto);
|
||||
return StrToPort(colon+1, port, proto);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* $Id: $
|
||||
* $Id: alias_cmd.h,v 1.3 1997/10/26 01:02:01 brian Exp $
|
||||
*/
|
||||
|
||||
extern int AliasRedirectPort(struct cmdtab *, int, char **, void *);
|
||||
extern int AliasRedirectAddr(struct cmdtab *, int, char **, void *);
|
||||
extern int AliasRedirectPort(struct cmdargs const *);
|
||||
extern int AliasRedirectAddr(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: os.c,v 1.33 1997/11/13 12:09:57 brian Exp $
|
||||
* $Id: os.c,v 1.34 1997/11/16 22:15:07 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -26,7 +26,9 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <net/if.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/if_tun.h>
|
||||
#include <net/route.h>
|
||||
#include <arpa/inet.h>
|
||||
@ -39,6 +41,7 @@
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "id.h"
|
||||
@ -48,7 +51,6 @@
|
||||
#include "ipcp.h"
|
||||
#include "os.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "arp.h"
|
||||
#include "systems.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: os.h,v 1.10 1997/10/29 01:19:48 brian Exp $
|
||||
* $Id: os.h,v 1.11 1997/11/16 22:15:09 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -28,5 +28,3 @@ extern int OpenTunnel(int *);
|
||||
extern void OsLinkup(void);
|
||||
extern int OsLinkIsUp(void);
|
||||
extern void OsLinkdown(void);
|
||||
extern void OsSetRoute(int, struct in_addr, struct in_addr, struct in_addr);
|
||||
extern void DeleteIfRoutes(int);
|
||||
|
@ -18,7 +18,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: pap.c,v 1.17 1997/10/16 23:55:19 brian Exp $
|
||||
* $Id: pap.c,v 1.18 1997/10/26 01:03:28 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -37,6 +37,7 @@
|
||||
#endif
|
||||
#include <utmp.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
@ -45,16 +46,13 @@
|
||||
#include "lcp.h"
|
||||
#include "pap.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcpproto.h"
|
||||
#include "phase.h"
|
||||
#include "auth.h"
|
||||
|
||||
static char *papcodes[] = {
|
||||
"???", "REQUEST", "ACK", "NAK"
|
||||
};
|
||||
static const char *papcodes[] = { "???", "REQUEST", "ACK", "NAK" };
|
||||
|
||||
static void
|
||||
SendPapChallenge(int papid)
|
||||
@ -93,7 +91,7 @@ struct authinfo AuthPapInfo = {
|
||||
};
|
||||
|
||||
static void
|
||||
SendPapCode(int id, int code, char *message)
|
||||
SendPapCode(int id, int code, const char *message)
|
||||
{
|
||||
struct fsmheader lh;
|
||||
struct mbuf *bp;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: phase.c,v 1.1 1997/10/26 01:03:31 brian Exp $
|
||||
* $Id: phase.c,v 1.2 1997/10/29 01:19:50 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -7,6 +7,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "lcp.h"
|
||||
@ -20,13 +21,12 @@
|
||||
#include "defs.h"
|
||||
#include "main.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "phase.h"
|
||||
|
||||
int phase = 0; /* Curent phase */
|
||||
|
||||
static char *PhaseNames[] = {
|
||||
static const char *PhaseNames[] = {
|
||||
"Dead", "Establish", "Authenticate", "Network", "Terminate"
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Updated by: Carsten Bormann <cabo@cs.tu-berlin.de>
|
||||
* Original : Dave Rand <dlr@bungi.com>/<dave_rand@novell.com>
|
||||
*
|
||||
* $Id: pred.c,v 1.15 1997/10/26 01:03:34 brian Exp $
|
||||
* $Id: pred.c,v 1.16 1997/11/09 06:22:46 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: route.c,v 1.25 1997/11/11 22:58:13 brian Exp $
|
||||
* $Id: route.c,v 1.26 1997/11/15 02:15:56 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -41,10 +41,10 @@
|
||||
#include <sys/sysctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "defs.h"
|
||||
#include "vars.h"
|
||||
#include "id.h"
|
||||
@ -67,7 +67,8 @@ OsSetRoute(int cmd,
|
||||
{
|
||||
struct rtmsg rtmes;
|
||||
int s, nb, wb;
|
||||
char *cp, *cmdstr;
|
||||
char *cp;
|
||||
const char *cmdstr;
|
||||
u_long *lp;
|
||||
struct sockaddr_in rtdata;
|
||||
|
||||
@ -145,7 +146,8 @@ OsSetRoute(int cmd,
|
||||
static void
|
||||
p_sockaddr(struct sockaddr *phost, struct sockaddr *pmask, int width)
|
||||
{
|
||||
char buf[29], *cp;
|
||||
char buf[29];
|
||||
const char *cp;
|
||||
struct sockaddr_in *ihost = (struct sockaddr_in *)phost;
|
||||
struct sockaddr_in *mask = (struct sockaddr_in *)pmask;
|
||||
struct sockaddr_dl *dl = (struct sockaddr_dl *)phost;
|
||||
@ -244,7 +246,7 @@ struct bits {
|
||||
};
|
||||
|
||||
static void
|
||||
p_flags(u_long f, char *format)
|
||||
p_flags(u_long f, const char *format)
|
||||
{
|
||||
if (VarTerm) {
|
||||
char name[33], *flags;
|
||||
@ -258,7 +260,7 @@ p_flags(u_long f, char *format)
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
Index2Nam(int idx)
|
||||
{
|
||||
static char ifs[50][6];
|
||||
@ -325,7 +327,7 @@ Index2Nam(int idx)
|
||||
}
|
||||
|
||||
int
|
||||
ShowRoute()
|
||||
ShowRoute(struct cmdargs const *arg)
|
||||
{
|
||||
struct rt_msghdr *rtm;
|
||||
struct sockaddr *sa_dst, *sa_gw, *sa_mask;
|
||||
@ -471,7 +473,7 @@ int
|
||||
GetIfIndex(char *name)
|
||||
{
|
||||
int idx;
|
||||
char *got;
|
||||
const char *got;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
idx = 1; /* We start at 1, not 0 */
|
||||
|
@ -17,11 +17,11 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: route.h,v 1.5 1997/08/25 00:29:27 brian Exp $
|
||||
* $Id: route.h,v 1.6 1997/10/26 01:03:38 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
extern int GetIfIndex(char *);
|
||||
extern int ShowRoute(void);
|
||||
extern int ShowRoute(struct cmdargs const *);
|
||||
extern void OsSetRoute(int, struct in_addr, struct in_addr, struct in_addr);
|
||||
extern void DeleteIfRoutes(int);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: server.c,v 1.9 1997/11/09 22:07:29 brian Exp $
|
||||
* $Id: server.c,v 1.10 1997/11/11 22:58:13 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -16,14 +16,13 @@
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "defs.h"
|
||||
#include "vars.h"
|
||||
#include "server.h"
|
||||
#include "log.h"
|
||||
#include "id.h"
|
||||
|
||||
int server = -1;
|
||||
|
@ -1,14 +1,15 @@
|
||||
/*
|
||||
* $Id: $
|
||||
* $Id: sig.c,v 1.9 1997/10/26 01:03:42 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "sig.h"
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "sig.h"
|
||||
|
||||
static caused[NSIG]; /* An array of pending signals */
|
||||
static sig_type handler[NSIG]; /* all start at SIG_DFL */
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: slcompress.c,v 1.12 1997/10/12 21:43:55 brian Exp $
|
||||
* $Id: slcompress.c,v 1.13 1997/10/26 01:03:44 brian Exp $
|
||||
*
|
||||
* Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
|
||||
* - Initial distribution.
|
||||
@ -32,12 +32,12 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
#include "slcompress.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
|
||||
static struct slstat {
|
||||
@ -570,7 +570,7 @@ sl_uncompress_tcp(u_char ** bufp,
|
||||
}
|
||||
|
||||
int
|
||||
ReportCompress()
|
||||
ReportCompress(struct cmdargs const *arg)
|
||||
{
|
||||
if (!VarTerm)
|
||||
return 1;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Definitions for tcp compression routines.
|
||||
*
|
||||
* $Header: /home/ncvs/src/usr.sbin/ppp/slcompress.h,v 1.8 1997/10/07 00:56:58 brian Exp $
|
||||
* $Header: /home/ncvs/src/usr.sbin/ppp/slcompress.h,v 1.9 1997/10/26 01:03:46 brian Exp $
|
||||
*
|
||||
* Copyright (c) 1989 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
@ -18,7 +18,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: slcompress.h,v 1.8 1997/10/07 00:56:58 brian Exp $
|
||||
* $Id: slcompress.h,v 1.9 1997/10/26 01:03:46 brian Exp $
|
||||
*
|
||||
* Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
|
||||
* - Initial distribution.
|
||||
@ -131,4 +131,4 @@ extern void sl_compress_init(struct slcompress *, int);
|
||||
extern u_char sl_compress_tcp
|
||||
(struct mbuf *, struct ip *, struct slcompress *, int);
|
||||
extern int sl_uncompress_tcp(u_char **, int, u_int, struct slcompress *);
|
||||
extern int ReportCompress(void);
|
||||
extern int ReportCompress(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: systems.c,v 1.26 1997/11/13 14:43:20 brian Exp $
|
||||
* $Id: systems.c,v 1.27 1997/11/14 15:38:07 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -31,6 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "id.h"
|
||||
@ -38,7 +39,6 @@
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "ipcp.h"
|
||||
#include "pathnames.h"
|
||||
#include "vars.h"
|
||||
@ -49,7 +49,7 @@
|
||||
#define issep(ch) ((ch) == ' ' || (ch) == '\t')
|
||||
|
||||
FILE *
|
||||
OpenSecret(char *file)
|
||||
OpenSecret(const char *file)
|
||||
{
|
||||
FILE *fp;
|
||||
char line[100];
|
||||
@ -169,7 +169,7 @@ DecodeCtrlCommand(char *line, char *arg)
|
||||
static int userok;
|
||||
|
||||
int
|
||||
AllowUsers(struct cmdtab const *list, int argc, char **argv)
|
||||
AllowUsers(struct cmdargs const *arg)
|
||||
{
|
||||
int f;
|
||||
char *user;
|
||||
@ -177,8 +177,8 @@ AllowUsers(struct cmdtab const *list, int argc, char **argv)
|
||||
userok = 0;
|
||||
user = getlogin();
|
||||
if (user && *user)
|
||||
for (f = 0; f < argc; f++)
|
||||
if (!strcmp("*", argv[f]) || !strcmp(user, argv[f])) {
|
||||
for (f = 0; f < arg->argc; f++)
|
||||
if (!strcmp("*", arg->argv[f]) || !strcmp(user, arg->argv[f])) {
|
||||
userok = 1;
|
||||
break;
|
||||
}
|
||||
@ -188,7 +188,7 @@ AllowUsers(struct cmdtab const *list, int argc, char **argv)
|
||||
|
||||
static struct {
|
||||
int mode;
|
||||
char *name;
|
||||
const char *name;
|
||||
} modes[] = {
|
||||
{ MODE_INTER, "interactive" },
|
||||
{ MODE_AUTO, "auto" },
|
||||
@ -203,21 +203,21 @@ static struct {
|
||||
static int modeok;
|
||||
|
||||
int
|
||||
AllowModes(struct cmdtab const *list, int argc, char **argv)
|
||||
AllowModes(struct cmdargs const *arg)
|
||||
{
|
||||
int f;
|
||||
int m;
|
||||
int allowed;
|
||||
|
||||
allowed = 0;
|
||||
for (f = 0; f < argc; f++) {
|
||||
for (f = 0; f < arg->argc; f++) {
|
||||
for (m = 0; modes[m].mode; m++)
|
||||
if (!strcasecmp(modes[m].name, argv[f])) {
|
||||
if (!strcasecmp(modes[m].name, arg->argv[f])) {
|
||||
allowed |= modes[m].mode;
|
||||
break;
|
||||
}
|
||||
if (modes[m].mode == 0)
|
||||
LogPrintf(LogWARN, "%s: Invalid mode\n", argv[f]);
|
||||
LogPrintf(LogWARN, "%s: Invalid mode\n", arg->argv[f]);
|
||||
}
|
||||
|
||||
modeok = (mode | allowed) == allowed ? 1 : 0;
|
||||
@ -301,7 +301,7 @@ ReadSystem(const char *name, const char *file, int doexec)
|
||||
olauth = VarLocalAuth;
|
||||
if (VarLocalAuth == LOCAL_NO_AUTH)
|
||||
VarLocalAuth = LOCAL_AUTH;
|
||||
RunCommand(argc, argv, name);
|
||||
RunCommand(argc, (char const *const *)argv, name);
|
||||
VarLocalAuth = olauth;
|
||||
}
|
||||
} else if (*cp == '#' || *cp == '\n' || *cp == '\0') {
|
||||
@ -340,12 +340,12 @@ SelectSystem(const char *name, const char *file)
|
||||
}
|
||||
|
||||
int
|
||||
LoadCommand(struct cmdtab const * list, int argc, char **argv)
|
||||
LoadCommand(struct cmdargs const *arg)
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
if (argc > 0)
|
||||
name = *argv;
|
||||
if (arg->argc > 0)
|
||||
name = *arg->argv;
|
||||
else
|
||||
name = "default";
|
||||
|
||||
@ -356,12 +356,12 @@ LoadCommand(struct cmdtab const * list, int argc, char **argv)
|
||||
LogPrintf(LogWARN, "%s: not found.\n", name);
|
||||
return -1;
|
||||
} else
|
||||
SetLabel(argc ? name : NULL);
|
||||
SetLabel(arg->argc ? name : NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
SaveCommand(struct cmdtab const *list, int argc, char **argv)
|
||||
SaveCommand(struct cmdargs const *arg)
|
||||
{
|
||||
LogPrintf(LogWARN, "save command is not implemented (yet).\n");
|
||||
return 1;
|
||||
|
@ -17,15 +17,15 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: systems.h,v 1.8 1997/11/09 06:22:48 brian Exp $
|
||||
* $Id: systems.h,v 1.9 1997/11/11 22:58:14 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
extern int SelectSystem(const char *, const char *);
|
||||
extern int ValidSystem(const char *);
|
||||
extern int AllowUsers(struct cmdtab const *, int, char **);
|
||||
extern int AllowModes(struct cmdtab const *, int, char **);
|
||||
extern FILE *OpenSecret(char *);
|
||||
extern FILE *OpenSecret(const char *);
|
||||
extern void CloseSecret(FILE *);
|
||||
extern int LoadCommand(struct cmdtab const *, int, char **);
|
||||
extern int SaveCommand(struct cmdtab const *, int, char **);
|
||||
extern int AllowUsers(struct cmdargs const *);
|
||||
extern int AllowModes(struct cmdargs const *);
|
||||
extern int LoadCommand(struct cmdargs const *);
|
||||
extern int SaveCommand(struct cmdargs const *);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: throughput.c,v 1.1 1997/11/18 14:52:07 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -8,14 +8,14 @@
|
||||
#include <time.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "timer.h"
|
||||
#include "throughput.h"
|
||||
#include "defs.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
|
||||
void
|
||||
throughput_init(struct pppThroughput *t)
|
||||
@ -74,8 +74,9 @@ throughput_log(struct pppThroughput *t, int level, const char *title)
|
||||
}
|
||||
|
||||
static void
|
||||
throughput_sampler(struct pppThroughput *t)
|
||||
throughput_sampler(void *v)
|
||||
{
|
||||
struct pppThroughput *t = (struct pppThroughput *)v;
|
||||
u_long old;
|
||||
|
||||
StopTimer(&t->Timer);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: timer.c,v 1.22 1997/10/26 01:03:52 brian Exp $
|
||||
* $Id: timer.c,v 1.23 1997/11/09 06:22:49 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -30,6 +30,7 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: timer.h,v 1.1 1997/10/26 01:03:53 brian Exp $
|
||||
* $Id: timer.h,v 1.2 1997/10/26 12:42:13 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -27,7 +27,7 @@ struct pppTimer {
|
||||
int state;
|
||||
u_long rest; /* Ticks to expire */
|
||||
u_long load; /* Initial load value */
|
||||
void (*func)(); /* Function called when timer is expired */
|
||||
void (*func)(void *); /* Function called when timer is expired */
|
||||
void *arg; /* Argument passed to timeout function */
|
||||
struct pppTimer *next; /* Link to next timer */
|
||||
struct pppTimer *enext; /* Link to next expired timer */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: tun.c,v 1.2 1997/11/17 00:42:41 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -8,7 +8,9 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <net/if.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/if_tun.h>
|
||||
|
||||
#include <stdio.h>
|
||||
@ -16,12 +18,13 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "hdlc.h"
|
||||
#include "defs.h"
|
||||
#include "loadalias.h"
|
||||
#include "command.h"
|
||||
#include "vars.h"
|
||||
#include "log.h"
|
||||
#include "tun.h"
|
||||
|
||||
void
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: vars.c,v 1.34 1997/11/11 22:58:14 brian Exp $
|
||||
* $Id: vars.c,v 1.35 1997/11/18 14:52:07 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -26,21 +26,20 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "command.h"
|
||||
#include "hdlc.h"
|
||||
#include "termios.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "auth.h"
|
||||
#include "defs.h"
|
||||
|
||||
char VarVersion[] = "PPP Version 1.4";
|
||||
char VarLocalVersion[] = "$Date: 1997/11/11 22:58:14 $";
|
||||
char VarLocalVersion[] = "$Date: 1997/11/18 14:52:07 $";
|
||||
int Utmp = 0;
|
||||
int ipInOctets = 0;
|
||||
int ipOutOctets = 0;
|
||||
@ -77,7 +76,7 @@ struct pppvars pppVars = {
|
||||
};
|
||||
|
||||
int
|
||||
DisplayCommand()
|
||||
DisplayCommand(struct cmdargs const *arg)
|
||||
{
|
||||
struct confdesc *vp;
|
||||
|
||||
@ -98,18 +97,19 @@ DisplayCommand()
|
||||
}
|
||||
|
||||
static int
|
||||
ConfigCommand(struct cmdtab * list, int argc, char **argv, int mine, int val)
|
||||
ConfigCommand(struct cmdargs const *arg, int mine, int val)
|
||||
{
|
||||
struct confdesc *vp;
|
||||
int err;
|
||||
int narg = 0;
|
||||
|
||||
if (argc < 1)
|
||||
if (arg->argc < 1)
|
||||
return -1;
|
||||
|
||||
err = 0;
|
||||
do {
|
||||
for (vp = pppConfs; vp->name; vp++)
|
||||
if (strcasecmp(vp->name, *argv) == 0) {
|
||||
if (strcasecmp(vp->name, arg->argv[narg]) == 0) {
|
||||
if (mine) {
|
||||
if (vp->myside == CONF_NONE) {
|
||||
LogPrintf(LogWARN, "Config: %s cannot be enabled or disabled\n",
|
||||
@ -128,50 +128,48 @@ ConfigCommand(struct cmdtab * list, int argc, char **argv, int mine, int val)
|
||||
break;
|
||||
}
|
||||
if (!vp->name) {
|
||||
LogPrintf(LogWARN, "Config: %s: No such key word\n", *argv);
|
||||
LogPrintf(LogWARN, "Config: %s: No such key word\n", arg->argv[narg]);
|
||||
err++;
|
||||
}
|
||||
argc--;
|
||||
argv++;
|
||||
} while (argc > 0);
|
||||
} while (++narg < arg->argc);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
EnableCommand(struct cmdtab * list, int argc, char **argv)
|
||||
EnableCommand(struct cmdargs const *arg)
|
||||
{
|
||||
return ConfigCommand(list, argc, argv, 1, CONF_ENABLE);
|
||||
return ConfigCommand(arg, 1, CONF_ENABLE);
|
||||
}
|
||||
|
||||
int
|
||||
DisableCommand(struct cmdtab * list, int argc, char **argv)
|
||||
DisableCommand(struct cmdargs const *arg)
|
||||
{
|
||||
return ConfigCommand(list, argc, argv, 1, CONF_DISABLE);
|
||||
return ConfigCommand(arg, 1, CONF_DISABLE);
|
||||
}
|
||||
|
||||
int
|
||||
AcceptCommand(struct cmdtab * list, int argc, char **argv)
|
||||
AcceptCommand(struct cmdargs const *arg)
|
||||
{
|
||||
return ConfigCommand(list, argc, argv, 0, CONF_ACCEPT);
|
||||
return ConfigCommand(arg, 0, CONF_ACCEPT);
|
||||
}
|
||||
|
||||
int
|
||||
DenyCommand(struct cmdtab * list, int argc, char **argv)
|
||||
DenyCommand(struct cmdargs const *arg)
|
||||
{
|
||||
return ConfigCommand(list, argc, argv, 0, CONF_DENY);
|
||||
return ConfigCommand(arg, 0, CONF_DENY);
|
||||
}
|
||||
|
||||
int
|
||||
LocalAuthCommand(struct cmdtab * list, int argc, char **argv)
|
||||
LocalAuthCommand(struct cmdargs const *arg)
|
||||
{
|
||||
char *pass;
|
||||
if (argc == 0)
|
||||
const char *pass;
|
||||
if (arg->argc == 0)
|
||||
pass = "";
|
||||
else if (argc > 1)
|
||||
else if (arg->argc > 1)
|
||||
return -1;
|
||||
else
|
||||
pass = *argv;
|
||||
pass = *arg->argv;
|
||||
|
||||
if (VarHaveLocalAuthKey)
|
||||
VarLocalAuth = strcmp(VarLocalAuthKey, pass) ? LOCAL_NO_AUTH : LOCAL_AUTH;
|
||||
|
@ -15,13 +15,13 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: vars.h,v 1.33 1997/11/09 22:07:29 brian Exp $
|
||||
* $Id: vars.h,v 1.34 1997/11/18 14:52:08 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
|
||||
struct confdesc {
|
||||
char *name;
|
||||
const char *name;
|
||||
int myside, hisside;
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct pppvars {
|
||||
int dial_tries; /* Dial attempts before giving up, 0 == inf */
|
||||
int loopback; /* Turn around packets addressed to me */
|
||||
char modem_dev[40]; /* Name of device / host:port */
|
||||
char *base_modem_dev; /* Pointer to base of modem_dev */
|
||||
const char *base_modem_dev; /* Pointer to base of modem_dev */
|
||||
int open_mode; /* LCP open mode */
|
||||
#define LOCAL_AUTH 0x01
|
||||
#define LOCAL_NO_AUTH 0x02
|
||||
@ -196,9 +196,9 @@ extern int reconnectCount;
|
||||
*
|
||||
*/
|
||||
|
||||
extern int EnableCommand(struct cmdtab *, int, char **);
|
||||
extern int DisableCommand(struct cmdtab *, int, char **);
|
||||
extern int AcceptCommand(struct cmdtab *, int, char **);
|
||||
extern int DenyCommand(struct cmdtab *, int, char **);
|
||||
extern int LocalAuthCommand(struct cmdtab *, int, char **);
|
||||
extern int DisplayCommand(void);
|
||||
extern int EnableCommand(struct cmdargs const *);
|
||||
extern int DisableCommand(struct cmdargs const *);
|
||||
extern int AcceptCommand(struct cmdargs const *);
|
||||
extern int DenyCommand(struct cmdargs const *);
|
||||
extern int LocalAuthCommand(struct cmdargs const *);
|
||||
extern int DisplayCommand(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: vjcomp.c,v 1.11 1997/10/26 01:04:01 brian Exp $
|
||||
* $Id: vjcomp.c,v 1.12 1997/11/09 06:22:49 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -29,6 +29,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
|
Loading…
Reference in New Issue
Block a user