Addressing
72
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Network Addresses
5.3.2 IPv6 Addresses
To enable IPv6, the host application must configure an IPv6 LLA. Configuration of an IPv6 global address
is optional.
Example:
_u32 IfBitmap = 0;
_i16 Status;
IfBitmap = SL_NETCFG_IF_IPV6_STA_LOCAL | SL_NETCFG_IF_IPV6_STA_GLOBAL;
Status = sl_NetCfgSet(SL_NETCFG_IF,SL_NETCFG_IF_STATE,
sizeof
(IfBitmap),&IfBitmap);
if
( Status )
{
// error
}
5.3.2.1
Local Link
IPv6 local link must consist of the following prefix: Fe80::/64. The following IPv6 link-local acquisition
methods are allowed:
•
Stateless Auto Configuration –
The least significant 64 bits are filled with the device MAC address in
EUI-64 format. The Duplicate Address Detection (DAD) algorithm is used to verify that the address is
unique on the local link. When DAD failure occurs, this procedure continues with random numbers on
the least significant 64 bits.
Example:
_i16 Status;
Status = sl_NetCfgSet(SL_NETCFG_IPV6_ADDR_LOCAL,SL_NETCFG_ADDR_STATELESS,0,0);
if
( Status )
{
// error
}
•
Stateful (DHCPv6) –
IPv6 LLA is acquired from the DHCPv6 server. The DAD algorithm is used to
verify that the address is unique on the local link. When DAD failure occurs, stateless auto-
configuration is used instead.
Example:
_i16 Status;
Status = sl_NetCfgSet(SL_NETCFG_IPV6_ADDR_LOCAL,SL_NETCFG_ADDR_STATEFUL,0,0);
if
( Status )
{
// error
}
•
Static –
In this mode the IPv6 address of the device is preconfigured. The DAD algorithm is used to
verify that the address is unique on the local link. When DAD failure occurs the address is not valid,
and notification is sent to the host.
Example:
_i16 Status;
SlNetCfgIpV6Args_t ipV6;
memset(&ipV6, 0, sizeof(ipV6));
ipV6.Ip[0] = 0xfe800000;
ipV6.Ip[1] = 0x00000000;
ipV6.Ip[2] = 0x00004040;
ipV6.Ip[3] = 0x0000ce65;
Status = sl_NetCfgSet(SL_NETCFG_IPV6_ADDR_LOCAL,SL_NETCFG_ADDR_STATIC,
sizeof
(ipV6),(_u8*)&ipV6);
if
( Status )
{
// error