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:
195:bd5b123143ca
Parent:
187:122fc1996c86
--- a/ip4/ip4.c	Thu Mar 04 12:08:14 2021 +0000
+++ b/ip4/ip4.c	Sun Apr 18 19:04:48 2021 +0000
@@ -19,7 +19,8 @@
 #include "restart.h"
 #include "checksum.h"
 
-bool Ip4Trace = true;
+bool     Ip4Trace = true;
+uint32_t Ip4Remote = 0;
 
 #define OFF_LINK_TTL 64
 
@@ -96,6 +97,8 @@
     uint32_t srcIp         = Ip4HdrGetSrc      (pPacketRx);
     uint32_t dstIp         = Ip4HdrGetDst      (pPacketRx);
     
+    Ip4Remote = srcIp;
+    
     char* pDataRx = pPacketRx + headerLengthRx;
     char* pDataTx = pPacketTx + IP4_HEADER_LENGTH;
 
@@ -185,6 +188,7 @@
         case UNICAST_DHCP:
         case UNICAST_NTP:
         case UNICAST_TFTP:
+        case UNICAST_USER:
             if (DhcpIpNeedsToBeRouted(dstIp))
             {
                 Ar4IpToMac(DhcpRouterIp, pDstMac); //send via router