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:
121:bc048b65a630
Parent:
113:904b40231907
Child:
138:5ff0c7069300
--- a/udp/udp.c	Tue Jan 29 18:32:57 2019 +0000
+++ b/udp/udp.c	Mon Feb 04 15:27:33 2019 +0000
@@ -1,20 +1,21 @@
 #include <stdint.h>
 #include <stdbool.h>
 
-#include    "log.h"
-#include    "net.h"
+#include "log.h"
+#include "net.h"
 #include "action.h"
-#include    "udp.h"
-#include    "ntp.h"
-#include   "tftp.h"
-#include   "dhcp.h"
-#include    "dns.h"
-#include    "eth.h"
-#include    "ip4.h"
-#include    "ip6.h"
-#include  "slaac.h"
-#include     "ns.h"
+#include "udp.h"
+#include "ntp.h"
+#include "tftp.h"
+#include "dhcp.h"
+#include "dns.h"
+#include "eth.h"
+#include "ip4.h"
+#include "ip6.h"
+#include "slaac.h"
+#include "ns.h"
 #include "ntpclient.h"
+#include "fault.h"
 
 bool UdpTrace = true;
 
@@ -84,6 +85,9 @@
 }
 int UdpHandleReceivedPacket(void (*traceback)(void), int sizeRx, void* pPacketRx, int* pSizeTx, void* pPacketTx)
 {    
+    int lastFaultPoint = FaultPoint;
+    FaultPoint = FAULT_POINT_UdpHandleReceivedPacket;
+    
     readHeader(pPacketRx, sizeRx);
 
     void* pDataRx    = (char*)pPacketRx + sizeof(struct header);
@@ -99,6 +103,7 @@
     dstPort = srcPort;
     srcPort = tmpPort;
     
+    FaultPoint = lastFaultPoint;
     return action;
 }
 static int pollForPacketToSend(int type, int* pDataLength, void* pData)