/* This function will set network interface device DNS server address. */
int netdev_set_dns_server(struct netdev *netdev, uint8_t dns_num, const ip_addr_t *dns_server)
/* This function will set network interface device DNS server address. */
int netdev_set_dns_server(struct netdev *netdev, uint8_t dns_num, const ip_addr_t *dns_server)
{
    ASSERT(netdev);
    ASSERT(dns_server);
    if (dns_num >= NETDEV_DNS_SERVERS_NUM)
    {
        LOGE(TAG, "The number of DNS servers(%d) set exceeds the maximum number(%d).", dns_num + 1, NETDEV_DNS_SERVERS_NUM);
        return -1;
    }
    if (!netdev->ops || !netdev->ops->set_dns_server)
    {
        LOGE(TAG, "The network interface device(%s) not support to set DNS server address.", netdev->name);
        return -1;
    }
    return netdev->ops->set_dns_server(netdev, dns_num, (ip_addr_t *)dns_server);
}