dns_debug.h
Go to the documentation of this file.
1 /**
2  * @file dns_debug.h
3  * @brief Data logging functions for debugging purpose (DNS)
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 _DNS_DEBUG_H
30 #define _DNS_DEBUG_H
31 
32 //Dependencies
33 #include "core/net.h"
34 #include "dns/dns_common.h"
35 #include "debug.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39  extern "C" {
40 #endif
41 
42 //Check current trace level
43 #if (DNS_TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
44  void dnsDumpMessage(const DnsHeader *message, size_t length);
45  size_t dnsDumpQuestion(const DnsHeader *message, size_t length, size_t pos, char_t *buffer);
46  size_t dnsDumpResourceRecord(const DnsHeader *message, size_t length, size_t pos, char_t *buffer);
47 #else
48  #define dnsDumpMessage(message, length)
49 #endif
50 
51 //C++ guard
52 #ifdef __cplusplus
53  }
54 #endif
55 
56 #endif
char char_t
Definition: compiler_port.h:41
TCP/IP stack core.
Debugging facilities.
uint8_t message[]
Definition: chap.h:150
__start_packed struct @150 DnsHeader
DNS message header.
size_t dnsDumpQuestion(const DnsHeader *message, size_t length, size_t pos, char_t *buffer)
Dump DNS question for debugging purpose.
Definition: dns_debug.c:168
void dnsDumpMessage(const DnsHeader *message, size_t length)
Dump DNS message for debugging purpose.
Definition: dns_debug.c:50
size_t dnsDumpResourceRecord(const DnsHeader *message, size_t length, size_t pos, char_t *buffer)
Dump DNS resource record for debugging purpose.
Definition: dns_debug.c:221
uint8_t length
Definition: dtls_misc.h:140
Common DNS routines.