1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
5 #include <geekos/net.h>
6 #include <geekos/socket.h>
7 #include <geekos/ne2k.h>
9 #include <geekos/debug.h>
13 #include <lwip/apps/ping.h>
14 #include <lwip/lwip/sockets.h>
15 #include <lwip/ipv4/lwip/ip_addr.h>
16 #include <lwip/netif/ne2kif.h>
18 #include <lwip/netifapi.h>
19 #include <lwip/tcpip.h>
21 #include <netif/etharp.h>
25 tcpip_init_done(void *arg)
36 //temporay now we are using lwip sockets
37 // init_socket_layer();
41 struct ip_addr ipaddr, netmask, gateway;
48 PrintBoth("lwIP: before tcpip_init\n");
51 tcpip_init(tcpip_init_done, &sem); //initial the whole lwip module
54 PrintBoth("lwIP: After tcpip_init\n");
60 IP4_ADDR(&gateway, 192,168,1,1);
61 IP4_ADDR(&ipaddr, 192,168,1,2);
62 IP4_ADDR(&netmask, 255,255,255,0);
65 err = netifapi_netif_add(&ne2kif, &ipaddr, &netmask, &gateway,
66 NULL, ne2kif_init, ethernet_input);
69 PrintBoth("lwip: initial network failed! add netif error %d/n", err);
73 netifapi_netif_set_default(&ne2kif);
75 //initial a network application
88 uchar_t local_addr[4];
89 uchar_t remote_addr[4];
96 // set_ip_addr(local_addr);
104 // connect(remote_addr, 4301);