MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / netdev_dhcp_enabled

Function netdev_dhcp_enabled

components/net/netdev/src/netdev.c:594–612  ·  view source on GitHub ↗

* This function will control network interface device DHCP capability enable or disable. * * @param netdev the network interface device device to change * @param is_enable the new DHCP status * * @return 0: set DHCP status successfully * -1: set DHCP status failed */

Source from the content-addressed store, hash-verified

592 * -1: set DHCP status failed
593 */
594int netdev_dhcp_enabled(struct netdev *netdev, rt_bool_t is_enabled)
595{
596 RT_ASSERT(netdev);
597
598 if (!netdev->ops || !netdev->ops->set_dhcp)
599 {
600 LOG_E("The network interface device(%s) not support to set DHCP status.", netdev->name);
601 return -RT_ERROR;
602 }
603
604 /* network interface device DHCP flags check */
605 if (netdev_is_dhcp_enabled(netdev) == is_enabled)
606 {
607 return RT_EOK;
608 }
609
610 /* execute network interface device DHCP capability control operations */
611 return netdev->ops->set_dhcp(netdev, is_enabled);
612}
613
614int netdev_dhcp_open(char *netdev_name)
615{

Callers 8

rndis_lwip_initFunction · 0.85
test_netdev_dhcpFunction · 0.85
test_netdev_ifconfig_setFunction · 0.85
test_netdev_config_setFunction · 0.85
dhcp_enable_wrapperFunction · 0.85
utest_tc_cleanupFunction · 0.85
netdev_dhcp_openFunction · 0.85
netdev_dhcp_closeFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_netdev_dhcpFunction · 0.68
test_netdev_ifconfig_setFunction · 0.68
test_netdev_config_setFunction · 0.68