dhcpv6_client.h File Reference

DHCPv6 client (Dynamic Host Configuration Protocol for IPv6) More...

#include "dhcpv6/dhcpv6_common.h"
#include "core/socket.h"

Go to the source code of this file.

Data Structures

struct  Dhcpv6ClientSettings
 DHCPv6 client settings. More...
 
struct  Dhcpv6ClientAddrEntry
 IA address entry. More...
 
struct  Dhcpv6ClientIa
 Client's IA (Identity Association) More...
 
struct  _Dhcpv6ClientContext
 DHCPv6 client context. More...
 

Macros

#define DHCPV6_CLIENT_SUPPORT   DISABLED
 
#define DHCPV6_CLIENT_TICK_INTERVAL   200
 
#define DHCPV6_CLIENT_ADDR_LIST_SIZE   2
 
#define DHCPV6_CLIENT_SOL_MAX_DELAY   1000
 
#define DHCPV6_CLIENT_SOL_TIMEOUT   1000
 
#define DHCPV6_CLIENT_SOL_MAX_RT   120000
 
#define DHCPV6_CLIENT_REQ_TIMEOUT   1000
 
#define DHCPV6_CLIENT_REQ_MAX_RT   30000
 
#define DHCPV6_CLIENT_REQ_MAX_RC   10
 
#define DHCPV6_CLIENT_CNF_MAX_DELAY   1000
 
#define DHCPV6_CLIENT_CNF_TIMEOUT   1000
 
#define DHCPV6_CLIENT_CNF_MAX_RT   4000
 
#define DHCPV6_CLIENT_CNF_MAX_RD   10000
 
#define DHCPV6_CLIENT_REN_TIMEOUT   10000
 
#define DHCPV6_CLIENT_REN_MAX_RT   600000
 
#define DHCPV6_CLIENT_REB_TIMEOUT   10000
 
#define DHCPV6_CLIENT_REB_MAX_RT   600000
 
#define DHCPV6_CLIENT_INF_MAX_DELAY   1000
 
#define DHCPV6_CLIENT_INF_TIMEOUT   1000
 
#define DHCPV6_CLIENT_INF_MAX_RT   120000
 
#define DHCPV6_CLIENT_REL_TIMEOUT   1000
 
#define DHCPV6_CLIENT_REL_MAX_RC   5
 
#define DHCPV6_CLIENT_DEC_TIMEOUT   1000
 
#define DHCPV6_CLIENT_DEC_MAX_RC   5
 
#define DHCPV6_CLIENT_REC_TIMEOUT   2000
 
#define DHCPV6_CLIENT_REC_MAX_RC   8
 
#define DHCPV6_CLIENT_PRIVATE_CONTEXT
 
#define Dhcpv6ClientContext   struct _Dhcpv6ClientContext
 

Typedefs

typedef void(* Dhcpv6TimeoutCallback) (Dhcpv6ClientContext *context, NetInterface *interface)
 DHCPv6 configuration timeout callback. More...
 
typedef void(* Dhcpv6LinkChangeCallback) (Dhcpv6ClientContext *context, NetInterface *interface, bool_t linkState)
 Link state change callback. More...
 
typedef void(* Dhcpv6StateChangeCallback) (Dhcpv6ClientContext *context, NetInterface *interface, Dhcpv6State state)
 FSM state change callback. More...
 
typedef void(* Dhcpv6AddOptionsCallback) (Dhcpv6ClientContext *context, Dhcpv6Message *message, size_t *length)
 Add DHCPv6 options callback. More...
 
typedef void(* Dhcpv6ParseOptionsCallback) (Dhcpv6ClientContext *context, const Dhcpv6Message *message, size_t length)
 Parse DHCPv6 options callback. More...
 

Enumerations

enum  Dhcpv6State {
  DHCPV6_STATE_INIT = 0, DHCPV6_STATE_SOLICIT = 1, DHCPV6_STATE_REQUEST = 2, DHCPV6_STATE_INIT_CONFIRM = 3,
  DHCPV6_STATE_CONFIRM = 4, DHCPV6_STATE_DAD = 5, DHCPV6_STATE_BOUND = 6, DHCPV6_STATE_RENEW = 7,
  DHCPV6_STATE_REBIND = 8, DHCPV6_STATE_RELEASE = 9, DHCPV6_STATE_DECLINE = 10
}
 DHCPv6 client FSM states. More...
 

