#include "lwip/opt.h"
#include "lwip/api_msg.h"
#include "lwip/netifapi.h"
#include "lwip/pbuf.h"
#include "lwip/api.h"
#include "lwip/sys.h"
#include "lwip/netif.h"
#define LOCK_TCPIP_CORE |
( |
| ) |
|
#define TCPIP_APIMSG |
( |
|
m | ) |
tcpip_apimsg(m) |
#define TCPIP_NETIFAPI |
( |
|
m | ) |
tcpip_netifapi(m) |
#define UNLOCK_TCPIP_CORE |
( |
| ) |
|
Enumerator |
---|
TCPIP_MSG_INPKT |
|
TCPIP_MSG_CALLBACK |
|
TCPIP_MSG_CALLBACK_STATIC |
|
TCPIP_MSG_INPKT |
|
TCPIP_MSG_CALLBACK |
|
TCPIP_MSG_TIMEOUT |
|
TCPIP_MSG_UNTIMEOUT |
|
TCPIP_MSG_INPKT |
|
TCPIP_MSG_CALLBACK |
|
err_t mem_free_callback |
( |
void * |
m | ) |
|
A simple wrapper function that allows you to free heap memory from interrupt context.
- Parameters
-
- Returns
- ERR_OK if callback could be enqueued, an err_t if not
A simple wrapper function that allows you to free a pbuf from interrupt context.
- Parameters
-
p | The pbuf (chain) to be dereferenced. |
- Returns
- ERR_OK if callback could be enqueued, an err_t if not
Call a specific function in the thread context of tcpip_thread for easy access synchronization.
A function called in that way may access lwIP core code without fearing concurrent access.
- Parameters
-
f | the function to call |
ctx | parameter passed to f |
block | 1 to block until the request is posted, 0 to non-blocking mode |
- Returns
- ERR_OK if the function was called, another err_t if not
void tcpip_init |
( |
void(*)(void *) |
initfunc, |
|
|
void * |
arg |
|
) |
| |
Initialize this module:
- initialize all sub modules
- start the tcpip_thread
- Parameters
-
initfunc | a function to call when tcpip_thread is running and finished initializing |
arg | argument to pass to initfunc |
References arg, lwip_init(), mbox, NULL, sys_mbox_new(), sys_sem_new(), sys_thread_new(), tcpip_init_done, tcpip_init_done_arg, TCPIP_MBOX_SIZE, tcpip_thread(), TCPIP_THREAD_NAME, TCPIP_THREAD_PRIO, and TCPIP_THREAD_STACKSIZE.
Pass a received packet to tcpip_thread for input processing.
- Parameters
-
p | the received packet, p->payload pointing to the Ethernet header or to an IP header (if inp doesn't have NETIF_FLAG_ETHARP or NETIF_FLAG_ETHERNET flags) |
inp | the network interface on which the packet was received |
p | the received packet, p->payload pointing to the Ethernet header or to an IP header (if netif doesn't got NETIF_FLAG_ETHARP flag) |
inp | the network interface on which the packet was received |
call sys_timeout in tcpip_thread
- Parameters
-
msec | time in miliseconds for timeout |
h | function to be called on timeout |
arg | argument to pass to timeout function h |
- Returns
- ERR_MEM on memory error, ERR_OK otherwise
References arg, ERR_MEM, ERR_OK, ERR_VAL, tcpip_msg::h, mbox, memp_malloc(), tcpip_msg::msecs, tcpip_msg::msg, msg, NULL, sys_mbox_post(), TCPIP_MSG_TIMEOUT, tcpip_msg::tmo, and tcpip_msg::type.
call sys_untimeout in tcpip_thread
- Parameters
-
msec | time in miliseconds for timeout |
h | function to be called on timeout |
arg | argument to pass to timeout function h |
- Returns
- ERR_MEM on memory error, ERR_OK otherwise
References arg, ERR_MEM, ERR_OK, ERR_VAL, tcpip_msg::h, mbox, memp_malloc(), tcpip_msg::msg, msg, NULL, sys_mbox_post(), TCPIP_MSG_UNTIMEOUT, tcpip_msg::tmo, and tcpip_msg::type.