Deleted Added
full compact
pap.c (25908) pap.c (26098)
1/*
2 * PPP PAP Module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993-94, Internet Initiative Japan, Inc.
7 * All rights reserverd.
8 *

--- 4 unchanged lines hidden (view full) ---

13 * distribution and use acknowledge that the software was developed
14 * by the Internet Initiative Japan, Inc. The name of the
15 * IIJ may not be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
19 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
1/*
2 * PPP PAP Module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993-94, Internet Initiative Japan, Inc.
7 * All rights reserverd.
8 *

--- 4 unchanged lines hidden (view full) ---

13 * distribution and use acknowledge that the software was developed
14 * by the Internet Initiative Japan, Inc. The name of the
15 * IIJ may not be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
19 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * $Id: pap.c,v 1.9 1997/02/22 16:10:40 peter Exp $
21 * $Id: pap.c,v 1.10 1997/05/19 02:00:12 brian Exp $
22 *
23 * TODO:
24 */
25#include "fsm.h"
26#include "lcp.h"
27#include "pap.h"
28#include "vars.h"
29#include "hdlc.h"

--- 118 unchanged lines hidden (view full) ---

148 cp = (u_char *) (php + 1);
149 if (PapValidate(cp, cp + *cp + 1)) {
150 SendPapCode(php->id, PAP_ACK, "Greetings!!");
151 lcp->auth_ineed = 0;
152 if (lcp->auth_iwait == 0)
153 NewPhase(PHASE_NETWORK);
154 } else {
155 SendPapCode(php->id, PAP_NAK, "Login incorrect");
22 *
23 * TODO:
24 */
25#include "fsm.h"
26#include "lcp.h"
27#include "pap.h"
28#include "vars.h"
29#include "hdlc.h"

--- 118 unchanged lines hidden (view full) ---

148 cp = (u_char *) (php + 1);
149 if (PapValidate(cp, cp + *cp + 1)) {
150 SendPapCode(php->id, PAP_ACK, "Greetings!!");
151 lcp->auth_ineed = 0;
152 if (lcp->auth_iwait == 0)
153 NewPhase(PHASE_NETWORK);
154 } else {
155 SendPapCode(php->id, PAP_NAK, "Login incorrect");
156 reconnect(RECON_FALSE);
156 LcpClose();
157 LcpClose();
157 reconnectCount = 0;
158 }
159 break;
160 case PAP_ACK:
161 StopAuthTimer(&AuthPapInfo);
162 cp = (u_char *)(php + 1);
163 len = *cp++;
164 cp[len] = 0;
165 LogPrintf(LOG_PHASE_BIT, "Received PAP_ACK (%s)\n", cp);

--- 4 unchanged lines hidden (view full) ---

170 }
171 break;
172 case PAP_NAK:
173 StopAuthTimer(&AuthPapInfo);
174 cp = (u_char *)(php + 1);
175 len = *cp++;
176 cp[len] = 0;
177 LogPrintf(LOG_PHASE_BIT, "Received PAP_NAK (%s)\n", cp);
158 }
159 break;
160 case PAP_ACK:
161 StopAuthTimer(&AuthPapInfo);
162 cp = (u_char *)(php + 1);
163 len = *cp++;
164 cp[len] = 0;
165 LogPrintf(LOG_PHASE_BIT, "Received PAP_ACK (%s)\n", cp);

--- 4 unchanged lines hidden (view full) ---

170 }
171 break;
172 case PAP_NAK:
173 StopAuthTimer(&AuthPapInfo);
174 cp = (u_char *)(php + 1);
175 len = *cp++;
176 cp[len] = 0;
177 LogPrintf(LOG_PHASE_BIT, "Received PAP_NAK (%s)\n", cp);
178 reconnect(RECON_FALSE);
178 LcpClose();
179 LcpClose();
179 reconnectCount = 0;
180 break;
181 }
182 }
183 }
184 pfree(bp);
185}
180 break;
181 }
182 }
183 }
184 pfree(bp);
185}