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  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _PPP_MISC_H
30 #define _PPP_MISC_H
31 
32 //Dependencies
33 #include "core/net.h"
34 #include "ppp/ppp.h"
35 
36 //C++ guard
37 #ifdef __cplusplus
38  extern "C" {
39 #endif
40 
41 //PPP related functions
43  const PppConfigurePacket *configureReqPacket, PppProtocol protocol, PppCode code);
44 
47 
50 
51 error_t pppSendCodeRej(PppContext *context, const PppPacket *packet,
53 
55  uint16_t protocol, const uint8_t *information, size_t length);
56 
58  const PppEchoPacket *echoReqPacket, PppProtocol protocol);
59 
60 error_t pppAddOption(PppConfigurePacket *packet, uint8_t optionType,
61  const void *optionValue, uint8_t optionLen);
62 
63 //C++ guard
64 #ifdef __cplusplus
65  }
66 #endif
67 
68 #endif
PPP (Point-to-Point Protocol)
error_t pppSendCodeRej(PppContext *context, const PppPacket *packet, uint8_t identifier, PppProtocol protocol)
Send Code-Reject packet.
Definition: ppp_misc.c:263
TCP/IP stack core.
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:446
__start_packed struct @292 PppEchoPacket
Echo-Request and Echo-Reply packet.
PppCode
Code field values.
Definition: ppp.h:212
error_t pppSendTerminateReq(PppContext *context, uint8_t identifier, PppProtocol protocol)
Send Terminate-Request packet.
Definition: ppp_misc.c:164
#define PppPacket
Definition: ppp.h:35
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:323
error_t pppSendConfigureAckNak(PppContext *context, const PppConfigurePacket *configureReqPacket, PppProtocol protocol, PppCode code)
Send Configure-Ack, Nak or Reject packet.
Definition: ppp_misc.c:54
uint8_t identifier[]
#define PppContext
Definition: ppp.h:36
error_t pppSendEchoRep(PppContext *context, const PppEchoPacket *echoReqPacket, PppProtocol protocol)
Send Echo-Reply packet.
Definition: ppp_misc.c:383
error_t
Error codes.
Definition: error.h:40
uint8_t code
Definition: coap_common.h:179
error_t pppSendTerminateAck(PppContext *context, uint8_t identifier, PppProtocol protocol)
Send Terminate-Ack packet.
Definition: ppp_misc.c:213
uint8_t protocol
uint8_t length
Definition: dtls_misc.h:140
__start_packed struct @288 PppConfigurePacket
Configure-Request, Configure-Ack, Configure-Nak and Configure-Reject packets.
PppProtocol
Protocol field values.
Definition: ppp.h:195