Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Revision:
61:aad055f1b0d1
Parent:
59:e0e556c8bd46
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ip6/icmp/echo6.c	Thu Jan 11 17:38:21 2018 +0000
@@ -0,0 +1,24 @@
+#include  <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include    "log.h"
+#include    "net.h"
+#include "action.h"
+
+bool Echo6Trace = false;
+
+int Echo6HandleRequest(void (*traceback)(void), uint8_t* pType, uint8_t* pCode, char* payloadRx, int sizeRx, char* payloadTx, int* pSizeTx)
+{
+    if (Echo6Trace)
+    {
+        if (NetTraceNewLine) Log("\r\n");
+        LogTime("Echo6\r\n");
+        if (NetTraceStack) traceback();
+    }
+    *pType = 129;
+    *pCode = 0;
+    *pSizeTx = sizeRx;
+    memcpy(payloadTx, payloadRx, *pSizeTx);
+    return ActionMakeFromDestAndTrace(UNICAST, Echo6Trace && NetTraceStack);
+}
\ No newline at end of file