summaryrefslogtreecommitdiffstats
path: root/sys/i4b/driver
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-11-26 19:34:06 +0000
committerphk <phk@FreeBSD.org>2000-11-26 19:34:06 +0000
commit7c4763bbdd4cb046f92027fbbfb033f3e9987580 (patch)
tree19ddfab61312f39f9931025607e68b3c7c27ac2c /sys/i4b/driver
parent2ad308fd87c069be6ea9eb90bfc1b811438fdb46 (diff)
downloadFreeBSD-src-7c4763bbdd4cb046f92027fbbfb033f3e9987580.zip
FreeBSD-src-7c4763bbdd4cb046f92027fbbfb033f3e9987580.tar.gz
Make log(-1, ...) do what addlog(...) did.
Replace all uses of addlog(...) with log(-1, ...) Remove bogus "register" keywords in subr_prf.c Make log() return void.
Diffstat (limited to 'sys/i4b/driver')
-rw-r--r--sys/i4b/driver/i4b_ispppsubr.c194
1 files changed, 97 insertions, 97 deletions
diff --git a/sys/i4b/driver/i4b_ispppsubr.c b/sys/i4b/driver/i4b_ispppsubr.c
index cbe45b6..fa68171 100644
--- a/sys/i4b/driver/i4b_ispppsubr.c
+++ b/sys/i4b/driver/i4b_ispppsubr.c
@@ -1212,7 +1212,7 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m)
switch (ntohl (h->type)) {
default:
if (debug)
- addlog(SPP_FMT "cisco unknown packet type: 0x%lx\n",
+ log(-1, SPP_FMT "cisco unknown packet type: 0x%lx\n",
SPP_ARGS(ifp), (u_long)ntohl (h->type));
break;
case CISCO_ADDR_REPLY:
@@ -1355,7 +1355,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
sppp_cp_type_name (lh->type), lh->ident,
ntohs (lh->len));
sppp_print_bytes ((u_char*) (lh+1), len);
- addlog(">\n");
+ log(-1, ">\n");
}
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
++ifp->if_oerrors;
@@ -1388,7 +1388,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
sppp_state_name(sp->state[cp->protoidx]),
sppp_cp_type_name (h->type), h->ident, ntohs (h->len));
sppp_print_bytes ((u_char*) (h+1), len-4);
- addlog(">\n");
+ log(-1, ">\n");
}
if (len > ntohs (h->len))
len = ntohs (h->len);
@@ -1397,7 +1397,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
case CONF_REQ:
if (len < 4) {
if (debug)
- addlog(SPP_FMT "%s invalid conf-req length %d\n",
+ log(-1, SPP_FMT "%s invalid conf-req length %d\n",
SPP_ARGS(ifp), cp->name,
len);
++ifp->if_ierrors;
@@ -1452,7 +1452,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
case CONF_ACK:
if (h->ident != sp->confid[cp->protoidx]) {
if (debug)
- addlog(SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
+ log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
SPP_ARGS(ifp), cp->name,
h->ident, sp->confid[cp->protoidx]);
++ifp->if_ierrors;
@@ -1497,7 +1497,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
case CONF_REJ:
if (h->ident != sp->confid[cp->protoidx]) {
if (debug)
- addlog(SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
+ log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
SPP_ARGS(ifp), cp->name,
h->ident, sp->confid[cp->protoidx]);
++ifp->if_ierrors;
@@ -1638,14 +1638,14 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
goto illegal;
if (sp->state[cp->protoidx] != STATE_OPENED) {
if (debug)
- addlog(SPP_FMT "lcp echo req but lcp closed\n",
+ log(-1, SPP_FMT "lcp echo req but lcp closed\n",
SPP_ARGS(ifp));
++ifp->if_ierrors;
break;
}
if (len < 8) {
if (debug)
- addlog(SPP_FMT "invalid lcp echo request "
+ log(-1, SPP_FMT "invalid lcp echo request "
"packet length: %d bytes\n",
SPP_ARGS(ifp), len);
break;
@@ -1667,7 +1667,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
}
*(long*)(h+1) = htonl (sp->lcp.magic);
if (debug)
- addlog(SPP_FMT "got lcp echo req, sending echo rep\n",
+ log(-1, SPP_FMT "got lcp echo req, sending echo rep\n",
SPP_ARGS(ifp));
sppp_cp_send (sp, PPP_LCP, ECHO_REPLY, h->ident, len-4, h+1);
break;
@@ -1680,13 +1680,13 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
}
if (len < 8) {
if (debug)
- addlog(SPP_FMT "lcp invalid echo reply "
+ log(-1, SPP_FMT "lcp invalid echo reply "
"packet length: %d bytes\n",
SPP_ARGS(ifp), len);
break;
}
if (debug)
- addlog(SPP_FMT "lcp got echo rep\n",
+ log(-1, SPP_FMT "lcp got echo rep\n",
SPP_ARGS(ifp));
if (!(sp->lcp.opts & (1 << LCP_OPT_MAGIC)) ||
@@ -1697,7 +1697,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
/* Unknown packet type -- send Code-Reject packet. */
illegal:
if (debug)
- addlog(SPP_FMT "%s send code-rej for 0x%x\n",
+ log(-1, SPP_FMT "%s send code-rej for 0x%x\n",
SPP_ARGS(ifp), cp->name, h->type);
sppp_cp_send(sp, cp->proto, CODE_REJ, ++sp->pp_seq,
m->m_pkthdr.len, h);
@@ -1976,11 +1976,11 @@ sppp_lcp_up(struct sppp *sp)
ifp->if_flags |= IFF_RUNNING;
if (sp->state[IDX_LCP] == STATE_INITIAL) {
if (debug)
- addlog("(incoming call)\n");
+ log(-1, "(incoming call)\n");
sp->pp_flags |= PP_CALLIN;
lcp.Open(sp);
} else if (debug)
- addlog("\n");
+ log(-1, "\n");
}
sppp_up_event(&lcp, sp);
@@ -2072,7 +2072,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
p = (void*) (h+1);
for (rlen=0; len>1 && p[1]; len-=p[1], p+=p[1]) {
if (debug)
- addlog(" %s ", sppp_lcp_opt_name(*p));
+ log(-1, " %s ", sppp_lcp_opt_name(*p));
switch (*p) {
case LCP_OPT_MAGIC:
/* Magic number. */
@@ -2082,31 +2082,31 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
if (len >= 6 || p[1] == 6)
continue;
if (debug)
- addlog("[invalid] ");
+ log(-1, "[invalid] ");
break;
case LCP_OPT_MRU:
/* Maximum receive unit. */
if (len >= 4 && p[1] == 4)
continue;
if (debug)
- addlog("[invalid] ");
+ log(-1, "[invalid] ");
break;
case LCP_OPT_AUTH_PROTO:
if (len < 4) {
if (debug)
- addlog("[invalid] ");
+ log(-1, "[invalid] ");
break;
}
authproto = (p[2] << 8) + p[3];
if (authproto == PPP_CHAP && p[1] != 5) {
if (debug)
- addlog("[invalid chap len] ");
+ log(-1, "[invalid chap len] ");
break;
}
if (sp->myauth.proto == 0) {
/* we are not configured to do auth */
if (debug)
- addlog("[not configured] ");
+ log(-1, "[not configured] ");
break;
}
/*
@@ -2119,7 +2119,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
default:
/* Others not supported. */
if (debug)
- addlog("[rej] ");
+ log(-1, "[rej] ");
break;
}
/* Add the option to rejected list. */
@@ -2129,11 +2129,11 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
}
if (rlen) {
if (debug)
- addlog(" send conf-rej\n");
+ log(-1, " send conf-rej\n");
sppp_cp_send (sp, PPP_LCP, CONF_REJ, h->ident, rlen, buf);
return 0;
} else if (debug)
- addlog("\n");
+ log(-1, "\n");
/*
* pass 2: check for option values that are unacceptable and
@@ -2147,7 +2147,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
len = origlen;
for (rlen=0; len>1 && p[1]; len-=p[1], p+=p[1]) {
if (debug)
- addlog(" %s ", sppp_lcp_opt_name(*p));
+ log(-1, " %s ", sppp_lcp_opt_name(*p));
switch (*p) {
case LCP_OPT_MAGIC:
/* Magic number -- extract. */
@@ -2155,7 +2155,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
(u_long)p[3] << 16 | p[4] << 8 | p[5];
if (nmagic != sp->lcp.magic) {
if (debug)
- addlog("0x%lx ", nmagic);
+ log(-1, "0x%lx ", nmagic);
continue;
}
/*
@@ -2173,7 +2173,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
lcp.Up(sp);
}
} else if (debug)
- addlog("[glitch] ");
+ log(-1, "[glitch] ");
++sp->pp_loopcnt;
/*
* We negate our magic here, and NAK it. If
@@ -2193,11 +2193,11 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
/* Async control character map -- check to be zero. */
if (! p[2] && ! p[3] && ! p[4] && ! p[5]) {
if (debug)
- addlog("[empty] ");
+ log(-1, "[empty] ");
continue;
}
if (debug)
- addlog("[non-empty] ");
+ log(-1, "[non-empty] ");
from Armin Gruner:
Anyway, if I remove the "p[2] = p[3] = p[4] = p[5] = 0;",
@@ -2218,7 +2218,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
*/
sp->lcp.their_mru = p[2] * 256 + p[3];
if (debug)
- addlog("%lu ", sp->lcp.their_mru);
+ log(-1, "%lu ", sp->lcp.their_mru);
continue;
case LCP_OPT_AUTH_PROTO:
@@ -2226,7 +2226,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
if (sp->myauth.proto != authproto) {
/* not agreed, nak */
if (debug)
- addlog("[mine %s != his %s] ",
+ log(-1, "[mine %s != his %s] ",
sppp_proto_name(sp->hisauth.proto),
sppp_proto_name(authproto));
p[2] = sp->myauth.proto >> 8;
@@ -2235,7 +2235,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
}
if (authproto == PPP_CHAP && p[4] != CHAP_MD5) {
if (debug)
- addlog("[chap not MD5] ");
+ log(-1, "[chap not MD5] ");
p[4] = CHAP_MD5;
break;
}
@@ -2249,19 +2249,19 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
if (rlen) {
if (++sp->fail_counter[IDX_LCP] >= sp->lcp.max_failure) {
if (debug)
- addlog(" max_failure (%d) exceeded, "
+ log(-1, " max_failure (%d) exceeded, "
"send conf-rej\n",
sp->lcp.max_failure);
sppp_cp_send(sp, PPP_LCP, CONF_REJ, h->ident, rlen, buf);
} else {
if (debug)
- addlog(" send conf-nak\n");
+ log(-1, " send conf-nak\n");
sppp_cp_send (sp, PPP_LCP, CONF_NAK, h->ident, rlen, buf);
}
return 0;
} else {
if (debug)
- addlog(" send conf-ack\n");
+ log(-1, " send conf-ack\n");
sp->fail_counter[IDX_LCP] = 0;
sp->pp_loopcnt = 0;
sppp_cp_send (sp, PPP_LCP, CONF_ACK,
@@ -2294,7 +2294,7 @@ sppp_lcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
p = (void*) (h+1);
for (; len > 1 && p[1]; len -= p[1], p += p[1]) {
if (debug)
- addlog(" %s ", sppp_lcp_opt_name(*p));
+ log(-1, " %s ", sppp_lcp_opt_name(*p));
switch (*p) {
case LCP_OPT_MAGIC:
/* Magic number -- can't use it, use 0 */
@@ -2318,19 +2318,19 @@ sppp_lcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
if ((sp->pp_flags & PP_CALLIN) == 0 &&
(sp->hisauth.flags & AUTHFLAG_NOCALLOUT) != 0) {
if (debug)
- addlog("[don't insist on auth "
+ log(-1, "[don't insist on auth "
"for callout]");
sp->lcp.opts &= ~(1 << LCP_OPT_AUTH_PROTO);
break;
}
if (debug)
- addlog("[access denied]\n");
+ log(-1, "[access denied]\n");
lcp.Close(sp);
break;
}
}
if (debug)
- addlog("\n");
+ log(-1, "\n");
free (buf, M_TEMP);
return;
}
@@ -2358,7 +2358,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
p = (void*) (h+1);
for (; len > 1 && p[1]; len -= p[1], p += p[1]) {
if (debug)
- addlog(" %s ", sppp_lcp_opt_name(*p));
+ log(-1, " %s ", sppp_lcp_opt_name(*p));
switch (*p) {
case LCP_OPT_MAGIC:
/* Magic number -- renegotiate */
@@ -2373,7 +2373,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
*/
if (magic == ~sp->lcp.magic) {
if (debug)
- addlog("magic glitch ");
+ log(-1, "magic glitch ");
#if defined(__NetBSD__) || (defined(__FreeBSD__) && __FreeBSD__ >= 3)
sp->lcp.magic = random();
#else
@@ -2382,7 +2382,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
} else {
sp->lcp.magic = magic;
if (debug)
- addlog("%lu ", magic);
+ log(-1, "%lu ", magic);
}
}
break;
@@ -2395,7 +2395,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
if (len >= 4 && p[1] == 4) {
u_int mru = p[2] * 256 + p[3];
if (debug)
- addlog("%d ", mru);
+ log(-1, "%d ", mru);
if (mru < PP_MTU || mru > PP_MAX_MRU)
mru = PP_MTU;
sp->lcp.mru = mru;
@@ -2408,13 +2408,13 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
* deny.
*/
if (debug)
- addlog("[access denied]\n");
+ log(-1, "[access denied]\n");
lcp.Close(sp);
break;
}
}
if (debug)
- addlog("\n");
+ log(-1, "\n");
free (buf, M_TEMP);
return;
}
@@ -2756,7 +2756,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
p = (void*) (h+1);
for (rlen=0; len>1 && p[1]; len-=p[1], p+=p[1]) {
if (debug)
- addlog(" %s ", sppp_ipcp_opt_name(*p));
+ log(-1, " %s ", sppp_ipcp_opt_name(*p));
switch (*p) {
#ifdef SPPP_VJ
@@ -2768,7 +2768,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
continue;
}
if (debug)
- addlog("[invalid] ");
+ log(-1, "[invalid] ");
}
break;
#endif
@@ -2779,12 +2779,12 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
continue;
}
if (debug)
- addlog("[invalid] ");
+ log(-1, "[invalid] ");
break;
default:
/* Others not supported. */
if (debug)
- addlog("[rej] ");
+ log(-1, "[rej] ");
break;
}
/* Add the option to rejected list. */
@@ -2794,11 +2794,11 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
}
if (rlen) {
if (debug)
- addlog(" send conf-rej\n");
+ log(-1, " send conf-rej\n");
sppp_cp_send (sp, PPP_IPCP, CONF_REJ, h->ident, rlen, buf);
return 0;
} else if (debug)
- addlog("\n");
+ log(-1, "\n");
/* pass 2: parse option values */
sppp_get_ip_addrs(sp, 0, &hisaddr, 0);
@@ -2809,7 +2809,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
len = origlen;
for (rlen=0; len>1 && p[1]; len-=p[1], p+=p[1]) {
if (debug)
- addlog(" %s ", sppp_ipcp_opt_name(*p));
+ log(-1, " %s ", sppp_ipcp_opt_name(*p));
switch (*p) {
#ifdef SPPP_VJ
@@ -2822,7 +2822,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
if(sp->enable_vj)
{
if (debug)
- addlog("VJ [ack] ");
+ log(-1, "VJ [ack] ");
sp->ipcp.flags |= IPCP_VJ;
#ifdef __FreeBSD__
sl_compress_init(&sp->pp_comp, p[4]);
@@ -2836,14 +2836,14 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
else
{
if (debug)
- addlog("%#04x [VJ disabled] ", desiredcomp);
+ log(-1, "%#04x [VJ disabled] ", desiredcomp);
p[2] = IPCP_COMP_VJ >> 8;
p[3] = IPCP_COMP_VJ;
break;
}
}
if (debug)
- addlog("%#04x [not supported] ", desiredcomp);
+ log(-1, "%#04x [not supported] ", desiredcomp);
p[2] = IPCP_COMP_VJ >> 8;
p[3] = IPCP_COMP_VJ;
break;
@@ -2864,7 +2864,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
* it.
*/
if (debug)
- addlog("%s [ack] ",
+ log(-1, "%s [ack] ",
sppp_dotted_quad(hisaddr));
/* record that we've seen it already */
sp->ipcp.flags |= IPCP_HISADDR_SEEN;
@@ -2880,9 +2880,9 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
*/
if (debug) {
if (desiredaddr == 0)
- addlog("[addr requested] ");
+ log(-1, "[addr requested] ");
else
- addlog("%s [not agreed] ",
+ log(-1, "%s [not agreed] ",
sppp_dotted_quad(desiredaddr));
}
p[2] = hisaddr >> 24;
@@ -2917,16 +2917,16 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
buf[5] = hisaddr;
rlen = 6;
if (debug)
- addlog("still need hisaddr ");
+ log(-1, "still need hisaddr ");
}
if (rlen) {
if (debug)
- addlog(" send conf-nak\n");
+ log(-1, " send conf-nak\n");
sppp_cp_send (sp, PPP_IPCP, CONF_NAK, h->ident, rlen, buf);
} else {
if (debug)
- addlog(" send conf-ack\n");
+ log(-1, " send conf-ack\n");
sppp_cp_send (sp, PPP_IPCP, CONF_ACK,
h->ident, origlen, h+1);
}
@@ -2958,7 +2958,7 @@ sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
p = (void*) (h+1);
for (; len > 1 && p[1]; len -= p[1], p += p[1]) {
if (debug)
- addlog(" %s ", sppp_ipcp_opt_name(*p));
+ log(-1, " %s ", sppp_ipcp_opt_name(*p));
switch (*p) {
#ifdef SPPP_VJ
case IPCP_OPT_COMPRESSION:
@@ -2982,7 +2982,7 @@ sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
}
}
if (debug)
- addlog("\n");
+ log(-1, "\n");
free (buf, M_TEMP);
return;
}
@@ -3014,14 +3014,14 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
p = (void*) (h+1);
for (; len > 1 && p[1]; len -= p[1], p += p[1]) {
if (debug)
- addlog(" %s ", sppp_ipcp_opt_name(*p));
+ log(-1, " %s ", sppp_ipcp_opt_name(*p));
switch (*p) {
#ifdef SPPP_VJ
case IPCP_OPT_COMPRESSION:
if (len >= 6 && p[1] == 6) {
desiredcomp = p[2] << 8 | p[3];
if (debug)
- addlog("[wantcomp %#04x] ",
+ log(-1, "[wantcomp %#04x] ",
desiredcomp);
if (desiredcomp == IPCP_COMP_VJ && sp->enable_vj) {
#ifdef __FreeBSD__
@@ -3031,7 +3031,7 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
#endif
sp->ipcp.max_state = p[4];
sp->ipcp.compress_cid = p[5];
- addlog("[agree] ");
+ log(-1, "[agree] ");
} else
sp->ipcp.opts &=
~(1 << IPCP_OPT_COMPRESSION);
@@ -3049,7 +3049,7 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
p[4] << 8 | p[5];
sp->ipcp.opts |= (1 << IPCP_OPT_ADDRESS);
if (debug)
- addlog("[wantaddr %s] ",
+ log(-1, "[wantaddr %s] ",
sppp_dotted_quad(wantaddr));
/*
* When doing dynamic address assignment,
@@ -3062,7 +3062,7 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
if (sp->ipcp.flags & IPCP_MYADDR_DYN) {
sppp_set_ip_addr(sp, wantaddr);
if (debug)
- addlog("[agree] ");
+ log(-1, "[agree] ");
sp->ipcp.flags |= IPCP_MYADDR_SEEN;
}
}
@@ -3077,7 +3077,7 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
}
}
if (debug)
- addlog("\n");
+ log(-1, "\n");
free (buf, M_TEMP);
return;
}
@@ -3269,7 +3269,7 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
sppp_auth_type_name(PPP_CHAP, h->type),
h->ident, ntohs(h->len));
sppp_print_bytes((u_char*) (h+1), len-4);
- addlog(">\n");
+ log(-1, ">\n");
}
break;
}
@@ -3281,9 +3281,9 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
sppp_auth_type_name(PPP_CHAP, h->type), h->ident,
ntohs(h->len));
sppp_print_string((char*) name, name_len);
- addlog(" value-size=%d value=", value_len);
+ log(-1, " value-size=%d value=", value_len);
sppp_print_bytes(value, value_len);
- addlog(">\n");
+ log(-1, ">\n");
}
/* Compute reply value. */
@@ -3308,10 +3308,10 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
log(LOG_DEBUG, SPP_FMT "chap success",
SPP_ARGS(ifp));
if (len > 4) {
- addlog(": ");
+ log(-1, ": ");
sppp_print_string((char*)(h + 1), len - 4);
}
- addlog("\n");
+ log(-1, "\n");
}
x = splimp();
sp->pp_flags &= ~PP_NEEDAUTH;
@@ -3335,10 +3335,10 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
log(LOG_INFO, SPP_FMT "chap failure",
SPP_ARGS(ifp));
if (len > 4) {
- addlog(": ");
+ log(-1, ": ");
sppp_print_string((char*)(h + 1), len - 4);
}
- addlog("\n");
+ log(-1, "\n");
} else
log(LOG_INFO, SPP_FMT "chap failure\n",
SPP_ARGS(ifp));
@@ -3360,7 +3360,7 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
sppp_auth_type_name(PPP_CHAP, h->type),
h->ident, ntohs(h->len));
sppp_print_bytes((u_char*)(h+1), len-4);
- addlog(">\n");
+ log(-1, ">\n");
}
break;
}
@@ -3378,10 +3378,10 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
log(LOG_INFO, SPP_FMT "chap response, his name ",
SPP_ARGS(ifp));
sppp_print_string(name, name_len);
- addlog(" != expected ");
+ log(-1, " != expected ");
sppp_print_string(sp->hisauth.name,
sppp_strnlen(sp->hisauth.name, AUTHNAMELEN));
- addlog("\n");
+ log(-1, "\n");
}
if (debug) {
log(LOG_DEBUG, SPP_FMT "chap input(%s) "
@@ -3391,9 +3391,9 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
sppp_auth_type_name(PPP_CHAP, h->type),
h->ident, ntohs (h->len));
sppp_print_string((char*)name, name_len);
- addlog(" value-size=%d value=", value_len);
+ log(-1, " value-size=%d value=", value_len);
sppp_print_bytes(value, value_len);
- addlog(">\n");
+ log(-1, ">\n");
}
if (value_len != AUTHKEYLEN) {
if (debug)
@@ -3445,7 +3445,7 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
sppp_state_name(sp->state[IDX_CHAP]),
h->type, h->ident, ntohs(h->len));
sppp_print_bytes((u_char*)(h+1), len-4);
- addlog(">\n");
+ log(-1, ">\n");
}
break;
@@ -3552,9 +3552,9 @@ sppp_chap_tlu(struct sppp *sp)
SPP_ARGS(ifp),
sp->pp_phase == PHASE_NETWORK? "reconfirmed": "tlu");
if ((sp->hisauth.flags & AUTHFLAG_NORECHALLENGE) == 0)
- addlog("next re-challenge in %d seconds\n", i);
+ log(-1, "next re-challenge in %d seconds\n", i);
else
- addlog("re-challenging supressed\n");
+ log(-1, "re-challenging supressed\n");
}
x = splimp();
@@ -3682,7 +3682,7 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
sppp_auth_type_name(PPP_PAP, h->type),
h->ident, ntohs(h->len));
sppp_print_bytes((u_char*)(h+1), len-4);
- addlog(">\n");
+ log(-1, ">\n");
}
break;
}
@@ -3694,9 +3694,9 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
sppp_auth_type_name(PPP_PAP, h->type),
h->ident, ntohs(h->len));
sppp_print_string((char*)name, name_len);
- addlog(" passwd=");
+ log(-1, " passwd=");
sppp_print_string((char*)passwd, passwd_len);
- addlog(">\n");
+ log(-1, ">\n");
}
if (name_len > AUTHNAMELEN ||
passwd_len > AUTHKEYLEN ||
@@ -3734,10 +3734,10 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
SPP_ARGS(ifp));
name_len = *((char *)h);
if (len > 5 && name_len) {
- addlog(": ");
+ log(-1, ": ");
sppp_print_string((char*)(h+1), name_len);
}
- addlog("\n");
+ log(-1, "\n");
}
x = splimp();
sp->pp_flags &= ~PP_NEEDAUTH;
@@ -3763,10 +3763,10 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
SPP_ARGS(ifp));
name_len = *((char *)h);
if (len > 5 && name_len) {
- addlog(": ");
+ log(-1, ": ");
sppp_print_string((char*)(h+1), name_len);
}
- addlog("\n");
+ log(-1, "\n");
} else
log(LOG_INFO, SPP_FMT "pap failure\n",
SPP_ARGS(ifp));
@@ -3781,7 +3781,7 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
SPP_ARGS(ifp),
h->type, h->ident, ntohs(h->len));
sppp_print_bytes((u_char*)(h+1), len-4);
- addlog(">\n");
+ log(-1, ">\n");
}
break;
@@ -4010,7 +4010,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
sppp_auth_type_name(cp->proto, lh->type),
lh->ident, ntohs(lh->len));
sppp_print_bytes((u_char*) (lh+1), len);
- addlog(">\n");
+ log(-1, ">\n");
}
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, NULL, 3))
++ifp->if_oerrors;
@@ -4515,14 +4515,14 @@ sppp_print_bytes(const u_char *p, u_short len)
{
#if defined(__FreeBSD_version) && (__FreeBSD_version > 300005)
if (len)
- addlog(" %*D", len, p, "-");
+ log(-1, " %*D", len, p, "-");
#else
if (!len)
return;
- addlog("%x", *p++);
+ log(-1, "%x", *p++);
while (--len)
- addlog("-%x", *p++);
+ log(-1, "-%x", *p++);
#endif
}
@@ -4537,9 +4537,9 @@ sppp_print_string(const char *p, u_short len)
* Print only ASCII chars directly. RFC 1994 recommends
* using only them, but we don't rely on it. */
if (c < ' ' || c > '~')
- addlog("\\x%x", c);
+ log(-1, "\\x%x", c);
else
- addlog("%c", c);
+ log(-1, "%c", c);
}
}
OpenPOWER on IntegriCloud