summaryrefslogtreecommitdiff
path: root/accel-pptpd/ppp
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-11-29 17:45:58 +0300
committerKozlov Dmitry <dima@server>2010-11-29 17:45:58 +0300
commitf96198bf149203e1ddca8f2c381cf4b9849cdda9 (patch)
treef4b4c10a7b489f693ecb6301d1584de22e4e90a5 /accel-pptpd/ppp
parent3a293aabc6e43319761a1f3020559873aa714334 (diff)
downloadaccel-ppp-f96198bf149203e1ddca8f2c381cf4b9849cdda9.tar.gz
accel-ppp-f96198bf149203e1ddca8f2c381cf4b9849cdda9.zip
log: introduced additional log level (3) which shows only minimum of information messages
Diffstat (limited to 'accel-pptpd/ppp')
-rw-r--r--accel-pptpd/ppp/ppp.c3
-rw-r--r--accel-pptpd/ppp/ppp_auth.c7
-rw-r--r--accel-pptpd/ppp/ppp_auth.h2
-rw-r--r--accel-pptpd/ppp/ppp_ccp.c78
-rw-r--r--accel-pptpd/ppp/ppp_ipcp.c78
-rw-r--r--accel-pptpd/ppp/ppp_lcp.c92
6 files changed, 132 insertions, 128 deletions
diff --git a/accel-pptpd/ppp/ppp.c b/accel-pptpd/ppp/ppp.c
index a30fa81..84f47f2 100644
--- a/accel-pptpd/ppp/ppp.c
+++ b/accel-pptpd/ppp/ppp.c
@@ -128,8 +128,7 @@ int __export establish_ppp(struct ppp_t *ppp)
generate_sessionid(ppp);
sprintf(ppp->ifname, "ppp%i", ppp->unit_idx);
- if (conf_ppp_verbose)
- log_ppp_info("connect: %s <--> %s(%s)\n", ppp->ifname, ppp->ctrl->name, ppp->chan_name);
+ log_ppp_info1("connect: %s <--> %s(%s)\n", ppp->ifname, ppp->ctrl->name, ppp->chan_name);
init_layers(ppp);
diff --git a/accel-pptpd/ppp/ppp_auth.c b/accel-pptpd/ppp/ppp_auth.c
index 0683593..32413c6 100644
--- a/accel-pptpd/ppp/ppp_auth.c
+++ b/accel-pptpd/ppp/ppp_auth.c
@@ -305,11 +305,16 @@ void __export ppp_auth_successed(struct ppp_t *ppp, char *username)
log_ppp_debug("auth_layer_started\n");
ppp->username = username;
ppp_layer_started(ppp, &ad->ld);
+ log_ppp_info1("%s: authentication successed\n", username);
triton_event_fire(EV_PPP_AUTHORIZED, ppp);
}
-void __export ppp_auth_failed(struct ppp_t *ppp)
+void __export ppp_auth_failed(struct ppp_t *ppp, const char *username)
{
+ if (username)
+ log_ppp_info1("%s: authentication failed\n", username);
+ else
+ log_ppp_info1("authentication failed\n");
ppp_terminate(ppp, TERM_AUTH_ERROR, 0);
}
diff --git a/accel-pptpd/ppp/ppp_auth.h b/accel-pptpd/ppp/ppp_auth.h
index ea12d9c..87cc742 100644
--- a/accel-pptpd/ppp/ppp_auth.h
+++ b/accel-pptpd/ppp/ppp_auth.h
@@ -30,7 +30,7 @@ struct ppp_auth_handler_t
int ppp_auth_register_handler(struct ppp_auth_handler_t*);
void ppp_auth_successed(struct ppp_t *ppp, char *username);
-void ppp_auth_failed(struct ppp_t *ppp);
+void ppp_auth_failed(struct ppp_t *ppp, const char *username);
int ppp_auth_restart(struct ppp_t *ppp);
#endif
diff --git a/accel-pptpd/ppp/ppp_ccp.c b/accel-pptpd/ppp/ppp_ccp.c
index dd63c71..2cad386 100644
--- a/accel-pptpd/ppp/ppp_ccp.c
+++ b/accel-pptpd/ppp/ppp_ccp.c
@@ -206,11 +206,11 @@ static void print_ropt(struct recv_opt_t *ropt)
int i;
uint8_t *ptr = (uint8_t*)ropt->hdr;
- log_ppp_info("<");
+ log_ppp_info2("<");
for (i = 0; i < ropt->len; i++) {
- log_ppp_info(" %x", ptr[i]);
+ log_ppp_info2(" %x", ptr[i]);
}
- log_ppp_info(" >");
+ log_ppp_info2(" >");
}
static int send_conf_req(struct ppp_fsm_t *fsm)
@@ -239,7 +239,7 @@ static int send_conf_req(struct ppp_fsm_t *fsm)
ptr = (uint8_t*)(ccp_hdr + 1);
if (conf_ppp_verbose)
- log_ppp_info("send [CCP ConfReq id=%x", ccp_hdr->id);
+ log_ppp_info2("send [CCP ConfReq id=%x", ccp_hdr->id);
list_for_each_entry(lopt, &ccp->options, entry) {
n = lopt->h->send_conf_req(ccp, lopt, ptr);
@@ -247,15 +247,15 @@ static int send_conf_req(struct ppp_fsm_t *fsm)
return -1;
if (n) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, NULL);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, NULL);
}
}
ptr += n;
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
ccp_hdr->len = htons(ptr - buf - 2);
ppp_unit_send(ccp->ppp, ccp_hdr, ptr - buf);
@@ -273,7 +273,7 @@ static void send_conf_ack(struct ppp_fsm_t *fsm)
hdr->code = CONFACK;
if (conf_ppp_verbose)
- log_ppp_info("send [CCP ConfAck id=%x]\n", ccp->fsm.recv_id);
+ log_ppp_info2("send [CCP ConfAck id=%x]\n", ccp->fsm.recv_id);
ppp_unit_send(ccp->ppp,hdr,ntohs(hdr->len)+2);
}
@@ -286,7 +286,7 @@ static void send_conf_nak(struct ppp_fsm_t *fsm)
struct recv_opt_t *ropt;
if (conf_ppp_verbose)
- log_ppp_info("send [CCP ConfNak id=%x", ccp->fsm.recv_id);
+ log_ppp_info2("send [CCP ConfNak id=%x", ccp->fsm.recv_id);
ccp_hdr->proto = htons(PPP_CCP);
ccp_hdr->code = CONFNAK;
@@ -298,15 +298,15 @@ static void send_conf_nak(struct ppp_fsm_t *fsm)
list_for_each_entry(ropt, &ccp->ropt_list, entry) {
if (ropt->state == CCP_OPT_NAK) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- ropt->lopt->h->print(log_ppp_info, ropt->lopt, NULL);
+ log_ppp_info2(" ");
+ ropt->lopt->h->print(log_ppp_info2, ropt->lopt, NULL);
}
ptr += ropt->lopt->h->send_conf_nak(ccp, ropt->lopt, ptr);
}
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
ccp_hdr->len = htons(ptr - buf - 2);
ppp_unit_send(ccp->ppp, ccp_hdr, ptr - buf);
@@ -322,7 +322,7 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
struct recv_opt_t *ropt;
if (conf_ppp_verbose)
- log_ppp_info("send [CCP ConfRej id=%x", ccp->fsm.recv_id);
+ log_ppp_info2("send [CCP ConfRej id=%x", ccp->fsm.recv_id);
ccp_hdr->proto = htons(PPP_CCP);
ccp_hdr->code = CONFREJ;
@@ -334,9 +334,9 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
list_for_each_entry(ropt, &ccp->ropt_list, entry) {
if (ropt->state == CCP_OPT_REJ) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
+ log_ppp_info2(" ");
if (ropt->lopt)
- ropt->lopt->h->print(log_ppp_info, ropt->lopt, (uint8_t*)ropt->hdr);
+ ropt->lopt->h->print(log_ppp_info2, ropt->lopt, (uint8_t*)ropt->hdr);
else
print_ropt(ropt);
}
@@ -346,7 +346,7 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
ccp_hdr->len = htons(ptr - buf - 2);
ppp_unit_send(ccp->ppp, ccp_hdr, ptr-buf);
@@ -384,14 +384,14 @@ static int ccp_recv_conf_req(struct ppp_ccp_t *ccp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("recv [CCP ConfReq id=%x", ccp->fsm.recv_id);
+ log_ppp_info2("recv [CCP ConfReq id=%x", ccp->fsm.recv_id);
list_for_each_entry(ropt, &ccp->ropt_list, entry) {
list_for_each_entry(lopt, &ccp->options, entry) {
if (lopt->id == ropt->hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, (uint8_t*)ropt->hdr);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, (uint8_t*)ropt->hdr);
}
r = lopt->h->recv_conf_req(ccp, lopt, (uint8_t*)ropt->hdr);
if (ack) {
@@ -413,7 +413,7 @@ static int ccp_recv_conf_req(struct ppp_ccp_t *ccp, uint8_t *data, int size)
ack = 1;
else if (!ropt->lopt) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
+ log_ppp_info2(" ");
print_ropt(ropt);
}
ropt->state = CCP_OPT_REJ;
@@ -422,7 +422,7 @@ static int ccp_recv_conf_req(struct ppp_ccp_t *ccp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
/*list_for_each_entry(lopt,&ccp->options,entry)
{
@@ -455,11 +455,11 @@ static int ccp_recv_conf_rej(struct ppp_ccp_t *ccp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [CCP ConfRej id=%x", ccp->fsm.recv_id);
+ log_ppp_info2("recv [CCP ConfRej id=%x", ccp->fsm.recv_id);
if (ccp->fsm.recv_id != ccp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -481,7 +481,7 @@ static int ccp_recv_conf_rej(struct ppp_ccp_t *ccp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -493,11 +493,11 @@ static int ccp_recv_conf_nak(struct ppp_ccp_t *ccp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [CCP ConfNak id=%x", ccp->fsm.recv_id);
+ log_ppp_info2("recv [CCP ConfNak id=%x", ccp->fsm.recv_id);
if (ccp->fsm.recv_id != ccp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -507,8 +507,8 @@ static int ccp_recv_conf_nak(struct ppp_ccp_t *ccp, uint8_t *data, int size)
list_for_each_entry(lopt, &ccp->options, entry) {
if (lopt->id == hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, data);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, data);
}
if (lopt->h->recv_conf_nak && lopt->h->recv_conf_nak(ccp, lopt, data))
res = -1;
@@ -523,7 +523,7 @@ static int ccp_recv_conf_nak(struct ppp_ccp_t *ccp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -535,11 +535,11 @@ static int ccp_recv_conf_ack(struct ppp_ccp_t *ccp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [CCP ConfAck id=%x", ccp->fsm.recv_id);
+ log_ppp_info2("recv [CCP ConfAck id=%x", ccp->fsm.recv_id);
if (ccp->fsm.recv_id != ccp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -549,8 +549,8 @@ static int ccp_recv_conf_ack(struct ppp_ccp_t *ccp, uint8_t *data, int size)
list_for_each_entry(lopt, &ccp->options, entry) {
if (lopt->id == hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info,lopt,data);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2,lopt,data);
}
if (!lopt->h->recv_conf_ack)
break;
@@ -565,7 +565,7 @@ static int ccp_recv_conf_ack(struct ppp_ccp_t *ccp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -581,7 +581,7 @@ static void send_term_req(struct ppp_fsm_t *fsm)
};
if (conf_ppp_verbose)
- log_ppp_info("send [CCP TermReq id=%i]\n", hdr.id);
+ log_ppp_info2("send [CCP TermReq id=%i]\n", hdr.id);
ppp_chan_send(ccp->ppp, &hdr, 6);
}
@@ -597,7 +597,7 @@ static void send_term_ack(struct ppp_fsm_t *fsm)
};
if (conf_ppp_verbose)
- log_ppp_info("send [CCP TermAck id=%i]\n", hdr.id);
+ log_ppp_info2("send [CCP TermAck id=%i]\n", hdr.id);
ppp_chan_send(ccp->ppp, &hdr, 6);
}
@@ -672,18 +672,18 @@ static void ccp_recv(struct ppp_handler_t*h)
break;
case TERMREQ:
if (conf_ppp_verbose)
- log_ppp_info("recv [CCP TermReq id=%x]\n", hdr->id);
+ log_ppp_info2("recv [CCP TermReq id=%x]\n", hdr->id);
ppp_fsm_recv_term_req(&ccp->fsm);
ppp_fsm_close(&ccp->fsm);
break;
case TERMACK:
if (conf_ppp_verbose)
- log_ppp_info("recv [CCP TermAck id=%x]\n", hdr->id);
+ log_ppp_info2("recv [CCP TermAck id=%x]\n", hdr->id);
ppp_fsm_recv_term_ack(&ccp->fsm);
break;
case CODEREJ:
if (conf_ppp_verbose)
- log_ppp_info("recv [CCP CodeRej id=%x]\n", hdr->id);
+ log_ppp_info2("recv [CCP CodeRej id=%x]\n", hdr->id);
ppp_fsm_recv_code_rej_bad(&ccp->fsm);
break;
default:
diff --git a/accel-pptpd/ppp/ppp_ipcp.c b/accel-pptpd/ppp/ppp_ipcp.c
index 3229893..0e743a1 100644
--- a/accel-pptpd/ppp/ppp_ipcp.c
+++ b/accel-pptpd/ppp/ppp_ipcp.c
@@ -164,11 +164,11 @@ static void print_ropt(struct recv_opt_t *ropt)
int i;
uint8_t *ptr = (uint8_t*)ropt->hdr;
- log_ppp_info("<");
+ log_ppp_info2("<");
for (i = 0; i < ropt->len; i++) {
- log_ppp_info(" %x", ptr[i]);
+ log_ppp_info2(" %x", ptr[i]);
}
- log_ppp_info(" >");
+ log_ppp_info2(" >");
}
static int send_conf_req(struct ppp_fsm_t *fsm)
@@ -198,14 +198,14 @@ static int send_conf_req(struct ppp_fsm_t *fsm)
}
if (conf_ppp_verbose) {
- log_ppp_info("send [IPCP ConfReq id=%x", ipcp_hdr->id);
+ log_ppp_info2("send [IPCP ConfReq id=%x", ipcp_hdr->id);
list_for_each_entry(lopt,&ipcp->options,entry) {
if (lopt->print) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, NULL);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, NULL);
}
}
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
}
ipcp_hdr->len = htons(ptr - buf - 2);
@@ -224,7 +224,7 @@ static void send_conf_ack(struct ppp_fsm_t *fsm)
hdr->code = CONFACK;
if (conf_ppp_verbose)
- log_ppp_info("send [IPCP ConfAck id=%x]\n", ipcp->fsm.recv_id);
+ log_ppp_info2("send [IPCP ConfAck id=%x]\n", ipcp->fsm.recv_id);
ppp_unit_send(ipcp->ppp, hdr, ntohs(hdr->len) + 2);
}
@@ -237,7 +237,7 @@ static void send_conf_nak(struct ppp_fsm_t *fsm)
struct recv_opt_t *ropt;
if (conf_ppp_verbose)
- log_ppp_info("send [IPCP ConfNak id=%x", ipcp->fsm.recv_id);
+ log_ppp_info2("send [IPCP ConfNak id=%x", ipcp->fsm.recv_id);
ipcp_hdr->proto = htons(PPP_IPCP);
ipcp_hdr->code = CONFNAK;
@@ -249,15 +249,15 @@ static void send_conf_nak(struct ppp_fsm_t *fsm)
list_for_each_entry(ropt, &ipcp->ropt_list, entry) {
if (ropt->state == IPCP_OPT_NAK) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- ropt->lopt->h->print(log_ppp_info, ropt->lopt, NULL);
+ log_ppp_info2(" ");
+ ropt->lopt->h->print(log_ppp_info2, ropt->lopt, NULL);
}
ptr += ropt->lopt->h->send_conf_nak(ipcp, ropt->lopt, ptr);
}
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
ipcp_hdr->len = htons(ptr-buf-2);
ppp_unit_send(ipcp->ppp, ipcp_hdr, ptr - buf);
@@ -273,7 +273,7 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
struct recv_opt_t *ropt;
if (conf_ppp_verbose)
- log_ppp_info("send [IPCP ConfRej id=%x", ipcp->fsm.recv_id);
+ log_ppp_info2("send [IPCP ConfRej id=%x", ipcp->fsm.recv_id);
ipcp_hdr->proto = htons(PPP_IPCP);
ipcp_hdr->code = CONFREJ;
@@ -285,9 +285,9 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
list_for_each_entry(ropt, &ipcp->ropt_list, entry) {
if (ropt->state == IPCP_OPT_REJ) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
+ log_ppp_info2(" ");
if (ropt->lopt)
- ropt->lopt->h->print(log_ppp_info, ropt->lopt, (uint8_t*)ropt->hdr);
+ ropt->lopt->h->print(log_ppp_info2, ropt->lopt, (uint8_t*)ropt->hdr);
else
print_ropt(ropt);
}
@@ -297,7 +297,7 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
ipcp_hdr->len = htons(ptr - buf - 2);
ppp_unit_send(ipcp->ppp, ipcp_hdr, ptr-buf);
@@ -336,23 +336,23 @@ static int ipcp_recv_conf_req(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
lopt->state=IPCP_OPT_NONE;
if (conf_ppp_verbose) {
- log_ppp_info("recv [IPCP ConfReq id=%x", ipcp->fsm.recv_id);
+ log_ppp_info2("recv [IPCP ConfReq id=%x", ipcp->fsm.recv_id);
list_for_each_entry(ropt, &ipcp->ropt_list, entry) {
list_for_each_entry(lopt, &ipcp->options, entry) {
if (lopt->id == ropt->hdr->id) {
ropt->lopt = lopt;
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, (uint8_t*)ropt->hdr);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, (uint8_t*)ropt->hdr);
break;
}
}
if (!ropt->lopt) {
- log_ppp_info(" ");
+ log_ppp_info2(" ");
print_ropt(ropt);
}
}
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
}
list_for_each_entry(ropt, &ipcp->ropt_list, entry) {
@@ -407,11 +407,11 @@ static int ipcp_recv_conf_rej(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [IPCP ConfRej id=%x", ipcp->fsm.recv_id);
+ log_ppp_info2("recv [IPCP ConfRej id=%x", ipcp->fsm.recv_id);
if (ipcp->fsm.recv_id != ipcp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -433,7 +433,7 @@ static int ipcp_recv_conf_rej(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -445,11 +445,11 @@ static int ipcp_recv_conf_nak(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [IPCP ConfNak id=%x", ipcp->fsm.recv_id);
+ log_ppp_info2("recv [IPCP ConfNak id=%x", ipcp->fsm.recv_id);
if (ipcp->fsm.recv_id != ipcp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -459,8 +459,8 @@ static int ipcp_recv_conf_nak(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
list_for_each_entry(lopt, &ipcp->options, entry) {
if (lopt->id == hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info,lopt,data);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2,lopt,data);
}
if (lopt->h->recv_conf_nak && lopt->h->recv_conf_nak(ipcp, lopt, data))
res =- 1;
@@ -473,7 +473,7 @@ static int ipcp_recv_conf_nak(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -485,11 +485,11 @@ static int ipcp_recv_conf_ack(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [IPCP ConfAck id=%x", ipcp->fsm.recv_id);
+ log_ppp_info2("recv [IPCP ConfAck id=%x", ipcp->fsm.recv_id);
if (ipcp->fsm.recv_id != ipcp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -499,8 +499,8 @@ static int ipcp_recv_conf_ack(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
list_for_each_entry(lopt, &ipcp->options, entry) {
if (lopt->id == hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, data);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, data);
}
if (!lopt->h->recv_conf_ack)
break;
@@ -515,7 +515,7 @@ static int ipcp_recv_conf_ack(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -531,7 +531,7 @@ static void send_term_req(struct ppp_fsm_t *fsm)
};
if (conf_ppp_verbose)
- log_ppp_info("send [IPCP TermReq id=%i]\n", hdr.id);
+ log_ppp_info2("send [IPCP TermReq id=%i]\n", hdr.id);
ppp_unit_send(ipcp->ppp, &hdr, 6);
}
@@ -547,7 +547,7 @@ static void send_term_ack(struct ppp_fsm_t *fsm)
};
if (conf_ppp_verbose)
- log_ppp_info("send [IPCP TermAck id=%i]\n", hdr.id);
+ log_ppp_info2("send [IPCP TermAck id=%i]\n", hdr.id);
ppp_unit_send(ipcp->ppp, &hdr, 6);
}
@@ -616,19 +616,19 @@ static void ipcp_recv(struct ppp_handler_t*h)
break;
case TERMREQ:
if (conf_ppp_verbose)
- log_ppp_info("recv [IPCP TermReq id=%x]\n", hdr->id);
+ log_ppp_info2("recv [IPCP TermReq id=%x]\n", hdr->id);
ppp_fsm_recv_term_req(&ipcp->fsm);
ppp_terminate(ipcp->ppp, TERM_USER_REQUEST, 0);
break;
case TERMACK:
if (conf_ppp_verbose)
- log_ppp_info("recv [IPCP TermAck id=%x]\n", hdr->id);
+ log_ppp_info2("recv [IPCP TermAck id=%x]\n", hdr->id);
//ppp_fsm_recv_term_ack(&ipcp->fsm);
//ppp_terminate(ipcp->ppp, 0);
break;
case CODEREJ:
if (conf_ppp_verbose)
- log_ppp_info("recv [IPCP CodeRej id=%x]\n", hdr->id);
+ log_ppp_info2("recv [IPCP CodeRej id=%x]\n", hdr->id);
ppp_fsm_recv_code_rej_bad(&ipcp->fsm);
break;
default:
diff --git a/accel-pptpd/ppp/ppp_lcp.c b/accel-pptpd/ppp/ppp_lcp.c
index 5416019..8c539a7 100644
--- a/accel-pptpd/ppp/ppp_lcp.c
+++ b/accel-pptpd/ppp/ppp_lcp.c
@@ -186,11 +186,11 @@ static void print_ropt(struct recv_opt_t *ropt)
int i;
uint8_t *ptr = (uint8_t*)ropt->hdr;
- log_ppp_info("<");
+ log_ppp_info2("<");
for (i = 0; i < ropt->len; i++) {
- log_ppp_info(" %x", ptr[i]);
+ log_ppp_info2(" %x", ptr[i]);
}
- log_ppp_info(" >");
+ log_ppp_info2(" >");
}
static int send_conf_req(struct ppp_fsm_t *fsm)
@@ -220,14 +220,14 @@ static int send_conf_req(struct ppp_fsm_t *fsm)
}
if (conf_ppp_verbose) {
- log_ppp_info("send [LCP ConfReq id=%x", lcp_hdr->id);
+ log_ppp_info2("send [LCP ConfReq id=%x", lcp_hdr->id);
list_for_each_entry(lopt,&lcp->options,entry) {
if (lopt->print) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, NULL);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, NULL);
}
}
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
}
lcp_hdr->len = htons(ptr - buf - 2);
@@ -246,7 +246,7 @@ static void send_conf_ack(struct ppp_fsm_t *fsm)
hdr->code = CONFACK;
if (conf_ppp_verbose)
- log_ppp_info("send [LCP ConfAck id=%x ]\n", lcp->fsm.recv_id);
+ log_ppp_info2("send [LCP ConfAck id=%x ]\n", lcp->fsm.recv_id);
ppp_chan_send(lcp->ppp, hdr, ntohs(hdr->len) + 2);
}
@@ -259,7 +259,7 @@ static void send_code_rej(struct ppp_fsm_t *fsm)
hdr->code = CONFACK;
if (conf_ppp_verbose)
- log_ppp_info("send [LCP CodeRej %x id=%x ]\n",hdr->code, lcp->fsm.recv_id);
+ log_ppp_info2("send [LCP CodeRej %x id=%x ]\n",hdr->code, lcp->fsm.recv_id);
ppp_chan_send(lcp->ppp, hdr, ntohs(hdr->len) + 2);
}
@@ -272,7 +272,7 @@ static void send_conf_nak(struct ppp_fsm_t *fsm)
struct lcp_option_t *lopt;
if (conf_ppp_verbose)
- log_ppp_info("send [LCP ConfNak id=%x", lcp->fsm.recv_id);
+ log_ppp_info2("send [LCP ConfNak id=%x", lcp->fsm.recv_id);
lcp_hdr->proto = htons(PPP_LCP);
lcp_hdr->code = CONFNAK;
@@ -286,14 +286,14 @@ static void send_conf_nak(struct ppp_fsm_t *fsm)
ptr+=lopt->h->send_conf_nak(lcp,lopt,ptr);
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, NULL);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, NULL);
}
}
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
lcp_hdr->len = htons(ptr - buf - 2);
ppp_chan_send(lcp->ppp, lcp_hdr,ptr - buf);
@@ -309,7 +309,7 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
struct recv_opt_t *ropt;
if (conf_ppp_verbose)
- log_ppp_info("send [LCP ConfRej id=%x ", lcp->fsm.recv_id);
+ log_ppp_info2("send [LCP ConfRej id=%x ", lcp->fsm.recv_id);
lcp_hdr->proto = htons(PPP_LCP);
lcp_hdr->code = CONFREJ;
@@ -324,9 +324,9 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
ptr += ropt->len;
if (conf_ppp_verbose) {
- log_ppp_info(" ");
+ log_ppp_info2(" ");
if (ropt->lopt)
- ropt->lopt->h->print(log_ppp_info, ropt->lopt, (uint8_t*)ropt->hdr);
+ ropt->lopt->h->print(log_ppp_info2, ropt->lopt, (uint8_t*)ropt->hdr);
else
print_ropt(ropt);
}
@@ -334,7 +334,7 @@ static void send_conf_rej(struct ppp_fsm_t *fsm)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
lcp_hdr->len = htons(ptr - buf - 2);
ppp_chan_send(lcp->ppp, lcp_hdr, ptr - buf);
@@ -374,14 +374,14 @@ static int lcp_recv_conf_req(struct ppp_lcp_t *lcp, uint8_t *data, int size)
lopt->state = LCP_OPT_NONE;
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP ConfReq id=%x", lcp->fsm.recv_id);
+ log_ppp_info2("recv [LCP ConfReq id=%x", lcp->fsm.recv_id);
list_for_each_entry(ropt, &lcp->ropt_list, entry) {
list_for_each_entry(lopt, &lcp->options, entry) {
if (lopt->id == ropt->hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, (uint8_t*)ropt->hdr);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, (uint8_t*)ropt->hdr);
}
r = lopt->h->recv_conf_req(lcp, lopt, (uint8_t*)ropt->hdr);
lopt->state = r;
@@ -394,7 +394,7 @@ static int lcp_recv_conf_req(struct ppp_lcp_t *lcp, uint8_t *data, int size)
}
if (!ropt->lopt) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
+ log_ppp_info2(" ");
print_ropt(ropt);
}
ropt->state=LCP_OPT_REJ;
@@ -403,7 +403,7 @@ static int lcp_recv_conf_req(struct ppp_lcp_t *lcp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
/*list_for_each_entry(lopt,&lcp->options,entry)
{
@@ -436,11 +436,11 @@ static int lcp_recv_conf_rej(struct ppp_lcp_t *lcp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP ConfRej id=%x", lcp->fsm.recv_id);
+ log_ppp_info2("recv [LCP ConfRej id=%x", lcp->fsm.recv_id);
if (lcp->fsm.recv_id != lcp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -450,8 +450,8 @@ static int lcp_recv_conf_rej(struct ppp_lcp_t *lcp, uint8_t *data, int size)
list_for_each_entry(lopt, &lcp->options, entry) {
if (lopt->id == hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, (uint8_t*)hdr);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, (uint8_t*)hdr);
}
if (!lopt->h->recv_conf_rej)
res = -1;
@@ -466,7 +466,7 @@ static int lcp_recv_conf_rej(struct ppp_lcp_t *lcp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -478,11 +478,11 @@ static int lcp_recv_conf_nak(struct ppp_lcp_t *lcp, uint8_t *data, int size)
int res = 0;
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP ConfNak id=%x", lcp->fsm.recv_id);
+ log_ppp_info2("recv [LCP ConfNak id=%x", lcp->fsm.recv_id);
if (lcp->fsm.recv_id != lcp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -492,8 +492,8 @@ static int lcp_recv_conf_nak(struct ppp_lcp_t *lcp, uint8_t *data, int size)
list_for_each_entry(lopt,&lcp->options,entry) {
if (lopt->id == hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, data);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, data);
}
if (lopt->h->recv_conf_nak && lopt->h->recv_conf_nak(lcp, lopt, data))
res = -1;
@@ -506,7 +506,7 @@ static int lcp_recv_conf_nak(struct ppp_lcp_t *lcp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -518,11 +518,11 @@ static int lcp_recv_conf_ack(struct ppp_lcp_t *lcp, uint8_t *data, int size)
int res=0;
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP ConfAck id=%x", lcp->fsm.recv_id);
+ log_ppp_info2("recv [LCP ConfAck id=%x", lcp->fsm.recv_id);
if (lcp->fsm.recv_id != lcp->fsm.id) {
if (conf_ppp_verbose)
- log_ppp_info(": id mismatch ]\n");
+ log_ppp_info2(": id mismatch ]\n");
return 0;
}
@@ -532,8 +532,8 @@ static int lcp_recv_conf_ack(struct ppp_lcp_t *lcp, uint8_t *data, int size)
list_for_each_entry(lopt, &lcp->options, entry) {
if (lopt->id == hdr->id) {
if (conf_ppp_verbose) {
- log_ppp_info(" ");
- lopt->h->print(log_ppp_info, lopt, data);
+ log_ppp_info2(" ");
+ lopt->h->print(log_ppp_info2, lopt, data);
}
if (!lopt->h->recv_conf_ack)
break;
@@ -548,7 +548,7 @@ static int lcp_recv_conf_ack(struct ppp_lcp_t *lcp, uint8_t *data, int size)
}
if (conf_ppp_verbose)
- log_ppp_info("]\n");
+ log_ppp_info2("]\n");
return res;
}
@@ -639,7 +639,7 @@ static void send_term_req(struct ppp_fsm_t *fsm)
};
if (conf_ppp_verbose)
- log_ppp_info("send [LCP TermReq id=%i]\n", hdr.id);
+ log_ppp_info2("send [LCP TermReq id=%i]\n", hdr.id);
ppp_chan_send(lcp->ppp, &hdr, 6);
}
@@ -655,7 +655,7 @@ static void send_term_ack(struct ppp_fsm_t *fsm)
};
if (conf_ppp_verbose)
- log_ppp_info("send [LCP TermAck id=%i]\n", hdr.id);
+ log_ppp_info2("send [LCP TermAck id=%i]\n", hdr.id);
ppp_chan_send(lcp->ppp, &hdr, 6);
}
@@ -676,7 +676,7 @@ void lcp_send_proto_rej(struct ppp_t *ppp, uint16_t proto)
};
if (conf_ppp_verbose)
- log_ppp_info("send [LCP ProtoRej id=%i <%04x>]\n", msg.hdr.id, proto);
+ log_ppp_info2("send [LCP ProtoRej id=%i <%04x>]\n", msg.hdr.id, proto);
ppp_chan_send(lcp->ppp, &msg, sizeof(msg));
}
@@ -749,18 +749,18 @@ static void lcp_recv(struct ppp_handler_t*h)
break;
case TERMREQ:
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP TermReq id=%x]\n", hdr->id);
+ log_ppp_info2("recv [LCP TermReq id=%x]\n", hdr->id);
ppp_fsm_recv_term_req(&lcp->fsm);
ppp_terminate(lcp->ppp, TERM_USER_REQUEST, 0);
break;
case TERMACK:
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP TermAck id=%x]\n", hdr->id);
+ log_ppp_info2("recv [LCP TermAck id=%x]\n", hdr->id);
ppp_fsm_recv_term_ack(&lcp->fsm);
break;
case CODEREJ:
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP CodeRej id=%x]\n", hdr->id);
+ log_ppp_info2("recv [LCP CodeRej id=%x]\n", hdr->id);
ppp_fsm_recv_code_rej_bad(&lcp->fsm);
break;
case ECHOREQ:
@@ -773,19 +773,19 @@ static void lcp_recv(struct ppp_handler_t*h)
break;
case PROTOREJ:
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP ProtoRej id=%x <%04x>]\n", hdr->code, hdr->id, ntohs(*(uint16_t*)(hdr + 1)));
+ log_ppp_info2("recv [LCP ProtoRej id=%x <%04x>]\n", hdr->code, hdr->id, ntohs(*(uint16_t*)(hdr + 1)));
ppp_recv_proto_rej(lcp->ppp, ntohs(*(uint16_t *)(hdr + 1)));
break;
case IDENT:
if (conf_ppp_verbose) {
term_msg = _strndup((char*)(hdr + 1) + 4, ntohs(hdr->len) - 4 - 4);
- log_ppp_info("recv [LCP Ident id=%x <%s>]\n", hdr->id, term_msg);
+ log_ppp_info2("recv [LCP Ident id=%x <%s>]\n", hdr->id, term_msg);
_free(term_msg);
}
break;
default:
if (conf_ppp_verbose)
- log_ppp_info("recv [LCP Unknown %x]\n", hdr->code);
+ log_ppp_info2("recv [LCP Unknown %x]\n", hdr->code);
ppp_fsm_recv_unk(&lcp->fsm);
break;
}