mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-13 02:05:43 +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)
|
#define API_EXPR_DEREF(expr) *(expr)
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
#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
|
#if LWIP_NETCONN || LWIP_SOCKET
|
||||||
err_t tcpip_apimsg(struct api_msg *apimsg);
|
err_t tcpip_apimsg(struct api_msg *apimsg);
|
||||||
@ -180,7 +186,6 @@ enum tcpip_msg_type {
|
|||||||
|
|
||||||
struct tcpip_msg {
|
struct tcpip_msg {
|
||||||
enum tcpip_msg_type type;
|
enum tcpip_msg_type type;
|
||||||
sys_sem_t *sem;
|
|
||||||
union {
|
union {
|
||||||
#if LWIP_NETCONN || LWIP_SOCKET
|
#if LWIP_NETCONN || LWIP_SOCKET
|
||||||
struct api_msg *apimsg;
|
struct api_msg *apimsg;
|
||||||
@ -194,6 +199,7 @@ struct tcpip_msg {
|
|||||||
struct {
|
struct {
|
||||||
struct pbuf *p;
|
struct pbuf *p;
|
||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
|
tcpip_inpkt_fn input_fn;
|
||||||
} inp;
|
} inp;
|
||||||
struct {
|
struct {
|
||||||
tcpip_callback_fn function;
|
tcpip_callback_fn function;
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
|
#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
|
||||||
|
|
||||||
#include "lwip/err.h"
|
#include "lwip/err.h"
|
||||||
|
#include "lwip/timers.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
Loading…
Reference in New Issue
Block a user