mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-24 23:25:58 +00:00
Change TCPIP INPKT API message to take a function pointer. Allows integration of other protocols without extending lwIP core (e.g. 6LoWPAN)
Remove unused sem member of struct tcpip_msg
This commit is contained in:
parent
17fad79f71
commit
439ae629e0
@ -132,6 +132,12 @@ extern sys_mutex_t lock_tcpip_core;
|
||||
#define API_EXPR_DEREF(expr) *(expr)
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
|
||||
/** Function prototype for input functions functions.
|
||||
*
|
||||
* @param p The received packet, copied into a pbuf
|
||||
* @param inp The netif which received the packet
|
||||
*/
|
||||
typedef err_t (*tcpip_inpkt_fn)(struct pbuf *p, struct netif *inp);
|
||||
|
||||
#if LWIP_NETCONN || LWIP_SOCKET
|
||||
err_t tcpip_apimsg(struct api_msg *apimsg);
|
||||
@ -180,7 +186,6 @@ enum tcpip_msg_type {
|
||||
|
||||
struct tcpip_msg {
|
||||
enum tcpip_msg_type type;
|
||||
sys_sem_t *sem;
|
||||
union {
|
||||
#if LWIP_NETCONN || LWIP_SOCKET
|
||||
struct api_msg *apimsg;
|
||||
@ -194,6 +199,7 @@ struct tcpip_msg {
|
||||
struct {
|
||||
struct pbuf *p;
|
||||
struct netif *netif;
|
||||
tcpip_inpkt_fn input_fn;
|
||||
} inp;
|
||||
struct {
|
||||
tcpip_callback_fn function;
|
||||
|
@ -37,6 +37,7 @@
|
||||
#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/timers.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
Loading…
Reference in New Issue
Block a user