MPppFsm Class Reference

class MPppFsm : public MPppRecvr

Inherits from

Public Member Functions
MPppFsm(CPppLcp *, TPppPhase, TUint)
~MPppFsm()
voidChangeTimers(TBool)
voidConnectionPersist(TBool)
voidFsmAbort(TInt)
voidFsmClose(TInt)
voidFsmConstructL()
TBool FsmIsThisLayerOpen()
TUint8 FsmNewId()
TInt FsmOpen()
voidFsmRejectPacket(RMBufChain &, TUint, TUint)
voidTerminateLink()
Protected Member Functions
TBool FsmAckOptionsValid(RPppOptionList &, RPppOptionList &)
voidFsmApplyConfigRequest(RPppOptionList &)
voidFsmCheckConfigRequest(RPppOptionList &, RPppOptionList &, RPppOptionList &, RPppOptionList &)
TBool FsmConfigRequestOptionsValid(RPppOptionList &)
voidFsmFillinConfigRequestL(RPppOptionList &)
voidFsmLayerDown(TInt)
voidFsmLayerFinished(TInt)
TInt FsmLayerStarted()
voidFsmLayerUp()
voidFsmRecvConfigAck(RPppOptionList &)
voidFsmRecvConfigNak(RPppOptionList &, RPppOptionList &)
voidFsmRecvConfigReject(RPppOptionList &, RPppOptionList &)
TBool FsmRecvUnknownCode(TUint8, TUint8, TInt, RMBufChain &)
TBool FsmRejectOptionsValid(RPppOptionList &, RPppOptionList &)
TPppFsmState FsmState()
voidFsmTerminationPhaseComplete()
IMPORT_C voidKillProtocol()
TUint8 *NewPacket(RMBufPacket &, TUint)
voidSetState(TPppFsmState)
Private Member Functions
voidDecrementMaxFailure()
IMPORT_C voidFrameError()
voidInitMaxFailure()
voidInitRestartCountForConfig()
voidInitRestartCountForTerminate()
TInt InitialiseConfigRequest()
IMPORT_C voidLowerLayerDown(TInt)
IMPORT_C voidLowerLayerUp()
TBool MaxFailureExceeded()
voidProcessConfig(TUint8, TUint8, TInt, RMBufChain &)
TBool ProcessEmptyConfigReq()
voidProcessReject(TUint8, TUint8, TInt, RMBufChain &)
voidProcessTerminate(TUint8, TUint8, TInt, RMBufChain &)
voidReadIniFileL()
IMPORT_C TBoolRecvFrame(RMBufChain &)
voidSendConfigReply(RPppOptionList &, TUint8, TUint8)
voidSendConfigRequest()
voidSendConfigRequestAfterNak(RPppOptionList &)
voidSendConfigRequestAfterReject(RPppOptionList &)
voidSendInitialConfigRequest()
voidSendInitialTerminateRequest()
voidSendTerminateAck(TUint8)
voidSendTerminateRequest()
voidThisLayerDown()
voidThisLayerFinished()
voidThisLayerStarted()
voidThisLayerUp()
IMPORT_C voidTimerComplete(TInt)
voidZeroRestartCount()
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,
TPppPhaseaPhase,
TUintaPppId
)

Parameters

CPppLcp * aPppLcp
TPppPhase aPhase
TUint aPppId

~MPppFsm()

~MPppFsm()[virtual]

Member Functions Documentation

ChangeTimers(TBool)

voidChangeTimers(TBoolaLengthen)[inline]

Parameters

TBool aLengthen

ConnectionPersist(TBool)

voidConnectionPersist(TBoolaPersist)[inline]

Parameters

TBool aPersist

DecrementMaxFailure()

voidDecrementMaxFailure()[private, inline]

FrameError()

IMPORT_C voidFrameError()[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)

voidFsmAbort(TIntaReason)

Abort the protocol.

Parameters

