/* This function will get network interface device in network interface device list by netdev name. */
struct netdev* netdev_get_by_name(const char *name)
/* This function will get network interface device in network interface device list by netdev name. */
struct netdev* netdev_get_by_name(const char *name)
{
    slist_t *node = NULL;
    struct netdev *netdev = NULL;
    if (netdev_list == NULL)
    {
        return NULL;
    }
    CPSR_ALLOC();
    RHINO_CPU_INTRPT_DISABLE();
    slist_for_each_entry_safe(&(netdev_list->list), node, netdev, struct netdev, list)
    {
        if (netdev && (strncmp(netdev->name, name, strlen(netdev->name)) == 0))
        {
            RHINO_CPU_INTRPT_ENABLE();
            return netdev;
        }
    }
    RHINO_CPU_INTRPT_ENABLE();
    return NULL;
}