Final cleanup for now. -Wall is now silent. A couple of bogons found.
This commit is contained in:
parent
5a39b83123
commit
ed6a16c181
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13389
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.2 1995/02/26 12:17:08 amurai Exp $
|
||||
# $Id: Makefile,v 1.3 1995/09/02 17:20:48 amurai Exp $
|
||||
|
||||
PROG= ppp
|
||||
SRCS= async.c auth.c ccp.c chap.c chat.c command.c filter.c fsm.c hdlc.c \
|
||||
@ -6,6 +6,7 @@ SRCS= async.c auth.c ccp.c chap.c chat.c command.c filter.c fsm.c hdlc.c \
|
||||
pap.c pred.c route.c slcompress.c timer.c systems.c uucplock.c vars.c \
|
||||
vjcomp.c arp.c
|
||||
#CFLAGS+= -DHAVE_SHELL_CMD_WITH_ANY_MODE
|
||||
CFLAGS += -Wall
|
||||
MAN8= ppp.8
|
||||
BINMODE=4555
|
||||
BINOWN= root
|
||||
|
@ -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.2 1995/05/30 03:50:23 rgrimes Exp $
|
||||
* $Id: arp.c,v 1.3 1996/01/10 21:27:35 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -54,6 +54,8 @@
|
||||
|
||||
static int rtm_seq;
|
||||
|
||||
static int get_ether_addr __P((int, u_long, struct sockaddr_dl *));
|
||||
|
||||
#define BCOPY(s, d, l) memcpy(d, s, l)
|
||||
#define BZERO(s, n) memset(s, 0, n)
|
||||
/*
|
||||
|
28
usr.sbin/ppp/arp.h
Normal file
28
usr.sbin/ppp/arp.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* User Process PPP
|
||||
*
|
||||
* Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
||||
*
|
||||
* Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the Internet Initiative Japan, Inc. The name of the
|
||||
* IIJ may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.12 1996/01/10 21:27:53 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ARP_H_
|
||||
#define _ARP_H_
|
||||
extern int cifproxyarp __P((int, u_long));
|
||||
extern int sifproxyarp __P((int, u_long));
|
||||
#endif
|
@ -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.3 1995/04/16 12:06:39 amurai Exp $
|
||||
* $Id: async.c,v 1.4 1995/05/30 03:50:24 rgrimes Exp $
|
||||
*
|
||||
*/
|
||||
#include "fsm.h"
|
||||
@ -26,6 +26,7 @@
|
||||
#include "lcpproto.h"
|
||||
#include "modem.h"
|
||||
#include "vars.h"
|
||||
#include "os.h"
|
||||
|
||||
#define HDLCSIZE (MAX_MRU*2+6)
|
||||
|
||||
|
@ -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.4 1995/05/30 03:50:25 rgrimes Exp $
|
||||
* $Id: auth.c,v 1.5 1995/09/02 17:20:49 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Implement check against with registered IP addresses.
|
||||
@ -26,20 +26,24 @@
|
||||
#include "lcpproto.h"
|
||||
#include "ipcp.h"
|
||||
#include "vars.h"
|
||||
#include "filter.h"
|
||||
#include "auth.h"
|
||||
#include "chat.h"
|
||||
|
||||
extern FILE *OpenSecret();
|
||||
extern void CloseSecret();
|
||||
|
||||
LOCAL_AUTH_VALID
|
||||
LocalAuthInit(void){
|
||||
LocalAuthInit(void)
|
||||
{
|
||||
|
||||
char *p;
|
||||
|
||||
if ( gethostname( VarShortHost, sizeof(VarShortHost))) {
|
||||
return(NOT_FOUND);
|
||||
}
|
||||
if ( p = strchr( VarShortHost, '.' ) )
|
||||
p = strchr( VarShortHost, '.' );
|
||||
if (p)
|
||||
*p = '\0';
|
||||
|
||||
VarLocalAuth = LOCAL_NO_AUTH;
|
||||
@ -64,7 +68,7 @@ LocalAuthValidate( char *fname, char *system, char *key) {
|
||||
continue;
|
||||
buff[strlen(buff)-1] = 0;
|
||||
bzero(vector, sizeof(vector));
|
||||
n = MakeArgs(buff, &vector);
|
||||
n = MakeArgs(buff, vector);
|
||||
if (n < 1)
|
||||
continue;
|
||||
if (strcmp(vector[0], system) == 0) {
|
||||
@ -98,7 +102,7 @@ char *fname, *system, *key;
|
||||
continue;
|
||||
buff[strlen(buff)-1] = 0;
|
||||
bzero(vector, sizeof(vector));
|
||||
n = MakeArgs(buff, &vector);
|
||||
n = MakeArgs(buff, vector);
|
||||
if (n < 2)
|
||||
continue;
|
||||
if (strcmp(vector[0], system) == 0) {
|
||||
@ -139,7 +143,7 @@ int len, setaddr;
|
||||
continue;
|
||||
buff[strlen(buff)-1] = 0;
|
||||
bzero(vector, sizeof(vector));
|
||||
n = MakeArgs(buff, &vector);
|
||||
n = MakeArgs(buff, vector);
|
||||
if (n < 2)
|
||||
continue;
|
||||
if (strlen(vector[0]) == len && strncmp(vector[0], system, len) == 0) {
|
||||
|
@ -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.1 1995/02/27 03:17:51 amurai Exp $
|
||||
* $Id: auth.h,v 1.2 1995/05/30 03:50:26 rgrimes Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -39,4 +39,6 @@ extern void SendPapChallenge __P((int));
|
||||
extern void SendChapChallenge __P((int));
|
||||
extern void StopAuthTimer __P((struct authinfo *));
|
||||
extern void StartAuthChallenge __P((struct authinfo *));
|
||||
extern LOCAL_AUTH_VALID LocalAuthInit __P((void));
|
||||
extern int AuthValidate __P((char *, char *, char *));
|
||||
#endif
|
||||
|
@ -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.3 1995/05/30 03:50:27 rgrimes Exp $
|
||||
* $Id: ccp.c,v 1.4 1996/01/10 21:27:36 phk Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Support other compression protocols
|
||||
@ -28,6 +28,7 @@
|
||||
#include "ccp.h"
|
||||
#include "phase.h"
|
||||
#include "vars.h"
|
||||
#include "pred.h"
|
||||
#include "cdefs.h"
|
||||
|
||||
extern void PutConfValue __P((void));
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id:$
|
||||
* $Id: ccp.h,v 1.2 1995/02/26 12:17:15 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -49,4 +49,10 @@ struct ccpstate {
|
||||
|
||||
extern struct ccpstate CcpInfo;
|
||||
|
||||
void CcpRecvResetReq __P((struct fsm *));
|
||||
void CcpSendResetReq __P((struct fsm *));
|
||||
void CcpInput __P((struct mbuf *));
|
||||
void CcpUp __P((void));
|
||||
void CcpOpen __P((void));
|
||||
void CcpInit __P((void));
|
||||
#endif
|
||||
|
29
usr.sbin/ppp/chat.h
Normal file
29
usr.sbin/ppp/chat.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
||||
*
|
||||
* Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
||||
*
|
||||
* Most of codes are derived from chat.c by Karl Fox (karl@MorningStar.Com).
|
||||
*
|
||||
* Chat -- a program for automatic session establishment (i.e. dial
|
||||
* the phone and log in).
|
||||
*
|
||||
* This software is in the public domain.
|
||||
*
|
||||
* Please send all bug reports, requests for information, etc. to:
|
||||
*
|
||||
* Karl Fox <karl@MorningStar.Com>
|
||||
* Morning Star Technologies, Inc.
|
||||
* 1760 Zollinger Road
|
||||
* Columbus, OH 43221
|
||||
* (614)451-1883
|
||||
*
|
||||
* $Id: chat.c,v 1.5 1995/09/02 17:20:50 amurai Exp $
|
||||
*
|
||||
*/
|
||||
#ifndef _CHAT_H_
|
||||
#define _CHAT_H_
|
||||
#include "cdefs.h"
|
||||
extern char * ExpandString __P((char *, char *, int));
|
||||
extern int MakeArgs __P((char *, char **));
|
||||
#endif
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: command.c,v 1.11 1996/01/10 21:27:40 phk Exp $
|
||||
* $Id: command.c,v 1.12 1996/01/11 05:58:59 peter Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
@ -30,6 +30,7 @@
|
||||
#include "lcp.h"
|
||||
#include "ipcp.h"
|
||||
#include "modem.h"
|
||||
#include "filter.h"
|
||||
#include "command.h"
|
||||
#include "hdlc.h"
|
||||
#include "vars.h"
|
||||
@ -318,8 +319,8 @@ static int ShowAuthKey()
|
||||
|
||||
static int ShowVersion()
|
||||
{
|
||||
extern char *VarVersion[];
|
||||
extern char *VarLocalVersion[];
|
||||
extern char VarVersion[];
|
||||
extern char VarLocalVersion[];
|
||||
|
||||
printf("%s - %s \n", VarVersion, VarLocalVersion);
|
||||
return(1);
|
||||
@ -833,7 +834,7 @@ int param;
|
||||
strncpy(VarDevice, *argv, sizeof(VarDevice)-1);
|
||||
break;
|
||||
case VAR_ACCMAP:
|
||||
sscanf(*argv, "%x", &map);
|
||||
sscanf(*argv, "%lx", &map);
|
||||
VarAccmap = map;
|
||||
break;
|
||||
case VAR_PHONE:
|
||||
|
@ -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.2 1995/02/26 12:17:26 amurai Exp $
|
||||
* $Id: filter.h,v 1.3 1995/03/11 15:18:41 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -79,4 +79,5 @@ struct filterent ofilters[MAXFILTERS];
|
||||
struct filterent dfilters[MAXFILTERS];
|
||||
struct filterent afilters[MAXFILTERS]; /* keep Alive packet filter */
|
||||
|
||||
extern int ParseAddr __P((int, char **, struct in_addr *, struct in_addr *, int*));
|
||||
#endif _FILTER_H_
|
||||
|
@ -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.3 1995/05/30 03:50:32 rgrimes Exp $
|
||||
* $Id: fsm.c,v 1.4 1995/09/09 13:23:53 joerg Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Refer loglevel for log output
|
||||
@ -28,13 +28,14 @@
|
||||
#include "lqr.h"
|
||||
#include "lcpproto.h"
|
||||
#include "lcp.h"
|
||||
#include "ccp.h"
|
||||
|
||||
void FsmSendConfigReq(struct fsm *fp);
|
||||
void FsmSendTerminateReq(struct fsm *fp);
|
||||
void FsmInitRestartCounter(struct fsm *fp);
|
||||
void FsmTimeout(struct fsm *fp);
|
||||
|
||||
char *StateNames[] = {
|
||||
char const *StateNames[] = {
|
||||
"Initial", "Starting", "Closed", "Stopped", "Closing", "Stopping",
|
||||
"Req-Sent", "Ack-Rcvd", "Ack-Sent", "Opend",
|
||||
};
|
||||
|
@ -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.2 1995/02/26 12:17:28 amurai Exp $
|
||||
* $Id: fsm.h,v 1.4 1995/02/27 03:17:58 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -116,7 +116,7 @@ u_char ReqBuff[200];
|
||||
|
||||
u_char *ackp, *nakp, *rejp;
|
||||
|
||||
extern char *StateNames[];
|
||||
extern char const *StateNames[];
|
||||
extern void FsmInit __P((struct fsm *));
|
||||
extern void NewState __P((struct fsm *, int));
|
||||
extern void FsmOutput __P((struct fsm *, u_int, u_int, u_char *, int));
|
||||
|
@ -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.5 1995/07/30 15:18:29 gpalmer Exp $
|
||||
* $Id: hdlc.c,v 1.6 1996/01/10 21:27:45 phk Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -27,6 +27,9 @@
|
||||
#include "lcp.h"
|
||||
#include "lqr.h"
|
||||
#include "vars.h"
|
||||
#include "pred.h"
|
||||
#include "modem.h"
|
||||
#include "ccp.h"
|
||||
|
||||
struct hdlcstat {
|
||||
int badfcs;
|
||||
@ -264,7 +267,7 @@ ReportProtStatus()
|
||||
printf(" Protocol in out Protocol in out\n");
|
||||
do {
|
||||
statp++;
|
||||
printf(" %-9s: %8u, %8u",
|
||||
printf(" %-9s: %8lu, %8lu",
|
||||
statp->name, statp->in_count, statp->out_count);
|
||||
if (++cnt == 2) {
|
||||
printf("\n");
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id:$
|
||||
* $Id: hdlc.h,v 1.2 1995/02/26 12:17:31 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -52,8 +52,10 @@
|
||||
unsigned char EscMap[33];
|
||||
|
||||
void HdlcInit __P((void));
|
||||
void HdlcErrorCheck __P((void));
|
||||
void HdlcInput __P((struct mbuf *bp));
|
||||
void HdlcOutput __P((int pri, u_short proto, struct mbuf *bp));
|
||||
void AsyncOutput __P((int pri, struct mbuf *bp, int proto));
|
||||
|
||||
u_short HdlcFcs __P((u_short, u_char *, int));
|
||||
void DecodePacket __P((u_short, struct mbuf *));
|
||||
#endif
|
||||
|
@ -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.5 1995/09/17 16:14:46 amurai Exp $
|
||||
* $Id: ip.c,v 1.6 1996/01/10 21:27:50 phk Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Return ICMP message for filterd packet
|
||||
@ -31,11 +31,11 @@
|
||||
#include <netinet/ip_icmp.h>
|
||||
#include <netinet/udp.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
#include "vars.h"
|
||||
#include "filter.h"
|
||||
|
||||
extern void SendPppFrame();
|
||||
extern int PacketCheck();
|
||||
extern void LcpClose();
|
||||
|
||||
static struct pppTimer IdleTimer;
|
||||
@ -341,7 +341,7 @@ struct mbuf *bp; /* IN: Pointer to IP pakcet */
|
||||
*/
|
||||
nw = write(tun_out, tunbuff, nb);
|
||||
if (nw != nb)
|
||||
fprintf(stderr, "wrote %d, got %d\r\n");
|
||||
fprintf(stderr, "wrote %d, got %d\r\n", nb, nw);
|
||||
pfree(bp);
|
||||
|
||||
RestartIdleTimer();
|
||||
|
29
usr.sbin/ppp/ip.h
Normal file
29
usr.sbin/ppp/ip.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* User Process PPP
|
||||
*
|
||||
* Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
||||
*
|
||||
* Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the Internet Initiative Japan, Inc. The name of the
|
||||
* IIJ may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.12 1996/01/10 21:27:53 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _IP_H_
|
||||
#define _IP_H_
|
||||
extern void IpStartOutput __P((void));
|
||||
extern int PacketCheck __P((char *, int , int));
|
||||
extern void IpEnqueue __P((int, char *, int));
|
||||
#endif
|
@ -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.5 1995/07/04 02:57:11 davidg Exp $
|
||||
* $Id: ipcp.c,v 1.6 1995/07/08 08:28:04 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o More RFC1772 backwoard compatibility
|
||||
@ -120,9 +120,9 @@ ReportIpcpStatus()
|
||||
struct fsm *fp = &IpcpFsm;
|
||||
|
||||
printf("%s [%s]\n", fp->name, StateNames[fp->state]);
|
||||
printf(" his side: %s, %x\n",
|
||||
printf(" his side: %s, %lx\n",
|
||||
inet_ntoa(icp->his_ipaddr), icp->his_compproto);
|
||||
printf(" my side: %s, %x\n",
|
||||
printf(" my side: %s, %lx\n",
|
||||
inet_ntoa(icp->want_ipaddr), icp->want_compproto);
|
||||
printf("connected: %d secs, idle: %d secs\n\n", ipConnectSecs, ipIdleSecs);
|
||||
printf("Defaults:\n");
|
||||
|
@ -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.5 1995/07/08 05:09:57 amurai Exp $
|
||||
* $Id: lcp.c,v 1.6 1995/09/17 16:14:47 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Validate magic number received from peer.
|
||||
@ -30,10 +30,12 @@
|
||||
#include "lcpproto.h"
|
||||
#include "os.h"
|
||||
#include "hdlc.h"
|
||||
#include "ccp.h"
|
||||
#include "lqr.h"
|
||||
#include "phase.h"
|
||||
#include "vars.h"
|
||||
#include "auth.h"
|
||||
#include <arpa/inet.h>
|
||||
|
||||
extern void IpcpUp();
|
||||
extern void IpcpOpen();
|
||||
@ -152,12 +154,12 @@ ReportLcpStatus()
|
||||
|
||||
printf("%s [%s]\n", fp->name, StateNames[fp->state]);
|
||||
printf(
|
||||
" his side: MRU %d, ACCMAP %08x, PROTOCOMP %d, ACFCOMP %d MAGIC %08x\n",
|
||||
" his side: MRU %ld, ACCMAP %08lx, PROTOCOMP %d, ACFCOMP %d MAGIC %08lx\n",
|
||||
lcp->his_mru, lcp->his_accmap, lcp->his_protocomp, lcp->his_acfcomp, lcp->his_magic);
|
||||
printf(
|
||||
" my side: MRU %d, ACCMAP %08x, PROTOCOMP %d, ACFCOMP %d MAGIC %08x\n",
|
||||
" my side: MRU %ld, ACCMAP %08lx, PROTOCOMP %d, ACFCOMP %d MAGIC %08lx\n",
|
||||
lcp->want_mru, lcp->want_accmap, lcp->want_protocomp, lcp->want_acfcomp, lcp->want_magic);
|
||||
printf("\nDefaults: MRU = %d, ACCMAP = %08x\t", VarMRU, VarAccmap);
|
||||
printf("\nDefaults: MRU = %ld, ACCMAP = %08x\t", VarMRU, VarAccmap);
|
||||
printf("Open Mode: %s\n", (VarOpenMode == OPEN_ACTIVE)? "active" : "passive");
|
||||
return(1);
|
||||
}
|
||||
@ -173,7 +175,7 @@ GenerateMagic()
|
||||
|
||||
time(&tl);
|
||||
gettimeofday(&tval, NULL);
|
||||
tl += tval.tv_sec ^ tval.tv_usec + getppid();
|
||||
tl += (tval.tv_sec ^ tval.tv_usec) + getppid();
|
||||
tl *= getpid();
|
||||
return(tl);
|
||||
}
|
||||
@ -220,13 +222,15 @@ int len;
|
||||
u_long val;
|
||||
{
|
||||
u_char *cp;
|
||||
struct in_addr ina;
|
||||
|
||||
cp = *cpp;
|
||||
*cp++ = type; *cp++ = len;
|
||||
if (len == 6) {
|
||||
if (type == TY_IPADDR) {
|
||||
ina.s_addr = htonl(val);
|
||||
LogPrintf(LOG_LCP, " %s [%d] %s\n",
|
||||
types[type], len, inet_ntoa(htonl(val)));
|
||||
types[type], len, inet_ntoa(ina));
|
||||
} else {
|
||||
LogPrintf(LOG_LCP, " %s [%d] %08x\n", types[type], len, val);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: log.h,v 1.2 1995/02/26 12:17:38 amurai Exp $
|
||||
* $Id: log.h,v 1.4 1995/02/27 03:18:16 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -51,4 +51,5 @@ extern void LogClose __P((void));
|
||||
extern void logprintf __P((char *, ...)), LogPrintf __P((int, char *, ...));
|
||||
extern void LogDumpBp __P((int level, char *header, struct mbuf *bp));
|
||||
extern void LogDumpBuff __P((int level, char *header, u_char *ptr, int cnt));
|
||||
extern void ListLog __P((void));
|
||||
#endif
|
||||
|
@ -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.3 1995/04/17 04:21:35 amurai Exp $
|
||||
* $Id: lqr.c,v 1.4 1995/05/30 03:50:44 rgrimes Exp $
|
||||
*
|
||||
* o LQR based on RFC1333
|
||||
*
|
||||
@ -31,6 +31,7 @@
|
||||
#include "hdlc.h"
|
||||
#include "lcp.h"
|
||||
#include "vars.h"
|
||||
#include "main.h"
|
||||
|
||||
struct pppTimer LqrTimer;
|
||||
|
||||
|
@ -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.11 1995/10/08 14:57:29 amurai Exp $
|
||||
* $Id: main.c,v 1.12 1996/01/10 21:27:53 phk Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Add commands for traffic summary, version display, etc.
|
||||
@ -37,11 +37,14 @@
|
||||
#include "modem.h"
|
||||
#include "os.h"
|
||||
#include "hdlc.h"
|
||||
#include "ccp.h"
|
||||
#include "lcp.h"
|
||||
#include "ipcp.h"
|
||||
#include "vars.h"
|
||||
#include "auth.h"
|
||||
#include "filter.h"
|
||||
#include "systems.h"
|
||||
#include "ip.h"
|
||||
|
||||
#define LAUTH_M1 "Warning: No password entry for this host in ppp.secret\n"
|
||||
#define LAUTH_M2 "Warning: All manipulation is allowed by anyone in the world\n"
|
||||
@ -377,7 +380,7 @@ char **argv;
|
||||
snprintf(pid_filename, sizeof (pid_filename), "%s/PPP.%s",
|
||||
_PATH_VARRUN, dstsystem);
|
||||
unlink(pid_filename);
|
||||
sprintf(pid, "%d\n", getpid());
|
||||
sprintf(pid, "%lu\n", getpid());
|
||||
|
||||
if ((fd = open(pid_filename, O_RDWR|O_CREAT, 0666)) != -1)
|
||||
{
|
||||
@ -565,7 +568,8 @@ int n;
|
||||
fp = *hp;
|
||||
if (DEV_IS_SYNC)
|
||||
fp++;
|
||||
if (ptr = strstr((char *)cp, fp))
|
||||
ptr = strstr((char *)cp, fp);
|
||||
if (ptr)
|
||||
break;
|
||||
}
|
||||
return((u_char *)ptr);
|
||||
|
27
usr.sbin/ppp/main.h
Normal file
27
usr.sbin/ppp/main.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* User Process PPP
|
||||
*
|
||||
* Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
||||
*
|
||||
* Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the Internet Initiative Japan, Inc. The name of the
|
||||
* IIJ may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.12 1996/01/10 21:27:53 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MAIN_H_
|
||||
#define _MAIN_H_
|
||||
void Cleanup __P((int));
|
||||
#endif
|
@ -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.9 1995/09/02 17:20:53 amurai Exp $
|
||||
* $Id: modem.c,v 1.10 1996/01/10 21:27:55 phk Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -40,7 +40,6 @@
|
||||
#endif
|
||||
|
||||
extern int DoChat();
|
||||
extern void CloseModem();
|
||||
|
||||
static int mbits; /* Current DCD status */
|
||||
static int connect_time; /* connection time */
|
||||
|
@ -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.2 1995/02/26 12:17:46 amurai Exp $
|
||||
* $Id: modem.h,v 1.4 1995/02/27 03:18:22 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -33,8 +33,13 @@ extern void DownModem __P((int));
|
||||
extern void WriteModem __P((int, char *, int));
|
||||
extern void ModemStartOutput __P((int));
|
||||
extern int OpenModem __P((int));
|
||||
extern void CloseModem __P((void));
|
||||
extern int ModemSpeed __P((void));
|
||||
extern int ModemQlen __P((void));
|
||||
extern int DialModem __P((void));
|
||||
|
||||
extern int SpeedToInt __P((speed_t));
|
||||
extern speed_t IntToSpeed __P((int));
|
||||
extern void ModemTimeout __P((void));
|
||||
extern void DownConnection __P((void));
|
||||
extern void ModemOutput __P((int, struct mbuf *));
|
||||
#endif
|
||||
|
@ -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.2 1995/02/26 12:17:48 amurai Exp $
|
||||
* $Id: os.c,v 1.3 1995/05/30 03:50:52 rgrimes Exp $
|
||||
*
|
||||
*/
|
||||
#include "fsm.h"
|
||||
@ -31,10 +31,14 @@
|
||||
#include <fcntl.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_tun.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include "ipcp.h"
|
||||
#include "os.h"
|
||||
#include "vars.h"
|
||||
#include "arp.h"
|
||||
#include "systems.h"
|
||||
#include "route.h"
|
||||
|
||||
static struct ifaliasreq ifra;
|
||||
static struct ifreq ifrq;
|
||||
|
29
usr.sbin/ppp/pred.h
Normal file
29
usr.sbin/ppp/pred.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
||||
*
|
||||
* Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the Internet Initiative Japan. The name of the
|
||||
* IIJ may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ccp.h,v 1.2 1995/02/26 12:17:15 amurai Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
|
||||
#ifndef _PRED_H_
|
||||
#define _PRED_H_
|
||||
|
||||
extern void Pred1Output __P((int, u_short, struct mbuf *bp));
|
||||
extern void Pred1Input __P((struct mbuf*));
|
||||
extern void Pred1Init __P((int));
|
||||
#endif
|
@ -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.3 1995/05/30 03:50:56 rgrimes Exp $
|
||||
* $Id: route.c,v 1.4 1995/07/08 06:08:52 amurai Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
@ -234,7 +234,7 @@ ShowRoute()
|
||||
mask <<= 8;
|
||||
}
|
||||
}
|
||||
printf("%08x ", mask);
|
||||
printf("%08lx ", mask);
|
||||
p_flags(rtm->rtm_flags & (RTF_UP|RTF_GATEWAY|RTF_HOST), "%-6.6s ");
|
||||
printf("(%d)\n", rtm->rtm_index);
|
||||
}
|
||||
|
27
usr.sbin/ppp/route.h
Normal file
27
usr.sbin/ppp/route.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* User Process PPP
|
||||
*
|
||||
* Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
||||
*
|
||||
* Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the Internet Initiative Japan, Inc. The name of the
|
||||
* IIJ may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.12 1996/01/10 21:27:53 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ROUTE_H_
|
||||
#define _ROUTE_H_
|
||||
int GetIfIndex __P((char *));
|
||||
#endif
|
@ -17,13 +17,13 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: slcompress.c,v 1.2 1995/02/26 12:17:57 amurai Exp $
|
||||
* $Id: slcompress.c,v 1.3 1995/05/30 03:50:57 rgrimes Exp $
|
||||
*
|
||||
* Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
|
||||
* - Initial distribution.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$Header";
|
||||
static char const rcsid[] = "$Id$";
|
||||
#endif
|
||||
|
||||
#include "defs.h"
|
||||
|
28
usr.sbin/ppp/systems.h
Normal file
28
usr.sbin/ppp/systems.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* User Process PPP
|
||||
*
|
||||
* Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
||||
*
|
||||
* Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the Internet Initiative Japan, Inc. The name of the
|
||||
* IIJ may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.12 1996/01/10 21:27:53 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SYSTEMS_H_
|
||||
#define _SYSTEMS_H_
|
||||
extern void GetUid __P((void));
|
||||
extern int SelectSystem __P((char *, char*));
|
||||
#endif
|
@ -30,12 +30,12 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: uucplock.c,v 1.5 1995/05/30 03:51:00 rgrimes Exp $
|
||||
* $Id: uucplock.c,v 1.6 1996/01/10 21:28:03 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)uucplock.c 5.5 (Berkeley) 6/1/90";
|
||||
static char const sccsid[] = "@(#)uucplock.c 5.5 (Berkeley) 6/1/90";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -112,6 +112,7 @@ uu_lock(ttyname)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
uu_unlock(ttyname)
|
||||
char *ttyname;
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user