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: Tue, 10 Jul 2007 23:19:56 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

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

Alright, how does this sound:
* opts.h: #define LWIP_NETIF_LINK_CHANGE_CALLBACK
* netif.h: add a void (*link_change_callback)(*netif) fcn to netif struct.
The driver will call this function on link change.
* netif.c#netif_link_change(*netif) will be the destination for the link
change event. It will cause the right things to trigger (ARP, DHCP, AUTOIP).
Who calls it?
** If LWIP_NETIF_LINK_CHANGE_CALLBACK==1, then there should be an extra
parameter passed to netif_add that sets the proper callback function (just
like we do for *input). This is a bit awkward, but I'm not sure who else
would set it...
** If LWIP_NETIF_LINK_CHANGE_CALLBACK==0, then netif_set_up and
netif_set_down should call netif_link_change() directly
* tcpip.c#tcpip_link_change(*netif) { return
tcpip_callback(netif_link_change,netif); }

Thus, a program that uses tcpip.c would do:
netif_add(netif, ipaddr, netmask, gw, NULL, driver_init, tcpip_ethinput,
tcpip_link_change);

A program that does not use tcpip.c would do:
netif_add(netif, ipaddr, netmask, gw, NULL, driver_init, tcpip_ethinput,
netif_link_change);


    _______________________________________________________

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]