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

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 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
2.4.0

Definition in file ppp_fsm.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   PPP_TRACE_LEVEL

Definition at line 32 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 924 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 189 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 84 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 135 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 792 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 524 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 586 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 335 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 889 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 697 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 648 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 757 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 257 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 50 of file ppp_fsm.c.