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:
43:bc028d5a6424
Parent:
42:222a4f45f916
Child:
44:83ce5ace337b
--- a/ip6/ip6.cpp	Sun Oct 15 17:54:09 2017 +0000
+++ b/ip6/ip6.cpp	Thu Oct 19 20:56:58 2017 +0000
@@ -134,16 +134,32 @@
 static void logHeader()
 {
     char text[100];
-    Log("IP6 header\r\n");
-    LogF("  Version           %d\r\n", version);
-    LogF("  Payload length    %d\r\n", dataLength);
-    LogF("  Hop limit         %d\r\n", hoplimit);
-    IpProtocolToString(protocol, sizeof(text), text);
-    LogF("  Protocol          %s\r\n", text);
-    Ip6AddressToString(srcIp, sizeof(text), text);
-    LogF("  Source IP         %s\r\n", text);
-    Ip6AddressToString(dstIp, sizeof(text), text);
-    LogF("  Destination IP    %s\r\n", text);
+    if (NetTraceVerbose)
+    {
+        Log("IP6 header\r\n");
+        LogF("  Version           %d\r\n", version);
+        LogF("  Payload length    %d\r\n", dataLength);
+        LogF("  Hop limit         %d\r\n", hoplimit);
+        IpProtocolToString(protocol, sizeof(text), text);
+        LogF("  Protocol          %s\r\n", text);
+        Ip6AddressToString(srcIp, sizeof(text), text);
+        LogF("  Source IP         %s\r\n", text);
+        Ip6AddressToString(dstIp, sizeof(text), text);
+        LogF("  Destination IP    %s\r\n", text);
+    }
+    else
+    {
+        Log("IP6 header ");
+        IpProtocolToString(protocol, sizeof(text), text);
+        Log(text);
+        Log(" ");
+        Ip6AddressToString(srcIp, sizeof(text), text);
+        Log(text);
+        Log(" >>> ");
+        Ip6AddressToString(dstIp, sizeof(text), text);
+        Log(text);
+        Log("\r\n");
+    }
 }
 
 static bool getIsSolicited(char* p)