MPppFsm Class Reference

class MPppFsm : public MPppRecvr

Inherits from

Public Member Functions
MPppFsm ( CPppLcp *, TPppPhase , TUint )
~MPppFsm ()
void ChangeTimers ( TBool )
void ConnectionPersist ( TBool )
void FsmAbort ( TInt )
void FsmClose ( TInt )
void FsmConstructL ()
TBool FsmIsThisLayerOpen ()
TUint8 FsmNewId ()
TInt FsmOpen ()
void FsmRejectPacket ( RMBufChain &, TUint , TUint )
void TerminateLink ()
Protected Member Functions
TBool FsmAckOptionsValid ( RPppOptionList &, RPppOptionList &)
void FsmApplyConfigRequest ( RPppOptionList &)
void FsmCheckConfigRequest ( RPppOptionList &, RPppOptionList &, RPppOptionList &, RPppOptionList &)
TBool FsmConfigRequestOptionsValid ( RPppOptionList &)
void FsmFillinConfigRequestL ( RPppOptionList &)
void FsmLayerDown ( TInt )
void FsmLayerFinished ( TInt )
TInt FsmLayerStarted ()
void FsmLayerUp ()
void FsmRecvConfigAck ( RPppOptionList &)
void FsmRecvConfigNak ( RPppOptionList &, RPppOptionList &)
void FsmRecvConfigReject ( RPppOptionList &, RPppOptionList &)
TBool FsmRecvUnknownCode ( TUint8 , TUint8 , TInt , RMBufChain &)
TBool FsmRejectOptionsValid ( RPppOptionList &, RPppOptionList &)
TPppFsmState FsmState ()
void FsmTerminationPhaseComplete ()
IMPORT_C void KillProtocol ()
TUint8 * NewPacket ( RMBufPacket &, TUint )
void SetState ( TPppFsmState )
Private Member Functions
void DecrementMaxFailure ()
IMPORT_C void FrameError ()
void InitMaxFailure ()
void InitRestartCountForConfig ()
void InitRestartCountForTerminate ()
TInt InitialiseConfigRequest ()
IMPORT_C void LowerLayerDown ( TInt )
IMPORT_C void LowerLayerUp ()
TBool MaxFailureExceeded ()
void ProcessConfig ( TUint8 , TUint8 , TInt , RMBufChain &)
TBool ProcessEmptyConfigReq ()
void ProcessReject ( TUint8 , TUint8 , TInt , RMBufChain &)
void ProcessTerminate ( TUint8 , TUint8 , TInt , RMBufChain &)
void ReadIniFileL ()
IMPORT_C TBool RecvFrame ( RMBufChain &)
void SendConfigReply ( RPppOptionList &, TUint8 , TUint8 )
void SendConfigRequest ()
void SendConfigRequestAfterNak ( RPppOptionList &)
void SendConfigRequestAfterReject ( RPppOptionList &)
void SendInitialConfigRequest ()
void SendInitialTerminateRequest ()
void SendTerminateAck ( TUint8 )
void SendTerminateRequest ()
void ThisLayerDown ()
void ThisLayerFinished ()
void ThisLayerStarted ()
void ThisLayerUp ()
IMPORT_C void TimerComplete ( TInt )
void ZeroRestartCount ()
Public Attributes
const TText * __iFsmName
Protected Attributes
TInt iFsmTerminationCauseError
TBool iTerminateAckEnabled
TBool iTerminateRequestEnabled
Private Attributes
TInt iConsecCfgReq
TUint8 iCurrentId
TBool iFsmTermination
TUint32 iLastCfgReqFcs
TBool iLengthenTimers
TInt iMaxFailureConfig
TInt iMaxFailureCount
TInt iMaxRestartConfig
TInt iMaxTerminateRequest
TBool iNoEvidenceOfPeer
TBool iPersist
TUint iRequestId
RPppOptionList iRequestList
TInt iRestartCount
TPppFsmState iState
TInt iTerminateAckTimeout
TUint iTerminateId
TInt iTerminateRequestTimeout
TInt iWaitTime
TInt iWaitTimeConfig
TBool iWaitTimeNoIncrease

