*/
#define LWIP_NOASSERT 1
-//#define LWIP_DEBUG 0
+#define LWIP_DEBUG 1
#define TAPIF_DEBUG LWIP_DBG_OFF
#define TUNIF_DEBUG LWIP_DBG_OFF
#define UNIXIF_DEBUG LWIP_DBG_OFF
#define IP_REASS_DEBUG LWIP_DBG_OFF
#define RAW_DEBUG LWIP_DBG_OFF
#define ICMP_DEBUG LWIP_DBG_OFF
-#define UDP_DEBUG LWIP_DBG_OFF
+#define UDP_DEBUG (LWIP_DBG_ON | LWIP_DBG_TYPES_ON | LWIP_DBG_MIN_LEVEL)
#define TCP_DEBUG LWIP_DBG_OFF
#define TCP_INPUT_DEBUG LWIP_DBG_OFF
#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
if (err_is_fail(err)) {
DEBUG_ERR(err, "failed to subscribte the ARP service\n");
}
-
- ip4_addr_t ipaddr, netmask;
- IP4_ADDR(&ipaddr, 192, 168, 0, 36);
- IP4_ADDR(&netmask, 255, 255, 255, 0);
- netif_set_addr(&st->netif, &ipaddr, &netmask,
- IP_ADDR_ANY);
}
NETDEBUG("initialization complete.\n");
flounderBindings = [ "unixsock", "octopus" ],
flounderExtraBindings = [ ("octopus", [ "rpcclient" ]) ],
flounderTHCStubs = [ "octopus" ],
- addLibraries = libDeps [ "vfs_noblockdev", "term_server", "octopus" ],
+ addLibraries = libDeps [ "vfs_ramfs", "term_server", "octopus", "lwip" ],
architectures = [ "x86_32", "k1om", "armv7", "armv8" ]
}
]
if (socket->udp_socket) {
ip_addr_t addr;
+ err_t e;
+
addr.addr = ip_address;
- assert(udp_connect(socket->udp_socket, &addr, port) == ERR_OK);
+ e = udp_connect(socket->udp_socket, &addr, port);
+ assert(e == ERR_OK);
*error = SYS_ERR_OK;
} else if (socket->tcp_socket) {
ip_addr_t addr;
+ err_t e;
+
addr.addr = ip_address;
- assert(tcp_connect(socket->tcp_socket, &addr, port, net_tcp_connected) == ERR_OK);
+ e = tcp_connect(socket->tcp_socket, &addr, port, net_tcp_connected);
+ assert(e == ERR_OK);
*error = SYS_ERR_OK;
}
notify = 1;
// debug_printf("%s(%d): %d\n", __func__, socket->descriptor, p->tot_len);
if (port && addr.addr) {
- assert(udp_sendto(pcb, p, &addr, port) == ERR_OK);
+ err_t e;
+
+ e = udp_sendto(pcb, p, &addr, port);
+ if (e != ERR_OK)
+ debug_printf("%s(%d): err:%d\n", __func__, socket->descriptor, e);
+ assert(e == ERR_OK);
} else {
- assert(udp_send(pcb, p) == ERR_OK);
+ err_t e;
+
+ e = udp_send(pcb, p);
+ if (e != ERR_OK)
+ debug_printf("%s(%d): err:%d\n", __func__, socket->descriptor, e);
+ assert(e == ERR_OK);
}
pbuf_free(p);
} else if (socket->tcp_socket) {
snprintf(servicename, sizeof(servicename), "e1000:%s", argv[2]);
/* connect to the network */
- err = networking_init(servicename, 0);
+ err = networking_init(servicename, NET_FLAGS_DO_DHCP);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "Failed to initialize the network");
}