summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/pred.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-06-09 03:27:43 +0000
committerbrian <brian@FreeBSD.org>1997-06-09 03:27:43 +0000
commit94d661ac8cb907e0a869759f76cd7134c9105e6c (patch)
tree5fa88c28cbdec0d4a0d3d118b33c1042dc49c526 /usr.sbin/ppp/pred.c
parent328d28c6502cfec45b8ead98e18b2d8638499efb (diff)
downloadFreeBSD-src-94d661ac8cb907e0a869759f76cd7134c9105e6c.zip
FreeBSD-src-94d661ac8cb907e0a869759f76cd7134c9105e6c.tar.gz
Overhaul ppp:
o Use syslog o Remove references to stdout/stderr (incl perror()) o Introduce VarTerm - the interactive terminal or zero o Allow "set timeout" to affect current session o Change "set debug" to "set log" o Allow "set log [+|-]flag" o Make MSEXT and PASSWDAUTH stuff the default o Move all #ifdef DEBUG stuff into the code - this shouldn't be too much overhead. It's now controlled with "set log +debug" o Add "set log command, debug, tun, warn, error, alert" o Remove cdefs.h, and assume an ansi compiler. o Improve all diagnostic output o Don't trap SIGSEGV o SIGHUP now terminates again (log files are controlled by syslog) o Call CloseModem() when changing devices o Fix parsing of third arg of "delete" I think this fixes the "magic is same" problems that some people have been experiencing. The man page is being rewritten. It'll follow soon.
Diffstat (limited to 'usr.sbin/ppp/pred.c')
-rw-r--r--usr.sbin/ppp/pred.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/usr.sbin/ppp/pred.c b/usr.sbin/ppp/pred.c
index d7fb09d..93d2a96 100644
--- a/usr.sbin/ppp/pred.c
+++ b/usr.sbin/ppp/pred.c
@@ -5,7 +5,7 @@
/*
*
- * $Id: pred.c,v 1.10 1997/05/10 01:22:18 brian Exp $
+ * $Id: pred.c,v 1.11 1997/06/01 11:35:04 brian Exp $
*
* pred.c -- Test program for Dave Rand's rendition of the
* predictor algorithm
@@ -130,9 +130,7 @@ Pred1Output(int pri, u_short proto, struct mbuf *bp)
fcs = ~fcs;
len = compress(bufp + 2, wp, orglen);
-#ifdef DEBUG
- logprintf("orglen (%d) --> len (%d)\n", orglen, len);
-#endif
+ LogPrintf(LogDEBUG, "Pred1Output: orglen (%d) --> len (%d)\n", orglen, len);
CcpInfo.orgout += orglen;
if (len < orglen) {
*hp |= 0x80;
@@ -174,7 +172,7 @@ struct mbuf *bp;
CcpInfo.compin += olen;
len &= 0x7fff;
if (len != len1) { /* Error is detected. Send reset request */
- LogPrintf(LOG_LCP_BIT, "%s: Length Error\n", CcpFsm.name);
+ LogPrintf(LogLCP, "%s: Length Error\n", CcpFsm.name);
CcpSendResetReq(&CcpFsm);
pfree(bp);
pfree(wp);
@@ -191,11 +189,10 @@ struct mbuf *bp;
*pp++ = *cp++; /* CRC */
*pp++ = *cp++;
fcs = HdlcFcs(INITFCS, bufp, wp->cnt = pp - bufp);
-#ifdef DEBUG
if (fcs != GOODFCS)
- logprintf("fcs = 0x%04x (%s), len = 0x%x, olen = 0x%x\n",
- fcs, (fcs == GOODFCS)? "good" : "bad", len, olen);
-#endif
+ LogPrintf(LogDEBUG, "Pred1Input: fcs = 0x%04x (%s), len = 0x%x,"
+ " olen = 0x%x\n", fcs, (fcs == GOODFCS)? "good" : "bad",
+ len, olen);
if (fcs == GOODFCS) {
wp->offset += 2; /* skip length */
wp->cnt -= 4; /* skip length & CRC */
@@ -213,7 +210,7 @@ struct mbuf *bp;
}
else
{
- LogDumpBp(LOG_HDLC, "Bad FCS", wp);
+ LogDumpBp(LogHDLC, "Bad FCS", wp);
CcpSendResetReq(&CcpFsm);
pfree(wp);
}
OpenPOWER on IntegriCloud