Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
dhcpv6.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
10
11#ifndef ZEPHYR_INCLUDE_NET_DHCPV6_H_
12#define ZEPHYR_INCLUDE_NET_DHCPV6_H_
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
26
28
30enum net_dhcpv6_state {
31 NET_DHCPV6_DISABLED,
32 NET_DHCPV6_INIT,
33 NET_DHCPV6_SOLICITING,
34 NET_DHCPV6_REQUESTING,
35 NET_DHCPV6_CONFIRMING,
36 NET_DHCPV6_RENEWING,
37 NET_DHCPV6_REBINDING,
38 NET_DHCPV6_INFO_REQUESTING,
39 NET_DHCPV6_BOUND,
40} __packed;
41
42#define DHCPV6_TID_SIZE 3
43
44#ifdef CONFIG_NET_DHCPV6_DUID_MAX_LEN
45#define NET_DHCPV6_DUID_MAX_LEN CONFIG_NET_DHCPV6_DUID_MAX_LEN
46#else
47#define NET_DHCPV6_DUID_MAX_LEN 22
48#endif
49
50struct net_dhcpv6_duid_raw {
51 uint16_t type;
52 uint8_t buf[NET_DHCPV6_DUID_MAX_LEN];
53} __packed;
54
55struct net_dhcpv6_duid_storage {
56 struct net_dhcpv6_duid_raw duid;
57 uint8_t length;
58};
59
60#ifdef CONFIG_NET_DHCPV6_MAX_DOWNSTREAM
61#define NET_DHCPV6_MAX_DOWNSTREAM CONFIG_NET_DHCPV6_MAX_DOWNSTREAM
62#else
63#define NET_DHCPV6_MAX_DOWNSTREAM 1
64#endif
65
66struct net_if;
67
69
72 bool request_addr : 1;
73 bool request_prefix : 1;
89 int downstream_ifaces[NET_DHCPV6_MAX_DOWNSTREAM];
90};
91
103void net_dhcpv6_start(struct net_if *iface, struct net_dhcpv6_params *params);
104
114void net_dhcpv6_stop(struct net_if *iface);
115
124void net_dhcpv6_restart(struct net_if *iface);
125
127
133const char *net_dhcpv6_state_name(enum net_dhcpv6_state state);
134
136
140
141#ifdef __cplusplus
142}
143#endif
144
145#endif /* ZEPHYR_INCLUDE_NET_DHCPV6_H_ */
void net_dhcpv6_restart(struct net_if *iface)
Restart DHCPv6 client on an iface.
void net_dhcpv6_start(struct net_if *iface, struct net_dhcpv6_params *params)
Start DHCPv6 client on an iface.
void net_dhcpv6_stop(struct net_if *iface)
Stop DHCPv6 client on an iface.
state
Definition parser_state.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
DHCPv6 client configuration parameters.
Definition dhcpv6.h:71
uint8_t downstream_count
Number of valid entries in downstream_ifaces.
Definition dhcpv6.h:75
bool request_addr
Request IPv6 address.
Definition dhcpv6.h:72
int downstream_ifaces[NET_DHCPV6_MAX_DOWNSTREAM]
Optional downstream interface indices.
Definition dhcpv6.h:89
bool request_prefix
Request IPv6 prefix.
Definition dhcpv6.h:73
Network Interface structure.
Definition net_if.h:764