[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #19347] netif_add & tcpip_init problem
From: |
Frédéric Bernon |
Subject: |
[lwip-devel] [bug #19347] netif_add & tcpip_init problem |
Date: |
Fri, 30 Mar 2007 16:07:28 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 |
Follow-up Comment #15, bug #19347 (project lwip):
I propose here a first DRAFT for a thread-safe netif api. Draft, because as
is, it can be used, but it is to have a first release to talk.
This idea is to use a new define, LWIP_NETIF_API, which add types and
functions in tcpip.h/.c. Four new messages are add to :
- add/remove netif
- start/stop dhcp
Several points have to be decide for this patch :
1/ Where place this code? My first idea was to add new files like
netif_msg.h/.c (or netifapi_msg) but in a first time, tcpip was better. But
tell me...
2/ net_add is "special", before this function do two tasks: initialize netif
struct, and add it to the netif's list. I think it's not the best thing to
do, but I don't want to break existing api (even if netif_add has already
change since first version). But, we can decide to change (split netif_add in
two functions) or add new functions in netif.c, or decide that init have to
be done in the new function (see the code, you will understand I think). In
this last case, we just have to add some fields in the new netifapi_msg
struct. What is your opinion.
3/ About DHCP, we already have open patch #5798 "New DHCP messages for
tcpip_thread (thread-safe problem)" https://savannah.nongnu.org/patch/?5798.
Simon's idea was to avoid to start timers if no interface got dhcp active.
This first patch dosen't do it, but I think the "good" place to do that would
be directly in dhcp.c/.h (so need to move timers in), or, to add a
dhcp_is_active to know if a dhcp client is enable.
Note I have change order in tcpip.h to have types before functions.
The new tcpip_netifapi function is synchrone.
The is a field "err" to get function result in application side.
Except any mistake, if LWIP_NETIF_API==0, nothing should be changed.
Please, comment that patch. Simon, I hope your remarks for that...
(file #12348)
_______________________________________________________
Additional Item Attachment:
File name: netifapi.patch Size:7 KB
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?19347>
_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, (continued)
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Frédéric Bernon, 2007/03/21
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Jonathan Larmour, 2007/03/23
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Simon Goldschmidt, 2007/03/23
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Frédéric Bernon, 2007/03/23
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Jonathan Larmour, 2007/03/27
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Frédéric Bernon, 2007/03/27
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Jonathan Larmour, 2007/03/27
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Simon Goldschmidt, 2007/03/28
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Frédéric Bernon, 2007/03/29
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Simon Goldschmidt, 2007/03/29
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem,
Frédéric Bernon <=
- [lwip-devel] [bug #19347] netif_add & tcpip_init problem, Frédéric Bernon, 2007/03/30