summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ppp/alias_cmd.c3
-rw-r--r--usr.sbin/ppp/async.c9
-rw-r--r--usr.sbin/ppp/auth.c7
-rw-r--r--usr.sbin/ppp/ccp.c3
-rw-r--r--usr.sbin/ppp/chap_ms.c5
-rw-r--r--usr.sbin/ppp/chat.c5
-rw-r--r--usr.sbin/ppp/defs.c3
-rw-r--r--usr.sbin/ppp/filter.c5
-rw-r--r--usr.sbin/ppp/fsm.h3
-rw-r--r--usr.sbin/ppp/hdlc.c23
-rw-r--r--usr.sbin/ppp/hdlc.h4
-rw-r--r--usr.sbin/ppp/id.c7
-rw-r--r--usr.sbin/ppp/ip.c8
-rw-r--r--usr.sbin/ppp/ipcp.c7
-rw-r--r--usr.sbin/ppp/lcp.c8
-rw-r--r--usr.sbin/ppp/log.c3
-rw-r--r--usr.sbin/ppp/lqr.c8
-rw-r--r--usr.sbin/ppp/lqr.h6
-rw-r--r--usr.sbin/ppp/main.c9
-rw-r--r--usr.sbin/ppp/mbuf.c5
-rw-r--r--usr.sbin/ppp/mbuf.h4
-rw-r--r--usr.sbin/ppp/modem.c6
-rw-r--r--usr.sbin/ppp/modem.h4
-rw-r--r--usr.sbin/ppp/os.c7
-rw-r--r--usr.sbin/ppp/phase.h3
-rw-r--r--usr.sbin/ppp/route.c5
-rw-r--r--usr.sbin/ppp/server.c3
-rw-r--r--usr.sbin/ppp/systems.c4
-rw-r--r--usr.sbin/ppp/timer.c8
-rw-r--r--usr.sbin/ppp/timer.h5
-rw-r--r--usr.sbin/ppp/tun.c3
-rw-r--r--usr.sbin/ppp/vars.c7
-rw-r--r--usr.sbin/ppp/vars.h5
-rw-r--r--usr.sbin/ppp/vjcomp.c9
34 files changed, 68 insertions, 136 deletions
diff --git a/usr.sbin/ppp/alias_cmd.c b/usr.sbin/ppp/alias_cmd.c
index 048b5a73d9e..393f19a2e4e 100644
--- a/usr.sbin/ppp/alias_cmd.c
+++ b/usr.sbin/ppp/alias_cmd.c
@@ -2,11 +2,10 @@
* The code in this file was written by Eivind Eklund <perhaps@yes.no>,
* who places it in the public domain without restriction.
*
- * $Id: alias_cmd.c,v 1.4 1997/12/24 10:28:15 brian Exp $
+ * $Id: alias_cmd.c,v 1.5 1998/01/21 02:13:28 brian Exp $
*/
#include <sys/param.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
diff --git a/usr.sbin/ppp/async.c b/usr.sbin/ppp/async.c
index 1f04ace6507..aa6516ff2d5 100644
--- a/usr.sbin/ppp/async.c
+++ b/usr.sbin/ppp/async.c
@@ -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.1 1997/11/23 20:27:32 brian Exp $
+ * $Id: async.c,v 1.2 1998/01/21 02:13:28 brian Exp $
*
*/
#include <sys/param.h>
@@ -39,7 +39,6 @@
#include "modem.h"
#include "loadalias.h"
#include "vars.h"
-#include "os.h"
#include "async.h"
#define HDLCSIZE (MAX_MRU*2+6)
@@ -140,7 +139,7 @@ AsyncDecode(u_char c)
struct mbuf *bp;
if ((hs->mode & MODE_HUNT) && c != HDLC_SYN)
- return (NULLBUFF);
+ return NULL;
switch (c) {
case HDLC_SYN:
@@ -149,7 +148,7 @@ AsyncDecode(u_char c)
bp = mballoc(hs->length, MB_ASYNC);
mbwrite(bp, hs->hbuff, hs->length);
hs->length = 0;
- return (bp);
+ return bp;
}
break;
case HDLC_ESC:
@@ -173,7 +172,7 @@ AsyncDecode(u_char c)
hs->hbuff[hs->length++] = c;
break;
}
- return NULLBUFF;
+ return NULL;
}
void
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c
index 42dd15bd9e6..8c6d78676c7 100644
--- a/usr.sbin/ppp/auth.c
+++ b/usr.sbin/ppp/auth.c
@@ -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.3 1998/01/05 01:39:03 brian Exp $
+ * $Id: auth.c,v 1.4 1998/01/21 02:13:29 brian Exp $
*
* TODO:
* o Implement check against with registered IP addresses.
@@ -31,20 +31,15 @@
#include "command.h"
#include "mbuf.h"
-#include "log.h"
#include "defs.h"
#include "timer.h"
#include "fsm.h"
-#include "lcpproto.h"
#include "ipcp.h"
#include "loadalias.h"
#include "vars.h"
-#include "filter.h"
#include "auth.h"
#include "chat.h"
#include "systems.h"
-#include "iplist.h"
-#include "route.h"
void
LocalAuthInit()
diff --git a/usr.sbin/ppp/ccp.c b/usr.sbin/ppp/ccp.c
index 14e87012753..04ed948828e 100644
--- a/usr.sbin/ppp/ccp.c
+++ b/usr.sbin/ppp/ccp.c
@@ -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.9 1998/01/20 22:46:21 brian Exp $
+ * $Id: ccp.c,v 1.10 1998/01/21 02:13:29 brian Exp $
*
* TODO:
* o Support other compression protocols
@@ -62,7 +62,6 @@ struct fsm CcpFsm = {
0,
ST_INITIAL,
0, 0, 0,
- 0,
{0, 0, 0, NULL, NULL, NULL}, /* FSM timer */
{0, 0, 0, NULL, NULL, NULL}, /* Open timer */
{0, 0, 0, NULL, NULL, NULL}, /* Stopped timer */
diff --git a/usr.sbin/ppp/chap_ms.c b/usr.sbin/ppp/chap_ms.c
index 6ea4bdb0138..00c3383477d 100644
--- a/usr.sbin/ppp/chap_ms.c
+++ b/usr.sbin/ppp/chap_ms.c
@@ -19,7 +19,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: chap_ms.c,v 1.2 1997/12/24 09:30:25 brian Exp $
+ * $Id: chap_ms.c,v 1.3 1998/01/21 02:13:30 brian Exp $
*
*/
@@ -29,12 +29,9 @@
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
-#include <syslog.h>
#include "command.h"
#include "mbuf.h"
-#include "timer.h"
-#include "chap.h"
#include "chap_ms.h"
/* unused, for documentation only */
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index 4c3085480ee..6bcd5cb4226 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -18,7 +18,7 @@
* Columbus, OH 43221
* (614)451-1883
*
- * $Id: chat.c,v 1.5 1997/12/27 07:22:16 brian Exp $
+ * $Id: chat.c,v 1.6 1998/01/21 02:13:30 brian Exp $
*
* TODO:
* o Support more UUCP compatible control sequences.
@@ -36,9 +36,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/socket.h>
#include <sys/time.h>
-#include <sys/uio.h>
#include <sys/wait.h>
#include <termios.h>
#include <unistd.h>
@@ -51,7 +49,6 @@
#include "loadalias.h"
#include "vars.h"
#include "chat.h"
-#include "sig.h"
#include "modem.h"
#ifndef isblank
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c
index b8e72718ba9..435efbb57cc 100644
--- a/usr.sbin/ppp/defs.c
+++ b/usr.sbin/ppp/defs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: defs.c,v 1.6 1997/12/30 20:03:16 brian Exp $
+ * $Id: defs.c,v 1.7 1998/01/21 02:13:31 brian Exp $
*/
#include <sys/param.h>
@@ -33,7 +33,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#include "defs.h"
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index 73fa3177db5..8b2562aad13 100644
--- a/usr.sbin/ppp/filter.c
+++ b/usr.sbin/ppp/filter.c
@@ -17,13 +17,12 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: filter.c,v 1.3 1997/12/24 09:30:29 brian Exp $
+ * $Id: filter.c,v 1.4 1998/01/21 02:13:31 brian Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
#include <sys/param.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -269,7 +268,7 @@ ParseUdpOrTcp(int argc, char const *const *argv, int proto)
return (0);
}
-const char *opname[] = {"none", "eq", "gt", NULL, "lt"};
+static const char *opname[] = {"none", "eq", "gt", NULL, "lt"};
static int
Parse(int argc, char const *const *argv, struct filterent * ofp)
diff --git a/usr.sbin/ppp/fsm.h b/usr.sbin/ppp/fsm.h
index 13872f208f3..09355d18d6e 100644
--- a/usr.sbin/ppp/fsm.h
+++ b/usr.sbin/ppp/fsm.h
@@ -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.4 1998/01/20 22:46:25 brian Exp $
+ * $Id: fsm.h,v 1.5 1998/01/21 02:13:31 brian Exp $
*
* TODO:
*/
@@ -55,7 +55,6 @@ struct fsm {
int restart; /* Restart counter value */
int maxconfig;
- int reqcode; /* Request code sent */
struct pppTimer FsmTimer; /* Restart Timer */
struct pppTimer OpenTimer; /* Delay before opening */
diff --git a/usr.sbin/ppp/hdlc.c b/usr.sbin/ppp/hdlc.c
index 3f9b797d28a..70a15671e96 100644
--- a/usr.sbin/ppp/hdlc.c
+++ b/usr.sbin/ppp/hdlc.c
@@ -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.6 1998/01/10 01:55:16 brian Exp $
+ * $Id: hdlc.c,v 1.7 1998/01/21 02:13:32 brian Exp $
*
* TODO:
*/
@@ -49,7 +49,7 @@
#include "modem.h"
#include "ccp.h"
-struct hdlcstat {
+static struct hdlcstat {
int badfcs;
int badaddr;
int badcommand;
@@ -59,10 +59,8 @@ struct hdlcstat {
static int ifOutPackets;
static int ifOutOctets;
static int ifOutLQRs;
-static int ifInPackets;
-static int ifInOctets;
-struct protostat {
+static struct protostat {
u_short number;
const char *name;
u_long in_count;
@@ -121,8 +119,8 @@ u_char EscMap[33];
void
HdlcInit()
{
- ifInOctets = ifOutOctets = 0;
- ifInPackets = ifOutPackets = 0;
+ ifOutOctets = 0;
+ ifOutPackets = 0;
ifOutLQRs = 0;
}
@@ -138,7 +136,7 @@ HdlcFcs(u_short fcs, u_char * cp, int len)
return (fcs);
}
-inline u_short
+static inline u_short
HdlcFcsBuf(u_short fcs, struct mbuf *m)
{
int len;
@@ -173,7 +171,7 @@ HdlcOutput(int pri, u_short proto, struct mbuf * bp)
return;
if (DEV_IS_SYNC)
- mfcs = NULLBUFF;
+ mfcs = NULL;
else
mfcs = mballoc(2, MB_HDLCOUT);
@@ -371,7 +369,7 @@ Protocol2Nam(u_short proto)
return "unrecognised protocol";
}
-void
+static void
DecodePacket(u_short proto, struct mbuf * bp)
{
u_char *cp;
@@ -406,7 +404,7 @@ DecodePacket(u_short proto, struct mbuf * bp)
case PROTO_VJUNCOMP:
case PROTO_VJCOMP:
bp = VjCompInput(bp, proto);
- if (bp == NULLBUFF) {
+ if (bp == NULL) {
break;
}
/* fall down */
@@ -518,9 +516,6 @@ HdlcInput(struct mbuf * bp)
}
cp = MBUF_CTOP(bp);
- ifInPackets++;
- ifInOctets += bp->cnt;
-
if (!LcpInfo.want_acfcomp) {
/*
diff --git a/usr.sbin/ppp/hdlc.h b/usr.sbin/ppp/hdlc.h
index 18b7d5006c2..2dcad67426b 100644
--- a/usr.sbin/ppp/hdlc.h
+++ b/usr.sbin/ppp/hdlc.h
@@ -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.2 1997/12/06 12:08:58 brian Exp $
+ * $Id: hdlc.h,v 1.3 1998/01/21 02:13:32 brian Exp $
*
* TODO:
*/
@@ -62,7 +62,5 @@ extern void HdlcErrorCheck(void);
extern void HdlcInput(struct mbuf *);
extern void HdlcOutput(int, u_short, struct mbuf *bp);
extern u_short HdlcFcs(u_short, u_char *, int);
-extern u_short HdlcFcsBuf(u_short, struct mbuf *);
-extern void DecodePacket(u_short, struct mbuf *);
extern int ReportHdlcStatus(struct cmdargs const *);
extern int ReportProtStatus(struct cmdargs const *);
diff --git a/usr.sbin/ppp/id.c b/usr.sbin/ppp/id.c
index 7495c691f76..34ad2e51f93 100644
--- a/usr.sbin/ppp/id.c
+++ b/usr.sbin/ppp/id.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: id.c,v 1.3 1997/12/27 19:22:26 brian Exp $
+ * $Id: id.c,v 1.4 1998/01/21 02:13:33 brian Exp $
*/
#include <sys/types.h>
@@ -32,7 +32,6 @@
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
#include <sysexits.h>
#include <unistd.h>
@@ -48,17 +47,13 @@
#include "id.h"
static int uid;
-static int gid;
static int euid;
-static int egid;
void
ID0init()
{
uid = getuid();
- gid = getgid();
euid = geteuid();
- egid = getegid();
}
static void
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index 5da419aecbb..b686f4a5bf8 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -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.6 1998/01/11 17:55:18 brian Exp $
+ * $Id: ip.c,v 1.7 1998/01/21 02:13:33 brian Exp $
*
* TODO:
* o Return ICMP message for filterd packet
@@ -25,8 +25,9 @@
*/
#include <sys/param.h>
#include <sys/time.h>
-#include <sys/select.h>
#include <sys/socket.h>
+#include <net/if.h>
+#include <net/if_tun.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
@@ -34,8 +35,6 @@
#include <netinet/udp.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
-#include <net/if.h>
-#include <net/if_tun.h>
#ifndef NOALIAS
#include <alias.h>
@@ -53,7 +52,6 @@
#include "defs.h"
#include "timer.h"
#include "fsm.h"
-#include "lcpproto.h"
#include "hdlc.h"
#include "loadalias.h"
#include "vars.h"
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index 137611fbcdf..5ccc5ae0cb7 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -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.12 1998/01/20 22:46:25 brian Exp $
+ * $Id: ipcp.c,v 1.13 1998/01/21 02:13:34 brian Exp $
*
* TODO:
* o More RFC1772 backwoard compatibility
@@ -30,11 +30,9 @@
#include <sys/socket.h>
#include <netdb.h>
-#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#include "command.h"
@@ -88,7 +86,6 @@ struct fsm IpcpFsm = {
ST_INITIAL,
0, 0, 0,
- 0,
{0, 0, 0, NULL, NULL, NULL}, /* FSM timer */
{0, 0, 0, NULL, NULL, NULL}, /* Open timer */
{0, 0, 0, NULL, NULL, NULL}, /* Stopped timer */
@@ -126,7 +123,7 @@ static const char *cftypes128[] = {
#define NCFTYPES128 (sizeof cftypes128/sizeof cftypes128[0])
-struct pppThroughput throughput;
+static struct pppThroughput throughput;
void
IpcpAddInOctets(int n)
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index edefcd306b3..9cf49252c4d 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -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.7 1998/01/20 22:46:26 brian Exp $
+ * $Id: lcp.c,v 1.8 1998/01/21 02:13:34 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
@@ -25,12 +25,11 @@
*/
#include <sys/param.h>
#include <sys/time.h>
-#include <sys/select.h>
#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
#include <net/if.h>
#include <net/if_tun.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include <signal.h>
#include <stdarg.h>
@@ -123,7 +122,6 @@ struct fsm LcpFsm = {
1, /* Open mode delay */
ST_INITIAL, /* State of machine */
0, 0, 0,
- 0,
{0, 0, 0, NULL, NULL, NULL}, /* FSM timer */
{0, 0, 0, NULL, NULL, NULL}, /* Open timer */
{0, 0, 0, NULL, NULL, NULL}, /* Stopped timer */
diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c
index b841be98512..1655e3d0d8b 100644
--- a/usr.sbin/ppp/log.c
+++ b/usr.sbin/ppp/log.c
@@ -23,12 +23,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: log.c,v 1.3 1997/12/24 09:30:40 brian Exp $
+ * $Id: log.c,v 1.4 1998/01/21 02:13:35 brian Exp $
*/
#include <sys/param.h>
#include <netinet/in.h>
-#include <sys/socket.h>
#include <stdarg.h>
#include <stdio.h>
diff --git a/usr.sbin/ppp/lqr.c b/usr.sbin/ppp/lqr.c
index da8343fe944..18c7d45300a 100644
--- a/usr.sbin/ppp/lqr.c
+++ b/usr.sbin/ppp/lqr.c
@@ -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.2 1998/01/11 17:54:47 brian Exp $
+ * $Id: lqr.c,v 1.3 1998/01/21 02:13:35 brian Exp $
*
* o LQR based on RFC1333
*
@@ -42,9 +42,11 @@
#include "lcp.h"
#include "loadalias.h"
#include "vars.h"
-#include "main.h"
-struct pppTimer LqrTimer;
+struct lqrdata MyLqrData, HisLqrData;
+struct lqrsave HisLqrSave;
+
+static struct pppTimer LqrTimer;
static u_long lastpeerin = (u_long) - 1;
diff --git a/usr.sbin/ppp/lqr.h b/usr.sbin/ppp/lqr.h
index c001d2f3135..6b260e298bc 100644
--- a/usr.sbin/ppp/lqr.h
+++ b/usr.sbin/ppp/lqr.h
@@ -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.2 1998/01/11 17:54:48 brian Exp $
+ * $Id: lqr.h,v 1.3 1998/01/21 02:13:36 brian Exp $
*
* TODO:
*/
@@ -46,8 +46,8 @@ struct lqrsave {
u_int32_t SaveInOctets;
};
-struct lqrdata MyLqrData, HisLqrData;
-struct lqrsave HisLqrSave;
+extern struct lqrdata MyLqrData, HisLqrData;
+extern struct lqrsave HisLqrSave;
/*
* We support LQR and ECHO as LQM method
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 5e0c7358ae6..2e7cb521d2e 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -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.14 1998/01/20 22:46:27 brian Exp $
+ * $Id: main.c,v 1.15 1998/01/21 02:13:36 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -27,13 +27,12 @@
#include <sys/time.h>
#include <sys/select.h>
#include <sys/socket.h>
+#include <net/if.h>
+#include <net/if_tun.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
-#include <netdb.h>
-#include <net/if.h>
-#include <net/if_tun.h>
#include <errno.h>
#include <fcntl.h>
@@ -44,7 +43,6 @@
#include <string.h>
#include <sys/time.h>
#include <sys/wait.h>
-#include <sysexits.h>
#include <termios.h>
#include <unistd.h>
@@ -69,7 +67,6 @@
#include "ip.h"
#include "sig.h"
#include "server.h"
-#include "lcpproto.h"
#include "main.h"
#include "vjcomp.h"
#include "async.h"
diff --git a/usr.sbin/ppp/mbuf.c b/usr.sbin/ppp/mbuf.c
index c7d8a68b993..397faca503a 100644
--- a/usr.sbin/ppp/mbuf.c
+++ b/usr.sbin/ppp/mbuf.c
@@ -17,11 +17,10 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: mbuf.c,v 1.2 1997/12/28 02:57:12 brian Exp $
+ * $Id: mbuf.c,v 1.3 1998/01/21 02:13:37 brian Exp $
*
*/
#include <sys/param.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
@@ -36,7 +35,7 @@
#include "vars.h"
#include "server.h"
-struct memmap {
+static struct memmap {
struct mbuf *queue;
int count;
} MemMap[MB_MAX + 2];
diff --git a/usr.sbin/ppp/mbuf.h b/usr.sbin/ppp/mbuf.h
index 717020d4d40..d2eeae96f13 100644
--- a/usr.sbin/ppp/mbuf.h
+++ b/usr.sbin/ppp/mbuf.h
@@ -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.2 1997/12/06 12:09:00 brian Exp $
+ * $Id: mbuf.h,v 1.3 1998/01/21 02:13:37 brian Exp $
*
* TODO:
*/
@@ -36,8 +36,6 @@ struct mqueue {
int qlen;
};
-#define NULLBUFF ((struct mbuf *)0)
-
#define MBUF_CTOP(bp) (bp->base + bp->offset)
#define MB_ASYNC 1
diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c
index fd174918f48..15c3472935c 100644
--- a/usr.sbin/ppp/modem.c
+++ b/usr.sbin/ppp/modem.c
@@ -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 1998/01/20 22:46:29 brian Exp $
+ * $Id: modem.c,v 1.10 1998/01/21 02:13:38 brian Exp $
*
* TODO:
*/
@@ -35,8 +35,6 @@
#include <string.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
-#include <termios.h>
-#include <time.h>
#include <unistd.h>
#include <utmp.h>
@@ -293,7 +291,7 @@ StartModemTimer(void)
StartTimer(&ModemTimer);
}
-struct parity {
+static struct parity {
const char *name;
const char *name1;
int set;
diff --git a/usr.sbin/ppp/modem.h b/usr.sbin/ppp/modem.h
index 7112096582d..858ef1eeb4c 100644
--- a/usr.sbin/ppp/modem.h
+++ b/usr.sbin/ppp/modem.h
@@ -15,14 +15,12 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: modem.h,v 1.2 1998/01/10 01:55:17 brian Exp $
+ * $Id: modem.h,v 1.3 1998/01/21 02:13:38 brian Exp $
*
* TODO:
*/
extern int RawModem(void);
-extern void UpModem(int);
-extern void DownModem(int);
extern void WriteModem(int, const char *, int);
extern void ModemStartOutput(int);
extern int OpenModem(void);
diff --git a/usr.sbin/ppp/os.c b/usr.sbin/ppp/os.c
index ad4eaed088d..6818680a9ad 100644
--- a/usr.sbin/ppp/os.c
+++ b/usr.sbin/ppp/os.c
@@ -17,17 +17,14 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: os.c,v 1.7 1998/01/19 02:57:33 brian Exp $
+ * $Id: os.c,v 1.8 1998/01/21 02:13:39 brian Exp $
*
*/
#include <sys/param.h>
#include <sys/time.h>
-#include <sys/select.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
-#include <net/if_tun.h>
-#include <net/route.h>
#include <arpa/inet.h>
#include <errno.h>
@@ -54,7 +51,6 @@
#include "route.h"
#include "lcp.h"
#include "ccp.h"
-#include "modem.h"
char *IfDevName;
@@ -215,7 +211,6 @@ OsSetIpaddress(struct in_addr myaddr, struct in_addr hisaddr)
}
static struct in_addr peer_addr;
-struct in_addr defaddr;
void
OsLinkup()
diff --git a/usr.sbin/ppp/phase.h b/usr.sbin/ppp/phase.h
index 75b909e6d00..f82529d7968 100644
--- a/usr.sbin/ppp/phase.h
+++ b/usr.sbin/ppp/phase.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: phase.h,v 1.1 1997/11/23 20:27:35 brian Exp $
+ * $Id: phase.h,v 1.2 1998/01/21 02:13:39 brian Exp $
*
* TODO:
*/
@@ -25,7 +25,6 @@
#define PHASE_AUTHENTICATE 2 /* Being authenticated */
#define PHASE_NETWORK 3
#define PHASE_TERMINATE 4 /* Terminating link */
-#define PHASE_OSLINKED 5 /* The OS is linked up */
extern int phase; /* Curent phase */
diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c
index 1aec5c6837b..6d03059580d 100644
--- a/usr.sbin/ppp/route.c
+++ b/usr.sbin/ppp/route.c
@@ -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.14 1998/01/19 02:57:34 brian Exp $
+ * $Id: route.c,v 1.15 1998/01/21 02:13:40 brian Exp $
*
*/
@@ -27,7 +27,6 @@
#include <net/if_types.h>
#include <net/route.h>
#include <net/if.h>
-#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if_dl.h>
@@ -252,7 +251,7 @@ p_sockaddr(struct sockaddr *phost, struct sockaddr *pmask, int width)
fprintf(VarTerm, "%-*s ", width-1, buf);
}
-struct bits {
+static struct bits {
u_long b_mask;
char b_val;
} bits[] = {
diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c
index 840a860a56a..90641fb6532 100644
--- a/usr.sbin/ppp/server.c
+++ b/usr.sbin/ppp/server.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: server.c,v 1.5 1997/12/24 09:30:49 brian Exp $
+ * $Id: server.c,v 1.6 1998/01/21 02:13:40 brian Exp $
*/
#include <sys/param.h>
@@ -31,7 +31,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/in_systm.h>
-#include <netinet/ip.h>
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c
index c1157e94276..1d7c65ac3a4 100644
--- a/usr.sbin/ppp/systems.c
+++ b/usr.sbin/ppp/systems.c
@@ -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.7 1997/12/24 09:30:53 brian Exp $
+ * $Id: systems.c,v 1.8 1998/01/21 02:13:41 brian Exp $
*
* TODO:
*/
@@ -39,11 +39,9 @@
#include "timer.h"
#include "fsm.h"
#include "loadalias.h"
-#include "ipcp.h"
#include "pathnames.h"
#include "vars.h"
#include "server.h"
-#include "chat.h"
#include "systems.h"
#define issep(ch) ((ch) == ' ' || (ch) == '\t')
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index c6c71e88717..173622a5a0e 100644
--- a/usr.sbin/ppp/timer.c
+++ b/usr.sbin/ppp/timer.c
@@ -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.3 1997/12/29 22:23:41 brian Exp $
+ * $Id: timer.c,v 1.4 1998/01/21 02:13:41 brian Exp $
*
* TODO:
*/
@@ -27,17 +27,15 @@
#include <errno.h>
#endif
#include <sys/time.h>
-#include <stdio.h>
#include <unistd.h>
#include "command.h"
#include "mbuf.h"
#include "log.h"
-#include "defs.h"
#include "sig.h"
#include "timer.h"
-struct pppTimer *TimerList = NULL;
+static struct pppTimer *TimerList = NULL;
static void StopTimerNoBlock(struct pppTimer *);
static void InitTimerService(void);
@@ -143,7 +141,7 @@ StopTimerNoBlock(struct pppTimer * tp)
tp->state = TIMER_STOPPED;
}
-void
+static void
TimerService()
{
struct pppTimer *tp, *exp, *wt;
diff --git a/usr.sbin/ppp/timer.h b/usr.sbin/ppp/timer.h
index c90abae8141..ba18da519bd 100644
--- a/usr.sbin/ppp/timer.h
+++ b/usr.sbin/ppp/timer.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.2 1997/12/28 21:54:25 brian Exp $
+ * $Id: timer.h,v 1.3 1998/01/21 02:13:42 brian Exp $
*
* TODO:
*/
@@ -37,11 +37,8 @@ struct pppTimer {
#define TIMER_RUNNING 1
#define TIMER_EXPIRED 2
-extern struct pppTimer *TimerList;
-
extern void StartTimer(struct pppTimer *);
extern void StopTimer(struct pppTimer *);
-extern void TimerService(void);
extern void TermTimerService(void);
extern void ShowTimers(void);
diff --git a/usr.sbin/ppp/tun.c b/usr.sbin/ppp/tun.c
index 6606041d5e5..17b472942e8 100644
--- a/usr.sbin/ppp/tun.c
+++ b/usr.sbin/ppp/tun.c
@@ -23,12 +23,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tun.c,v 1.3 1998/01/11 17:55:21 brian Exp $
+ * $Id: tun.c,v 1.4 1998/01/21 02:13:42 brian Exp $
*/
#include <sys/param.h>
#include <sys/time.h>
-#include <sys/select.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
diff --git a/usr.sbin/ppp/vars.c b/usr.sbin/ppp/vars.c
index efb528c23dd..08b69ccdb11 100644
--- a/usr.sbin/ppp/vars.c
+++ b/usr.sbin/ppp/vars.c
@@ -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.6 1998/01/20 22:46:32 brian Exp $
+ * $Id: vars.c,v 1.7 1998/01/21 02:13:43 brian Exp $
*
*/
#include <sys/param.h>
@@ -39,12 +39,9 @@
#include "auth.h"
char VarVersion[] = "PPP Version 1.65";
-char VarLocalVersion[] = "$Date: 1998/01/20 22:46:32 $";
+char VarLocalVersion[] = "$Date: 1998/01/21 02:13:43 $";
int Utmp = 0;
-int ipInOctets = 0;
-int ipOutOctets = 0;
int ipKeepAlive = 0;
-int ipConnectSecs = 0;
int reconnectState = RECON_UNKNOWN;
int reconnectCount = 0;
diff --git a/usr.sbin/ppp/vars.h b/usr.sbin/ppp/vars.h
index bfc24bbe999..5921ab80c89 100644
--- a/usr.sbin/ppp/vars.h
+++ b/usr.sbin/ppp/vars.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: vars.h,v 1.6 1998/01/20 22:46:32 brian Exp $
+ * $Id: vars.h,v 1.7 1998/01/21 02:13:44 brian Exp $
*
* TODO:
*/
@@ -156,10 +156,7 @@ extern char VarVersion[];
extern char VarLocalVersion[];
extern int Utmp; /* Are we in /etc/utmp ? */
-extern int ipInOctets;
-extern int ipOutOctets;
extern int ipKeepAlive;
-extern int ipConnectSecs;
extern int reconnectState;
extern int reconnectCount;
diff --git a/usr.sbin/ppp/vjcomp.c b/usr.sbin/ppp/vjcomp.c
index 8e3c4830cd7..7036980cb82 100644
--- a/usr.sbin/ppp/vjcomp.c
+++ b/usr.sbin/ppp/vjcomp.c
@@ -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.3 1998/01/11 17:54:49 brian Exp $
+ * $Id: vjcomp.c,v 1.4 1998/01/21 02:13:44 brian Exp $
*
* TODO:
*/
@@ -32,7 +32,6 @@
#include "command.h"
#include "mbuf.h"
#include "log.h"
-#include "defs.h"
#include "timer.h"
#include "fsm.h"
#include "lcpproto.h"
@@ -43,7 +42,7 @@
#define MAX_VJHEADER 16 /* Maximum size of compressed header */
-struct slcompress cslc;
+static struct slcompress cslc;
void
VjInit(int max_state)
@@ -103,7 +102,7 @@ VjUncompressTcp(struct mbuf * bp, u_char type)
len = sl_uncompress_tcp(&bufp, len, type, &cslc);
if (len <= 0) {
pfree(bp);
- bp = NULLBUFF;
+ bp = NULL;
}
return (bp);
}
@@ -121,7 +120,7 @@ VjUncompressTcp(struct mbuf * bp, u_char type)
len = sl_uncompress_tcp(&bufp, olen, type, &cslc);
if (len <= 0) {
pfree(bp);
- return NULLBUFF;
+ return NULL;
}
len -= olen;
len += rlen;