lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Packed structures


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] Packed structures
Date: Wed, 08 Jan 2003 22:55:40 -0000

On Thursday 03 January 2002 13.39, you wrote:
> Two things would be nice to have for lwIP:
> 1. A way to report failure of interface initialization back to the
> application. For example, if no packet driver is loaded the interface
> initialization will fail, currently I exit in that case, but I would like
> to react inside the application to this.

I guess the best way in this case would be to move the intialization of the 
actual hardware out of the init function that gets called from within 
netif_add(). The latter function would then only be responsible for filling 
in the ->output function, the ->state field and the ->name[] variables. 
Something like this:

if(ethernet_hardware_init() == FAILED) {
   do_something();
} else {
   netif_add(ipaddr, netmask, gw, ethernet_netif_init, tcpip_input);
}

> 2. A way to shut down lwIP. This isn't essential, but would be nice to make
> the cleanup of the interface nicer etc.

The same would probably go here as well; the application code could take down 
the interfaces and just stop calling lwIP functions (packet input and TCP 
timers). Since lwIP manages its own memory, there is no need to add extra 
functionality to lwIP for deallocating memory upon shutdown.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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