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:
37:793b39683406
Parent:
22:914b970356f0
Child:
43:bc028d5a6424
--- a/tcp/tcp.cpp	Mon Sep 25 07:09:32 2017 +0000
+++ b/tcp/tcp.cpp	Wed Oct 04 07:51:02 2017 +0000
@@ -1,10 +1,11 @@
-#include "mbed.h"
-#include  "log.h"
-#include  "net.h"
-#include  "tcp.h"
-#include  "tcb.h"
-#include  "ip4.h"
-#include "dhcp.h"
+#include   "mbed.h"
+#include    "log.h"
+#include    "net.h"
+#include "action.h"
+#include    "tcp.h"
+#include    "tcb.h"
+#include    "ip4.h"
+#include   "dhcp.h"
 #include "http-request.h"
 #include "http-reply.h"
 
@@ -62,9 +63,9 @@
 static    int      dataLength;
 static    uint16_t mss;
 
-void TcpLogHeader(char* title, void* pPacket, uint16_t calculatedChecksum)
+void TcpLogHeader(uint16_t calculatedChecksum)
 {    
-    LogTimeF("TCP %s\r\n", title);
+    Log("TCP header\r\n");
     LogF("  Source port      %hu\r\n",   srcPort);
     LogF("  Destination port %hu\r\n",   dstPort);
     LogF("  Sequence number  %u\r\n",    seqnum);
@@ -291,7 +292,7 @@
     return 1;
 }
 
-int TcpHandleReceivedPacket(int* pSize, void* pPacket)
+int TcpHandleReceivedPacket(void (*traceback)(void), int* pSize, void* pPacket)
 {
     struct tcb* pTcb = TcbGetExisting(srcPort);
     if (!pTcb)  pTcb = TcbGetEmpty();