net: dhcpv6: Move DHCPv6 files to lib directory

For consistency with DHCPv4.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2024-01-25 12:47:12 +01:00 committed by Henrik Brix Andersen
parent 19722aa8e8
commit cefc391db3
10 changed files with 38 additions and 17 deletions

View file

@ -31,7 +31,6 @@ zephyr_library_sources(net_tc.c)
zephyr_library_sources(icmp.c) zephyr_library_sources(icmp.c)
zephyr_library_sources_ifdef(CONFIG_NET_IP connection.c) zephyr_library_sources_ifdef(CONFIG_NET_IP connection.c)
zephyr_library_sources_ifdef(CONFIG_NET_6LO 6lo.c) zephyr_library_sources_ifdef(CONFIG_NET_6LO 6lo.c)
zephyr_library_sources_ifdef(CONFIG_NET_DHCPV6 dhcpv6.c)
zephyr_library_sources_ifdef(CONFIG_NET_IPV4_AUTO ipv4_autoconf.c) zephyr_library_sources_ifdef(CONFIG_NET_IPV4_AUTO ipv4_autoconf.c)
zephyr_library_sources_ifdef(CONFIG_NET_IPV4 icmpv4.c ipv4.c) zephyr_library_sources_ifdef(CONFIG_NET_IPV4 icmpv4.c ipv4.c)
zephyr_library_sources_ifdef(CONFIG_NET_IPV4_IGMP igmp.c) zephyr_library_sources_ifdef(CONFIG_NET_IPV4_IGMP igmp.c)

View file

@ -183,12 +183,6 @@ config NET_MAX_6LO_CONTEXTS
6lowpan context options table size. The value depends on your 6lowpan context options table size. The value depends on your
network and memory consumption. More 6CO options uses more memory. network and memory consumption. More 6CO options uses more memory.
config NET_DHCPV6
bool "DHCPv6 client"
select NET_MGMT
select NET_MGMT_EVENT
depends on NET_UDP
if NET_6LO if NET_6LO
module = NET_6LO module = NET_6LO
module-dep = NET_LOG module-dep = NET_LOG
@ -215,13 +209,5 @@ module-str = Log level for IPv6 neighbor cache
module-help = Enables IPv6 Neighbor Cache code to output debug messages. module-help = Enables IPv6 Neighbor Cache code to output debug messages.
source "subsys/net/Kconfig.template.log_config.net" source "subsys/net/Kconfig.template.log_config.net"
if NET_DHCPV6
module = NET_DHCPV6
module-dep = NET_LOG
module-str = Log level for DHCPv6 client
module-help = Enables DHCPv6 client code to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_DHCPV6
endif # NET_NATIVE_IPV6 endif # NET_NATIVE_IPV6
endif # NET_IPV6 endif # NET_IPV6

View file

@ -45,7 +45,7 @@ LOG_MODULE_REGISTER(net_core, CONFIG_NET_CORE_LOG_LEVEL);
#include "ipv4.h" #include "ipv4.h"
#include "dhcpv4/dhcpv4_internal.h" #include "dhcpv4/dhcpv4_internal.h"
#include "dhcpv6_internal.h" #include "dhcpv6/dhcpv6_internal.h"
#include "route.h" #include "route.h"

View file

@ -15,6 +15,7 @@ add_subdirectory_ifdef(CONFIG_NET_CAPTURE capture)
add_subdirectory_ifdef(CONFIG_NET_ZPERF zperf) add_subdirectory_ifdef(CONFIG_NET_ZPERF zperf)
add_subdirectory_ifdef(CONFIG_NET_SHELL shell) add_subdirectory_ifdef(CONFIG_NET_SHELL shell)
add_subdirectory_ifdef(CONFIG_NET_TRICKLE trickle) add_subdirectory_ifdef(CONFIG_NET_TRICKLE trickle)
add_subdirectory_ifdef(CONFIG_NET_DHCPV6 dhcpv6)
if (CONFIG_NET_DHCPV4 OR CONFIG_NET_DHCPV4_SERVER) if (CONFIG_NET_DHCPV4 OR CONFIG_NET_DHCPV4_SERVER)
add_subdirectory(dhcpv4) add_subdirectory(dhcpv4)

View file

@ -41,6 +41,8 @@ source "subsys/net/lib/capture/Kconfig"
source "subsys/net/lib/dhcpv4/Kconfig" source "subsys/net/lib/dhcpv4/Kconfig"
source "subsys/net/lib/dhcpv6/Kconfig"
source "subsys/net/lib/trickle/Kconfig" source "subsys/net/lib/trickle/Kconfig"
source "subsys/net/lib/zperf/Kconfig" source "subsys/net/lib/zperf/Kconfig"

View file

@ -0,0 +1,9 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/net/ip)
zephyr_library_sources_ifdef(CONFIG_NET_DHCPV6 dhcpv6.c)

View file

@ -0,0 +1,24 @@
# DHCPv4 server implementation for Zephyr
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
config NET_DHCPV6
bool "DHCPv6 client"
select NET_MGMT
select NET_MGMT_EVENT
depends on NET_IPV6 && NET_UDP
if NET_DHCPV6
module = NET_DHCPV6
module-dep = NET_LOG
module-str = Log level for DHCPv6 client
module-help = Enables DHCPv6 client code to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_DHCPV6

View file

@ -9,7 +9,7 @@
#include <zephyr/net/ethernet.h> #include <zephyr/net/ethernet.h>
#include <zephyr/net/net_if.h> #include <zephyr/net/net_if.h>
#include "../../../subsys/net/ip/dhcpv6.c" #include "../../../subsys/net/lib/dhcpv6/dhcpv6.c"
static struct in6_addr test_addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, static struct in6_addr test_addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0x1 } } }; 0, 0, 0, 0, 0, 0, 0, 0x1 } } };