netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and

rebinding (T2) time from DHCP packet.
According to RFC 2131, T1 and T2 times play a critical role in lease
management in DHCP clients.

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
This commit is contained in:
nuttxs 2025-08-05 18:51:19 +08:00 committed by Xiang Xiao
parent 8d2a7e32a5
commit 8f3c3c57f9
2 changed files with 37 additions and 1 deletions

View file

@ -58,6 +58,8 @@ struct dhcpc_state
struct in_addr dnsaddr;
struct in_addr default_router;
uint32_t lease_time; /* Lease expires in this number of seconds */
uint32_t renewal_time; /* Seconds to transition to RENEW state(T1) */
uint32_t rebinding_time; /* Seconds to transition to REBIND state(T2) */
};
typedef void (*dhcpc_callback_t)(FAR struct dhcpc_state *presult);