lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] 2 Interfaces


From: Fabian Cenedese
Subject: Re: [lwip-users] 2 Interfaces
Date: Thu, 28 Feb 2013 12:19:58 +0100

At 11:50 28.02.2013 +0100, you wrote:

>Fabian Cenedese wrote:
>> I have a device with 2 Ethernet interfaces. Can I have two
>> "instances" of lwip to handle those?
>
>Not unless you use a full-blown OS that can give the 2 instances seperated 
>address spaces. In other words, the answer is possibly "no, you can't".
>
>> My problem is that both
>> are equal and should allow the same functionality. E.g. it
>> should be possible to have handlers that listen on the same
>> (UDP) port for each interface. But lwip can obviously only
>> have one handler. Or with sockets, there's no way to specify
>> an interface if I have two sockets listening on the same port
>> and the same IP addresses.
>
>You can't do this on the same IP address. To do this with lwIP, you need to 
>give each netif a dedicated IP address.

Of course, I meant that they should be listening for the same
addresses (namely all) but each one can have a different IP
address on its own. Like a web server with two interfaces with
different IP addresses, but both should listen on port 80 from
all incoming IP addresses. And separate applications could
listen on port 80 for either one interface or the other (but not
both at the same time or only with separate sockets/handles).
Would that be possible with lwip? Like just one tcpip_init,
netif_add for each interface and one netif_set_default for the
main interface?

Thanks

bye  Fabi




reply via email to

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