#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;
}
#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;
}
#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
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
#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
/*
----------------------------------------------
endchoice
-if NET_LWIP
-source net/lwip/Kconfig
-endif #NET_LWIP
-
config NET_SECURITY_TLS
bool "TLS Support"
default n
+++ /dev/null
-#
-# 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