A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
Diff: udp/dns/dnsname.cpp
- Revision:
- 22:914b970356f0
- Parent:
- 13:9cd54f7db57a
- Child:
- 23:b641979389b2
--- a/udp/dns/dnsname.cpp Thu Jun 29 19:42:28 2017 +0000 +++ b/udp/dns/dnsname.cpp Mon Jul 03 14:29:07 2017 +0000 @@ -3,6 +3,8 @@ #include "ctype.h" #include "log.h" +#define DEBUG false + #define MAX_PACKET_SIZE 512 #define MAX_DEPTH 10 @@ -23,7 +25,7 @@ { if (p > DnsHdrPacket + MAX_PACKET_SIZE) { - LogTimeF("DnsNameLength strayed out of the packet\r\n"); + if (DEBUG) LogTimeF("DnsNameLength strayed out of the packet\r\n"); return 0; } @@ -55,7 +57,7 @@ { if (p > DnsHdrPacket + MAX_PACKET_SIZE) { - LogTimeF("DnsNameCompare strayed out of the packet\r\n"); + if (DEBUG) LogTimeF("DnsNameCompare strayed out of the packet\r\n"); return false; } @@ -70,7 +72,7 @@ depth++; if (depth > MAX_DEPTH) { - LogTimeF("DnsNameCompare exceeded depth limit\r\n"); + if (DEBUG) LogTimeF("DnsNameCompare exceeded depth limit\r\n"); return false; } p = derefOffset(p); @@ -95,7 +97,7 @@ depth++; if (depth > MAX_DEPTH) { - LogTimeF("DnsNameIndexFromPointer exceeded depth limit\r\n"); + if (DEBUG) LogTimeF("DnsNameIndexFromPointer exceeded depth limit\r\n"); return -1; } p = derefOffset(p);