PPP (Point-to-Point Protocol) More...
Go to the source code of this file.
Data Structures | |
struct | PppSettings |
PPP settings. More... | |
struct | PppFsm |
PPP finite state machine. More... | |
struct | PppConfig |
PPP configuration options. More... | |
struct | _PppContext |
PPP context. More... | |
Macros | |
#define | PppPacket struct _PppPacket |
#define | PppContext struct _PppContext |
#define | PPP_SUPPORT DISABLED |
#define | PPP_TX_BUFFER_SIZE 4096 |
#define | PPP_RX_BUFFER_SIZE 8192 |
#define | PPP_MAX_USERNAME_LEN 31 |
#define | PPP_MAX_PASSWORD_LEN 31 |
#define | PPP_TICK_INTERVAL 500 |
#define | PPP_POLLING_INTERVAL 50 |
#define | PPP_RESTART_TIMER 3000 |
#define | PPP_MAX_CONFIGURE 10 |
#define | PPP_MAX_TERMINATE 2 |
#define | PPP_MAX_FAILURE 5 |
#define | PPP_MASK_CHAR 0x20 |
#define | PPP_ESC_CHAR 0x7D |
#define | PPP_FLAG_CHAR 0x7E |
#define | PPP_DEFAULT_MRU 1500 |
#define | PPP_DEFAULT_ACCM 0xFFFFFFFF |
#define | PPP_DEFAULT_MAGIC_NUMBER 0 |
#define | PPP_MIN_MRU 32 |
#define | PPP_MAX_MRU 1500 |
#define | PPP_MAX_CONF_REQ_SIZE 128 |
#define | PPP_FRAME_HEADER_SIZE 4 |
#define | PPP_FCS_SIZE 2 |
#define | PPP_MAX_FRAME_SIZE (PPP_FRAME_HEADER_SIZE + PPP_MAX_MRU + PPP_FCS_SIZE) |
#define | PPP_ADDR_FIELD 0xFF |
#define | PPP_CTRL_FIELD 0x03 |
PPP Control field. More... | |
Typedefs | |
typedef error_t(* | PppRandCallback) (uint8_t *data, size_t length) |
Random data generation callback function. More... | |
typedef bool_t(* | PppAuthCallback) (NetInterface *interface, const char_t *username) |
PPP authentication callback function. More... | |
Functions | |
void | pppGetDefaultSettings (PppSettings *settings) |
Initialize settings with default values. More... | |
error_t | pppInit (PppContext *context, const PppSettings *settings) |
PPP initialization. More... | |
error_t | pppSetTimeout (NetInterface *interface, systime_t timeout) |
Set timeout value for blocking operations. More... | |
error_t | pppSetAuthInfo (NetInterface *interface, const char_t *username, const char_t *password) |
Set PPP authentication information. More... | |
bool_t | pppCheckPassword (NetInterface *interface, const char_t *password) |
Password verification. More... | |
error_t | pppSendAtCommand (NetInterface *interface, const char_t *data) |
Send AT command. More... | |
error_t | pppReceiveAtCommand (NetInterface *interface, char_t *data, size_t size) |
Wait for an incoming AT command. More... | |
error_t | pppConnect (NetInterface *interface) |
Establish a PPP connection. More... | |
error_t | pppClose (NetInterface *interface) |
Close a PPP connection. More... | |
void | pppTick (NetInterface *interface) |
PPP timer handler. More... | |
void | pppProcessFrame (NetInterface *interface, uint8_t *frame, size_t length, NetRxAncillary *ancillary) |
Process an incoming PPP frame. More... | |
error_t | pppSendFrame (NetInterface *interface, NetBuffer *buffer, size_t offset, uint16_t protocol) |
Send a PPP frame. More... | |
size_t | pppParseFrameHeader (const uint8_t *frame, size_t length, uint16_t *protocol) |
Parse PPP frame header. More... | |
uint16_t | pppCalcFcs (const uint8_t *data, size_t length) |
FCS calculation. More... | |
uint16_t | pppCalcFcsEx (const NetBuffer *buffer, size_t offset, size_t length) |
Calculate FCS over a multi-part buffer. More... | |
NetBuffer * | pppAllocBuffer (size_t length, size_t *offset) |
Allocate a buffer to hold a PPP frame. More... | |
Variables | |
__packed_struct | _PppPacket |
LCP/NCP packet header. More... | |
uint8_t | identifier |
uint16_t | length |
uint8_t | data [] |
typedef | __packed_struct |
Configure-Request, Configure-Ack, Configure-Nak and Configure-Reject packets. More... | |
uint8_t | options [] |
PppConfigurePacket | |
PppTerminatePacket | |
uint8_t | rejectedPacket [] |
PppCodeRejPacket | |
uint16_t | rejectedProtocol |
uint8_t | rejectedInfo [] |
PppProtocolRejPacket | |
uint32_t | magicNumber |
PppEchoPacket | |
PppDiscardReqPacket | |
PppOption | |
systime_t | pppTickCounter |
Detailed Description
PPP (Point-to-Point Protocol)
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.
- Version
- 2.4.4
Definition in file ppp.h.
Macro Definition Documentation
◆ PPP_ADDR_FIELD
◆ PPP_CTRL_FIELD
◆ PPP_DEFAULT_ACCM
◆ PPP_DEFAULT_MAGIC_NUMBER
◆ PPP_DEFAULT_MRU
◆ PPP_ESC_CHAR
◆ PPP_FCS_SIZE
◆ PPP_FLAG_CHAR
◆ PPP_FRAME_HEADER_SIZE
◆ PPP_MASK_CHAR
◆ PPP_MAX_CONF_REQ_SIZE
◆ PPP_MAX_CONFIGURE
◆ PPP_MAX_FAILURE
◆ PPP_MAX_FRAME_SIZE
#define PPP_MAX_FRAME_SIZE (PPP_FRAME_HEADER_SIZE + PPP_MAX_MRU + PPP_FCS_SIZE) |
◆ PPP_MAX_MRU
◆ PPP_MAX_PASSWORD_LEN
◆ PPP_MAX_TERMINATE
◆ PPP_MAX_USERNAME_LEN
◆ PPP_MIN_MRU
◆ PPP_POLLING_INTERVAL
◆ PPP_RESTART_TIMER
◆ PPP_RX_BUFFER_SIZE
◆ PPP_SUPPORT
◆ PPP_TICK_INTERVAL
◆ PPP_TX_BUFFER_SIZE
◆ PppContext
#define PppContext struct _PppContext |
◆ PppPacket
#define PppPacket struct _PppPacket |
Typedef Documentation
◆ PppAuthCallback
typedef bool_t(* PppAuthCallback) (NetInterface *interface, const char_t *username) |
◆ PppRandCallback
Enumeration Type Documentation
◆ PppAuthProtocol
enum PppAuthProtocol |
◆ PppCode
enum PppCode |
Code field values.
◆ PppPhase
enum PppPhase |
◆ PppProtocol
enum PppProtocol |
Protocol field values.
◆ PppState
enum PppState |
Function Documentation
◆ pppAllocBuffer()
NetBuffer* pppAllocBuffer | ( | size_t | length, |
size_t * | offset | ||
) |
◆ pppCalcFcs()
uint16_t pppCalcFcs | ( | const uint8_t * | data, |
size_t | length | ||
) |
◆ pppCalcFcsEx()
uint16_t pppCalcFcsEx | ( | const NetBuffer * | buffer, |
size_t | offset, | ||
size_t | length | ||
) |
◆ pppCheckPassword()
bool_t pppCheckPassword | ( | NetInterface * | interface, |
const char_t * | password | ||
) |
◆ pppClose()
error_t pppClose | ( | NetInterface * | interface | ) |
◆ pppConnect()
error_t pppConnect | ( | NetInterface * | interface | ) |
◆ pppGetDefaultSettings()
void pppGetDefaultSettings | ( | PppSettings * | settings | ) |
◆ pppInit()
error_t pppInit | ( | PppContext * | context, |
const PppSettings * | settings | ||
) |
◆ pppParseFrameHeader()
size_t pppParseFrameHeader | ( | const uint8_t * | frame, |
size_t | length, | ||
uint16_t * | protocol | ||
) |
Parse PPP frame header.
- Parameters
-
[in] frame Pointer to the PPP frame [in] length Length of the frame, in bytes [out] protocol Value of the Protocol field
- Returns
- If the PPP header was successfully parsed, the function returns the size of the PPP header, in bytes. If a parsing error occurred, zero is returned
◆ pppProcessFrame()
void pppProcessFrame | ( | NetInterface * | interface, |
uint8_t * | frame, | ||
size_t | length, | ||
NetRxAncillary * | ancillary | ||
) |
◆ pppReceiveAtCommand()
error_t pppReceiveAtCommand | ( | NetInterface * | interface, |
char_t * | data, | ||
size_t | size | ||
) |
◆ pppSendAtCommand()
error_t pppSendAtCommand | ( | NetInterface * | interface, |
const char_t * | data | ||
) |
◆ pppSendFrame()
error_t pppSendFrame | ( | NetInterface * | interface, |
NetBuffer * | buffer, | ||
size_t | offset, | ||
uint16_t | protocol | ||
) |
◆ pppSetAuthInfo()
error_t pppSetAuthInfo | ( | NetInterface * | interface, |
const char_t * | username, | ||
const char_t * | password | ||
) |
◆ pppSetTimeout()
error_t pppSetTimeout | ( | NetInterface * | interface, |
systime_t | timeout | ||
) |
◆ pppTick()
void pppTick | ( | NetInterface * | interface | ) |
Variable Documentation
◆ __packed_struct
typedef __packed_struct |
Configure-Request, Configure-Ack, Configure-Nak and Configure-Reject packets.
LCP/NCP option.
PPP Discard-Request packet.
Echo-Request and Echo-Reply packet.
Protocol-Reject packet.
Code-Reject packet.
Terminate-Request and Terminate-Ack packet.
◆ _PppPacket
__packed_struct _PppPacket |