Constructor & Destructor Documentation

MPppFsm(CPppLcp *, TPppPhase, TUint)

MPppFsm ( CPppLcp * aPppLcp,
TPppPhase aPhase,
TUint aPppId
)

Parameters

CPppLcp * aPppLcp
TPppPhase aPhase
TUint aPppId

~MPppFsm()

~MPppFsm ( ) [virtual]

Member Functions Documentation

ChangeTimers(TBool)

void ChangeTimers ( TBool aLengthen ) [inline]

Parameters

TBool aLengthen

ConnectionPersist(TBool)

void ConnectionPersist ( TBool aPersist ) [inline]

Parameters

TBool aPersist

DecrementMaxFailure()

void DecrementMaxFailure ( ) [private, inline]

FrameError()

IMPORT_C void FrameError ( ) [private, virtual]

Called when a bad frame is received. No action is currently taken.

RecvFrame() is called instead when a good frame is received

FsmAbort(TInt)

void FsmAbort ( TInt aReason )

Abort the protocol.

Parameters

TInt aReason Reason for aborting

FsmAckOptionsValid(RPppOptionList &, RPppOptionList &)

TBool FsmAckOptionsValid ( RPppOptionList & aList,
RPppOptionList & aRequestList
) [protected, virtual]

Perform validation checking on the option list of a ConfigAck or ConfigReject.

Parameters

RPppOptionList & aList option list of incoming ConfigAck or ConfigReject
RPppOptionList & aRequestList

FsmApplyConfigRequest(RPppOptionList &)

void FsmApplyConfigRequest ( RPppOptionList & aRequestList ) [protected, pure virtual]

Parameters

RPppOptionList & aRequestList

FsmCheckConfigRequest(RPppOptionList &, RPppOptionList &, RPppOptionList &, RPppOptionList &)

void FsmCheckConfigRequest ( RPppOptionList & aRequestList,
RPppOptionList & aAckList,
RPppOptionList & aNakList,
RPppOptionList & aRejList
) [protected, pure virtual]

Parameters

RPppOptionList & aRequestList
RPppOptionList & aAckList
RPppOptionList & aNakList
RPppOptionList & aRejList

FsmClose(TInt)

void FsmClose ( TInt aReason )

Close the state machine and protocol. Called by the derived class on closing.

Parameters

TInt aReason Reason for closing

FsmConfigRequestOptionsValid(RPppOptionList &)

TBool FsmConfigRequestOptionsValid ( RPppOptionList & aList ) [protected, virtual]

Perform validation checking on the option list of a ConfigRequest.

Parameters

RPppOptionList & aList option list of incoming ConfigRequest

FsmConstructL()

void FsmConstructL ( )

Construct the state machine object

FsmFillinConfigRequestL(RPppOptionList &)

void FsmFillinConfigRequestL ( RPppOptionList & aRequestList ) [protected, pure virtual]

Parameters

RPppOptionList & aRequestList

FsmIsThisLayerOpen()

TBool FsmIsThisLayerOpen ( ) [inline]

FsmLayerDown(TInt)

void FsmLayerDown ( TInt aReason =  KErrNone ) [protected, pure virtual]

Parameters

TInt aReason =  KErrNone

FsmLayerFinished(TInt)

void FsmLayerFinished ( TInt aReason =  KErrNone ) [protected, pure virtual]

Parameters

TInt aReason =  KErrNone

FsmLayerStarted()

TInt FsmLayerStarted ( ) [protected, pure virtual]

FsmLayerUp()

void FsmLayerUp ( ) [protected, pure virtual]

FsmNewId()

TUint8 FsmNewId ( )

