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-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 _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
Debugging facilities.
error_t
Error codes.
Definition: error.h:43
IPCP (PPP Internet Protocol Control Protocol)
uint8_t protocol
Definition: ipv4.h:296
LCP (PPP Link Control Protocol)
TCP/IP stack core.
PPP (Point-to-Point Protocol)
PppOption
Definition: ppp.h:354
PppProtocol
Protocol field values.
Definition: ppp.h:198
#define PppPacket
Definition: ppp.h:37
error_t ipcpDumpOptions(const PppOption *option, size_t length)
Dump IPCP options for debugging purpose.
Definition: ppp_debug.c:800
error_t lcpDumpOptions(const PppOption *option, size_t length)
Dump LCP options for debugging purpose.
Definition: ppp_debug.c:721
error_t lcpDumpPacket(const PppPacket *packet, size_t length)
Dump LCP packet for debugging purpose.
Definition: ppp_debug.c:188
error_t ipv6cpDumpOptions(const PppOption *option, size_t length)
Dump IPV6CP options for debugging purpose.
Definition: ppp_debug.c:880
error_t ncpDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol)
Dump NCP packet for debugging purpose.
Definition: ppp_debug.c:350
error_t pppDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol)
Dump LCP/NCP packet for debugging purpose.
Definition: ppp_debug.c:143
error_t chapDumpPacket(const PppPacket *packet, size_t length)
Dump CHAP packet for debugging purpose.
Definition: ppp_debug.c:608
error_t papDumpPacket(const PppPacket *packet, size_t length)
Dump PAP packet for debugging purpose.
Definition: ppp_debug.c:484
uint8_t length
Definition: tcp.h:368