net: remove NET_LWIP_DHCPC and NET_LWIP_DHCPS
authorEunBong Song <eunb.song@samsung.com>
Fri, 17 Mar 2017 07:41:03 +0000 (16:41 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 10:53:00 +0000 (19:53 +0900)
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 <eunb.song@samsung.com>
apps/examples/testcase/io_tc/network/tc_net_dhcpc.c
apps/examples/testcase/le_tc/network/tc_net_dhcpc.c
apps/examples/wakaama_client/wakaama_client.c
build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig
os/include/net/lwip/lwipopts.h
os/net/Kconfig
os/net/lwip/Kconfig [deleted file]

index 27b56d3..405a223 100644 (file)
 #include "../../../../../external/WICED/bcm4390x/include/wwd_structures.h"
 #endif
 
-#ifdef CONFIG_NET_LWIP_DHCPC
-#include <net/lwip/dhcp.h>
-
-#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_<type>, 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 <ssid> <security> <key> <ip address> <netmask> <gateway>\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;
 }
index 0080a19..405a223 100644 (file)
 #include "../../../../../external/WICED/bcm4390x/include/wwd_structures.h"
 #endif
 
-#ifdef CONFIG_NET_LWIP_DHCPC
-#include <net/lwip/dhcp.h>
-
-#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_<type>, 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 <ssid> <security> <key> <ip address> <netmask> <gateway>\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;
 }
index 3ab5e9d..677ac83 100644 (file)
 
 #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
index 2e2ab97..e3ddca2 100755 (executable)
@@ -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
 
index e9c5019..dda325c 100644 (file)
 #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
 
 /*
    ----------------------------------------------
index bf62019..4756cde 100644 (file)
@@ -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 (file)
index c1f82ee..0000000
+++ /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