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
slaac.cpp@7:b794780e33b4, 2017-03-12 (annotated)
- Committer:
- andrewboyson
- Date:
- Sun Mar 12 13:56:08 2017 +0000
- Revision:
- 7:b794780e33b4
Added IPv6 support which is partially working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 7:b794780e33b4 | 1 | #include "eth.h" |
andrewboyson | 7:b794780e33b4 | 2 | |
andrewboyson | 7:b794780e33b4 | 3 | char SlaacLinkLocalIp[16]; |
andrewboyson | 7:b794780e33b4 | 4 | |
andrewboyson | 7:b794780e33b4 | 5 | void SlaacInit() |
andrewboyson | 7:b794780e33b4 | 6 | { |
andrewboyson | 7:b794780e33b4 | 7 | char* p = SlaacLinkLocalIp; |
andrewboyson | 7:b794780e33b4 | 8 | *p++ = 0xFE; |
andrewboyson | 7:b794780e33b4 | 9 | *p++ = 0x80; |
andrewboyson | 7:b794780e33b4 | 10 | *p++ = 0x00; |
andrewboyson | 7:b794780e33b4 | 11 | *p++ = 0x00; |
andrewboyson | 7:b794780e33b4 | 12 | *p++ = 0x00; |
andrewboyson | 7:b794780e33b4 | 13 | *p++ = 0x00; |
andrewboyson | 7:b794780e33b4 | 14 | *p++ = 0x00; |
andrewboyson | 7:b794780e33b4 | 15 | *p++ = 0x00; |
andrewboyson | 7:b794780e33b4 | 16 | *p++ = EthLocalMac[0] | 0x02; //Modified EUI-64 |
andrewboyson | 7:b794780e33b4 | 17 | *p++ = EthLocalMac[1]; |
andrewboyson | 7:b794780e33b4 | 18 | *p++ = EthLocalMac[2]; |
andrewboyson | 7:b794780e33b4 | 19 | *p++ = 0xFF; |
andrewboyson | 7:b794780e33b4 | 20 | *p++ = 0xFE; |
andrewboyson | 7:b794780e33b4 | 21 | *p++ = EthLocalMac[3]; |
andrewboyson | 7:b794780e33b4 | 22 | *p++ = EthLocalMac[4]; |
andrewboyson | 7:b794780e33b4 | 23 | *p++ = EthLocalMac[5]; |
andrewboyson | 7:b794780e33b4 | 24 | } |