From: EunBong Song Date: Fri, 17 Mar 2017 07:41:03 +0000 (+0900) Subject: net: remove NET_LWIP_DHCPC and NET_LWIP_DHCPS X-Git-Tag: 1.1_Public_Release~614^2~251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c542fb6c4a99d8583d05c4d39bc3e13b0b50f40;p=rtos%2Ftinyara.git net: remove NET_LWIP_DHCPC and NET_LWIP_DHCPS NET_LWIP_DHCPC and NET_LWIP_DHCPS should not be used because this can break protection build. Instead of these, use NETUTILS_DHCPC and NETUTILS_DHCPD. This patch removes NET_LWIP_DHCPC and NET_LWIP_DHCPS. Change-Id: Iba3cbb95e90ae1a91c0d607bbf093dad2ecc4479 Signed-off-by: EunBong Song --- diff --git a/apps/examples/testcase/io_tc/network/tc_net_dhcpc.c b/apps/examples/testcase/io_tc/network/tc_net_dhcpc.c index 27b56d3..405a223 100644 --- a/apps/examples/testcase/io_tc/network/tc_net_dhcpc.c +++ b/apps/examples/testcase/io_tc/network/tc_net_dhcpc.c @@ -38,109 +38,7 @@ #include "../../../../../external/WICED/bcm4390x/include/wwd_structures.h" #endif -#ifdef CONFIG_NET_LWIP_DHCPC -#include - -#if defined(CONFIG_ENC28J60) || defined(CONFIG_WICED) -#if LWIP_HAVE_LOOPIF -#define NET_DEVNAME "en1" -#else -#define NET_DEVNAME "en0" -#endif -#elif defined(CONFIG_ARCH_BOARD_SIDK_S5JT200) -#if LWIP_HAVE_LOOPIF -#define NET_DEVNAME "wl1" -#else -#define NET_DEVNAME "wl0" -#endif -#else -#error "undefined CONFIG_NET_, check your .config" -#endif - -struct dhcp dhcp_handle; -#endif - int net_dhcpc_main(void) { -#if CONFIG_NET_LWIP_DHCPC - err_t ret; - struct netif *netif; - uint32_t timeleft = 150000; - - netif = netif_find(NET_DEVNAME); - if (netif == NULL) { - printf("tc_net_dhcp_netif_find: FAIL\n"); - total_fail++; - } else { - printf("tc_net_dhcp_netif_find: PASS\n"); - total_pass++; - } - - netlib_ifup(NET_DEVNAME); - -#if CONFIG_EXAMPLES_WICEDWIFI - printf("Please join an AP before starting DHCP: wicedwifi\n"); - printf("command: - wicedwifi join \n"); -#endif - if ((ret = dhcp_start(netif)) != ERR_OK) { - printf("tc_net_dhcp_start: FAIL\n"); - total_fail++; - } - - while (netif->dhcp->state != DHCP_BOUND) { - sleep(1); - timeleft -= 1000; - - if (timeleft <= 0) - break; - } - - if (timeleft <= 0) { - dhcp_stop(netif); - netif->dhcp = NULL; - } - - printf("tc_net_dhcp_start: PASS\n"); - total_pass++; - - printf("IP address get %u.%u.%u.%u ----\n", (unsigned char)((htonl(netif->ip_addr.addr) >> 24) & 0xff), (unsigned char)((htonl(netif->ip_addr.addr) >> 16) & 0xff), (unsigned char)((htonl(netif->ip_addr.addr) >> 8) & 0xff), (unsigned char)((htonl(netif->ip_addr.addr) >> 0) & 0xff)); - - ret = dhcp_release(netif); - if (ret == ERR_OK) { - printf("tc_net_dhcp_release: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_release: FAIL\n"); - total_fail++; - } - - dhcp_stop(netif); - if (netif->dhcp->state == DHCP_OFF) { - printf("tc_net_dhcp_stop: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_stop: FAIL\n"); - total_fail++; - } - - dhcp_cleanup(netif); - if (netif->dhcp == NULL) { - printf("tc_net_dhcp_cleanup: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_cleanup: FAIL\n"); - total_fail++; - } - - dhcp_set_struct(netif, &dhcp_handle); - if (netif->dhcp) { - printf("tc_net_dhcp_set_struct: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_set_struct: FAIL\n"); - total_fail++; - } - -#endif return 0; } diff --git a/apps/examples/testcase/le_tc/network/tc_net_dhcpc.c b/apps/examples/testcase/le_tc/network/tc_net_dhcpc.c index 0080a19..405a223 100644 --- a/apps/examples/testcase/le_tc/network/tc_net_dhcpc.c +++ b/apps/examples/testcase/le_tc/network/tc_net_dhcpc.c @@ -38,105 +38,7 @@ #include "../../../../../external/WICED/bcm4390x/include/wwd_structures.h" #endif -#ifdef CONFIG_NET_LWIP_DHCPC -#include - -#if defined(CONFIG_NET_ETHERNET) && CONFIG_NET_ETHERNET == 1 -#if LWIP_HAVE_LOOPIF -#define NET_DEVNAME "en1" -#else -#define NET_DEVNAME "en0" -#endif -#elif defined(CONFIG_NET_802154) && CONFIG_NET_802154 == 1 -#define NET_DEVNAME "wpan0" -#else -#error "undefined CONFIG_NET_, check your .config" -#endif - -struct dhcp dhcp_handle; -#endif - int net_dhcpc_main(void) { -#if CONFIG_NET_LWIP_DHCPC - err_t ret; - struct netif *netif; - uint32_t timeleft = 150000; - - netif = netif_find(NET_DEVNAME); - if (netif == NULL) { - printf("tc_net_dhcp_netif_find: FAIL\n"); - total_fail++; - } else { - printf("tc_net_dhcp_netif_find: PASS\n"); - total_pass++; - } - - netlib_ifup(NET_DEVNAME); - -#if CONFIG_EXAMPLES_WICEDWIFI - printf("Please join an AP before starting DHCP: wicedwifi\n"); - printf("command: - wicedwifi join \n"); -#endif - if ((ret = dhcp_start(netif)) != ERR_OK) { - printf("tc_net_dhcp_start: FAIL\n"); - total_fail++; - } - - while (netif->dhcp->state != DHCP_BOUND) { - sleep(1); - timeleft -= 1000; - - if (timeleft <= 0) - break; - } - - if (timeleft <= 0) { - dhcp_stop(netif); - netif->dhcp = NULL; - } - - printf("tc_net_dhcp_start: PASS\n"); - total_pass++; - - printf("IP address get %u.%u.%u.%u ----\n", (unsigned char)((htonl(netif->ip_addr.addr) >> 24) & 0xff), (unsigned char)((htonl(netif->ip_addr.addr) >> 16) & 0xff), (unsigned char)((htonl(netif->ip_addr.addr) >> 8) & 0xff), (unsigned char)((htonl(netif->ip_addr.addr) >> 0) & 0xff)); - - ret = dhcp_release(netif); - if (ret == ERR_OK) { - printf("tc_net_dhcp_release: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_release: FAIL\n"); - total_fail++; - } - - dhcp_stop(netif); - if (netif->dhcp->state == DHCP_OFF) { - printf("tc_net_dhcp_stop: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_stop: FAIL\n"); - total_fail++; - } - - dhcp_cleanup(netif); - if (netif->dhcp == NULL) { - printf("tc_net_dhcp_cleanup: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_cleanup: FAIL\n"); - total_fail++; - } - - dhcp_set_struct(netif, &dhcp_handle); - if (netif->dhcp) { - printf("tc_net_dhcp_set_struct: PASS\n"); - total_pass++; - } else { - printf("tc_net_dhcp_set_struct: FAIL\n"); - total_fail++; - } - -#endif return 0; } diff --git a/apps/examples/wakaama_client/wakaama_client.c b/apps/examples/wakaama_client/wakaama_client.c index 3ab5e9d..677ac83 100644 --- a/apps/examples/wakaama_client/wakaama_client.c +++ b/apps/examples/wakaama_client/wakaama_client.c @@ -33,11 +33,6 @@ #define NET_DEVNAME "wl1" -#if defined(CONFIG_NET_LWIP_DHCPC) && !defined(CONFIG_NETUTILS_DHCPC) -struct dhcp dhcp_handle; -#endif - - #define DM_LIFETIME 300 #define DM_SERVERIP "192.168.1.152" #define DM_SERVERPORT LWM2M_STANDARD_PORT_STR diff --git a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig index 2e2ab97..e3ddca2 100755 --- a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig +++ b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig @@ -624,11 +624,6 @@ CONFIG_ARCH_HAVE_NET=y CONFIG_NET=y CONFIG_NET_LWIP=y -# -# LwIP DHCP options -# -CONFIG_NET_LWIP_DHCPC=y -CONFIG_NET_LWIP_DHCPS=y # CONFIG_NET_SECURITY_TLS is not set CONFIG_NET_NOINTS=y diff --git a/os/include/net/lwip/lwipopts.h b/os/include/net/lwip/lwipopts.h index e9c5019..dda325c 100644 --- a/os/include/net/lwip/lwipopts.h +++ b/os/include/net/lwip/lwipopts.h @@ -110,21 +110,7 @@ #define UDP_TTL 255 #define LWIP_UDP_TODO 1 -/* ---------- DHCP options ---------- */ -/* Define LWIP_DHCP to 1 if you want DHCP configuration of - interfaces. -*/ -#ifdef CONFIG_NET_LWIP_DHCPC -#define LWIP_DHCP 0 -#endif - -/* ---------- DHCPS options ---------- */ -/* Caution. Define LWIP_DHCP to 1 before enabling DHCP server configuration - * Define LWIP_DHCPS, DHCP Server Function -* **/ -#ifdef CONFIG_NET_LWIP_DHCPS -#define LWIP_DHCPS 1 -#endif +#define LWIP_DHCPS 0 /* ---------------------------------------------- diff --git a/os/net/Kconfig b/os/net/Kconfig index bf62019..4756cde 100644 --- a/os/net/Kconfig +++ b/os/net/Kconfig @@ -29,10 +29,6 @@ config NET_LWIP endchoice -if NET_LWIP -source net/lwip/Kconfig -endif #NET_LWIP - config NET_SECURITY_TLS bool "TLS Support" default n diff --git a/os/net/lwip/Kconfig b/os/net/lwip/Kconfig deleted file mode 100644 index c1f82ee..0000000 --- a/os/net/lwip/Kconfig +++ /dev/null @@ -1,16 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt -# - -menu "LwIP DHCP options" - -config NET_LWIP_DHCPC - bool "DHCP client" - default y - -config NET_LWIP_DHCPS - bool "DHCP server" - default y - -endmenu