Generate a new nonzero packet identifier.

FsmOpen()

TInt FsmOpen ( )

Begin the state machine and protocol. Called by the derived class during initialization.

FsmRecvConfigAck(RPppOptionList &)

void FsmRecvConfigAck ( RPppOptionList & aReplyList ) [protected, pure virtual]

Parameters

RPppOptionList & aReplyList

FsmRecvConfigNak(RPppOptionList &, RPppOptionList &)

void FsmRecvConfigNak ( RPppOptionList & aReplyList,
RPppOptionList & aReqList
) [protected, pure virtual]

Parameters

RPppOptionList & aReplyList
RPppOptionList & aReqList

FsmRecvConfigReject(RPppOptionList &, RPppOptionList &)

void FsmRecvConfigReject ( RPppOptionList & aReplyList,
RPppOptionList & aReqList
) [protected, pure virtual]

Parameters

RPppOptionList & aReplyList
RPppOptionList & aReqList

FsmRecvUnknownCode(TUint8, TUint8, TInt, RMBufChain &)

TBool FsmRecvUnknownCode ( TUint8 aCode,
TUint8 aId,
TInt aLength,
RMBufChain & aPacket
) [protected, virtual]

Handle a received packet with an unknown code.

Parameters

TUint8 aCode Packet code (ignored)
TUint8 aId Packet identifier (ignored)
TInt aLength Length of packet (ignored)
RMBufChain & aPacket MBuf chain containing packet (ignored)

FsmRejectOptionsValid(RPppOptionList &, RPppOptionList &)

TBool FsmRejectOptionsValid ( RPppOptionList & aList,
RPppOptionList & aRequestList
) [protected, virtual]

Perform validation checking on the option list of a ConfigAck or ConfigReject.

Parameters

RPppOptionList & aList option list of incoming ConfigAck or ConfigReject
RPppOptionList & aRequestList

FsmRejectPacket(RMBufChain &, TUint, TUint)

void FsmRejectPacket ( RMBufChain & aPacket,
TUint aReason =  KPppLcpCodeReject ,
TUint aPppId =  KPppIdAsIs
)

Send a Code Reject or Protocol Reject packet.

Parameters

RMBufChain & aPacket MBuf chain containing packet; it will be used to send the reject message.
TUint aReason =  KPppLcpCodeReject Reason for rejecting (KPppLcpCodeReject or KPppLcpProtocolReject)
TUint aPppId =  KPppIdAsIs PPP protocol ID

FsmState()

TPppFsmState FsmState ( ) const [protected, inline]

FsmTerminationPhaseComplete()

void FsmTerminationPhaseComplete ( ) [protected, pure virtual]

InitMaxFailure()

void InitMaxFailure ( ) [private, inline]

InitRestartCountForConfig()

void InitRestartCountForConfig ( ) [private]

Initialize the restart count and wait time with values appropriate for the config phase.

InitRestartCountForTerminate()

void InitRestartCountForTerminate ( ) [private]

Initialize the restart count and wait time for with values appropriate for the termination phase.

InitialiseConfigRequest()

TInt InitialiseConfigRequest ( ) [private]

Delete any existing request list, then create a new one. Initialise counters for sending config requests.

Post-condition
iRequestList is initialized

KillProtocol()

IMPORT_C void KillProtocol ( ) [protected, virtual]

Called when the lower level protocol is killed.

LowerLayerDown(TInt)

IMPORT_C void LowerLayerDown ( TInt aStatus =  KErrNone ) [private, virtual]

Signals the Down event. Called when the lower layer protocol has gone down. This means that our layer can no longer receive or transmit anything.

In case of LCP, this means that the physical link is closed (e.g. Peer dropped DTR) If we are LCP, this may mean that PPP is finished, because the link is no longer available.

Parameters

TInt aStatus =  KErrNone Error code indicating the reason the layer is going down

