dhcpv6_client_fsm.c File Reference

DHCPv6 client finite state machine. More...

#include "core/net.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_misc.h"
#include "dhcpv6/dhcpv6_client.h"
#include "dhcpv6/dhcpv6_client_fsm.h"
#include "dhcpv6/dhcpv6_client_misc.h"
#include "dhcpv6/dhcpv6_common.h"
#include "dhcpv6/dhcpv6_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   DHCPV6_TRACE_LEVEL
 

Functions

void dhcpv6ClientStateInit (Dhcpv6ClientContext *context)
 INIT state. More...
 
void dhcpv6ClientStateSolicit (Dhcpv6ClientContext *context)
 SOLICIT state. More...
 
void dhcpv6ClientStateRequest (Dhcpv6ClientContext *context)
 REQUEST state. More...
 
void dhcpv6ClientStateInitConfirm (Dhcpv6ClientContext *context)
 INIT-CONFIRM state. More...
 
void dhcpv6ClientStateConfirm (Dhcpv6ClientContext *context)
 CONFIRM state. More...
 
void dhcpv6ClientStateDad (Dhcpv6ClientContext *context)
 DAD state. More...
 
void dhcpv6ClientStateBound (Dhcpv6ClientContext *context)
 BOUND state. More...
 
void dhcpv6ClientStateRenew (Dhcpv6ClientContext *context)
 RENEW state. More...
 
void dhcpv6ClientStateRebind (Dhcpv6ClientContext *context)
 REBIND state. More...
 
void dhcpv6ClientStateRelease (Dhcpv6ClientContext *context)
 RELEASE state. More...
 
void dhcpv6ClientStateDecline (Dhcpv6ClientContext *context)
 DECLINE state. More...
 

Detailed Description

DHCPv6 client finite state machine.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file dhcpv6_client_fsm.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   DHCPV6_TRACE_LEVEL

Definition at line 32 of file dhcpv6_client_fsm.c.

Function Documentation

◆ dhcpv6ClientStateBound()

void dhcpv6ClientStateBound ( Dhcpv6ClientContext context)

BOUND state.

Client has a valid lease and is in its normal operating state

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 459 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateConfirm()

void dhcpv6ClientStateConfirm ( Dhcpv6ClientContext context)

CONFIRM state.

Whenever a client may have moved to a new link, the prefixes from the addresses assigned to the interfaces on that link may no longer be appropriate for the link to which the client is attached. In such the client must initiate a Confirm/Reply message exchange

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 316 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateDad()

void dhcpv6ClientStateDad ( Dhcpv6ClientContext context)

DAD state.

The client perform duplicate address detection on each of the addresses in any IAs it receives in the Reply message before using that address for traffic

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 405 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateDecline()

void dhcpv6ClientStateDecline ( Dhcpv6ClientContext context)

DECLINE state.

If a client detects that one or more addresses assigned to it by a server are already in use by another node, the client sends a Decline message to the server to inform it that the address is suspect

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 762 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateInit()

void dhcpv6ClientStateInit ( Dhcpv6ClientContext context)

INIT state.

This is the initialization state, where a client begins the process of acquiring a lease. It also returns here when a lease ends, or when a lease negotiation fails

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 59 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateInitConfirm()

void dhcpv6ClientStateInitConfirm ( Dhcpv6ClientContext context)

INIT-CONFIRM state.

When a client that already has a valid lease starts up after a power-down or reboot, it starts here instead of the INIT state

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 269 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateRebind()

void dhcpv6ClientStateRebind ( Dhcpv6ClientContext context)

REBIND state.

The client sends a Rebind message to any available server to extend the lifetimes on the addresses assigned to the client and to update other configuration parameters. This message is sent after a client receives no response to a Renew message

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 600 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateRelease()

void dhcpv6ClientStateRelease ( Dhcpv6ClientContext context)

RELEASE state.

To release one or more addresses, a client sends a Release message to the server

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 692 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateRenew()

void dhcpv6ClientStateRenew ( Dhcpv6ClientContext context)

RENEW state.

The client sends a Renew message to the server that originally provided the client's addresses and configuration parameters to extend the lifetimes on the addresses assigned to the client and to update other configuration parameters

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 506 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateRequest()

void dhcpv6ClientStateRequest ( Dhcpv6ClientContext context)

REQUEST state.

The client uses a Request message to populate IAs with addresses and obtain other configuration information. The client includes one or more more IA options in the Request message. The server then returns addresses and other information about the IAs to the client in IA options in a Reply message

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 191 of file dhcpv6_client_fsm.c.

◆ dhcpv6ClientStateSolicit()

void dhcpv6ClientStateSolicit ( Dhcpv6ClientContext context)

SOLICIT state.

A client uses the Solicit message to discover DHCPv6 servers

Parameters
[in]contextPointer to the DHCPv6 client context

Definition at line 106 of file dhcpv6_client_fsm.c.