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:
14:e75a59c1123d
Parent:
13:9cd54f7db57a
Child:
28:edc17eeb4142
--- a/udp/dhcp.cpp	Mon May 01 18:20:55 2017 +0000
+++ b/udp/dhcp.cpp	Fri May 05 17:44:16 2017 +0000
@@ -1,6 +1,8 @@
 #include "mbed.h"
 #include  "log.h"
 #include  "net.h"
+#include  "eth.h"
+#include  "ip4.h"
 #include  "mac.h"
 #include  "udp.h"
 
@@ -175,11 +177,11 @@
     if (DEBUG)
     {
         char text[20];
-        NetIp4AddressToString(srvIp, sizeof(text), text);
+        Ip4AddressToString(srvIp, sizeof(text), text);
         LogF(" server=%s", text);
-        NetIp4AddressToString(reqIp, sizeof(text), text);
+        Ip4AddressToString(reqIp, sizeof(text), text);
         LogF(" request=%s", text);
-        NetIp4AddressToString(DhcpLocalIp, sizeof(text), text);
+        Ip4AddressToString(DhcpLocalIp, sizeof(text), text);
         LogF(" local=%s\r\n", text);
     }
     
@@ -246,18 +248,18 @@
     switch (dhcpMessageType)
     {
         case DHCPOFFER:
-            NetIp4AddressToString(yiaddr, sizeof(text), text);
+            Ip4AddressToString(yiaddr, sizeof(text), text);
             if (DEBUG) LogTimeF("DHCP <- offer ip %s\r\n", text);
             *pSize =sendRequest(pPacket, DHCPREQUEST, siaddr, yiaddr);
             return BROADCAST;
         case DHCPACK:
-            NetIp4AddressToString(yiaddr, sizeof(text), text);
+            Ip4AddressToString(yiaddr, sizeof(text), text);
             if (DEBUG) LogTimeF("DHCP <- ack ip %s\r\n", text);
             DhcpLocalIp = yiaddr;
             elapsedTime = 0;
             break;
         case DHCPNAK:
-            NetIp4AddressToString(yiaddr, sizeof(text), text);
+            Ip4AddressToString(yiaddr, sizeof(text), text);
             if (DEBUG) LogTimeF("DHCP <- nack ip %s\r\n", text);
             break;
         default: