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
Diff: eth/eth.cpp
- Revision:
- 43:bc028d5a6424
- Parent:
- 42:222a4f45f916
- Child:
- 44:83ce5ace337b
diff -r 222a4f45f916 -r bc028d5a6424 eth/eth.cpp --- a/eth/eth.cpp Sun Oct 15 17:54:09 2017 +0000 +++ b/eth/eth.cpp Thu Oct 19 20:56:58 2017 +0000 @@ -48,10 +48,26 @@ void LogHeader(struct header* pHeader) { char text[20]; - Log("ETH header\r\n"); - MacToString(pHeader->dst, sizeof(text), text); LogF(" Destination: %s\r\n", text); - MacToString(pHeader->src, sizeof(text), text); LogF(" Source: %s\r\n", text); - EthProtocolToString(NetToHost16(pHeader->typ), sizeof(text), text); LogF(" EtherType: %s\r\n", text); + if (NetTraceVerbose) + { + Log ("ETH header\r\n"); + MacToString(pHeader->dst, sizeof(text), text); LogF(" Destination: %s\r\n", text); + MacToString(pHeader->src, sizeof(text), text); LogF(" Source: %s\r\n", text); + EthProtocolToString(NetToHost16(pHeader->typ), sizeof(text), text); LogF(" EtherType: %s\r\n", text); + } + else + { + Log("ETH header "); + EthProtocolToString(NetToHost16(pHeader->typ), sizeof(text), text); + Log(text); + Log(" "); + MacToString(pHeader->src, sizeof(text), text); + Log(text); + Log(" >>> "); + MacToString(pHeader->dst, sizeof(text), text); + Log(text); + Log("\r\n"); + } } static void (*pTraceBack)(void); static void* tracePacket;