/* This function will control network interface device DHCP capability enable or disable. */
int netdev_dhcp_enabled(struct netdev *netdev, rt_bool_t is_enabled)
/* This function will control network interface device DHCP capability enable or disable. */
int netdev_dhcp_enabled(struct netdev *netdev, rt_bool_t is_enabled)
{
    RT_ASSERT(netdev);
    if (!netdev->ops || !netdev->ops->set_dhcp)
    {
        LOG_E("The network interface device(%s) not support to set DHCP status.", netdev->name);
        return -RT_ERROR;
    }
    if (netdev_is_dhcp_enabled(netdev) == is_enabled)
    {
        return RT_EOK;
    }
    return netdev->ops->set_dhcp(netdev, is_enabled);
}