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/slaac.cpp
- Revision:
- 10:f0854784e960
- Parent:
- 7:b794780e33b4
- Child:
- 13:9cd54f7db57a
diff -r 91dae5300a4d -r f0854784e960 ip6/slaac.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ip6/slaac.cpp Sun Apr 16 14:21:55 2017 +0000 @@ -0,0 +1,24 @@ +#include "eth.h" + +char SlaacLinkLocalIp[16]; + +void SlaacInit() +{ + char* p = SlaacLinkLocalIp; + *p++ = 0xFE; + *p++ = 0x80; + *p++ = 0x00; + *p++ = 0x00; + *p++ = 0x00; + *p++ = 0x00; + *p++ = 0x00; + *p++ = 0x00; + *p++ = EthLocalMac[0] | 0x02; //Modified EUI-64 + *p++ = EthLocalMac[1]; + *p++ = EthLocalMac[2]; + *p++ = 0xFF; + *p++ = 0xFE; + *p++ = EthLocalMac[3]; + *p++ = EthLocalMac[4]; + *p++ = EthLocalMac[5]; +} \ No newline at end of file