mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
feat(dhcps): Support for multiple DNS servers
This commit is contained in:

committed by
Abhik Roy

parent
d65d2fd4d1
commit
0fd3984c72
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -47,6 +47,13 @@ enum dhcps_offer_option{
|
||||
OFFER_END
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DNS_TYPE_MAIN = 0, /**< DNS main server address*/
|
||||
DNS_TYPE_BACKUP, /**< DNS backup server address (Wi-Fi STA and Ethernet only) */
|
||||
DNS_TYPE_MAX
|
||||
} dns_type_t;
|
||||
|
||||
/** @brief DHCP server's description of compile time configuration values in dhcpserver.c
|
||||
*
|
||||
* - DHCPS_DEBUG: Prints very detailed debug messages if set to 1, hardcoded to 0
|
||||
@@ -164,17 +171,19 @@ bool dhcp_search_ip_on_mac(dhcps_t *dhcps, u8_t *mac, ip4_addr_t *ip);
|
||||
* @brief Sets DNS server address for the DHCP server
|
||||
* @param dhcps Pointer to the DHCP handle
|
||||
* @param dnsserver Address of the DNS server
|
||||
* @param type Type of the DNS server
|
||||
* @return ERR_ARG if invalid handle, ERR_OK on success
|
||||
*/
|
||||
err_t dhcps_dns_setserver(dhcps_t *dhcps, const ip_addr_t *dnsserver);
|
||||
err_t dhcps_dns_setserver(dhcps_t *dhcps, const ip_addr_t *dnsserver, dns_type_t type);
|
||||
|
||||
/**
|
||||
* @brief Gets DNS server associated with this DHCP server
|
||||
* @param dhcps Pointer to the DHCP handle
|
||||
* @param dnsserver Address of the DNS server
|
||||
* @param type Type of the DNS server
|
||||
* @return ERR_ARG if invalid handle, ERR_OK on success
|
||||
*/
|
||||
err_t dhcps_dns_getserver(dhcps_t *dhcps, ip4_addr_t *dnsserver);
|
||||
err_t dhcps_dns_getserver(dhcps_t *dhcps, ip4_addr_t *dnsserver, dns_type_t type);
|
||||
|
||||
/**
|
||||
* @brief Sets callback on assigning an IP to the connected client
|
||||
|
Reference in New Issue
Block a user