X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fmain.c;h=25a0379e3cdc71da307160a32de731a86e666e47;hb=d4777d66024a8c343ad420f1d45ed2cbaa7468bc;hp=4fb985b89a010440c86bb6bf367604afae3b6448;hpb=93b9f7ad08d5f0ee16880ec2b21b1c13a00d4779;p=ppp.git diff --git a/pppd/main.c b/pppd/main.c index 4fb985b..25a0379 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: main.c,v 1.114 2002/10/10 05:47:34 fcusack Exp $" +#define RCSID "$Id: main.c,v 1.119 2002/11/02 19:48:12 carlsonj Exp $" #include #include @@ -52,6 +52,7 @@ #endif #include "upap.h" #include "chap.h" +#include "eap.h" #include "ccp.h" #include "ecp.h" #include "pathnames.h" @@ -146,7 +147,7 @@ int ngroups; /* How many groups valid in groups */ static struct timeval start_time; /* Time when link was started. */ struct pppd_stats link_stats; -int link_connect_time; +unsigned link_connect_time; int link_stats_valid; /* @@ -229,6 +230,7 @@ struct protent *protocols[] = { #ifdef AT_CHANGE &atcp_protent, #endif + &eap_protent, NULL }; @@ -366,7 +368,7 @@ main(argc, argv) * Early check for remote number authorization. */ if (!auth_number()) { - error("remote number %s is not authorized", remote_number); + warn("calling number %q is not authorized", remote_number); exit(EXIT_CNID_AUTH_FAILED); } @@ -990,7 +992,7 @@ get_input() * Toss all non-LCP packets unless LCP is OPEN. */ if (protocol != PPP_LCP && lcp_fsm[0].state != OPENED) { - MAINDEBUG(("get_input: Received non-LCP packet when LCP not open.")); + dbglog("Discarded non-LCP packet when LCP not open"); return; } @@ -1000,9 +1002,10 @@ get_input() */ if (phase <= PHASE_AUTHENTICATE && !(protocol == PPP_LCP || protocol == PPP_LQR - || protocol == PPP_PAP || protocol == PPP_CHAP)) { - MAINDEBUG(("get_input: discarding proto 0x%x in phase %d", - protocol, phase)); + || protocol == PPP_PAP || protocol == PPP_CHAP || + protocol == PPP_EAP)) { + dbglog("discarding proto 0x%x in phase %d", + protocol, phase); return; } @@ -1116,11 +1119,11 @@ update_link_stats(u) link_connect_time = now.tv_sec - start_time.tv_sec; link_stats_valid = 1; - slprintf(numbuf, sizeof(numbuf), "%d", link_connect_time); + slprintf(numbuf, sizeof(numbuf), "%u", link_connect_time); script_setenv("CONNECT_TIME", numbuf, 0); - slprintf(numbuf, sizeof(numbuf), "%d", link_stats.bytes_out); + slprintf(numbuf, sizeof(numbuf), "%u", link_stats.bytes_out); script_setenv("BYTES_SENT", numbuf, 0); - slprintf(numbuf, sizeof(numbuf), "%d", link_stats.bytes_in); + slprintf(numbuf, sizeof(numbuf), "%u", link_stats.bytes_in); script_setenv("BYTES_RCVD", numbuf, 0); }