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: K.J. Mansley
Subject: Re: [lwip-users] [LONG][Newbie] Questions about lwip
Date: 07 Sep 2004 17:02:08 +0100

On Tue, 2004-09-07 at 11:02, Gendag wrote:
> In conclusion,
> I think I don't understand very well how to initialize and use the
> stack, at the begining I thought that using API was not necessary
> initialize the modules, but now I'm not so sure.

I'm afraid you need to initialize it, no matter what API you are using,
unless you're using a library built on top of lwip (such as the unixlib
included in contrib) that already does it for you. You might not need to
initialize all parts if you're not using them (e.g. you might not use
UDP).

I think the best example of initialization is in the unixlib:

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.

(For comment by other developers) Perhaps we should port things like
unixsim to use unixlib to make this possibility clearer?

> 2. In "minimal" and "unixsim" programs It's used the tap device to
> communicate with the outside. What I would like to know is if it's always
> necessary to use a tap, or other interfaces, to permit the program to
> comunicate with the other programs. It's not possible, for example, use
> the real loopback interface of my PC, as I do when I test program writte
> with unix socket api? It's always necessary to initialize ad use a
> "virtual" lwip interface?

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.

Hope that helps,

Kieran





reply via email to

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