diff options
author | brian <brian@FreeBSD.org> | 1997-06-09 03:27:43 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-06-09 03:27:43 +0000 |
commit | 94d661ac8cb907e0a869759f76cd7134c9105e6c (patch) | |
tree | 5fa88c28cbdec0d4a0d3d118b33c1042dc49c526 /usr.sbin/ppp/pap.c | |
parent | 328d28c6502cfec45b8ead98e18b2d8638499efb (diff) | |
download | FreeBSD-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/pap.c')
-rw-r--r-- | usr.sbin/ppp/pap.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c index 89c387d..75f4384 100644 --- a/usr.sbin/ppp/pap.c +++ b/usr.sbin/ppp/pap.c @@ -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.11 1997/05/24 17:32:42 brian Exp $ + * $Id: pap.c,v 1.12 1997/05/26 00:44:08 brian Exp $ * * TODO: */ @@ -32,7 +32,7 @@ #include "phase.h" #include "auth.h" -#ifdef PASSWDAUTH +#ifndef NOPASSWDAUTH # include "passwdauth.h" #endif @@ -56,10 +56,9 @@ int papid; namelen = strlen(VarAuthName); keylen = strlen(VarAuthKey); plen = namelen + keylen + 2; -#ifdef DEBUG - logprintf("namelen = %d, keylen = %d\n", namelen, keylen); -#endif - LogPrintf(LOG_PHASE_BIT, "PAP: %s (%s)\n", VarAuthName, VarAuthKey); + LogPrintf(LogDEBUG, "SendPapChallenge: namelen = %d, keylen = %d\n", + namelen, keylen); + LogPrintf(LogPHASE, "PAP: %s (%s)\n", VarAuthName, VarAuthKey); lh.code = PAP_REQUEST; lh.id = papid; lh.length = htons(plen + sizeof(struct fsmheader)); @@ -96,7 +95,7 @@ int code; cp = MBUF_CTOP(bp) + sizeof(struct fsmheader); *cp++ = mlen; bcopy(message, cp, mlen); - LogPrintf(LOG_PHASE_BIT, "PapOutput: %s\n", papcodes[code]); + LogPrintf(LogPHASE, "PapOutput: %s\n", papcodes[code]); HdlcOutput(PRI_LINK, PROTO_PAP, bp); } @@ -113,17 +112,16 @@ u_char *name, *key; klen = *key; *key++ = 0; key[klen] = 0; -#ifdef DEBUG - logprintf("name: %s (%d), key: %s (%d)\n", name, nlen, key, klen); -#endif + LogPrintf(LogDEBUG, "PapValidate: name %s (%d), key %s (%d)\n", + name, nlen, key, klen); -#ifdef PASSWDAUTH +#ifndef NOPASSWDAUTH if( Enabled( ConfPasswdAuth ) ) { - LogPrintf( LOG_LCP, "PasswdAuth enabled - calling\n" ); + LogPrintf( LogLCP, "PasswdAuth enabled - calling\n" ); return PasswdAuth( name, key ); } -#endif /* PASSWDAUTH */ +#endif return(AuthValidate(SECRETFILE, name, key)); } @@ -142,7 +140,7 @@ struct mbuf *bp; if (len >= ntohs(php->length)) { if (php->code < PAP_REQUEST || php->code > PAP_NAK) php->code = 0; - LogPrintf(LOG_PHASE_BIT, "PapInput: %s\n", papcodes[php->code]); + LogPrintf(LogPHASE, "PapInput: %s\n", papcodes[php->code]); switch (php->code) { case PAP_REQUEST: @@ -163,7 +161,7 @@ struct mbuf *bp; cp = (u_char *)(php + 1); len = *cp++; cp[len] = 0; - LogPrintf(LOG_PHASE_BIT, "Received PAP_ACK (%s)\n", cp); + LogPrintf(LogPHASE, "Received PAP_ACK (%s)\n", cp); if (lcp->auth_iwait == PROTO_PAP) { lcp->auth_iwait = 0; if (lcp->auth_ineed == 0) @@ -175,7 +173,7 @@ struct mbuf *bp; cp = (u_char *)(php + 1); len = *cp++; cp[len] = 0; - LogPrintf(LOG_PHASE_BIT, "Received PAP_NAK (%s)\n", cp); + LogPrintf(LogPHASE, "Received PAP_NAK (%s)\n", cp); reconnect(RECON_FALSE); LcpClose(); break; |