lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #20409] Add netif callback function for link change ev


From: Jared Grubb
Subject: [lwip-devel] [bug #20409] Add netif callback function for link change event
Date: Thu, 12 Jul 2007 02:58:01 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.4) Gecko/20070509 Camino/1.5

Follow-up Comment #35, bug #20409 (project lwip):

Based on my last comment, I changed netif.c to show what it would look like.
It will have *minimal* impact on how things already work, while offering lots
of optional new features. The changes to netif.c:
* LWIP_NETIF_LINK_CALLBACK defines whether there is a link change callback
feature, and whether there is a status callback to the driver (may as well
couple these together for "smart" drivers)
* The gratuitous ARP and the status_callback happen in netif_set_ipaddr(),
since these are the events we want to capture
* netif_set_up is shorter, optionally calling the driver callback
* netif_set_down is more intelligent, calling dhcp_stop() or autoip_stop(),
the optional driver callback, and the optional status_callback. 
* netif_link_change() (optional via LWIP_NETIF_LINK_CALLBACK) calls
dhcp_link_change(), autoip_link_change, or etharp_query() as appropriate.

External changes not shown:
* new LWIP_NETIF_LINK_CALLBACK option
* new NETIF_FLAG_AUTOIP flag
* dhcp_start(), dhcp_stop(), autoip_start(), autoip_stop() do not call
netif_set_up/down, but instead call netif_set_ipaddr(addr) or
netif_set_ipaddr(NULL) depending on whether they get an IP or lose one.
* ip_input() still checks both for up/down, but will fail (properly) on NULL
ip adress, as set possibly from DHCP
* new (optional) functions dhcp_link_change() and autoip_link_change().

What you guys think? Minimal impact to current design, lots of new optional
features, user gets global up/down ability... (havent addressed the
core-locking on link change stuff, but that can be addressed next, if you
guys like this much.)

(file #13291)
    _______________________________________________________

Additional Item Attachment:



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20409>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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