ppp_debug.h
Go to the documentation of this file.
1 /**
2  * @file ppp_debug.h
3  * @brief Data logging functions for debugging purpose (PPP)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 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 1.9.6
29  **/
30 
31 #ifndef _DHCP_DEBUG_H
32 #define _DHCP_DEBUG_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "ppp/ppp.h"
37 #include "ppp/lcp.h"
38 #include "ppp/ipcp.h"
39 #include "debug.h"
40 
41 //C++ guard
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 //Check current trace level
47 #if (PPP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
48  error_t pppDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol);
49  error_t lcpDumpPacket(const PppPacket *packet, size_t length);
50  error_t ncpDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol);
51  error_t papDumpPacket(const PppPacket *packet, size_t length);
52  error_t chapDumpPacket(const PppPacket *packet, size_t length);
53  error_t lcpDumpOptions(const PppOption *option, size_t length);
54  error_t ipcpDumpOptions(const PppOption *option, size_t length);
55  error_t ipv6cpDumpOptions(const PppOption *option, size_t length);
56 #else
57  #define pppDumpPacket(packet, length, protocol)
58 #endif
59 
60 //C++ guard
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif
uint8_t length
Definition: dtls_misc.h:149
#define PppPacket
Definition: ppp.h:37
PppProtocol
Protocol field values.
Definition: ppp.h:197
error_t pppDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol)
Dump LCP/NCP packet for debugging purpose.
Definition: ppp_debug.c:143
__start_packed struct @291 PppOption
LCP/NCP option.
error_t ncpDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol)
Dump NCP packet for debugging purpose.
Definition: ppp_debug.c:343
error_t ipcpDumpOptions(const PppOption *option, size_t length)
Dump IPCP options for debugging purpose.
Definition: ppp_debug.c:775
IPCP (PPP Internet Protocol Control Protocol)
LCP (PPP Link Control Protocol)
error_t
Error codes.
Definition: error.h:42
uint8_t protocol
error_t ipv6cpDumpOptions(const PppOption *option, size_t length)
Dump IPV6CP options for debugging purpose.
Definition: ppp_debug.c:846
error_t lcpDumpOptions(const PppOption *option, size_t length)
Dump LCP options for debugging purpose.
Definition: ppp_debug.c:702
error_t chapDumpPacket(const PppPacket *packet, size_t length)
Dump CHAP packet for debugging purpose.
Definition: ppp_debug.c:593
error_t lcpDumpPacket(const PppPacket *packet, size_t length)
Dump LCP packet for debugging purpose.
Definition: ppp_debug.c:185
PPP (Point-to-Point Protocol)
TCP/IP stack core.
Debugging facilities.
error_t papDumpPacket(const PppPacket *packet, size_t length)
Dump PAP packet for debugging purpose.
Definition: ppp_debug.c:473