Functions

void dhcpv6ClientGetDefaultSettings (Dhcpv6ClientSettings *settings)
 Initialize settings with default values. More...
 
error_t dhcpv6ClientInit (Dhcpv6ClientContext *context, const Dhcpv6ClientSettings *settings)
 DHCPv6 client initialization. More...
 
error_t dhcpv6ClientStart (Dhcpv6ClientContext *context)
 Start DHCPv6 client. More...
 
error_t dhcpv6ClientStop (Dhcpv6ClientContext *context)
 Stop DHCPv6 client. More...
 
error_t dhcpv6ClientRelease (Dhcpv6ClientContext *context)
 Release DHCPv6 lease. More...
 
Dhcpv6State dhcpv6ClientGetState (Dhcpv6ClientContext *context)
 Retrieve current state. More...
 

Detailed Description

DHCPv6 client (Dynamic Host Configuration Protocol for IPv6)

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.4

Definition in file dhcpv6_client.h.

Macro Definition Documentation

◆ DHCPV6_CLIENT_ADDR_LIST_SIZE

#define DHCPV6_CLIENT_ADDR_LIST_SIZE   2

Definition at line 54 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_CNF_MAX_DELAY

#define DHCPV6_CLIENT_CNF_MAX_DELAY   1000

Definition at line 103 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_CNF_MAX_RD

#define DHCPV6_CLIENT_CNF_MAX_RD   10000

Definition at line 124 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_CNF_MAX_RT

#define DHCPV6_CLIENT_CNF_MAX_RT   4000

Definition at line 117 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_CNF_TIMEOUT

#define DHCPV6_CLIENT_CNF_TIMEOUT   1000

Definition at line 110 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_DEC_MAX_RC

#define DHCPV6_CLIENT_DEC_MAX_RC   5

Definition at line 201 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_DEC_TIMEOUT

#define DHCPV6_CLIENT_DEC_TIMEOUT   1000

Definition at line 194 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_INF_MAX_DELAY

#define DHCPV6_CLIENT_INF_MAX_DELAY   1000

Definition at line 159 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_INF_MAX_RT

#define DHCPV6_CLIENT_INF_MAX_RT   120000

Definition at line 173 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_INF_TIMEOUT

#define DHCPV6_CLIENT_INF_TIMEOUT   1000

Definition at line 166 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_PRIVATE_CONTEXT

#define DHCPV6_CLIENT_PRIVATE_CONTEXT

Definition at line 222 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REB_MAX_RT

#define DHCPV6_CLIENT_REB_MAX_RT   600000

Definition at line 152 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REB_TIMEOUT

#define DHCPV6_CLIENT_REB_TIMEOUT   10000

Definition at line 145 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REC_MAX_RC

#define DHCPV6_CLIENT_REC_MAX_RC   8

Definition at line 215 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REC_TIMEOUT

#define DHCPV6_CLIENT_REC_TIMEOUT   2000

Definition at line 208 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REL_MAX_RC

#define DHCPV6_CLIENT_REL_MAX_RC   5

Definition at line 187 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REL_TIMEOUT

#define DHCPV6_CLIENT_REL_TIMEOUT   1000

Definition at line 180 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REN_MAX_RT

#define DHCPV6_CLIENT_REN_MAX_RT   600000

Definition at line 138 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REN_TIMEOUT

#define DHCPV6_CLIENT_REN_TIMEOUT   10000

Definition at line 131 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REQ_MAX_RC

#define DHCPV6_CLIENT_REQ_MAX_RC   10

Definition at line 96 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REQ_MAX_RT

#define DHCPV6_CLIENT_REQ_MAX_RT   30000

Definition at line 89 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_REQ_TIMEOUT

#define DHCPV6_CLIENT_REQ_TIMEOUT   1000

Definition at line 82 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_SOL_MAX_DELAY

#define DHCPV6_CLIENT_SOL_MAX_DELAY   1000

Definition at line 61 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_SOL_MAX_RT

#define DHCPV6_CLIENT_SOL_MAX_RT   120000

Definition at line 75 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_SOL_TIMEOUT

#define DHCPV6_CLIENT_SOL_TIMEOUT   1000

Definition at line 68 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_SUPPORT

#define DHCPV6_CLIENT_SUPPORT   DISABLED