TInt aReasonReason 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 & aListoption list of incoming ConfigAck or ConfigReject
RPppOptionList & aRequestList

FsmApplyConfigRequest(RPppOptionList &)

voidFsmApplyConfigRequest(RPppOptionList &aRequestList)[protected, pure virtual]

Parameters

RPppOptionList & aRequestList

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

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

Parameters

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

FsmClose(TInt)

voidFsmClose(TIntaReason)

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

Parameters

TInt aReasonReason for closing

FsmConfigRequestOptionsValid(RPppOptionList &)

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

Perform validation checking on the option list of a ConfigRequest.

Parameters

RPppOptionList & aListoption list of incoming ConfigRequest

FsmConstructL()

voidFsmConstructL()

Construct the state machine object

FsmFillinConfigRequestL(RPppOptionList &)

voidFsmFillinConfigRequestL(RPppOptionList &aRequestList)[protected, pure virtual]

Parameters

RPppOptionList & aRequestList

FsmIsThisLayerOpen()

TBool FsmIsThisLayerOpen()[inline]

FsmLayerDown(TInt)

voidFsmLayerDown(TIntaReason =  KErrNone )[protected, pure virtual]

Parameters

TInt aReason =  KErrNone

FsmLayerFinished(TInt)

voidFsmLayerFinished(TIntaReason =  KErrNone )[protected, pure virtual]

Parameters

TInt aReason =  KErrNone

FsmLayerStarted()

TInt FsmLayerStarted()[protected, pure virtual]

FsmLayerUp()

voidFsmLayerUp()[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 &)

voidFsmRecvConfigAck(RPppOptionList &aReplyList)[protected, pure virtual]

Parameters

RPppOptionList & aReplyList

FsmRecvConfigNak(RPppOptionList &, RPppOptionList &)

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

Parameters

RPppOptionList & aReplyList
RPppOptionList & aReqList

FsmRecvConfigReject(RPppOptionList &, RPppOptionList &)

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

Parameters

RPppOptionList & aReplyList
RPppOptionList & aReqList

FsmRecvUnknownCode(TUint8, TUint8, TInt, RMBufChain &)

TBool FsmRecvUnknownCode(TUint8aCode,
TUint8aId,
TIntaLength,
RMBufChain &aPacket
)[protected, virtual]

Handle a received packet with an unknown code.

Parameters

TUint8 aCodePacket code (ignored)
TUint8 aIdPacket identifier (ignored)
TInt aLengthLength of packet (ignored)
RMBufChain & aPacketMBuf 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 & aListoption list of incoming ConfigAck or ConfigReject
RPppOptionList & aRequestList

FsmRejectPacket(RMBufChain &, TUint, TUint)

voidFsmRejectPacket(RMBufChain &aPacket,
TUintaReason =  KPppLcpCodeReject ,
TUintaPppId =  KPppIdAsIs
)

Send a Code Reject or Protocol Reject packet.

Parameters

RMBufChain & aPacketMBuf 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()

voidFsmTerminationPhaseComplete()[protected, pure virtual]

InitMaxFailure()

voidInitMaxFailure()[private, inline]

InitRestartCountForConfig()

voidInitRestartCountForConfig()[private]

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

InitRestartCountForTerminate()

