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: net.cpp
- Revision:
- 57:e0fb648acf48
- Parent:
- 52:fbc5a46b5e16
- Child:
- 59:e0e556c8bd46
diff -r 35117a8b5c65 -r e0fb648acf48 net.cpp --- a/net.cpp Tue Nov 14 17:43:08 2017 +0000 +++ b/net.cpp Tue Nov 28 17:05:46 2017 +0000 @@ -12,11 +12,35 @@ #include "ndp.h" #include "ntp.h" #include "io.h" - +#include "tftp.h" bool NetTraceStack = false; bool NetTraceNewLine = false; bool NetTraceVerbose = false; + +static bool hostMatched = false; +char NetTraceHost[] = { 0, 0 }; +bool NetTraceHostGetMatched() +{ + return hostMatched; +} +void NetTraceHostResetMatched() +{ + hostMatched = false; +} +void NetTraceHostCheckIp6(char* ip) +{ + if (!ip[0]) return; + if (NetTraceHost[0] != ip[14]) return; + if (NetTraceHost[1] != ip[15]) return; + hostMatched = true; +} +void NetTraceHostCheckMac(char* mac) +{ + if (NetTraceHost[0] != mac[4]) return; + if (NetTraceHost[1] != mac[5]) return; + hostMatched = true; +} bool NetPreferIp4Polled = false; char* NetName4; @@ -106,14 +130,15 @@ } int NetMain() { - PhyMain(); - TcbMain(); - Ar4Main(); - Ar6Main(); - Nr4Main(); - Nr6Main(); + PhyMain(); + TcbMain(); + Ar4Main(); + Ar6Main(); + Nr4Main(); + Nr6Main(); DhcpMain(); - DnsMain(); - NdpMain(); + DnsMain(); + NdpMain(); + TftpMain(); return 0; } \ No newline at end of file