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: ip.cpp
- Revision:
- 47:73af5c0b0dc2
- Parent:
- 33:714a0345e59b
--- a/ip.cpp Tue Oct 24 07:01:35 2017 +0000 +++ b/ip.cpp Thu Oct 26 14:50:24 2017 +0000 @@ -1,7 +1,8 @@ #include "mbed.h" +#include "log.h" #include "ip.h" -void IpProtocolToString(uint8_t protocol, int size, char* text) +void IpProtocolString(uint8_t protocol, int size, char* text) { switch (protocol) { @@ -14,3 +15,16 @@ default: snprintf(text, size, "%d", protocol); break; } } +void IpProtocolLog(uint8_t protocol) +{ + switch (protocol) + { + case ICMP: Log("ICMP" ); break; + case IGMP: Log("IGMP" ); break; + case ICMP6: Log("ICMP6" ); break; + case TCP: Log("TCP" ); break; + case UDP: Log("UDP" ); break; + case IP6IN4: Log("IP6IN4"); break; + default: LogF("%d", protocol); break; + } +}