dhcp_debug.h
Go to the documentation of this file.
1 /**
2  * @file dhcp_debug.h
3  * @brief Data logging functions for debugging purpose (DHCP)
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 "dhcp/dhcp_common.h"
37 #include "debug.h"
38 
39 //C++ guard
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 //Check current trace level
45 #if (DHCP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
47  error_t dhcpDumpMessageType(const DhcpOption *option);
49  error_t dhcpDumpBoolean(const DhcpOption *option);
50  error_t dhcpDumpInt8(const DhcpOption *option);
51  error_t dhcpDumpInt16(const DhcpOption *option);
52  error_t dhcpDumpInt32(const DhcpOption *option);
53  error_t dhcpDumpString(const DhcpOption *option);
54  error_t dhcpDumpIpv4Addr(const DhcpOption *option);
56  error_t dhcpDumpRawData(const DhcpOption *option);
57 #else
58  #define dhcpDumpMessage(message, length)
59 #endif
60 
61 //C++ guard
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif
uint8_t length
Definition: dtls_misc.h:149
__start_packed struct @124 DhcpOption
DHCP option.
error_t dhcpDumpInt16(const DhcpOption *option)
Dump an option containing a 16-bit integer.
Definition: dhcp_debug.c:447
error_t dhcpDumpInt8(const DhcpOption *option)
Dump an option containing a 8-bit integer.
Definition: dhcp_debug.c:427
error_t dhcpDumpString(const DhcpOption *option)
Dump an option containing a string.
Definition: dhcp_debug.c:495
__start_packed struct @123 DhcpMessage
DHCP message.
error_t dhcpDumpIpv4Addr(const DhcpOption *option)
Dump an option containing an IPv4 address.
Definition: dhcp_debug.c:518
error_t
Error codes.
Definition: error.h:42
Definitions common to DHCP client and server.
error_t dhcpDumpParamRequestList(const DhcpOption *option)
Dump Parameter Request List option.
Definition: dhcp_debug.c:379
error_t dhcpDumpInt32(const DhcpOption *option)
Dump an option containing a 32-bit integer.
Definition: dhcp_debug.c:471
error_t dhcpDumpIpv4AddrList(const DhcpOption *option)
Dump an option containing a list of IPv4 addresses.
Definition: dhcp_debug.c:542
error_t dhcpDumpBoolean(const DhcpOption *option)
Dump an option containing a boolean.
Definition: dhcp_debug.c:407
uint8_t message[]
Definition: chap.h:152
error_t dhcpDumpMessageType(const DhcpOption *option)
Dump Message Type option.
Definition: dhcp_debug.c:352
TCP/IP stack core.
Debugging facilities.
error_t dhcpDumpMessage(const DhcpMessage *message, size_t length)
Dump DHCP message for debugging purpose.
Definition: dhcp_debug.c:158
error_t dhcpDumpRawData(const DhcpOption *option)
Dump an option containing raw data.
Definition: dhcp_debug.c:571