lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] [LONG][Newbie] Questions about lwip


From: Gendag
Subject: Re: [lwip-users] [LONG][Newbie] Questions about lwip
Date: Wed, 8 Sep 2004 21:59:54 +0200
User-agent: Mutt/1.5.6+20040818i

On 07/09/04(Tue) 17:02, K.J. Mansley wrote:
> On Tue, 2004-09-07 at 11:02, Gendag wrote:
> contrib/ports/unix/proj/lib/unixlib.c
> 
> That should be completely application independent, and should even cut
> and paste into another application quite cleanly as it's fairly stand
> alone.  Try that and see if it helps.

ok thx, now I try to use the code of the libs.

> Tap just allows a program to act as a network interface, and is a
> convenient way for programs to get packets delivered to them without
> them first being processed by the kernel stack.  Think of it as a
> "virtual network cable" from the lwip stack to the normal kernel OS
> stack.  Therefore, you must either always use tap, or access the network
> hardware directly (which may or may not be possible).  Even if you
> wanted to use your normal PC loopback interface, you need tap to get
> from your program to the normal PC stack.

ok, now it's more clear. But another question about tap interface.
I'm try to do a very simple server that send a "hello world" message to
a client, both use lwip, and I used the code of the lib to initialize
them, as you suggested. The server when run brings up a tap0 interface.
A question for the client, also the client has to brings up a tap
interface, but it has to bring up a different tap interface from the
server, like tap1, or it can you the same tap1 interface of the server
but with a different ip address. Example:
If I configure the tap0 interface of the server with:

IP4_ADDR(&gateway, 192,168,1,1);
IP4_ADDR(&ipaddr, 192,168,1,2);
IP4_ADDR(&netmask, 255,255,255,0);

netif_set_default(netif_add(&netif, &ipaddr,
      &netmask, &gateway, NULL, tapif_init,
      tcpip_input));

I can configure the client tap0 interface with:
IP4_ADDR(&gateway, 192,168,1,1);
IP4_ADDR(&ipaddr, 192,168,1,3);
IP4_ADDR(&netmask, 255,255,255,0);

netif_set_default(netif_add(&netif, &ipaddr,
      &netmask, &gateway, NULL, tapif_init,
      tcpip_input));

where only ipaddr is different between server and client. Or I have to
change tap interface? If the latter idea is right, how can i change
interface?


> Hope that helps,

yes, thaks a lot.

Gendag




reply via email to

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