Function esp_idf_sys::esp_netif_get_dns_info

source ·
pub unsafe extern "C" fn esp_netif_get_dns_info(
    esp_netif: *mut esp_netif_t,
    type_: esp_netif_dns_type_t,
    dns: *mut esp_netif_dns_info_t,
) -> esp_err_t
Expand description

@brief Get DNS Server information

Return the currently configured DNS Server address for the specified interface and Server type.

This may be result of a previous call to esp_netif_set_dns_info(). If the interface’s DHCP client is enabled, the Main or Backup DNS Server may be set by the current DHCP lease.

Note that LWIP stores DNS server information globally, not per interface, so the first parameter is unused in the default LWIP configuration. If CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF=1 this API returns internally saved DNS server information per netif. It’s also possible to ask for the global DNS server info by supplying esp_netif=NULL

@param[in] esp_netif Handle to esp-netif instance @param[in] type Type of DNS Server to get: ESP_NETIF_DNS_MAIN, ESP_NETIF_DNS_BACKUP, ESP_NETIF_DNS_FALLBACK @param[out] dns DNS Server result is written here on success

@return - ESP_OK on success - ESP_ERR_ESP_NETIF_INVALID_PARAMS invalid params