Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Diff: ip6/icmp/icmp6.cpp
- Revision:
- 57:e0fb648acf48
- Parent:
- 49:1a6336f2b3f9
- Child:
- 59:e0e556c8bd46
--- a/ip6/icmp/icmp6.cpp Tue Nov 14 17:43:08 2017 +0000
+++ b/ip6/icmp/icmp6.cpp Tue Nov 28 17:05:46 2017 +0000
@@ -1,14 +1,15 @@
-#include "mbed.h"
-#include "log.h"
-#include "net.h"
-#include "action.h"
-#include "ns.h"
-#include "ra.h"
-#include "rs.h"
-#include "ip.h"
+#include "mbed.h"
+#include "log.h"
+#include "net.h"
+#include "action.h"
+#include "ns.h"
+#include "ra.h"
+#include "rs.h"
+#include "ip.h"
#include "ip6addr.h"
-#include "slaac.h"
-#include "echo6.h"
+#include "slaac.h"
+#include "echo6.h"
+#include "dest6.h"
#define HEADER_LENGTH 4
__packed struct header
@@ -31,12 +32,12 @@
case 1: Log ("Destination unreacheable" ); break;
case 128: Log ("Echo Request" ); break;
case 129: Log ("Echo Reply" ); break;
- case 133: Log ("Router solicit" ); break;
- case 134: Log ("Router advertisement" ); break;
- case 135: Log ("Neighbour solicit" ); break;
- case 136: Log ("Neighbour advertisement"); break;
- case 137: Log ("Redirect" ); break;
- default: LogF("Unknown type %u", type ); break;
+ case 133: Log ("Router solicit" ); break;
+ case 134: Log ("Router advertisement" ); break;
+ case 135: Log ("Neighbour solicit" ); break;
+ case 136: Log ("Neighbour advertisement" ); break;
+ case 137: Log ("Redirect" ); break;
+ default: LogF("Unknown type %u", type ); break;
}
}
static uint16_t calculateChecksum(char* pSrcIp, char* pDstIp, int size, void* pPacket)
@@ -113,6 +114,9 @@
int action = DO_NOTHING;
switch (type)
{
+ case 1: //Destination unreacheable
+ action = Dest6HandleRequest(trace, &type, &code);
+ break;
case 128: //Echo request - Ping
action = Echo6HandleRequest(trace, &type, &code);
break;