ppp_misc.h
Go to the documentation of this file.
1 /**
2  * @file ppp_misc.h
3  * @brief PPP miscellaneous functions
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.0
29  **/
30 
31 #ifndef _PPP_MISC_H
32 #define _PPP_MISC_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "ppp/ppp.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //PPP related functions
45  const PppConfigurePacket *configureReqPacket, PppProtocol protocol, PppCode code);
46 
49 
52 
53 error_t pppSendCodeRej(PppContext *context, const PppPacket *packet,
55 
57  uint16_t protocol, const uint8_t *information, size_t length);
58 
60  const PppEchoPacket *echoReqPacket, PppProtocol protocol);
61 
62 error_t pppAddOption(PppConfigurePacket *packet, uint8_t optionType,
63  const void *optionValue, uint8_t optionLen);
64 
65 //C++ guard
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif
uint8_t code
Definition: coap_common.h:179
uint8_t identifier[]
error_t
Error codes.
Definition: error.h:43
uint8_t protocol
Definition: ipv4.h:296
TCP/IP stack core.
PPP (Point-to-Point Protocol)
PppConfigurePacket
Definition: ppp.h:274
PppProtocol
Protocol field values.
Definition: ppp.h:198
#define PppContext
Definition: ppp.h:38
PppCode
Code field values.
Definition: ppp.h:215
#define PppPacket
Definition: ppp.h:37
PppEchoPacket
Definition: ppp.h:328
error_t pppSendTerminateAck(PppContext *context, uint8_t identifier, PppProtocol protocol)
Send Terminate-Ack packet.
Definition: ppp_misc.c:215
error_t pppSendCodeRej(PppContext *context, const PppPacket *packet, uint8_t identifier, PppProtocol protocol)
Send Code-Reject packet.
Definition: ppp_misc.c:265
error_t pppSendConfigureAckNak(PppContext *context, const PppConfigurePacket *configureReqPacket, PppProtocol protocol, PppCode code)
Send Configure-Ack, Nak or Reject packet.
Definition: ppp_misc.c:56
error_t pppSendEchoRep(PppContext *context, const PppEchoPacket *echoReqPacket, PppProtocol protocol)
Send Echo-Reply packet.
Definition: ppp_misc.c:385
error_t pppAddOption(PppConfigurePacket *packet, uint8_t optionType, const void *optionValue, uint8_t optionLen)
Add an option to a Configure packet.
Definition: ppp_misc.c:448
error_t pppSendProtocolRej(PppContext *context, uint8_t identifier, uint16_t protocol, const uint8_t *information, size_t length)
Send Protocol-Reject packet.
Definition: ppp_misc.c:325
error_t pppSendTerminateReq(PppContext *context, uint8_t identifier, PppProtocol protocol)
Send Terminate-Request packet.
Definition: ppp_misc.c:166
uint8_t length
Definition: tcp.h:368