LowerLayerUp()

IMPORT_C void LowerLayerUp ( ) [private, virtual]

Called when the lower layer protocol has come up.

MaxFailureExceeded()

TBool MaxFailureExceeded ( ) const [private, inline]

NewPacket(RMBufPacket &, TUint)

TUint8 * NewPacket ( RMBufPacket & aPkt,
TUint aLength
) [protected]

Allocate a new packet buffer and info header. The caller must fill in the the packet and call its Pack() method before sending.

RPppOptionList::CreatePacketL

Parameters

RMBufPacket & aPkt reference to a packet
TUint aLength length of the buffer

ProcessConfig(TUint8, TUint8, TInt, RMBufChain &)

void ProcessConfig ( TUint8 aCode,
TUint8 aId,
TInt aLength,
RMBufChain & aPacket
) [private]

Handle ConfigRequest, ConfigAck, ConfigNak and ConfigReject

Parameters

TUint8 aCode Packet code
TUint8 aId Packet identifier
TInt aLength Length of packet (ignored)
RMBufChain & aPacket MBuf chain containing packet.

ProcessEmptyConfigReq()

TBool ProcessEmptyConfigReq ( ) [private]

Handle Config Request with no options.

ProcessReject(TUint8, TUint8, TInt, RMBufChain &)

void ProcessReject ( TUint8 aCode,
TUint8 aId,
TInt aLength,
RMBufChain & aPacket
) [private]

Handle a Code Reject or Protocol Reject. If the reject rejects a code (or protocol) that should be known terminate layer. (Note, As the behaviour of protocol reject is the same as code reject, this function handles protocol reject for LCP)

Parameters

TUint8 aCode Packet code
TUint8 aId Packet identifier (ignored)
TInt aLength Length of packet (ignored)
RMBufChain & aPacket MBuf chain containing packet.

ProcessTerminate(TUint8, TUint8, TInt, RMBufChain &)

void ProcessTerminate ( TUint8 aCode,
TUint8 aId,
TInt aLength,
RMBufChain & aPacket
) [private]

Handle a Terminate Request packet and cleanly terminate the connection.

Parameters

TUint8 aCode Packet code
TUint8 aId Packet identifier
TInt aLength Length of packet (ignored)
RMBufChain & aPacket MBuf chain containing packet (ignored)

ReadIniFileL()

void ReadIniFileL ( ) [private]

Reads the contents of the ppp.ini file.

leave
Error code if file cannot be read

RecvFrame(RMBufChain &)

IMPORT_C TBool RecvFrame ( RMBufChain & aPacket ) [private, virtual]

Receives and processes a PPP frame. Called by CPppLcp .

FrameError() is called instead when a bad frame is received

Parameters

RMBufChain & aPacket MBuf chain containing packet

SendConfigReply(RPppOptionList &, TUint8, TUint8)

void SendConfigReply ( RPppOptionList & aOptList,
TUint8 aType,
TUint8 aId
) [private]

Reply to a config request with a set of options.

Parameters

RPppOptionList & aOptList Options list
TUint8 aType Packet type (Ack, Nak, Rej)
TUint8 aId Packet identifier

SendConfigRequest()

void SendConfigRequest ( ) [private]

Send the config request in iRequestList

SendConfigRequestAfterNak(RPppOptionList &)

void SendConfigRequestAfterNak ( RPppOptionList & aOptList ) [private]

Update the options list and send a new config request after a Nak.

Parameters

RPppOptionList & aOptList Options list (ignored)

SendConfigRequestAfterReject(RPppOptionList &)

void SendConfigRequestAfterReject ( RPppOptionList & aOptList ) [private]

Update the options list and send a new config request after a Reject.

Parameters

RPppOptionList & aOptList Options list (ignored)

SendInitialConfigRequest()

void SendInitialConfigRequest ( ) [private]

Initialise request list and send a request if successful.

