++ New features:
+ 2010-01-14: Simon Goldschmidt
+ * ppp.c/.h: Fixed bug #27856: PPP: Set netif link- and status-callback
+ by adding ppp_set_netif_statuscallback()/ppp_set_netif_linkcallback()
+
2010-01-13: Simon Goldschmidt
* mem.c: The heap now may be moved to user-defined memory by defining
LWIP_RAM_HEAP_POINTER as a void pointer to that memory's address
#include "netif/ppp_oe.h"
#endif /* PPPOE_SUPPORT */
+#include "lwip/tcpip.h"
+#include "lwip/api.h"
+
#include <string.h>
/*************************/
}
#endif /* PPPOE_SUPPORT */
+#if LWIP_NETIF_STATUS_CALLBACK
+/** Set the status callback of a PPP's netif
+ *
+ * @param pd The PPP descriptor returned by pppOpen()
+ * @param status_callback pointer to the status callback function
+ *
+ * @see netif_set_status_callback
+ */
+void
+ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback)
+{
+ netif_set_status_callback(&pppControl[pd].netif, status_callback);
+}
+#endif /* LWIP_NETIF_STATUS_CALLBACK */
+
+#if LWIP_NETIF_LINK_CALLBACK
+/** Set the link callback of a PPP's netif
+ *
+ * @param pd The PPP descriptor returned by pppOpen()
+ * @param link_callback pointer to the link callback function
+ *
+ * @see netif_set_link_callback
+ */
+void
+ppp_set_netif_linkcallback(int pd, netif_status_callback_fn link_callback)
+{
+ netif_set_link_callback(&pppControl[pd].netif, link_callback);
+}
+#endif /* LWIP_NETIF_LINK_CALLBACK */
+
#endif /* PPP_SUPPORT */
#include "lwip/def.h"
#include "lwip/sio.h"
-#include "lwip/api.h"
-#include "lwip/sockets.h"
#include "lwip/stats.h"
#include "lwip/mem.h"
-#include "lwip/tcpip.h"
#include "lwip/netif.h"
#include "lwip/sys.h"
#include "lwip/timers.h"
* OR MODIFICATIONS.
*/
-#define TIMEOUT(f, a, t) sys_untimeout((f), (a)); sys_timeout((t)*1000, (f), (a))
+#define TIMEOUT(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t)*1000, (f), (a)); } while(0)
#define UNTIMEOUT(f, a) sys_untimeout((f), (a))
/* Get appropriate netmask for address */
u32_t GetMask (u32_t);
+#if LWIP_NETIF_STATUS_CALLBACK
+void ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback);
+#endif /* LWIP_NETIF_STATUS_CALLBACK */
+#if LWIP_NETIF_LINK_CALLBACK
+void ppp_set_netif_linkcallback(int pd, netif_status_callback_fn link_callback);
+#endif /* LWIP_NETIF_LINK_CALLBACK */
+
#endif /* PPP_SUPPORT */
#endif /* PPP_H */