slaac.c File Reference

IPv6 Stateless Address Autoconfiguration. More...

#include "core/net.h"
#include "core/ethernet.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_misc.h"
#include "ipv6/slaac.h"
#include "ipv6/ndp.h"
#include "ipv6/ndp_misc.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   SLAAC_TRACE_LEVEL
 

Functions

void slaacGetDefaultSettings (SlaacSettings *settings)
 Initialize settings with default values. More...
 
error_t slaacInit (SlaacContext *context, const SlaacSettings *settings)
 SLAAC initialization. More...
 
error_t slaacStart (SlaacContext *context)
 Start SLAAC process. More...
 
error_t slaacStop (SlaacContext *context)
 Stop SLAAC process. More...
 
void slaacLinkChangeEvent (SlaacContext *context)
 Callback function for link change event. More...
 
void slaacParseRouterAdv (SlaacContext *context, NdpRouterAdvMessage *message, size_t length)
 Parse Router Advertisement message. More...
 
void slaacParsePrefixInfoOption (SlaacContext *context, NdpPrefixInfoOption *option)
 Parse Prefix Information Option. More...
 
error_t slaacGenerateLinkLocalAddr (SlaacContext *context)
 Generate a link-local address. More...
 
void slaacDumpConfig (SlaacContext *context)
 Dump IPv6 configuration for debugging purpose. More...
 

Detailed Description

IPv6 Stateless Address Autoconfiguration.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Description

Stateless Address Autoconfiguration is a facility to allow devices to configure themselves independently. Refer to the following RFCs for complete details:

  • RFC 4862: IPv6 Stateless Address Autoconfiguration
  • RFC 6106: IPv6 Router Advertisement Options for DNS Configuration
Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file slaac.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   SLAAC_TRACE_LEVEL

Definition at line 38 of file slaac.c.

Function Documentation

◆ slaacDumpConfig()

void slaacDumpConfig ( SlaacContext context)

Dump IPv6 configuration for debugging purpose.

Parameters
[in]contextPointer to the SLAAC context

Definition at line 614 of file slaac.c.

◆ slaacGenerateLinkLocalAddr()

error_t slaacGenerateLinkLocalAddr ( SlaacContext context)

Generate a link-local address.

Parameters
[in]contextPointer to the SLAAC context
Returns
Error code

Definition at line 563 of file slaac.c.

◆ slaacGetDefaultSettings()

void slaacGetDefaultSettings ( SlaacSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure that contains SLAAC settings

Definition at line 59 of file slaac.c.

◆ slaacInit()

error_t slaacInit ( SlaacContext context,
const SlaacSettings settings 
)

SLAAC initialization.

Parameters
[in]contextPointer to the SLAAC context
[in]settingsSLAAC specific settings
Returns
Error code

Definition at line 80 of file slaac.c.

◆ slaacLinkChangeEvent()

void slaacLinkChangeEvent ( SlaacContext context)

Callback function for link change event.

Parameters
[in]contextPointer to the SLAAC context

Definition at line 200 of file slaac.c.

◆ slaacParsePrefixInfoOption()

void slaacParsePrefixInfoOption ( SlaacContext context,
NdpPrefixInfoOption option 
)

Parse Prefix Information Option.

Parameters
[in]contextPointer to the SLAAC context
[in]optionPointer to the Prefix Information option

Definition at line 343 of file slaac.c.

◆ slaacParseRouterAdv()

void slaacParseRouterAdv ( SlaacContext context,
NdpRouterAdvMessage message,
size_t  length 
)

Parse Router Advertisement message.

Parameters
[in]contextPointer to the SLAAC context
[in]messagePointer to the Router Advertisement message
[in]lengthLength of the message, in bytes

Definition at line 250 of file slaac.c.

◆ slaacStart()

error_t slaacStart ( SlaacContext context)

Start SLAAC process.

Parameters
[in]contextPointer to the SLAAC context
Returns
Error code

Definition at line 120 of file slaac.c.

◆ slaacStop()

error_t slaacStop ( SlaacContext context)

Stop SLAAC process.

Parameters
[in]contextPointer to the SLAAC context
Returns
Error code

Definition at line 172 of file slaac.c.