SendInitialTerminateRequest()

void SendInitialTerminateRequest ( ) [private]

Send the first Terminate Request packet to begin connection teardown.

SendTerminateAck(TUint8)

void SendTerminateAck ( TUint8 aId ) [private]

Send a Terminate Ack packet.

Parameters

TUint8 aId Packet identifier

SendTerminateRequest()

void SendTerminateRequest ( ) [private]

Send a Terminate Request packet.

Pre-condition
SendInitialTerminateRequest() must have previously been called

SetState(TPppFsmState)

void SetState ( TPppFsmState aState ) [protected]

Set the next state in the FSM. Cancels the timer when appropriate.

Parameters

TPppFsmState aState Next state

TerminateLink()

void TerminateLink ( )

Tear down the protocol, regardless of the state of the FSM.

ThisLayerDown()

void ThisLayerDown ( ) [private]

ThisLayerFinished()

void ThisLayerFinished ( ) [private]

ThisLayerStarted()

void ThisLayerStarted ( ) [private]

ThisLayerUp()

void ThisLayerUp ( ) [private]

TimerComplete(TInt)

IMPORT_C void TimerComplete ( TInt aStatus ) [private, virtual]

Called by MTimer on timer expiry.

Parameters

TInt aStatus Aynchronous request completion status (ignored)

ZeroRestartCount()

void ZeroRestartCount ( ) [private]

Clear the restart count.

Member Data Documentation

const TText * __iFsmName

const TText * __iFsmName

TInt iConsecCfgReq

TInt iConsecCfgReq [private]

TUint8 iCurrentId

TUint8 iCurrentId [private]

TBool iFsmTermination

TBool iFsmTermination [private]

If MPppFsm is to be terminated.

TInt iFsmTerminationCauseError

TInt iFsmTerminationCauseError [protected]

Why PPP is shutting down

TUint32 iLastCfgReqFcs

TUint32 iLastCfgReqFcs [private]

TBool iLengthenTimers

TBool iLengthenTimers [private]

TInt iMaxFailureConfig

TInt iMaxFailureConfig [private]

TInt iMaxFailureCount

TInt iMaxFailureCount [private]

TInt iMaxRestartConfig

TInt iMaxRestartConfig [private]

TInt iMaxTerminateRequest

TInt iMaxTerminateRequest [private]

Maximum TerminateRequest transmissions.

TBool iNoEvidenceOfPeer

TBool iNoEvidenceOfPeer [private]

The physical layer may block on its own retries when trying to send an initial config packet which then blocks the LCP from shutting down until attempts to send a disconnect packet have timed out. To allow for a quick shutdown in such cases where there is no evidence that the link layer is working the EPppFsmStarting state also sets this flag. This is driven by INC85191.

TBool iPersist

TBool iPersist [private]

TUint iRequestId

TUint iRequestId [private]

RPppOptionList iRequestList

RPppOptionList iRequestList [private]

TInt iRestartCount

TInt iRestartCount [private]

TPppFsmState iState

TPppFsmState iState [private]

TBool iTerminateAckEnabled

TBool iTerminateAckEnabled [protected]

Is RFC compliant termination phase for incoming TerminateRequest enabled?

TInt iTerminateAckTimeout

TInt iTerminateAckTimeout [private]

Terminate Ack timeout period

TUint iTerminateId

TUint iTerminateId [private]

TBool iTerminateRequestEnabled

TBool iTerminateRequestEnabled [protected]

Is RFC compliant termination phase for Administrative close enabled?

TInt iTerminateRequestTimeout

TInt iTerminateRequestTimeout [private]

TerminateRequest retransmission timeout

TInt iWaitTime

TInt iWaitTime [private]

TInt iWaitTimeConfig

TInt iWaitTimeConfig [private]

TBool iWaitTimeNoIncrease

TBool iWaitTimeNoIncrease [private]

Whether restart timer period doubles or not