lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: [lwip] Lwip application


From: Kieran Mansley
Subject: [lwip-users] Re: [lwip] Lwip application
Date: Thu, 09 Jan 2003 00:21:42 -0000

On Mon, 7 Oct 2002, ERIC MAHLAKO wrote:

> hi
>
> Has anyone managed to develop a test software for lwip
> using BSD sockets or tun/tap intefaces for measuring
> throughput and latency. If yes, can I know how you
> managed to do it because I trying to do that but I'm
> struckling.

I use a program called ttcp.  It's kind of a simpler predecessor of
netperf.  To make it work, I added the following code:

        {
          struct ip_addr ipaddr, netmask, gw;
          char host[256];
          struct hostent *hostent;

          stats_init();
          sys_init();
          mem_init();
          memp_init();
          pbuf_init();

          gethostname(host, 255);
          hostent = gethostbyname(host);

          gw.addr = ((struct in_addr *)hostent->h_addr_list[0])->s_addr;
          ipaddr.addr = gw.addr;

          IP4_ADDR(&netmask, 255,255,255,0);

          netif_init();

          netif_set_default(netif_add(&ipaddr, &netmask, &gw,
queueif_init,
                                      tcpip_input));

          tcpip_init(0, 0);
        }


And also changed the header includes like this:

#if 0
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#else
#define LWIP_COMPAT_SOCKETS 1
#include "lwip/sys.h"
#include "lwip/raw_sockets.h"
#include "lwip/tcp.h"
#include "lwip/tcpip.h"
#include "netif/queueif.h"
#endif

Hope that helps.  There were probably a couple of other things that needed
doing, but it was a while ago that I set it up so can't recall exactly.

Kieran

[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]