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:
172:9bc3c7b2cca1
Parent:
171:f708d6776752
Child:
173:9bc30cd82a76
--- a/udp/udp.c	Sat Dec 12 20:10:02 2020 +0000
+++ b/udp/udp.c	Wed Dec 16 17:33:22 2020 +0000
@@ -138,7 +138,7 @@
 {
     int action = DO_NOTHING;
     
-    if (!action && type == IPV4) //DHCP only works under IPv4
+    if (!action && type == ETH_IPV4) //DHCP only works under IPv4
     {
         action = DhcpPollForRequestToSend(pData, pDataLength);
         if (action)
@@ -148,7 +148,8 @@
         }
     }
     
-    if (!action && type == (DnsSendRequestsViaIp4 ? IPV4 : IPV6)) //DNS is agnostic
+    //if (!action && type == (DnsSendRequestsViaIp4 ? ETH_IPV4 : ETH_IPV6)) //DNS is agnostic
+    if (!action) //DNS is agnostic
     {
         action = DnsPollForPacketToSend(type, pData, pDataLength);
         int dest = ActionGetDestPart(action);
@@ -167,7 +168,7 @@
             }
         }
     }
-    if (!action && type == (NtpClientQuerySendRequestsViaIp4 ? IPV4 : IPV6)) //NTP is agnostic
+    if (!action && type == (NtpClientQuerySendRequestsViaIp4 ? ETH_IPV4 : ETH_IPV6)) //NTP is agnostic
     {
         action = NtpPollForPacketToSend(type, pData, pDataLength);
         if (action)
@@ -176,7 +177,7 @@
             dstPort = NTP_PORT;
         }
     }
-    if (!action && type == (TftpSendRequestsViaIp4 ? IPV4 : IPV6)) //TFTP is agnostic
+    if (!action && type == (TftpSendRequestsViaIp4 ? ETH_IPV4 : ETH_IPV6)) //TFTP is agnostic
     {
         action = TftpPollForPacketToSend(type, pData, pDataLength);
         if (action)