ppp_fsm.c File Reference

PPP finite state machine. More...

#include "core/net.h"
#include "ppp/ppp_fsm.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   PPP_TRACE_LEVEL
 

Functions

void pppUpEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Up event. More...
 
void pppDownEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Down event. More...
 
void pppOpenEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Open event. More...
 
void pppCloseEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Close event. More...
 
void pppTimeoutEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Timeout event. More...
 
void pppRcvConfigureReqEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks, const PppConfigurePacket *configureReqPacket, PppCode code)
 Process Receive-Configure-Request event. More...
 
void pppRcvConfigureAckEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Receive-Configure-Ack event. More...
 
void pppRcvConfigureNakEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Receive-Configure-Nak event. More...
 
void pppRcvTerminateReqEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks, const PppTerminatePacket *terminateReqPacket)
 Process Receive-Terminate-Req event. More...
 
void pppRcvTerminateAckEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks)
 Process Receive-Terminate-Ack event. More...
 
void pppRcvUnknownCodeEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks, const PppPacket *packet)
 Process Receive-Unknown-Code event. More...
 
void pppRcvCodeRejEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks, bool_t acceptable)
 Process Receive-Code-Reject or Receive-Protocol-Reject event. More...
 
void pppRcvEchoReqEvent (PppContext *context, PppFsm *fsm, const PppCallbacks *callbacks, const PppEchoPacket *echoReqPacket)
 Process Receive-Echo-Request event. More...
 
void pppChangeState (PppFsm *fsm, PppState newState)
 Update PPP FSM state. More...
 

Detailed Description

PPP finite state machine.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file ppp_fsm.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   PPP_TRACE_LEVEL

Definition at line 30 of file ppp_fsm.c.

Function Documentation

◆ pppChangeState()

void pppChangeState ( PppFsm fsm,
PppState  newState 
)

Update PPP FSM state.

Parameters
[in,out]fsmFinite state machine
[in]newStateNew PPP state to switch to

Definition at line 922 of file ppp_fsm.c.

◆ pppCloseEvent()

void pppCloseEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Close event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 187 of file ppp_fsm.c.

◆ pppDownEvent()

void pppDownEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Down event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 82 of file ppp_fsm.c.

◆ pppOpenEvent()

void pppOpenEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Open event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 133 of file ppp_fsm.c.

◆ pppRcvCodeRejEvent()

void pppRcvCodeRejEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks,
bool_t  acceptable 
)

Process Receive-Code-Reject or Receive-Protocol-Reject event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions
[in]acceptableThis parameter tells whether the rejected value is acceptable or catastrophic

Definition at line 790 of file ppp_fsm.c.

◆ pppRcvConfigureAckEvent()

void pppRcvConfigureAckEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Receive-Configure-Ack event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 522 of file ppp_fsm.c.

◆ pppRcvConfigureNakEvent()

void pppRcvConfigureNakEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Receive-Configure-Nak event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 584 of file ppp_fsm.c.

◆ pppRcvConfigureReqEvent()

void pppRcvConfigureReqEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks,
const PppConfigurePacket configureReqPacket,
PppCode  code 
)

Process Receive-Configure-Request event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions
[in]configureReqPacketConfigure-Request packet received from the peer
[in]codeTells whether the configuration options are acceptable

Definition at line 333 of file ppp_fsm.c.

◆ pppRcvEchoReqEvent()

void pppRcvEchoReqEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks,
const PppEchoPacket echoReqPacket 
)

Process Receive-Echo-Request event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions
[in]echoReqPacketEcho-Request packet received from the peer

Definition at line 887 of file ppp_fsm.c.

◆ pppRcvTerminateAckEvent()

void pppRcvTerminateAckEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Receive-Terminate-Ack event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 695 of file ppp_fsm.c.

◆ pppRcvTerminateReqEvent()

void pppRcvTerminateReqEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks,
const PppTerminatePacket terminateReqPacket 
)

Process Receive-Terminate-Req event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions
[in]terminateReqPacketTerminate-Request packet received from the peer

Definition at line 646 of file ppp_fsm.c.

◆ pppRcvUnknownCodeEvent()

void pppRcvUnknownCodeEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks,
const PppPacket packet 
)

Process Receive-Unknown-Code event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions
[in]packetUn-interpretable packet received from the peer

Definition at line 755 of file ppp_fsm.c.

◆ pppTimeoutEvent()

void pppTimeoutEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Timeout event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 255 of file ppp_fsm.c.

◆ pppUpEvent()

void pppUpEvent ( PppContext context,
PppFsm fsm,
const PppCallbacks callbacks 
)

Process Up event.

Parameters
[in]contextPPP context
[in,out]fsmFinite state machine
[in]callbacksFSM actions

Definition at line 48 of file ppp_fsm.c.