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: ip6/ip6addr.c
- Revision:
- 143:8cec8f08dc54
- Parent:
- 136:8a65abb0dc63
- Child:
- 171:f708d6776752
--- a/ip6/ip6addr.c Wed May 08 12:15:13 2019 +0000 +++ b/ip6/ip6addr.c Thu May 09 07:47:12 2019 +0000 @@ -31,9 +31,9 @@ *pAdded = true; } } -int Ip6AddressToString(char* pIp, int size, char* pText) +int Ip6AddressToString(const char* pIp, int size, char* pText) { - char* pIpE = pIp + 16; + const char* pIpE = pIp + 16; char* p = pText; while (true) { @@ -66,10 +66,10 @@ *pAdded = true; } } -int Ip6AddressLog(char* pIp) +int Ip6AddressLog(const char* pIp) { int count = 0; - char* pIpE = pIp + 16; + const char* pIpE = pIp + 16; while (true) { bool added = false; @@ -100,10 +100,10 @@ *pAdded = true; } } -int Ip6AddressHttp(char* pIp) +int Ip6AddressHttp(const char* pIp) { int count = 0; - char* pIpE = pIp + 16; + const char* pIpE = pIp + 16; while (true) { bool added = false; @@ -131,7 +131,7 @@ memcpy(ipTo, ipFrom, 16); } -bool Ip6AddrIsSolicited(char* p) +bool Ip6AddrIsSolicited(const char* p) { if (*p++ != 0xff) return false; if (*p++ != 0x02) return false; @@ -155,11 +155,11 @@ return true; } -bool Ip6AddrIsMulticast(char *p) +bool Ip6AddrIsMulticast(const char *p) { return *p == 0xFF; } -bool Ip6AddrIsSameGroup(char* pA, char* pB) +bool Ip6AddrIsSameGroup(const char* pA, const char* pB) { pA += 13; pB += 13;