/* This function will control network interface device DHCP capability enable or disable. */
int netdev_dhcpd_enabled(struct netdev *netdev, bool is_enabled)
/* This function will control network interface device DHCP capability enable or disable. */
int netdev_dhcpd_enabled(struct netdev *netdev, bool is_enabled)
{
    ASSERT(netdev);
    if (!netdev->ops || !netdev->ops->set_dhcpd)
    {
        LOGE(TAG, "The network interface device(%s) not support to set DHCPD status.", netdev->name);
        return -1;
    }
    if (netdev_is_dhcpd_enabled(netdev) == is_enabled)
    {
        return 0;
    }
    if (is_enabled)
    {
        netdev->flags |= NETDEV_FLAG_DHCPD;
    }
    else
    {
        netdev->flags &= ~NETDEV_FLAG_DHCPD;
    }
    return netdev->ops->set_dhcpd(netdev, is_enabled);
}