voidInitRestartCountForTerminate()[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 voidKillProtocol()[protected, virtual]

Called when the lower level protocol is killed.

LowerLayerDown(TInt)

IMPORT_C voidLowerLayerDown(TIntaStatus =  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 voidLowerLayerUp()[private, virtual]

Called when the lower layer protocol has come up.

MaxFailureExceeded()

TBool MaxFailureExceeded()const [private, inline]

NewPacket(RMBufPacket &, TUint)

TUint8 *NewPacket(RMBufPacket &aPkt,
TUintaLength
)[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 & aPktreference to a packet
TUint aLengthlength of the buffer

ProcessConfig(TUint8, TUint8, TInt, RMBufChain &)

voidProcessConfig(TUint8aCode,
TUint8aId,
TIntaLength,
RMBufChain &aPacket
)[private]

Handle ConfigRequest, ConfigAck, ConfigNak and ConfigReject

Parameters

TUint8 aCodePacket code
TUint8 aIdPacket identifier
TInt aLengthLength of packet (ignored)
RMBufChain & aPacketMBuf chain containing packet.

ProcessEmptyConfigReq()

TBool ProcessEmptyConfigReq()[private]

Handle Config Request with no options.

ProcessReject(TUint8, TUint8, TInt, RMBufChain &)

voidProcessReject(TUint8aCode,
TUint8aId,
TIntaLength,
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 aCodePacket code
TUint8 aIdPacket identifier (ignored)
TInt aLengthLength of packet (ignored)
RMBufChain & aPacketMBuf chain containing packet.

ProcessTerminate(TUint8, TUint8, TInt, RMBufChain &)

voidProcessTerminate(TUint8aCode,
TUint8aId,
TIntaLength,
RMBufChain &aPacket
)[private]

Handle a Terminate Request packet and cleanly terminate the connection.

Parameters

TUint8 aCodePacket code
TUint8 aIdPacket identifier
TInt aLengthLength of packet (ignored)
RMBufChain & aPacketMBuf chain containing packet (ignored)

ReadIniFileL()

voidReadIniFileL()[private]

Reads the contents of the ppp.ini file.

leave
Error code if file cannot be read

RecvFrame(RMBufChain &)

IMPORT_C TBoolRecvFrame(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 & aPacketMBuf chain containing packet

SendConfigReply(RPppOptionList &, TUint8, TUint8)

voidSendConfigReply(RPppOptionList &aOptList,
TUint8aType,
TUint8aId
)[private]

Reply to a config request with a set of options.

Parameters

RPppOptionList & aOptListOptions list
TUint8 aTypePacket type (Ack, Nak, Rej)
TUint8 aIdPacket identifier

SendConfigRequest()

voidSendConfigRequest()[private]

Send the config request in iRequestList

SendConfigRequestAfterNak(RPppOptionList &)

voidSendConfigRequestAfterNak(RPppOptionList &aOptList)[private]

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

Parameters

RPppOptionList & aOptListOptions list (ignored)

SendConfigRequestAfterReject(RPppOptionList &)

voidSendConfigRequestAfterReject(RPppOptionList &aOptList)[private]

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

Parameters

RPppOptionList & aOptListOptions list (ignored)

SendInitialConfigRequest()

voidSendInitialConfigRequest()[private]

Initialise request list and send a request if successful.

SendInitialTerminateRequest()

voidSendInitialTerminateRequest()[private]

Send the first Terminate Request packet to begin connection teardown.

SendTerminateAck(TUint8)

voidSendTerminateAck(TUint8aId)[private]

Send a Terminate Ack packet.

Parameters

TUint8 aIdPacket identifier

SendTerminateRequest()

voidSendTerminateRequest()[private]

Send a Terminate Request packet.

Pre-condition
SendInitialTerminateRequest() must have previously been called

SetState(TPppFsmState)

voidSetState(TPppFsmStateaState)[protected]

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

Parameters

TPppFsmState aStateNext state

TerminateLink()

voidTerminateLink()

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

ThisLayerDown()

voidThisLayerDown()[private]

ThisLayerFinished()

voidThisLayerFinished()[private]

ThisLayerStarted()

voidThisLayerStarted()[private]

ThisLayerUp()

voidThisLayerUp()[private]

TimerComplete(TInt)

IMPORT_C voidTimerComplete(TIntaStatus)[private, virtual]

Called by MTimer on timer expiry.

Parameters

TInt aStatusAynchronous request completion status (ignored)

ZeroRestartCount()

voidZeroRestartCount()[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