ppp_misc.h File Reference

PPP miscellaneous functions. More...

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

Go to the source code of this file.

Functions

error_t pppSendConfigureAckNak (PppContext *context, const PppConfigurePacket *configureReqPacket, PppProtocol protocol, PppCode code)
 Send Configure-Ack, Nak or Reject packet. More...
 
error_t pppSendTerminateReq (PppContext *context, uint8_t identifier, PppProtocol protocol)
 Send Terminate-Request packet. More...
 
error_t pppSendTerminateAck (PppContext *context, uint8_t identifier, PppProtocol protocol)
 Send Terminate-Ack packet. More...
 
error_t pppSendCodeRej (PppContext *context, const PppPacket *packet, uint8_t identifier, PppProtocol protocol)
 Send Code-Reject packet. More...
 
error_t pppSendProtocolRej (PppContext *context, uint8_t identifier, uint16_t protocol, const uint8_t *information, size_t length)
 Send Protocol-Reject packet. More...
 
error_t pppSendEchoRep (PppContext *context, const PppEchoPacket *echoReqPacket, PppProtocol protocol)
 Send Echo-Reply packet. More...
 
error_t pppAddOption (PppConfigurePacket *packet, uint8_t optionType, const void *optionValue, uint8_t optionLen)
 Add an option to a Configure packet. More...
 

Detailed Description

PPP miscellaneous functions.

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.4

Definition in file ppp_misc.h.

Function Documentation

◆ pppAddOption()

error_t pppAddOption ( PppConfigurePacket packet,
uint8_t  optionType,
const void *  optionValue,
uint8_t  optionLen 
)

Add an option to a Configure packet.

Parameters
[in,out]packetPointer to the Configure packet
[in]optionTypeOption type
[in]optionValueOption value
[in]optionLenLength of the option value
Returns
Error code

Definition at line 454 of file ppp_misc.c.

◆ pppSendCodeRej()

error_t pppSendCodeRej ( PppContext context,
const PppPacket packet,
uint8_t  identifier,
PppProtocol  protocol 
)

Send Code-Reject packet.

Parameters
[in]contextPPP context
[in]packetUn-interpretable packet received from the peer
[in]identifierIdentifier field
[in]protocolProtocol field
Returns
Error code

Definition at line 268 of file ppp_misc.c.

◆ pppSendConfigureAckNak()

error_t pppSendConfigureAckNak ( PppContext context,
const PppConfigurePacket configureReqPacket,
PppProtocol  protocol,
PppCode  code 
)

Send Configure-Ack, Nak or Reject packet.

Parameters
[in]contextPPP context
[in]configureReqPacketPointer to the incoming Configure-Request
[in]protocolProtocol field
[in]codeCode field
Returns
Error code

Definition at line 56 of file ppp_misc.c.

◆ pppSendEchoRep()

error_t pppSendEchoRep ( PppContext context,
const PppEchoPacket echoReqPacket,
PppProtocol  protocol 
)

Send Echo-Reply packet.

Parameters
[in]contextPPP context
[in]echoReqPacketEcho-Request packet received from the peer
[in]protocolProtocol field
Returns
Error code

Definition at line 390 of file ppp_misc.c.

◆ pppSendProtocolRej()

error_t pppSendProtocolRej ( PppContext context,
uint8_t  identifier,
uint16_t  protocol,
const uint8_t *  information,
size_t  length 
)

Send Protocol-Reject packet.

Parameters
[in]contextPPP context
[in]identifierIdentifier field
[in]protocolRejected protocol
[in]informationRejected information
[in]lengthLength of the rejected information
Returns
Error code

Definition at line 329 of file ppp_misc.c.

◆ pppSendTerminateAck()

error_t pppSendTerminateAck ( PppContext context,
uint8_t  identifier,
PppProtocol  protocol 
)

Send Terminate-Ack packet.

Parameters
[in]contextPPP context
[in]identifierIdentifier field
[in]protocolProtocol field
Returns
Error code

Definition at line 217 of file ppp_misc.c.

◆ pppSendTerminateReq()

error_t pppSendTerminateReq ( PppContext context,
uint8_t  identifier,
PppProtocol  protocol 
)

Send Terminate-Request packet.

Parameters
[in]contextPPP context
[in]identifierIdentifier field
[in]protocolProtocol field
Returns
Error code

Definition at line 167 of file ppp_misc.c.