ppp: minor changes: fix some 'is unused' warning when debug is off.

This commit is contained in:
fbernon 2008-03-16 08:53:58 +00:00
parent e07d71f5e8
commit 03f888c968
7 changed files with 52 additions and 1 deletions

View File

@ -178,6 +178,8 @@ static int passwd_from_file;
void void
link_required(int unit) link_required(int unit)
{ {
LWIP_UNUSED_ARG(unit);
AUTHDEBUG((LOG_INFO, "link_required: %d\n", unit)); AUTHDEBUG((LOG_INFO, "link_required: %d\n", unit));
} }
@ -322,6 +324,8 @@ link_established(int unit)
void void
auth_peer_fail(int unit, u16_t protocol) auth_peer_fail(int unit, u16_t protocol)
{ {
LWIP_UNUSED_ARG(protocol);
AUTHDEBUG((LOG_INFO, "auth_peer_fail: %d proto=%X\n", unit, protocol)); AUTHDEBUG((LOG_INFO, "auth_peer_fail: %d proto=%X\n", unit, protocol));
/* /*
* Authentication failure: take the link down * Authentication failure: take the link down
@ -378,6 +382,8 @@ auth_withpeer_fail(int unit, u16_t protocol)
{ {
int errCode = PPPERR_AUTHFAIL; int errCode = PPPERR_AUTHFAIL;
LWIP_UNUSED_ARG(protocol);
AUTHDEBUG((LOG_INFO, "auth_withpeer_fail: %d proto=%X\n", unit, protocol)); AUTHDEBUG((LOG_INFO, "auth_withpeer_fail: %d proto=%X\n", unit, protocol));
if (passwd_from_file) { if (passwd_from_file) {
BZERO(ppp_settings.passwd, MAXSECRETLEN); BZERO(ppp_settings.passwd, MAXSECRETLEN);
@ -437,6 +443,9 @@ auth_withpeer_success(int unit, u16_t protocol)
void void
np_up(int unit, u16_t proto) np_up(int unit, u16_t proto)
{ {
LWIP_UNUSED_ARG(unit);
LWIP_UNUSED_ARG(proto);
AUTHDEBUG((LOG_INFO, "np_up: %d proto=%X\n", unit, proto)); AUTHDEBUG((LOG_INFO, "np_up: %d proto=%X\n", unit, proto));
if (num_np_up == 0) { if (num_np_up == 0) {
AUTHDEBUG((LOG_INFO, "np_up: maxconnect=%d idle_time_limit=%d\n",ppp_settings.maxconnect,ppp_settings.idle_time_limit)); AUTHDEBUG((LOG_INFO, "np_up: maxconnect=%d idle_time_limit=%d\n",ppp_settings.maxconnect,ppp_settings.idle_time_limit));
@ -464,6 +473,9 @@ np_up(int unit, u16_t proto)
void void
np_down(int unit, u16_t proto) np_down(int unit, u16_t proto)
{ {
LWIP_UNUSED_ARG(unit);
LWIP_UNUSED_ARG(proto);
AUTHDEBUG((LOG_INFO, "np_down: %d proto=%X\n", unit, proto)); AUTHDEBUG((LOG_INFO, "np_down: %d proto=%X\n", unit, proto));
if (--num_np_up == 0 && ppp_settings.idle_time_limit > 0) { if (--num_np_up == 0 && ppp_settings.idle_time_limit > 0) {
UNTIMEOUT(check_idle, NULL); UNTIMEOUT(check_idle, NULL);
@ -476,6 +488,9 @@ np_down(int unit, u16_t proto)
void void
np_finished(int unit, u16_t proto) np_finished(int unit, u16_t proto)
{ {
LWIP_UNUSED_ARG(unit);
LWIP_UNUSED_ARG(proto);
AUTHDEBUG((LOG_INFO, "np_finished: %d proto=%X\n", unit, proto)); AUTHDEBUG((LOG_INFO, "np_finished: %d proto=%X\n", unit, proto));
if (--num_np_open <= 0) { if (--num_np_open <= 0) {
/* no further use for the link: shut up shop. */ /* no further use for the link: shut up shop. */
@ -526,6 +541,12 @@ int
check_passwd( int unit, char *auser, int userlen, char *apasswd, int passwdlen, char **msg, int *msglen) check_passwd( int unit, char *auser, int userlen, char *apasswd, int passwdlen, char **msg, int *msglen)
{ {
#if 1 #if 1
LWIP_UNUSED_ARG(unit);
LWIP_UNUSED_ARG(auser);
LWIP_UNUSED_ARG(userlen);
LWIP_UNUSED_ARG(apasswd);
LWIP_UNUSED_ARG(passwdlen);
LWIP_UNUSED_ARG(msglen);
*msg = (char *) 0; *msg = (char *) 0;
return UPAP_AUTHACK; /* XXX Assume all entries OK. */ return UPAP_AUTHACK; /* XXX Assume all entries OK. */
#else #else
@ -621,6 +642,10 @@ int get_secret( int unit, char *client, char *server, char *secret, int *secret_
int len; int len;
struct wordlist *addrs; struct wordlist *addrs;
LWIP_UNUSED_ARG(unit);
LWIP_UNUSED_ARG(server);
LWIP_UNUSED_ARG(save_addrs);
addrs = NULL; addrs = NULL;
if(!client || !client[0] || strcmp(client, ppp_settings.user)) { if(!client || !client[0] || strcmp(client, ppp_settings.user)) {
@ -846,6 +871,7 @@ null_login(int unit)
static int static int
get_pap_passwd(int unit, char *user, char *passwd) get_pap_passwd(int unit, char *user, char *passwd)
{ {
LWIP_UNUSED_ARG(unit);
/* normally we would reject PAP if no password is provided, /* normally we would reject PAP if no password is provided,
but this causes problems with some providers (like CHT in Taiwan) but this causes problems with some providers (like CHT in Taiwan)
who incorrectly request PAP and expect a bogus/empty password, so who incorrectly request PAP and expect a bogus/empty password, so

View File

@ -638,6 +638,9 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len)
static void static void
ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len) ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len)
{ {
LWIP_UNUSED_ARG(id);
LWIP_UNUSED_ARG(inp);
CHAPDEBUG((LOG_INFO, "ChapReceiveSuccess: Rcvd id %d.\n", id)); CHAPDEBUG((LOG_INFO, "ChapReceiveSuccess: Rcvd id %d.\n", id));
if (cstate->clientstate == CHAPCS_OPEN) { if (cstate->clientstate == CHAPCS_OPEN) {
@ -672,6 +675,9 @@ ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len)
static void static void
ChapReceiveFailure(chap_state *cstate, u_char *inp, u_char id, int len) ChapReceiveFailure(chap_state *cstate, u_char *inp, u_char id, int len)
{ {
LWIP_UNUSED_ARG(id);
LWIP_UNUSED_ARG(inp);
CHAPDEBUG((LOG_INFO, "ChapReceiveFailure: Rcvd id %d.\n", id)); CHAPDEBUG((LOG_INFO, "ChapReceiveFailure: Rcvd id %d.\n", id));
if (cstate->clientstate != CHAPCS_RESPONSE) { if (cstate->clientstate != CHAPCS_RESPONSE) {

View File

@ -148,6 +148,8 @@ fsm_lowerup(fsm *f)
{ {
int oldState = f->state; int oldState = f->state;
LWIP_UNUSED_ARG(oldState);
switch( f->state ) { switch( f->state ) {
case LS_INITIAL: case LS_INITIAL:
f->state = LS_CLOSED; f->state = LS_CLOSED;
@ -183,6 +185,8 @@ fsm_lowerdown(fsm *f)
{ {
int oldState = f->state; int oldState = f->state;
LWIP_UNUSED_ARG(oldState);
switch( f->state ) { switch( f->state ) {
case LS_CLOSED: case LS_CLOSED:
f->state = LS_INITIAL; f->state = LS_INITIAL;
@ -233,6 +237,8 @@ fsm_open(fsm *f)
{ {
int oldState = f->state; int oldState = f->state;
LWIP_UNUSED_ARG(oldState);
switch( f->state ) { switch( f->state ) {
case LS_INITIAL: case LS_INITIAL:
f->state = LS_STARTING; f->state = LS_STARTING;
@ -279,6 +285,8 @@ fsm_close(fsm *f, char *reason)
{ {
int oldState = f->state; int oldState = f->state;
LWIP_UNUSED_ARG(oldState);
f->term_reason = reason; f->term_reason = reason;
f->term_reason_len = (reason == NULL? 0: strlen(reason)); f->term_reason_len = (reason == NULL? 0: strlen(reason));
switch( f->state ) { switch( f->state ) {
@ -747,6 +755,8 @@ fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len)
static void static void
fsm_rtermreq(fsm *f, int id, u_char *p, int len) fsm_rtermreq(fsm *f, int id, u_char *p, int len)
{ {
LWIP_UNUSED_ARG(p);
FSMDEBUG((LOG_INFO, "fsm_rtermreq(%s): Rcvd id %d state=%d (%s)\n", FSMDEBUG((LOG_INFO, "fsm_rtermreq(%s): Rcvd id %d state=%d (%s)\n",
PROTO_NAME(f), id, f->state, ppperr_strerr[f->state])); PROTO_NAME(f), id, f->state, ppperr_strerr[f->state]));

View File

@ -466,6 +466,8 @@ upap_rauthack(upap_state *u, u_char *inp, int id, int len)
u_char msglen; u_char msglen;
char *msg; char *msg;
LWIP_UNUSED_ARG(id);
UPAPDEBUG((LOG_INFO, "pap_rauthack: Rcvd id %d s=%d\n", id, u->us_clientstate)); UPAPDEBUG((LOG_INFO, "pap_rauthack: Rcvd id %d s=%d\n", id, u->us_clientstate));
if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */ if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */
@ -503,6 +505,8 @@ upap_rauthnak(upap_state *u, u_char *inp, int id, int len)
u_char msglen; u_char msglen;
char *msg; char *msg;
LWIP_UNUSED_ARG(id);
UPAPDEBUG((LOG_INFO, "pap_rauthnak: Rcvd id %d s=%d\n", id, u->us_clientstate)); UPAPDEBUG((LOG_INFO, "pap_rauthnak: Rcvd id %d s=%d\n", id, u->us_clientstate));
if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */ if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */

View File

@ -590,6 +590,9 @@ int pppOverEthernetOpen(struct netif *ethif, const char *service_name, const cha
PPPControl *pc; PPPControl *pc;
int pd; int pd;
LWIP_UNUSED_ARG(service_name);
LWIP_UNUSED_ARG(concentrator_name);
/* Find a free PPP session descriptor. Critical region? */ /* Find a free PPP session descriptor. Critical region? */
for (pd = 0; pd < NUM_PPP && pppControl[pd].openFlag != 0; pd++); for (pd = 0; pd < NUM_PPP && pppControl[pd].openFlag != 0; pd++);
if (pd >= NUM_PPP) { if (pd >= NUM_PPP) {

View File

@ -187,7 +187,7 @@ enum NPmode {
} }
#define PUTSHORT(s, cp) { \ #define PUTSHORT(s, cp) { \
*(cp)++ = (u_char) ((s) >> 8); \ *(cp)++ = (u_char) ((s) >> 8); \
*(cp)++ = (u_char) (s); \ *(cp)++ = (u_char) (s & 0xff); \
} }
#define GETLONG(l, cp) { \ #define GETLONG(l, cp) { \

View File

@ -1201,6 +1201,8 @@ pppoe_ifattach_hook(void *arg, struct pbuf **mp, struct netif *ifp, int dir)
static void static void
pppoe_clear_softc(struct pppoe_softc *sc, const char *message) pppoe_clear_softc(struct pppoe_softc *sc, const char *message)
{ {
LWIP_UNUSED_ARG(message);
/* stop timer */ /* stop timer */
tcpip_untimeout(pppoe_timeout, sc); tcpip_untimeout(pppoe_timeout, sc);
PPPDEBUG((LOG_DEBUG, "pppoe: %c%c%"U16_F": session 0x%x terminated, %s\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, sc->sc_session, message)); PPPDEBUG((LOG_DEBUG, "pppoe: %c%c%"U16_F": session 0x%x terminated, %s\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, sc->sc_session, message));