Add generic tcpip_inpkt function that can be called to make last changes really usable

This commit is contained in:
Dirk Ziegelmeier
2016-02-22 20:18:10 +01:00
parent fa6f068fd1
commit 777e667f08
3 changed files with 35 additions and 52 deletions

View File

@@ -132,13 +132,6 @@ 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);
#endif /* LWIP_NETCONN || LWIP_SOCKET */

View File

@@ -50,11 +50,19 @@ struct netif;
typedef void (*tcpip_init_done_fn)(void *arg);
/** Function prototype for functions passed to tcpip_callback() */
typedef void (*tcpip_callback_fn)(void *ctx);
/** 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);
/* Forward declarations */
struct tcpip_callback_msg;
void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg);
err_t tcpip_inpkt(struct pbuf *p, struct netif *inp, tcpip_inpkt_fn input_fn);
err_t tcpip_input(struct pbuf *p, struct netif *inp);
err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block);