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:
71:736a5747ade1
Parent:
66:18a10c0b6d93
Child:
74:c3756bfa960e
--- a/eth/ar4.c	Fri Feb 16 17:31:52 2018 +0000
+++ b/eth/ar4.c	Sat Oct 20 18:56:13 2018 +0000
@@ -91,7 +91,7 @@
     records[i].elapsed  = elapsed;
     MacClear(records[i].mac);
 }
-void Ar4AddIpRecord(void (*traceback)(void), char* mac, uint32_t ip)
+uint32_t* Ar4AddIpRecord(void (*traceback)(void), char* mac, uint32_t ip)
 {
     //Don't treat non ips
     if (!ip)
@@ -101,7 +101,7 @@
             LogTime("Ar4AddIpRecord had blank ip\r\n");
             if (NetTraceStack) traceback();
         }
-        return;
+        return NULL;
     }
     if (MacIsEmpty(mac))
     {
@@ -110,7 +110,7 @@
             LogTime("Ar4AddIpRecord had blank mac\r\n");
             if (NetTraceStack) traceback();
         }
-        return;
+        return NULL;
     }
     int i;
     
@@ -121,7 +121,7 @@
         records[i].elapsed   = elapsed;
         records[i].state = STATE_VALID;
         MacCopy(records[i].mac, mac);
-        return;
+        return &records[i].ip;
     }
     
     //Otherwise find the first empty slot and add the IP, MAC, and date
@@ -130,7 +130,7 @@
     records[i].elapsed  = elapsed;
     records[i].state = STATE_VALID;
     MacCopy(records[i].mac, mac);
-    return;
+    return &records[i].ip;
 }
 void Ar4IpToMac(uint32_t ip, char* mac)
 {