ppp_misc.c File Reference

PPP miscellaneous functions. More...

#include "core/net.h"
#include "ppp/ppp_misc.h"
#include "ppp/ppp_debug.h"
#include "ppp/lcp.h"
#include "ppp/ipcp.h"
#include "ppp/ipv6cp.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   PPP_TRACE_LEVEL
 

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

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_misc.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   PPP_TRACE_LEVEL

Definition at line 30 of file ppp_misc.c.

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 446 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 263 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 54 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 383 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 323 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 213 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 164 of file ppp_misc.c.