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
ip6/slaac.cpp@13:9cd54f7db57a, 2017-05-01 (annotated)
- Committer:
- andrewboyson
- Date:
- Mon May 01 18:20:55 2017 +0000
- Revision:
- 13:9cd54f7db57a
- Parent:
- 10:f0854784e960
- Child:
- 15:6ca6778168b1
Added ability to read DNS queries with encoded IP addresses
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 13:9cd54f7db57a | 1 | #include "mac.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 | 13:9cd54f7db57a | 16 | *p++ = MacLocal[0] | 0x02; //Modified EUI-64 |
andrewboyson | 13:9cd54f7db57a | 17 | *p++ = MacLocal[1]; |
andrewboyson | 13:9cd54f7db57a | 18 | *p++ = MacLocal[2]; |
andrewboyson | 7:b794780e33b4 | 19 | *p++ = 0xFF; |
andrewboyson | 7:b794780e33b4 | 20 | *p++ = 0xFE; |
andrewboyson | 13:9cd54f7db57a | 21 | *p++ = MacLocal[3]; |
andrewboyson | 13:9cd54f7db57a | 22 | *p++ = MacLocal[4]; |
andrewboyson | 13:9cd54f7db57a | 23 | *p++ = MacLocal[5]; |
andrewboyson | 7:b794780e33b4 | 24 | } |