linklayerprotocols/pppnif/SPPP/ppppap.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Protocol (PAP) - RFC 1334.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @brief Header file for the implementation of Password Authentication
       
    21  @internalComponent 
       
    22 */
       
    23 
       
    24 #ifndef __PPPPAP_H__
       
    25 #define __PPPPAP_H__
       
    26 
       
    27 #include "PPPAUTH.H"
       
    28 
       
    29 const TInt KPppPapWaitTime = 3000;
       
    30 const TInt KPppPapRetries = 4;
       
    31 
       
    32 const TUint8 KPppPapRequest = 1;
       
    33 const TUint8 KPppPapAck = 2;
       
    34 const TUint8 KPppPapNak = 3;
       
    35 
       
    36 
       
    37 NONSHARABLE_CLASS(CPppPap) : public CPppAuthentication, protected MTimer
       
    38 	{
       
    39 public:
       
    40 	static CPppAuthentication* NewL();
       
    41 	virtual ~CPppPap();
       
    42 
       
    43 	virtual void InitL(CPppLcp* aLcp);
       
    44 	virtual void AuthenticateComplete(TInt aStatus);
       
    45 
       
    46 protected:
       
    47 	virtual TUint PppId() const;
       
    48 
       
    49 	// MPppRecvr upcalls
       
    50 	virtual TBool RecvFrame(RMBufChain& aPacket);
       
    51 	virtual void LowerLayerUp();
       
    52 	virtual void LowerLayerDown(TInt aStatus=KErrNone);
       
    53 	// MTimer upcall
       
    54 	virtual void TimerComplete(TInt aStatus);
       
    55 
       
    56 private:
       
    57 	void SendAuthRequestL(TBool aNewRequest=EFalse);
       
    58 	CPppPap();
       
    59 
       
    60 private:
       
    61 	TInt	iTryCount;
       
    62 	TUint8	iCurrentId;
       
    63 	};
       
    64 
       
    65 /**
       
    66    Object factory for CPppPap.
       
    67    @leave Standard Symbian OS error codes. e.g. KErrNoMemory.
       
    68 */
       
    69 inline CPppAuthentication* CPppPap::NewL()
       
    70 	{
       
    71 	return new(ELeave) CPppPap;
       
    72 	}
       
    73 
       
    74 inline TUint CPppPap::PppId() const
       
    75 	{
       
    76 	return KPppIdPap;
       
    77 	}
       
    78 
       
    79 #endif // ___PPPPAP_H__