Definition at line 40 of file dhcpv6_client.h.

◆ DHCPV6_CLIENT_TICK_INTERVAL

#define DHCPV6_CLIENT_TICK_INTERVAL   200

Definition at line 47 of file dhcpv6_client.h.

◆ Dhcpv6ClientContext

#define Dhcpv6ClientContext   struct _Dhcpv6ClientContext

Definition at line 227 of file dhcpv6_client.h.

Typedef Documentation

◆ Dhcpv6AddOptionsCallback

typedef void(* Dhcpv6AddOptionsCallback) (Dhcpv6ClientContext *context, Dhcpv6Message *message, size_t *length)

Add DHCPv6 options callback.

Definition at line 283 of file dhcpv6_client.h.

◆ Dhcpv6LinkChangeCallback

typedef void(* Dhcpv6LinkChangeCallback) (Dhcpv6ClientContext *context, NetInterface *interface, bool_t linkState)

Link state change callback.

Definition at line 267 of file dhcpv6_client.h.

◆ Dhcpv6ParseOptionsCallback

typedef void(* Dhcpv6ParseOptionsCallback) (Dhcpv6ClientContext *context, const Dhcpv6Message *message, size_t length)

Parse DHCPv6 options callback.

Definition at line 291 of file dhcpv6_client.h.

◆ Dhcpv6StateChangeCallback

typedef void(* Dhcpv6StateChangeCallback) (Dhcpv6ClientContext *context, NetInterface *interface, Dhcpv6State state)

FSM state change callback.

Definition at line 275 of file dhcpv6_client.h.

◆ Dhcpv6TimeoutCallback

typedef void(* Dhcpv6TimeoutCallback) (Dhcpv6ClientContext *context, NetInterface *interface)

DHCPv6 configuration timeout callback.

Definition at line 259 of file dhcpv6_client.h.

Enumeration Type Documentation

◆ Dhcpv6State

DHCPv6 client FSM states.

Enumerator
DHCPV6_STATE_INIT 
DHCPV6_STATE_SOLICIT 
DHCPV6_STATE_REQUEST 
DHCPV6_STATE_INIT_CONFIRM 
DHCPV6_STATE_CONFIRM 
DHCPV6_STATE_DAD 
DHCPV6_STATE_BOUND 
DHCPV6_STATE_RENEW 
DHCPV6_STATE_REBIND 
DHCPV6_STATE_RELEASE 
DHCPV6_STATE_DECLINE 

Definition at line 239 of file dhcpv6_client.h.

Function Documentation

◆ dhcpv6ClientGetDefaultSettings()

void dhcpv6ClientGetDefaultSettings ( Dhcpv6ClientSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure that contains DHCPv6 client settings

Definition at line 59 of file dhcpv6_client.c.

◆ dhcpv6ClientGetState()

Dhcpv6State dhcpv6ClientGetState ( Dhcpv6ClientContext context)

Retrieve current state.

Parameters
[in]contextPointer to the DHCPv6 client context
Returns
Current DHCPv6 client state

Definition at line 325 of file dhcpv6_client.c.

◆ dhcpv6ClientInit()

error_t dhcpv6ClientInit ( Dhcpv6ClientContext context,
const Dhcpv6ClientSettings settings 
)

DHCPv6 client initialization.

Parameters
[in]contextPointer to the DHCPv6 client context
[in]settingsDHCPv6 client specific settings
Returns
Error code

Definition at line 92 of file dhcpv6_client.c.

◆ dhcpv6ClientRelease()

error_t dhcpv6ClientRelease ( Dhcpv6ClientContext context)

Release DHCPv6 lease.

Parameters
[in]contextPointer to the DHCPv6 client context
Returns
Error code

Definition at line 259 of file dhcpv6_client.c.

◆ dhcpv6ClientStart()

error_t dhcpv6ClientStart ( Dhcpv6ClientContext context)

Start DHCPv6 client.

Parameters
[in]contextPointer to the DHCPv6 client context
Returns
Error code

Definition at line 142 of file dhcpv6_client.c.

◆ dhcpv6ClientStop()

error_t dhcpv6ClientStop ( Dhcpv6ClientContext context)

Stop DHCPv6 client.

Parameters
[in]contextPointer to the DHCPv6 client context
Returns
Error code

Definition at line 216 of file dhcpv6_client.c.