Add lwip test to bootdisk image
This commit is contained in:
parent
f067ec6252
commit
a9a5ffb08a
@ -196,6 +196,7 @@ if env["BOOTDISK"] == "1":
|
|||||||
Depends(bootdisk, "#build/sbin/ifconfig/ifconfig")
|
Depends(bootdisk, "#build/sbin/ifconfig/ifconfig")
|
||||||
Depends(bootdisk, "#build/sbin/init/init")
|
Depends(bootdisk, "#build/sbin/init/init")
|
||||||
Depends(bootdisk, "#build/sys/castor")
|
Depends(bootdisk, "#build/sys/castor")
|
||||||
|
Depends(bootdisk, "#build/tests/lwiptest")
|
||||||
Depends(bootdisk, "#build/tests/pthreadtest")
|
Depends(bootdisk, "#build/tests/pthreadtest")
|
||||||
Depends(bootdisk, "#build/tests/threadtest")
|
Depends(bootdisk, "#build/tests/threadtest")
|
||||||
env.Alias('bootdisk', '#build/bootdisk.img')
|
env.Alias('bootdisk', '#build/bootdisk.img')
|
||||||
|
@ -14,6 +14,7 @@ DIR /
|
|||||||
FILE init build/sbin/init/init
|
FILE init build/sbin/init/init
|
||||||
END
|
END
|
||||||
DIR tests
|
DIR tests
|
||||||
|
FILE lwiptest build/tests/lwiptest
|
||||||
FILE pthreadtest build/tests/pthreadtest
|
FILE pthreadtest build/tests/pthreadtest
|
||||||
FILE threadtest build/tests/threadtest
|
FILE threadtest build/tests/threadtest
|
||||||
END
|
END
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
|
|
||||||
|
#include <lwip/init.h>
|
||||||
#include <lwip/ip.h>
|
#include <lwip/ip.h>
|
||||||
#include <lwip/sockets.h>
|
#include <lwip/sockets.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, const char *argv[])
|
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);
|
lwip_socket(AF_INET, SOCK_STREAM, IP_PROTO_TCP);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user