Add lwip test to bootdisk image

This commit is contained in:
Ali Mashtizadeh 2015-02-03 15:19:16 -08:00
parent f067ec6252
commit a9a5ffb08a
3 changed files with 12 additions and 0 deletions

View File

@ -196,6 +196,7 @@ if env["BOOTDISK"] == "1":
Depends(bootdisk, "#build/sbin/ifconfig/ifconfig")
Depends(bootdisk, "#build/sbin/init/init")
Depends(bootdisk, "#build/sys/castor")
Depends(bootdisk, "#build/tests/lwiptest")
Depends(bootdisk, "#build/tests/pthreadtest")
Depends(bootdisk, "#build/tests/threadtest")
env.Alias('bootdisk', '#build/bootdisk.img')

View File

@ -14,6 +14,7 @@ DIR /
FILE init build/sbin/init/init
END
DIR tests
FILE lwiptest build/tests/lwiptest
FILE pthreadtest build/tests/pthreadtest
FILE threadtest build/tests/threadtest
END

View File

@ -1,10 +1,20 @@
#include <lwip/init.h>
#include <lwip/ip.h>
#include <lwip/sockets.h>
int
main(int argc, const char *argv[])
{
struct netif netif;
static ip_addr_t addr, mask, gw;
IP4_ADDR(&addr, 192, 168, 0, 1);
IP4_ADDR(&mask, 255, 255, 255, 0);
IP4_ADDR(&gw, 0, 0, 0, 0);
lwip_init();
lwip_socket(AF_INET, SOCK_STREAM, IP_PROTO_TCP);
return 0;