netutils/netlib: Encapsulate the dhcp configuration network code and modify at all calling locations

The DHCP configuration network code is called multiple times, so it is encapsulated

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
This commit is contained in:
zhangshuai39 2024-08-19 10:15:10 +08:00 committed by Xiang Xiao
parent 054edfc653
commit 6d52a0fbc1
7 changed files with 199 additions and 141 deletions

View file

@ -375,6 +375,12 @@ ssize_t netlib_get_route(FAR struct rtentry *rtelist,
unsigned int nentries, sa_family_t family);
#endif
#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NETUTILS_DHCPC)
/* DHCP */
int netlib_obtain_ipv4addr(FAR const char *ifname);
#endif
#ifdef CONFIG_NET_ICMPv6_AUTOCONF
/* ICMPv6 Autoconfiguration */