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

Committer:
andrewboyson
Date:
2017-04-16
Revision:
10:f0854784e960
Parent:
slaac.cpp@ 7:b794780e33b4
Child:
13:9cd54f7db57a

File content as of revision 10:f0854784e960:

#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];
}