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

Revision:
59:e0e556c8bd46
Parent:
47:73af5c0b0dc2
diff -r d48c899e482f -r e0e556c8bd46 udp/dns/dns.cpp
--- a/udp/dns/dns.cpp	Thu Dec 07 20:44:32 2017 +0000
+++ b/udp/dns/dns.cpp	Thu Dec 14 20:55:40 2017 +0000
@@ -89,7 +89,7 @@
     return true;                             //If we get here the strings must equate.
 }
 
-int DnsMakeFullNameFromName(int protocol, char* p, int size, char* result)
+int DnsMakeFullNameFromName(int protocol, const char* p, int size, char* result)
 {
     int i = 0;
     char c;
@@ -163,24 +163,24 @@
     DnsQueryMain();
 }
 
-int DnsHandlePacketReceived(void (*traceback)(void), int dnsProtocol, int* pSize, void* pPacket)
+int DnsHandlePacketReceived(void (*traceback)(void), int dnsProtocol, int sizeRx, void* pPacketRx, int* pSizeTx, void* pPacketTx)
 {
-    DnsHdrSetup(pPacket);
+    DnsHdrSetup(pPacketRx, sizeRx);
     DnsHdrRead();
+    
     int action;
     if (DnsHdrIsReply)
     {
-        action = DnsReplyHandle(traceback, dnsProtocol, pSize);
+        action = DnsReplyHandle(traceback, dnsProtocol);
     }
     else
     {
-        action = DnsServerHandleQuery(traceback, dnsProtocol, pSize);
+        action = DnsServerHandleQuery(traceback, dnsProtocol, pPacketTx, pSizeTx);
     }
     return action;
 }
 
-int DnsPollForPacketToSend(void* pPacket, int* pSize)
+int DnsPollForPacketToSend(void* pPacketTx, int* pSize)
 {
-    DnsHdrSetup(pPacket);
-    return DnsQueryPoll(pSize);
+    return DnsQueryPoll(pPacketTx, pSize);
 }
\ No newline at end of file