Ethernet test for ECE 4180 and others to find your IP address and do a simple HTTP GET request over port 80.

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Committer:
mkersh3
Date:
Thu Apr 04 05:26:09 2013 +0000
Revision:
0:e7ca326e76ee
Ethernet Test for ECE4180 and others to find their IP Address and do a simple HTTP GET request over port 80.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mkersh3 0:e7ca326e76ee 1 /*****************************************************************************
mkersh3 0:e7ca326e76ee 2 * pap.c - Network Password Authentication Protocol program file.
mkersh3 0:e7ca326e76ee 3 *
mkersh3 0:e7ca326e76ee 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
mkersh3 0:e7ca326e76ee 5 * portions Copyright (c) 1997 by Global Election Systems Inc.
mkersh3 0:e7ca326e76ee 6 *
mkersh3 0:e7ca326e76ee 7 * The authors hereby grant permission to use, copy, modify, distribute,
mkersh3 0:e7ca326e76ee 8 * and license this software and its documentation for any purpose, provided
mkersh3 0:e7ca326e76ee 9 * that existing copyright notices are retained in all copies and that this
mkersh3 0:e7ca326e76ee 10 * notice and the following disclaimer are included verbatim in any
mkersh3 0:e7ca326e76ee 11 * distributions. No written agreement, license, or royalty fee is required
mkersh3 0:e7ca326e76ee 12 * for any of the authorized uses.
mkersh3 0:e7ca326e76ee 13 *
mkersh3 0:e7ca326e76ee 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
mkersh3 0:e7ca326e76ee 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
mkersh3 0:e7ca326e76ee 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
mkersh3 0:e7ca326e76ee 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
mkersh3 0:e7ca326e76ee 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
mkersh3 0:e7ca326e76ee 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
mkersh3 0:e7ca326e76ee 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
mkersh3 0:e7ca326e76ee 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mkersh3 0:e7ca326e76ee 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
mkersh3 0:e7ca326e76ee 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mkersh3 0:e7ca326e76ee 24 *
mkersh3 0:e7ca326e76ee 25 ******************************************************************************
mkersh3 0:e7ca326e76ee 26 * REVISION HISTORY
mkersh3 0:e7ca326e76ee 27 *
mkersh3 0:e7ca326e76ee 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
mkersh3 0:e7ca326e76ee 29 * Ported to lwIP.
mkersh3 0:e7ca326e76ee 30 * 97-12-12 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.
mkersh3 0:e7ca326e76ee 31 * Original.
mkersh3 0:e7ca326e76ee 32 *****************************************************************************/
mkersh3 0:e7ca326e76ee 33 /*
mkersh3 0:e7ca326e76ee 34 * upap.c - User/Password Authentication Protocol.
mkersh3 0:e7ca326e76ee 35 *
mkersh3 0:e7ca326e76ee 36 * Copyright (c) 1989 Carnegie Mellon University.
mkersh3 0:e7ca326e76ee 37 * All rights reserved.
mkersh3 0:e7ca326e76ee 38 *
mkersh3 0:e7ca326e76ee 39 * Redistribution and use in source and binary forms are permitted
mkersh3 0:e7ca326e76ee 40 * provided that the above copyright notice and this paragraph are
mkersh3 0:e7ca326e76ee 41 * duplicated in all such forms and that any documentation,
mkersh3 0:e7ca326e76ee 42 * advertising materials, and other materials related to such
mkersh3 0:e7ca326e76ee 43 * distribution and use acknowledge that the software was developed
mkersh3 0:e7ca326e76ee 44 * by Carnegie Mellon University. The name of the
mkersh3 0:e7ca326e76ee 45 * University may not be used to endorse or promote products derived
mkersh3 0:e7ca326e76ee 46 * from this software without specific prior written permission.
mkersh3 0:e7ca326e76ee 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
mkersh3 0:e7ca326e76ee 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
mkersh3 0:e7ca326e76ee 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
mkersh3 0:e7ca326e76ee 50 */
mkersh3 0:e7ca326e76ee 51
mkersh3 0:e7ca326e76ee 52 #include "lwip/opt.h"
mkersh3 0:e7ca326e76ee 53
mkersh3 0:e7ca326e76ee 54 #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */
mkersh3 0:e7ca326e76ee 55
mkersh3 0:e7ca326e76ee 56 #if PAP_SUPPORT /* don't build if not configured for use in lwipopts.h */
mkersh3 0:e7ca326e76ee 57
mkersh3 0:e7ca326e76ee 58 #include "ppp.h"
mkersh3 0:e7ca326e76ee 59 #include "pppdebug.h"
mkersh3 0:e7ca326e76ee 60
mkersh3 0:e7ca326e76ee 61 #include "auth.h"
mkersh3 0:e7ca326e76ee 62 #include "pap.h"
mkersh3 0:e7ca326e76ee 63
mkersh3 0:e7ca326e76ee 64 #include <string.h>
mkersh3 0:e7ca326e76ee 65
mkersh3 0:e7ca326e76ee 66 #if 0 /* UNUSED */
mkersh3 0:e7ca326e76ee 67 static bool hide_password = 1;
mkersh3 0:e7ca326e76ee 68
mkersh3 0:e7ca326e76ee 69 /*
mkersh3 0:e7ca326e76ee 70 * Command-line options.
mkersh3 0:e7ca326e76ee 71 */
mkersh3 0:e7ca326e76ee 72 static option_t pap_option_list[] = {
mkersh3 0:e7ca326e76ee 73 { "hide-password", o_bool, &hide_password,
mkersh3 0:e7ca326e76ee 74 "Don't output passwords to log", 1 },
mkersh3 0:e7ca326e76ee 75 { "show-password", o_bool, &hide_password,
mkersh3 0:e7ca326e76ee 76 "Show password string in debug log messages", 0 },
mkersh3 0:e7ca326e76ee 77 { "pap-restart", o_int, &upap[0].us_timeouttime,
mkersh3 0:e7ca326e76ee 78 "Set retransmit timeout for PAP" },
mkersh3 0:e7ca326e76ee 79 { "pap-max-authreq", o_int, &upap[0].us_maxtransmits,
mkersh3 0:e7ca326e76ee 80 "Set max number of transmissions for auth-reqs" },
mkersh3 0:e7ca326e76ee 81 { "pap-timeout", o_int, &upap[0].us_reqtimeout,
mkersh3 0:e7ca326e76ee 82 "Set time limit for peer PAP authentication" },
mkersh3 0:e7ca326e76ee 83 { NULL }
mkersh3 0:e7ca326e76ee 84 };
mkersh3 0:e7ca326e76ee 85 #endif
mkersh3 0:e7ca326e76ee 86
mkersh3 0:e7ca326e76ee 87 /*
mkersh3 0:e7ca326e76ee 88 * Protocol entry points.
mkersh3 0:e7ca326e76ee 89 */
mkersh3 0:e7ca326e76ee 90 static void upap_init (int);
mkersh3 0:e7ca326e76ee 91 static void upap_lowerup (int);
mkersh3 0:e7ca326e76ee 92 static void upap_lowerdown (int);
mkersh3 0:e7ca326e76ee 93 static void upap_input (int, u_char *, int);
mkersh3 0:e7ca326e76ee 94 static void upap_protrej (int);
mkersh3 0:e7ca326e76ee 95 #if PPP_ADDITIONAL_CALLBACKS
mkersh3 0:e7ca326e76ee 96 static int upap_printpkt (u_char *, int, void (*)(void *, char *, ...), void *);
mkersh3 0:e7ca326e76ee 97 #endif /* PPP_ADDITIONAL_CALLBACKS */
mkersh3 0:e7ca326e76ee 98
mkersh3 0:e7ca326e76ee 99 struct protent pap_protent = {
mkersh3 0:e7ca326e76ee 100 PPP_PAP,
mkersh3 0:e7ca326e76ee 101 upap_init,
mkersh3 0:e7ca326e76ee 102 upap_input,
mkersh3 0:e7ca326e76ee 103 upap_protrej,
mkersh3 0:e7ca326e76ee 104 upap_lowerup,
mkersh3 0:e7ca326e76ee 105 upap_lowerdown,
mkersh3 0:e7ca326e76ee 106 NULL,
mkersh3 0:e7ca326e76ee 107 NULL,
mkersh3 0:e7ca326e76ee 108 #if PPP_ADDITIONAL_CALLBACKS
mkersh3 0:e7ca326e76ee 109 upap_printpkt,
mkersh3 0:e7ca326e76ee 110 NULL,
mkersh3 0:e7ca326e76ee 111 #endif /* PPP_ADDITIONAL_CALLBACKS */
mkersh3 0:e7ca326e76ee 112 1,
mkersh3 0:e7ca326e76ee 113 "PAP",
mkersh3 0:e7ca326e76ee 114 #if PPP_ADDITIONAL_CALLBACKS
mkersh3 0:e7ca326e76ee 115 NULL,
mkersh3 0:e7ca326e76ee 116 NULL,
mkersh3 0:e7ca326e76ee 117 NULL
mkersh3 0:e7ca326e76ee 118 #endif /* PPP_ADDITIONAL_CALLBACKS */
mkersh3 0:e7ca326e76ee 119 };
mkersh3 0:e7ca326e76ee 120
mkersh3 0:e7ca326e76ee 121 upap_state upap[NUM_PPP]; /* UPAP state; one for each unit */
mkersh3 0:e7ca326e76ee 122
mkersh3 0:e7ca326e76ee 123 static void upap_timeout (void *);
mkersh3 0:e7ca326e76ee 124 static void upap_reqtimeout(void *);
mkersh3 0:e7ca326e76ee 125 static void upap_rauthreq (upap_state *, u_char *, u_char, int);
mkersh3 0:e7ca326e76ee 126 static void upap_rauthack (upap_state *, u_char *, int, int);
mkersh3 0:e7ca326e76ee 127 static void upap_rauthnak (upap_state *, u_char *, int, int);
mkersh3 0:e7ca326e76ee 128 static void upap_sauthreq (upap_state *);
mkersh3 0:e7ca326e76ee 129 static void upap_sresp (upap_state *, u_char, u_char, char *, int);
mkersh3 0:e7ca326e76ee 130
mkersh3 0:e7ca326e76ee 131
mkersh3 0:e7ca326e76ee 132 /*
mkersh3 0:e7ca326e76ee 133 * upap_init - Initialize a UPAP unit.
mkersh3 0:e7ca326e76ee 134 */
mkersh3 0:e7ca326e76ee 135 static void
mkersh3 0:e7ca326e76ee 136 upap_init(int unit)
mkersh3 0:e7ca326e76ee 137 {
mkersh3 0:e7ca326e76ee 138 upap_state *u = &upap[unit];
mkersh3 0:e7ca326e76ee 139
mkersh3 0:e7ca326e76ee 140 UPAPDEBUG(LOG_INFO, ("upap_init: %d\n", unit));
mkersh3 0:e7ca326e76ee 141 u->us_unit = unit;
mkersh3 0:e7ca326e76ee 142 u->us_user = NULL;
mkersh3 0:e7ca326e76ee 143 u->us_userlen = 0;
mkersh3 0:e7ca326e76ee 144 u->us_passwd = NULL;
mkersh3 0:e7ca326e76ee 145 u->us_passwdlen = 0;
mkersh3 0:e7ca326e76ee 146 u->us_clientstate = UPAPCS_INITIAL;
mkersh3 0:e7ca326e76ee 147 u->us_serverstate = UPAPSS_INITIAL;
mkersh3 0:e7ca326e76ee 148 u->us_id = 0;
mkersh3 0:e7ca326e76ee 149 u->us_timeouttime = UPAP_DEFTIMEOUT;
mkersh3 0:e7ca326e76ee 150 u->us_maxtransmits = 10;
mkersh3 0:e7ca326e76ee 151 u->us_reqtimeout = UPAP_DEFREQTIME;
mkersh3 0:e7ca326e76ee 152 }
mkersh3 0:e7ca326e76ee 153
mkersh3 0:e7ca326e76ee 154 /*
mkersh3 0:e7ca326e76ee 155 * upap_authwithpeer - Authenticate us with our peer (start client).
mkersh3 0:e7ca326e76ee 156 *
mkersh3 0:e7ca326e76ee 157 * Set new state and send authenticate's.
mkersh3 0:e7ca326e76ee 158 */
mkersh3 0:e7ca326e76ee 159 void
mkersh3 0:e7ca326e76ee 160 upap_authwithpeer(int unit, char *user, char *password)
mkersh3 0:e7ca326e76ee 161 {
mkersh3 0:e7ca326e76ee 162 upap_state *u = &upap[unit];
mkersh3 0:e7ca326e76ee 163
mkersh3 0:e7ca326e76ee 164 UPAPDEBUG(LOG_INFO, ("upap_authwithpeer: %d user=%s password=%s s=%d\n",
mkersh3 0:e7ca326e76ee 165 unit, user, password, u->us_clientstate));
mkersh3 0:e7ca326e76ee 166
mkersh3 0:e7ca326e76ee 167 /* Save the username and password we're given */
mkersh3 0:e7ca326e76ee 168 u->us_user = user;
mkersh3 0:e7ca326e76ee 169 u->us_userlen = (int)strlen(user);
mkersh3 0:e7ca326e76ee 170 u->us_passwd = password;
mkersh3 0:e7ca326e76ee 171 u->us_passwdlen = (int)strlen(password);
mkersh3 0:e7ca326e76ee 172
mkersh3 0:e7ca326e76ee 173 u->us_transmits = 0;
mkersh3 0:e7ca326e76ee 174
mkersh3 0:e7ca326e76ee 175 /* Lower layer up yet? */
mkersh3 0:e7ca326e76ee 176 if (u->us_clientstate == UPAPCS_INITIAL ||
mkersh3 0:e7ca326e76ee 177 u->us_clientstate == UPAPCS_PENDING) {
mkersh3 0:e7ca326e76ee 178 u->us_clientstate = UPAPCS_PENDING;
mkersh3 0:e7ca326e76ee 179 return;
mkersh3 0:e7ca326e76ee 180 }
mkersh3 0:e7ca326e76ee 181
mkersh3 0:e7ca326e76ee 182 upap_sauthreq(u); /* Start protocol */
mkersh3 0:e7ca326e76ee 183 }
mkersh3 0:e7ca326e76ee 184
mkersh3 0:e7ca326e76ee 185
mkersh3 0:e7ca326e76ee 186 /*
mkersh3 0:e7ca326e76ee 187 * upap_authpeer - Authenticate our peer (start server).
mkersh3 0:e7ca326e76ee 188 *
mkersh3 0:e7ca326e76ee 189 * Set new state.
mkersh3 0:e7ca326e76ee 190 */
mkersh3 0:e7ca326e76ee 191 void
mkersh3 0:e7ca326e76ee 192 upap_authpeer(int unit)
mkersh3 0:e7ca326e76ee 193 {
mkersh3 0:e7ca326e76ee 194 upap_state *u = &upap[unit];
mkersh3 0:e7ca326e76ee 195
mkersh3 0:e7ca326e76ee 196 /* Lower layer up yet? */
mkersh3 0:e7ca326e76ee 197 if (u->us_serverstate == UPAPSS_INITIAL ||
mkersh3 0:e7ca326e76ee 198 u->us_serverstate == UPAPSS_PENDING) {
mkersh3 0:e7ca326e76ee 199 u->us_serverstate = UPAPSS_PENDING;
mkersh3 0:e7ca326e76ee 200 return;
mkersh3 0:e7ca326e76ee 201 }
mkersh3 0:e7ca326e76ee 202
mkersh3 0:e7ca326e76ee 203 u->us_serverstate = UPAPSS_LISTEN;
mkersh3 0:e7ca326e76ee 204 if (u->us_reqtimeout > 0) {
mkersh3 0:e7ca326e76ee 205 TIMEOUT(upap_reqtimeout, u, u->us_reqtimeout);
mkersh3 0:e7ca326e76ee 206 }
mkersh3 0:e7ca326e76ee 207 }
mkersh3 0:e7ca326e76ee 208
mkersh3 0:e7ca326e76ee 209 /*
mkersh3 0:e7ca326e76ee 210 * upap_timeout - Retransmission timer for sending auth-reqs expired.
mkersh3 0:e7ca326e76ee 211 */
mkersh3 0:e7ca326e76ee 212 static void
mkersh3 0:e7ca326e76ee 213 upap_timeout(void *arg)
mkersh3 0:e7ca326e76ee 214 {
mkersh3 0:e7ca326e76ee 215 upap_state *u = (upap_state *) arg;
mkersh3 0:e7ca326e76ee 216
mkersh3 0:e7ca326e76ee 217 UPAPDEBUG(LOG_INFO, ("upap_timeout: %d timeout %d expired s=%d\n",
mkersh3 0:e7ca326e76ee 218 u->us_unit, u->us_timeouttime, u->us_clientstate));
mkersh3 0:e7ca326e76ee 219
mkersh3 0:e7ca326e76ee 220 if (u->us_clientstate != UPAPCS_AUTHREQ) {
mkersh3 0:e7ca326e76ee 221 UPAPDEBUG(LOG_INFO, ("upap_timeout: not in AUTHREQ state!\n"));
mkersh3 0:e7ca326e76ee 222 return;
mkersh3 0:e7ca326e76ee 223 }
mkersh3 0:e7ca326e76ee 224
mkersh3 0:e7ca326e76ee 225 if (u->us_transmits >= u->us_maxtransmits) {
mkersh3 0:e7ca326e76ee 226 /* give up in disgust */
mkersh3 0:e7ca326e76ee 227 UPAPDEBUG(LOG_ERR, ("No response to PAP authenticate-requests\n"));
mkersh3 0:e7ca326e76ee 228 u->us_clientstate = UPAPCS_BADAUTH;
mkersh3 0:e7ca326e76ee 229 auth_withpeer_fail(u->us_unit, PPP_PAP);
mkersh3 0:e7ca326e76ee 230 return;
mkersh3 0:e7ca326e76ee 231 }
mkersh3 0:e7ca326e76ee 232
mkersh3 0:e7ca326e76ee 233 upap_sauthreq(u); /* Send Authenticate-Request and set upap timeout*/
mkersh3 0:e7ca326e76ee 234 }
mkersh3 0:e7ca326e76ee 235
mkersh3 0:e7ca326e76ee 236
mkersh3 0:e7ca326e76ee 237 /*
mkersh3 0:e7ca326e76ee 238 * upap_reqtimeout - Give up waiting for the peer to send an auth-req.
mkersh3 0:e7ca326e76ee 239 */
mkersh3 0:e7ca326e76ee 240 static void
mkersh3 0:e7ca326e76ee 241 upap_reqtimeout(void *arg)
mkersh3 0:e7ca326e76ee 242 {
mkersh3 0:e7ca326e76ee 243 upap_state *u = (upap_state *) arg;
mkersh3 0:e7ca326e76ee 244
mkersh3 0:e7ca326e76ee 245 if (u->us_serverstate != UPAPSS_LISTEN) {
mkersh3 0:e7ca326e76ee 246 return; /* huh?? */
mkersh3 0:e7ca326e76ee 247 }
mkersh3 0:e7ca326e76ee 248
mkersh3 0:e7ca326e76ee 249 auth_peer_fail(u->us_unit, PPP_PAP);
mkersh3 0:e7ca326e76ee 250 u->us_serverstate = UPAPSS_BADAUTH;
mkersh3 0:e7ca326e76ee 251 }
mkersh3 0:e7ca326e76ee 252
mkersh3 0:e7ca326e76ee 253
mkersh3 0:e7ca326e76ee 254 /*
mkersh3 0:e7ca326e76ee 255 * upap_lowerup - The lower layer is up.
mkersh3 0:e7ca326e76ee 256 *
mkersh3 0:e7ca326e76ee 257 * Start authenticating if pending.
mkersh3 0:e7ca326e76ee 258 */
mkersh3 0:e7ca326e76ee 259 static void
mkersh3 0:e7ca326e76ee 260 upap_lowerup(int unit)
mkersh3 0:e7ca326e76ee 261 {
mkersh3 0:e7ca326e76ee 262 upap_state *u = &upap[unit];
mkersh3 0:e7ca326e76ee 263
mkersh3 0:e7ca326e76ee 264 UPAPDEBUG(LOG_INFO, ("upap_lowerup: init %d clientstate s=%d\n", unit, u->us_clientstate));
mkersh3 0:e7ca326e76ee 265
mkersh3 0:e7ca326e76ee 266 if (u->us_clientstate == UPAPCS_INITIAL) {
mkersh3 0:e7ca326e76ee 267 u->us_clientstate = UPAPCS_CLOSED;
mkersh3 0:e7ca326e76ee 268 } else if (u->us_clientstate == UPAPCS_PENDING) {
mkersh3 0:e7ca326e76ee 269 upap_sauthreq(u); /* send an auth-request */
mkersh3 0:e7ca326e76ee 270 /* now client state is UPAPCS__AUTHREQ */
mkersh3 0:e7ca326e76ee 271 }
mkersh3 0:e7ca326e76ee 272
mkersh3 0:e7ca326e76ee 273 if (u->us_serverstate == UPAPSS_INITIAL) {
mkersh3 0:e7ca326e76ee 274 u->us_serverstate = UPAPSS_CLOSED;
mkersh3 0:e7ca326e76ee 275 } else if (u->us_serverstate == UPAPSS_PENDING) {
mkersh3 0:e7ca326e76ee 276 u->us_serverstate = UPAPSS_LISTEN;
mkersh3 0:e7ca326e76ee 277 if (u->us_reqtimeout > 0) {
mkersh3 0:e7ca326e76ee 278 TIMEOUT(upap_reqtimeout, u, u->us_reqtimeout);
mkersh3 0:e7ca326e76ee 279 }
mkersh3 0:e7ca326e76ee 280 }
mkersh3 0:e7ca326e76ee 281 }
mkersh3 0:e7ca326e76ee 282
mkersh3 0:e7ca326e76ee 283
mkersh3 0:e7ca326e76ee 284 /*
mkersh3 0:e7ca326e76ee 285 * upap_lowerdown - The lower layer is down.
mkersh3 0:e7ca326e76ee 286 *
mkersh3 0:e7ca326e76ee 287 * Cancel all timeouts.
mkersh3 0:e7ca326e76ee 288 */
mkersh3 0:e7ca326e76ee 289 static void
mkersh3 0:e7ca326e76ee 290 upap_lowerdown(int unit)
mkersh3 0:e7ca326e76ee 291 {
mkersh3 0:e7ca326e76ee 292 upap_state *u = &upap[unit];
mkersh3 0:e7ca326e76ee 293
mkersh3 0:e7ca326e76ee 294 UPAPDEBUG(LOG_INFO, ("upap_lowerdown: %d s=%d\n", unit, u->us_clientstate));
mkersh3 0:e7ca326e76ee 295
mkersh3 0:e7ca326e76ee 296 if (u->us_clientstate == UPAPCS_AUTHREQ) { /* Timeout pending? */
mkersh3 0:e7ca326e76ee 297 UNTIMEOUT(upap_timeout, u); /* Cancel timeout */
mkersh3 0:e7ca326e76ee 298 }
mkersh3 0:e7ca326e76ee 299 if (u->us_serverstate == UPAPSS_LISTEN && u->us_reqtimeout > 0) {
mkersh3 0:e7ca326e76ee 300 UNTIMEOUT(upap_reqtimeout, u);
mkersh3 0:e7ca326e76ee 301 }
mkersh3 0:e7ca326e76ee 302
mkersh3 0:e7ca326e76ee 303 u->us_clientstate = UPAPCS_INITIAL;
mkersh3 0:e7ca326e76ee 304 u->us_serverstate = UPAPSS_INITIAL;
mkersh3 0:e7ca326e76ee 305 }
mkersh3 0:e7ca326e76ee 306
mkersh3 0:e7ca326e76ee 307
mkersh3 0:e7ca326e76ee 308 /*
mkersh3 0:e7ca326e76ee 309 * upap_protrej - Peer doesn't speak this protocol.
mkersh3 0:e7ca326e76ee 310 *
mkersh3 0:e7ca326e76ee 311 * This shouldn't happen. In any case, pretend lower layer went down.
mkersh3 0:e7ca326e76ee 312 */
mkersh3 0:e7ca326e76ee 313 static void
mkersh3 0:e7ca326e76ee 314 upap_protrej(int unit)
mkersh3 0:e7ca326e76ee 315 {
mkersh3 0:e7ca326e76ee 316 upap_state *u = &upap[unit];
mkersh3 0:e7ca326e76ee 317
mkersh3 0:e7ca326e76ee 318 if (u->us_clientstate == UPAPCS_AUTHREQ) {
mkersh3 0:e7ca326e76ee 319 UPAPDEBUG(LOG_ERR, ("PAP authentication failed due to protocol-reject\n"));
mkersh3 0:e7ca326e76ee 320 auth_withpeer_fail(unit, PPP_PAP);
mkersh3 0:e7ca326e76ee 321 }
mkersh3 0:e7ca326e76ee 322 if (u->us_serverstate == UPAPSS_LISTEN) {
mkersh3 0:e7ca326e76ee 323 UPAPDEBUG(LOG_ERR, ("PAP authentication of peer failed (protocol-reject)\n"));
mkersh3 0:e7ca326e76ee 324 auth_peer_fail(unit, PPP_PAP);
mkersh3 0:e7ca326e76ee 325 }
mkersh3 0:e7ca326e76ee 326 upap_lowerdown(unit);
mkersh3 0:e7ca326e76ee 327 }
mkersh3 0:e7ca326e76ee 328
mkersh3 0:e7ca326e76ee 329
mkersh3 0:e7ca326e76ee 330 /*
mkersh3 0:e7ca326e76ee 331 * upap_input - Input UPAP packet.
mkersh3 0:e7ca326e76ee 332 */
mkersh3 0:e7ca326e76ee 333 static void
mkersh3 0:e7ca326e76ee 334 upap_input(int unit, u_char *inpacket, int l)
mkersh3 0:e7ca326e76ee 335 {
mkersh3 0:e7ca326e76ee 336 upap_state *u = &upap[unit];
mkersh3 0:e7ca326e76ee 337 u_char *inp;
mkersh3 0:e7ca326e76ee 338 u_char code, id;
mkersh3 0:e7ca326e76ee 339 int len;
mkersh3 0:e7ca326e76ee 340
mkersh3 0:e7ca326e76ee 341 /*
mkersh3 0:e7ca326e76ee 342 * Parse header (code, id and length).
mkersh3 0:e7ca326e76ee 343 * If packet too short, drop it.
mkersh3 0:e7ca326e76ee 344 */
mkersh3 0:e7ca326e76ee 345 inp = inpacket;
mkersh3 0:e7ca326e76ee 346 if (l < (int)UPAP_HEADERLEN) {
mkersh3 0:e7ca326e76ee 347 UPAPDEBUG(LOG_INFO, ("pap_input: rcvd short header.\n"));
mkersh3 0:e7ca326e76ee 348 return;
mkersh3 0:e7ca326e76ee 349 }
mkersh3 0:e7ca326e76ee 350 GETCHAR(code, inp);
mkersh3 0:e7ca326e76ee 351 GETCHAR(id, inp);
mkersh3 0:e7ca326e76ee 352 GETSHORT(len, inp);
mkersh3 0:e7ca326e76ee 353 if (len < (int)UPAP_HEADERLEN) {
mkersh3 0:e7ca326e76ee 354 UPAPDEBUG(LOG_INFO, ("pap_input: rcvd illegal length.\n"));
mkersh3 0:e7ca326e76ee 355 return;
mkersh3 0:e7ca326e76ee 356 }
mkersh3 0:e7ca326e76ee 357 if (len > l) {
mkersh3 0:e7ca326e76ee 358 UPAPDEBUG(LOG_INFO, ("pap_input: rcvd short packet.\n"));
mkersh3 0:e7ca326e76ee 359 return;
mkersh3 0:e7ca326e76ee 360 }
mkersh3 0:e7ca326e76ee 361 len -= UPAP_HEADERLEN;
mkersh3 0:e7ca326e76ee 362
mkersh3 0:e7ca326e76ee 363 /*
mkersh3 0:e7ca326e76ee 364 * Action depends on code.
mkersh3 0:e7ca326e76ee 365 */
mkersh3 0:e7ca326e76ee 366 switch (code) {
mkersh3 0:e7ca326e76ee 367 case UPAP_AUTHREQ:
mkersh3 0:e7ca326e76ee 368 upap_rauthreq(u, inp, id, len);
mkersh3 0:e7ca326e76ee 369 break;
mkersh3 0:e7ca326e76ee 370
mkersh3 0:e7ca326e76ee 371 case UPAP_AUTHACK:
mkersh3 0:e7ca326e76ee 372 upap_rauthack(u, inp, id, len);
mkersh3 0:e7ca326e76ee 373 break;
mkersh3 0:e7ca326e76ee 374
mkersh3 0:e7ca326e76ee 375 case UPAP_AUTHNAK:
mkersh3 0:e7ca326e76ee 376 upap_rauthnak(u, inp, id, len);
mkersh3 0:e7ca326e76ee 377 break;
mkersh3 0:e7ca326e76ee 378
mkersh3 0:e7ca326e76ee 379 default: /* XXX Need code reject */
mkersh3 0:e7ca326e76ee 380 UPAPDEBUG(LOG_INFO, ("pap_input: UNHANDLED default: code: %d, id: %d, len: %d.\n", code, id, len));
mkersh3 0:e7ca326e76ee 381 break;
mkersh3 0:e7ca326e76ee 382 }
mkersh3 0:e7ca326e76ee 383 }
mkersh3 0:e7ca326e76ee 384
mkersh3 0:e7ca326e76ee 385
mkersh3 0:e7ca326e76ee 386 /*
mkersh3 0:e7ca326e76ee 387 * upap_rauth - Receive Authenticate.
mkersh3 0:e7ca326e76ee 388 */
mkersh3 0:e7ca326e76ee 389 static void
mkersh3 0:e7ca326e76ee 390 upap_rauthreq(upap_state *u, u_char *inp, u_char id, int len)
mkersh3 0:e7ca326e76ee 391 {
mkersh3 0:e7ca326e76ee 392 u_char ruserlen, rpasswdlen;
mkersh3 0:e7ca326e76ee 393 char *ruser, *rpasswd;
mkersh3 0:e7ca326e76ee 394 u_char retcode;
mkersh3 0:e7ca326e76ee 395 char *msg;
mkersh3 0:e7ca326e76ee 396 int msglen;
mkersh3 0:e7ca326e76ee 397
mkersh3 0:e7ca326e76ee 398 UPAPDEBUG(LOG_INFO, ("pap_rauth: Rcvd id %d.\n", id));
mkersh3 0:e7ca326e76ee 399
mkersh3 0:e7ca326e76ee 400 if (u->us_serverstate < UPAPSS_LISTEN) {
mkersh3 0:e7ca326e76ee 401 return;
mkersh3 0:e7ca326e76ee 402 }
mkersh3 0:e7ca326e76ee 403
mkersh3 0:e7ca326e76ee 404 /*
mkersh3 0:e7ca326e76ee 405 * If we receive a duplicate authenticate-request, we are
mkersh3 0:e7ca326e76ee 406 * supposed to return the same status as for the first request.
mkersh3 0:e7ca326e76ee 407 */
mkersh3 0:e7ca326e76ee 408 if (u->us_serverstate == UPAPSS_OPEN) {
mkersh3 0:e7ca326e76ee 409 upap_sresp(u, UPAP_AUTHACK, id, "", 0); /* return auth-ack */
mkersh3 0:e7ca326e76ee 410 return;
mkersh3 0:e7ca326e76ee 411 }
mkersh3 0:e7ca326e76ee 412 if (u->us_serverstate == UPAPSS_BADAUTH) {
mkersh3 0:e7ca326e76ee 413 upap_sresp(u, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */
mkersh3 0:e7ca326e76ee 414 return;
mkersh3 0:e7ca326e76ee 415 }
mkersh3 0:e7ca326e76ee 416
mkersh3 0:e7ca326e76ee 417 /*
mkersh3 0:e7ca326e76ee 418 * Parse user/passwd.
mkersh3 0:e7ca326e76ee 419 */
mkersh3 0:e7ca326e76ee 420 if (len < (int)sizeof (u_char)) {
mkersh3 0:e7ca326e76ee 421 UPAPDEBUG(LOG_INFO, ("pap_rauth: rcvd short packet.\n"));
mkersh3 0:e7ca326e76ee 422 return;
mkersh3 0:e7ca326e76ee 423 }
mkersh3 0:e7ca326e76ee 424 GETCHAR(ruserlen, inp);
mkersh3 0:e7ca326e76ee 425 len -= sizeof (u_char) + ruserlen + sizeof (u_char);
mkersh3 0:e7ca326e76ee 426 if (len < 0) {
mkersh3 0:e7ca326e76ee 427 UPAPDEBUG(LOG_INFO, ("pap_rauth: rcvd short packet.\n"));
mkersh3 0:e7ca326e76ee 428 return;
mkersh3 0:e7ca326e76ee 429 }
mkersh3 0:e7ca326e76ee 430 ruser = (char *) inp;
mkersh3 0:e7ca326e76ee 431 INCPTR(ruserlen, inp);
mkersh3 0:e7ca326e76ee 432 GETCHAR(rpasswdlen, inp);
mkersh3 0:e7ca326e76ee 433 if (len < rpasswdlen) {
mkersh3 0:e7ca326e76ee 434 UPAPDEBUG(LOG_INFO, ("pap_rauth: rcvd short packet.\n"));
mkersh3 0:e7ca326e76ee 435 return;
mkersh3 0:e7ca326e76ee 436 }
mkersh3 0:e7ca326e76ee 437 rpasswd = (char *) inp;
mkersh3 0:e7ca326e76ee 438
mkersh3 0:e7ca326e76ee 439 /*
mkersh3 0:e7ca326e76ee 440 * Check the username and password given.
mkersh3 0:e7ca326e76ee 441 */
mkersh3 0:e7ca326e76ee 442 retcode = check_passwd(u->us_unit, ruser, ruserlen, rpasswd, rpasswdlen, &msg, &msglen);
mkersh3 0:e7ca326e76ee 443 /* lwip: currently retcode is always UPAP_AUTHACK */
mkersh3 0:e7ca326e76ee 444 BZERO(rpasswd, rpasswdlen);
mkersh3 0:e7ca326e76ee 445
mkersh3 0:e7ca326e76ee 446 upap_sresp(u, retcode, id, msg, msglen);
mkersh3 0:e7ca326e76ee 447
mkersh3 0:e7ca326e76ee 448 if (retcode == UPAP_AUTHACK) {
mkersh3 0:e7ca326e76ee 449 u->us_serverstate = UPAPSS_OPEN;
mkersh3 0:e7ca326e76ee 450 auth_peer_success(u->us_unit, PPP_PAP, ruser, ruserlen);
mkersh3 0:e7ca326e76ee 451 } else {
mkersh3 0:e7ca326e76ee 452 u->us_serverstate = UPAPSS_BADAUTH;
mkersh3 0:e7ca326e76ee 453 auth_peer_fail(u->us_unit, PPP_PAP);
mkersh3 0:e7ca326e76ee 454 }
mkersh3 0:e7ca326e76ee 455
mkersh3 0:e7ca326e76ee 456 if (u->us_reqtimeout > 0) {
mkersh3 0:e7ca326e76ee 457 UNTIMEOUT(upap_reqtimeout, u);
mkersh3 0:e7ca326e76ee 458 }
mkersh3 0:e7ca326e76ee 459 }
mkersh3 0:e7ca326e76ee 460
mkersh3 0:e7ca326e76ee 461
mkersh3 0:e7ca326e76ee 462 /*
mkersh3 0:e7ca326e76ee 463 * upap_rauthack - Receive Authenticate-Ack.
mkersh3 0:e7ca326e76ee 464 */
mkersh3 0:e7ca326e76ee 465 static void
mkersh3 0:e7ca326e76ee 466 upap_rauthack(upap_state *u, u_char *inp, int id, int len)
mkersh3 0:e7ca326e76ee 467 {
mkersh3 0:e7ca326e76ee 468 u_char msglen;
mkersh3 0:e7ca326e76ee 469 char *msg;
mkersh3 0:e7ca326e76ee 470
mkersh3 0:e7ca326e76ee 471 LWIP_UNUSED_ARG(id);
mkersh3 0:e7ca326e76ee 472
mkersh3 0:e7ca326e76ee 473 UPAPDEBUG(LOG_INFO, ("pap_rauthack: Rcvd id %d s=%d\n", id, u->us_clientstate));
mkersh3 0:e7ca326e76ee 474
mkersh3 0:e7ca326e76ee 475 if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */
mkersh3 0:e7ca326e76ee 476 UPAPDEBUG(LOG_INFO, ("pap_rauthack: us_clientstate != UPAPCS_AUTHREQ\n"));
mkersh3 0:e7ca326e76ee 477 return;
mkersh3 0:e7ca326e76ee 478 }
mkersh3 0:e7ca326e76ee 479
mkersh3 0:e7ca326e76ee 480 /*
mkersh3 0:e7ca326e76ee 481 * Parse message.
mkersh3 0:e7ca326e76ee 482 */
mkersh3 0:e7ca326e76ee 483 if (len < (int)sizeof (u_char)) {
mkersh3 0:e7ca326e76ee 484 UPAPDEBUG(LOG_INFO, ("pap_rauthack: ignoring missing msg-length.\n"));
mkersh3 0:e7ca326e76ee 485 } else {
mkersh3 0:e7ca326e76ee 486 GETCHAR(msglen, inp);
mkersh3 0:e7ca326e76ee 487 if (msglen > 0) {
mkersh3 0:e7ca326e76ee 488 len -= sizeof (u_char);
mkersh3 0:e7ca326e76ee 489 if (len < msglen) {
mkersh3 0:e7ca326e76ee 490 UPAPDEBUG(LOG_INFO, ("pap_rauthack: rcvd short packet.\n"));
mkersh3 0:e7ca326e76ee 491 return;
mkersh3 0:e7ca326e76ee 492 }
mkersh3 0:e7ca326e76ee 493 msg = (char *) inp;
mkersh3 0:e7ca326e76ee 494 PRINTMSG(msg, msglen);
mkersh3 0:e7ca326e76ee 495 }
mkersh3 0:e7ca326e76ee 496 }
mkersh3 0:e7ca326e76ee 497 UNTIMEOUT(upap_timeout, u); /* Cancel timeout */
mkersh3 0:e7ca326e76ee 498 u->us_clientstate = UPAPCS_OPEN;
mkersh3 0:e7ca326e76ee 499
mkersh3 0:e7ca326e76ee 500 auth_withpeer_success(u->us_unit, PPP_PAP);
mkersh3 0:e7ca326e76ee 501 }
mkersh3 0:e7ca326e76ee 502
mkersh3 0:e7ca326e76ee 503
mkersh3 0:e7ca326e76ee 504 /*
mkersh3 0:e7ca326e76ee 505 * upap_rauthnak - Receive Authenticate-Nak.
mkersh3 0:e7ca326e76ee 506 */
mkersh3 0:e7ca326e76ee 507 static void
mkersh3 0:e7ca326e76ee 508 upap_rauthnak(upap_state *u, u_char *inp, int id, int len)
mkersh3 0:e7ca326e76ee 509 {
mkersh3 0:e7ca326e76ee 510 u_char msglen;
mkersh3 0:e7ca326e76ee 511 char *msg;
mkersh3 0:e7ca326e76ee 512
mkersh3 0:e7ca326e76ee 513 LWIP_UNUSED_ARG(id);
mkersh3 0:e7ca326e76ee 514
mkersh3 0:e7ca326e76ee 515 UPAPDEBUG(LOG_INFO, ("pap_rauthnak: Rcvd id %d s=%d\n", id, u->us_clientstate));
mkersh3 0:e7ca326e76ee 516
mkersh3 0:e7ca326e76ee 517 if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */
mkersh3 0:e7ca326e76ee 518 return;
mkersh3 0:e7ca326e76ee 519 }
mkersh3 0:e7ca326e76ee 520
mkersh3 0:e7ca326e76ee 521 /*
mkersh3 0:e7ca326e76ee 522 * Parse message.
mkersh3 0:e7ca326e76ee 523 */
mkersh3 0:e7ca326e76ee 524 if (len < sizeof (u_char)) {
mkersh3 0:e7ca326e76ee 525 UPAPDEBUG(LOG_INFO, ("pap_rauthnak: ignoring missing msg-length.\n"));
mkersh3 0:e7ca326e76ee 526 } else {
mkersh3 0:e7ca326e76ee 527 GETCHAR(msglen, inp);
mkersh3 0:e7ca326e76ee 528 if(msglen > 0) {
mkersh3 0:e7ca326e76ee 529 len -= sizeof (u_char);
mkersh3 0:e7ca326e76ee 530 if (len < msglen) {
mkersh3 0:e7ca326e76ee 531 UPAPDEBUG(LOG_INFO, ("pap_rauthnak: rcvd short packet.\n"));
mkersh3 0:e7ca326e76ee 532 return;
mkersh3 0:e7ca326e76ee 533 }
mkersh3 0:e7ca326e76ee 534 msg = (char *) inp;
mkersh3 0:e7ca326e76ee 535 PRINTMSG(msg, msglen);
mkersh3 0:e7ca326e76ee 536 }
mkersh3 0:e7ca326e76ee 537 }
mkersh3 0:e7ca326e76ee 538
mkersh3 0:e7ca326e76ee 539 u->us_clientstate = UPAPCS_BADAUTH;
mkersh3 0:e7ca326e76ee 540
mkersh3 0:e7ca326e76ee 541 UPAPDEBUG(LOG_ERR, ("PAP authentication failed\n"));
mkersh3 0:e7ca326e76ee 542 auth_withpeer_fail(u->us_unit, PPP_PAP);
mkersh3 0:e7ca326e76ee 543 }
mkersh3 0:e7ca326e76ee 544
mkersh3 0:e7ca326e76ee 545
mkersh3 0:e7ca326e76ee 546 /*
mkersh3 0:e7ca326e76ee 547 * upap_sauthreq - Send an Authenticate-Request.
mkersh3 0:e7ca326e76ee 548 */
mkersh3 0:e7ca326e76ee 549 static void
mkersh3 0:e7ca326e76ee 550 upap_sauthreq(upap_state *u)
mkersh3 0:e7ca326e76ee 551 {
mkersh3 0:e7ca326e76ee 552 u_char *outp;
mkersh3 0:e7ca326e76ee 553 int outlen;
mkersh3 0:e7ca326e76ee 554
mkersh3 0:e7ca326e76ee 555 outlen = UPAP_HEADERLEN + 2 * sizeof (u_char)
mkersh3 0:e7ca326e76ee 556 + u->us_userlen + u->us_passwdlen;
mkersh3 0:e7ca326e76ee 557 outp = outpacket_buf[u->us_unit];
mkersh3 0:e7ca326e76ee 558
mkersh3 0:e7ca326e76ee 559 MAKEHEADER(outp, PPP_PAP);
mkersh3 0:e7ca326e76ee 560
mkersh3 0:e7ca326e76ee 561 PUTCHAR(UPAP_AUTHREQ, outp);
mkersh3 0:e7ca326e76ee 562 PUTCHAR(++u->us_id, outp);
mkersh3 0:e7ca326e76ee 563 PUTSHORT(outlen, outp);
mkersh3 0:e7ca326e76ee 564 PUTCHAR(u->us_userlen, outp);
mkersh3 0:e7ca326e76ee 565 BCOPY(u->us_user, outp, u->us_userlen);
mkersh3 0:e7ca326e76ee 566 INCPTR(u->us_userlen, outp);
mkersh3 0:e7ca326e76ee 567 PUTCHAR(u->us_passwdlen, outp);
mkersh3 0:e7ca326e76ee 568 BCOPY(u->us_passwd, outp, u->us_passwdlen);
mkersh3 0:e7ca326e76ee 569
mkersh3 0:e7ca326e76ee 570 pppWrite(u->us_unit, outpacket_buf[u->us_unit], outlen + PPP_HDRLEN);
mkersh3 0:e7ca326e76ee 571
mkersh3 0:e7ca326e76ee 572 UPAPDEBUG(LOG_INFO, ("pap_sauth: Sent id %d\n", u->us_id));
mkersh3 0:e7ca326e76ee 573
mkersh3 0:e7ca326e76ee 574 TIMEOUT(upap_timeout, u, u->us_timeouttime);
mkersh3 0:e7ca326e76ee 575 ++u->us_transmits;
mkersh3 0:e7ca326e76ee 576 u->us_clientstate = UPAPCS_AUTHREQ;
mkersh3 0:e7ca326e76ee 577 }
mkersh3 0:e7ca326e76ee 578
mkersh3 0:e7ca326e76ee 579
mkersh3 0:e7ca326e76ee 580 /*
mkersh3 0:e7ca326e76ee 581 * upap_sresp - Send a response (ack or nak).
mkersh3 0:e7ca326e76ee 582 */
mkersh3 0:e7ca326e76ee 583 static void
mkersh3 0:e7ca326e76ee 584 upap_sresp(upap_state *u, u_char code, u_char id, char *msg, int msglen)
mkersh3 0:e7ca326e76ee 585 {
mkersh3 0:e7ca326e76ee 586 u_char *outp;
mkersh3 0:e7ca326e76ee 587 int outlen;
mkersh3 0:e7ca326e76ee 588
mkersh3 0:e7ca326e76ee 589 outlen = UPAP_HEADERLEN + sizeof (u_char) + msglen;
mkersh3 0:e7ca326e76ee 590 outp = outpacket_buf[u->us_unit];
mkersh3 0:e7ca326e76ee 591 MAKEHEADER(outp, PPP_PAP);
mkersh3 0:e7ca326e76ee 592
mkersh3 0:e7ca326e76ee 593 PUTCHAR(code, outp);
mkersh3 0:e7ca326e76ee 594 PUTCHAR(id, outp);
mkersh3 0:e7ca326e76ee 595 PUTSHORT(outlen, outp);
mkersh3 0:e7ca326e76ee 596 PUTCHAR(msglen, outp);
mkersh3 0:e7ca326e76ee 597 BCOPY(msg, outp, msglen);
mkersh3 0:e7ca326e76ee 598 pppWrite(u->us_unit, outpacket_buf[u->us_unit], outlen + PPP_HDRLEN);
mkersh3 0:e7ca326e76ee 599
mkersh3 0:e7ca326e76ee 600 UPAPDEBUG(LOG_INFO, ("pap_sresp: Sent code %d, id %d s=%d\n", code, id, u->us_clientstate));
mkersh3 0:e7ca326e76ee 601 }
mkersh3 0:e7ca326e76ee 602
mkersh3 0:e7ca326e76ee 603 #if PPP_ADDITIONAL_CALLBACKS
mkersh3 0:e7ca326e76ee 604 static char *upap_codenames[] = {
mkersh3 0:e7ca326e76ee 605 "AuthReq", "AuthAck", "AuthNak"
mkersh3 0:e7ca326e76ee 606 };
mkersh3 0:e7ca326e76ee 607
mkersh3 0:e7ca326e76ee 608 /*
mkersh3 0:e7ca326e76ee 609 * upap_printpkt - print the contents of a PAP packet.
mkersh3 0:e7ca326e76ee 610 */
mkersh3 0:e7ca326e76ee 611 static int upap_printpkt(
mkersh3 0:e7ca326e76ee 612 u_char *p,
mkersh3 0:e7ca326e76ee 613 int plen,
mkersh3 0:e7ca326e76ee 614 void (*printer) (void *, char *, ...),
mkersh3 0:e7ca326e76ee 615 void *arg
mkersh3 0:e7ca326e76ee 616 )
mkersh3 0:e7ca326e76ee 617 {
mkersh3 0:e7ca326e76ee 618 LWIP_UNUSED_ARG(p);
mkersh3 0:e7ca326e76ee 619 LWIP_UNUSED_ARG(plen);
mkersh3 0:e7ca326e76ee 620 LWIP_UNUSED_ARG(printer);
mkersh3 0:e7ca326e76ee 621 LWIP_UNUSED_ARG(arg);
mkersh3 0:e7ca326e76ee 622 return 0;
mkersh3 0:e7ca326e76ee 623 }
mkersh3 0:e7ca326e76ee 624 #endif /* PPP_ADDITIONAL_CALLBACKS */
mkersh3 0:e7ca326e76ee 625
mkersh3 0:e7ca326e76ee 626 #endif /* PAP_SUPPORT */
mkersh3 0:e7ca326e76ee 627
mkersh3 0:e7ca326e76ee 628 #endif /* PPP_SUPPORT */