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/ndp/ra.cpp
- Revision:
- 47:73af5c0b0dc2
- Parent:
- 46:40d33e9037e4
--- a/ip6/icmp/ndp/ra.cpp Tue Oct 24 07:01:35 2017 +0000
+++ b/ip6/icmp/ndp/ra.cpp Thu Oct 26 14:50:24 2017 +0000
@@ -18,7 +18,7 @@
uint32_t reachable;
uint32_t retrans;
};
-void logHeader(struct header* pHeader)
+void logHeader(struct header* pHeader, char* pData, int dataLength)
{
if (NetTraceVerbose)
{
@@ -28,10 +28,13 @@
LogF(" Lifetime %d\r\n", NetToHost16(pHeader->lifetime));
LogF(" Reachable %d\r\n", NetToHost32(pHeader->reachable));
LogF(" Retrans %d\r\n", NetToHost32(pHeader->retrans));
+ NdpLogOptionsVerbose(pData, dataLength);
}
else
{
- Log("RA header\r\n");
+ Log("RA header");
+ NdpLogOptionsQuiet(pData, dataLength);
+ Log("\r\n");
}
}
int RaHandleReceivedAdvertisement(void (*traceback)(void), void* pPacket, int* pSize)
@@ -40,20 +43,19 @@
char* pData = (char*)pHeader + sizeof(struct header);
int dataLength = *pSize - sizeof(struct header);
- NdpHopLimit = pHeader->hop;
- NdpManagedAddressConfiguration = pHeader->mo & 0x80;
- NdpOtherConfiguration = pHeader->mo & 0x40;
- NdpLifetime = NetToHost16(pHeader->lifetime);
+ NdpHopLimit = pHeader->hop;
+ NdpManagedConfiguration = pHeader->mo & 0x80;
+ NdpOtherConfiguration = pHeader->mo & 0x40;
+ NdpLifetime = NetToHost16(pHeader->lifetime);
if (RaTrace)
{
if (NetTraceNewLine) Log("\r\n");
LogTimeF("NDP received router advertise\r\n");
if (NetTraceStack) traceback();
- logHeader(pHeader);
- NdpLogOptions(pData, dataLength);
+ logHeader(pHeader, pData, dataLength);
}
- NdpDecodeOptions(pData, dataLength);
+ NdpDecodeOptions(pData, dataLength, NdpRouterMac, NULL);
NdpElapsedTime = 0;