#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"
Data Structures | |
struct | tcpip_msg |
Macros | |
#define | LOCK_TCPIP_CORE() |
#define | TCPIP_APIMSG(m) tcpip_apimsg(m) |
#define | TCPIP_APIMSG_ACK(m) sys_sem_signal(m->conn->op_completed) |
#define | tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1) |
#define | TCPIP_NETIFAPI(m) tcpip_netifapi(m) |
#define | TCPIP_NETIFAPI_ACK(m) sys_sem_signal(m->sem) |
#define | UNLOCK_TCPIP_CORE() |
Functions | |
err_t | mem_free_callback (void *m) |
A simple wrapper function that allows you to free heap memory from interrupt context. More... | |
err_t | pbuf_free_callback (struct pbuf *p) |
A simple wrapper function that allows you to free a pbuf from interrupt context. More... | |
err_t | tcpip_callback_with_block (void(*f)(void *ctx), void *ctx, u8_t block) |
Call a specific function in the thread context of tcpip_thread for easy access synchronization. More... | |
void | tcpip_init (void(*tcpip_init_done)(void *), void *arg) |
Initialize this module: More... | |
err_t | tcpip_input (struct pbuf *p, struct netif *inp) |
Pass a received packet to tcpip_thread for input processing. More... | |
err_t | tcpip_timeout (u32_t msecs, sys_timeout_handler h, void *arg) |
call sys_timeout in tcpip_thread More... | |
err_t | tcpip_untimeout (sys_timeout_handler h, void *arg) |
call sys_untimeout in tcpip_thread More... | |
#define LOCK_TCPIP_CORE | ( | ) |
#define TCPIP_APIMSG | ( | m | ) | tcpip_apimsg(m) |
#define TCPIP_APIMSG_ACK | ( | m | ) | sys_sem_signal(m->conn->op_completed) |
#define tcpip_callback | ( | f, | |
ctx | |||
) | tcpip_callback_with_block(f, ctx, 1) |
#define TCPIP_NETIFAPI | ( | m | ) | tcpip_netifapi(m) |
#define TCPIP_NETIFAPI_ACK | ( | m | ) | sys_sem_signal(m->sem) |
#define UNLOCK_TCPIP_CORE | ( | ) |
enum tcpip_msg_type |
err_t mem_free_callback | ( | void * | m | ) |
A simple wrapper function that allows you to free heap memory from interrupt context.
m | the heap memory to free |
References mem_free(), and tcpip_callback_with_block().
A simple wrapper function that allows you to free a pbuf from interrupt context.
p | The pbuf (chain) to be dereferenced. |
References pbuf_free_int(), and tcpip_callback_with_block().
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.
f | the function to call |
ctx | parameter passed to f |
block | 1 to block until the request is posted, 0 to non-blocking mode |
References tcpip_msg::cb, ctx, ERR_MEM, ERR_OK, ERR_VAL, tcpip_msg::f, memp_free(), memp_malloc(), tcpip_msg::msg, msg, NULL, SYS_MBOX_NULL, sys_mbox_post(), sys_mbox_trypost(), sys_mbox_valid(), TCPIP_MSG_CALLBACK, and tcpip_msg::type.
Referenced by mem_free_callback(), and pbuf_free_callback().
void tcpip_init | ( | void(*)(void *) | initfunc, |
void * | arg | ||
) |
Initialize this module:
initfunc | a function to call when tcpip_thread is running and finished initializing |
arg | argument to pass to initfunc |
References arg, lwip_init(), 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.
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 |
References ERR_MEM, ERR_OK, ERR_VAL, netif::flags, tcpip_msg::inp, LOCK_TCPIP_CORE, LWIP_DEBUGF, memp_free(), memp_malloc(), tcpip_msg::msg, msg, NETIF_FLAG_ETHARP, NETIF_FLAG_ETHERNET, NULL, tcpip_msg::p, SYS_MBOX_NULL, sys_mbox_trypost(), sys_mbox_valid(), TCPIP_DEBUG, TCPIP_MSG_INPKT, tcpip_msg::type, and UNLOCK_TCPIP_CORE.
Referenced by netif_init(), and prvEthernetConfigureInterface().
err_t tcpip_timeout | ( | u32_t | msecs, |
sys_timeout_handler | h, | ||
void * | arg | ||
) |
call sys_timeout in tcpip_thread
msec | time in miliseconds for timeout |
h | function to be called on timeout |
arg | argument to pass to timeout function h |
References arg, ERR_MEM, ERR_OK, ERR_VAL, tcpip_msg::h, memp_malloc(), tcpip_msg::msecs, tcpip_msg::msg, msg, NULL, SYS_MBOX_NULL, sys_mbox_post(), TCPIP_MSG_TIMEOUT, tcpip_msg::tmo, and tcpip_msg::type.
err_t tcpip_untimeout | ( | sys_timeout_handler | h, |
void * | arg | ||
) |
call sys_untimeout in tcpip_thread
msec | time in miliseconds for timeout |
h | function to be called on timeout |
arg | argument to pass to timeout function h |
References arg, ERR_MEM, ERR_OK, ERR_VAL, tcpip_msg::h, memp_malloc(), tcpip_msg::msg, msg, NULL, SYS_MBOX_NULL, sys_mbox_post(), TCPIP_MSG_UNTIMEOUT, tcpip_msg::tmo, and tcpip_msg::type.