A version of LWIP, provided for backwards compatibility.

Dependents:   AA_DemoBoard DemoBoard HelloServerDemo DemoBoard_RangeIndicator ... more

Embed: (wiki syntax)

« Back to documentation index

tcpip.c File Reference

tcpip.c File Reference

Sequential API Main thread module. More...

Go to the source code of this file.

Functions

static void tcpip_tcp_timer (void *arg)
 Timer callback function that calls tcp_tmr() and reschedules itself.
void tcp_timer_needed (void)
 Called from TCP_REG when registering a new PCB: the reason is to have the TCP timer only running when there are active (or time-wait) PCBs.
static void ip_reass_timer (void *arg)
 Timer callback function that calls ip_reass_tmr() and reschedules itself.
static void arp_timer (void *arg)
 Timer callback function that calls etharp_tmr() and reschedules itself.
static void dhcp_timer_coarse (void *arg)
 Timer callback function that calls dhcp_coarse_tmr() and reschedules itself.
static void dhcp_timer_fine (void *arg)
 Timer callback function that calls dhcp_fine_tmr() and reschedules itself.
static void autoip_timer (void *arg)
 Timer callback function that calls autoip_tmr() and reschedules itself.
static void igmp_timer (void *arg)
 Timer callback function that calls igmp_tmr() and reschedules itself.
static void dns_timer (void *arg)
 Timer callback function that calls dns_tmr() and reschedules itself.
static void tcpip_thread (void *arg)
 The main lwIP thread.
err_t tcpip_input (struct pbuf *p, struct netif *inp)
 Pass a received packet to tcpip_thread for input processing.
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.
err_t tcpip_apimsg (struct api_msg *apimsg)
 Call the lower part of a netconn_* function This function is then running in the thread context of tcpip_thread and has exclusive access to lwIP core code.
err_t tcpip_apimsg_lock (struct api_msg *apimsg)
 Call the lower part of a netconn_* function This function has exclusive access to lwIP core code by locking it before the function is called.
err_t tcpip_netifapi (struct netifapi_msg *netifapimsg)
 Much like tcpip_apimsg, but calls the lower part of a netifapi_* function.
err_t tcpip_netifapi_lock (struct netifapi_msg *netifapimsg)
 Call the lower part of a netifapi_* function This function has exclusive access to lwIP core code by locking it before the function is called.
void tcpip_init (void(*initfunc)(void *), void *arg)
 Initialize this module:

  • initialize all sub modules
  • start the tcpip_thread.

Variables

sys_sem_t lock_tcpip_core
 The global semaphore to lock the stack.

Detailed Description

Sequential API Main thread module.

Definition in file 7/Core/lwIP/api/tcpip.c.


Function Documentation

static void arp_timer ( void *  arg ) [static]

Timer callback function that calls etharp_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 135 of file 7/Core/lwIP/api/tcpip.c.

static void autoip_timer ( void *  arg ) [static]

Timer callback function that calls autoip_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 181 of file 7/Core/lwIP/api/tcpip.c.

static void dhcp_timer_coarse ( void *  arg ) [static]

Timer callback function that calls dhcp_coarse_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 151 of file 7/Core/lwIP/api/tcpip.c.

static void dhcp_timer_fine ( void *  arg ) [static]

Timer callback function that calls dhcp_fine_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 165 of file 7/Core/lwIP/api/tcpip.c.

static void dns_timer ( void *  arg ) [static]

Timer callback function that calls dns_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 213 of file 7/Core/lwIP/api/tcpip.c.

static void igmp_timer ( void *  arg ) [static]

Timer callback function that calls igmp_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 197 of file 7/Core/lwIP/api/tcpip.c.

static void ip_reass_timer ( void *  arg ) [static]

Timer callback function that calls ip_reass_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 119 of file 7/Core/lwIP/api/tcpip.c.

void tcp_timer_needed ( void   )

Called from TCP_REG when registering a new PCB: the reason is to have the TCP timer only running when there are active (or time-wait) PCBs.

Definition at line 100 of file 7/Core/lwIP/api/tcpip.c.

err_t tcpip_apimsg ( struct api_msg apimsg )

Call the lower part of a netconn_* function This function is then running in the thread context of tcpip_thread and has exclusive access to lwIP core code.

Parameters:
apimsga struct containing the function to call and its parameters
Returns:
ERR_OK if the function was called, another err_t if not

Definition at line 413 of file 7/Core/lwIP/api/tcpip.c.

err_t tcpip_apimsg_lock ( struct api_msg apimsg )

Call the lower part of a netconn_* function This function has exclusive access to lwIP core code by locking it before the function is called.

Parameters:
apimsga struct containing the function to call and its parameters
Returns:
ERR_OK (only for compatibility fo tcpip_apimsg())

Definition at line 437 of file 7/Core/lwIP/api/tcpip.c.

err_t tcpip_callback_with_block ( void(*)(void *ctx)  f,
void *  ctx,
u8_t  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.

Parameters:
fthe function to call
ctxparameter passed to f
block1 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

Definition at line 356 of file 7/Core/lwIP/api/tcpip.c.

void tcpip_init ( void(*)(void *)  initfunc,
void *  arg 
)

Initialize this module:

  • initialize all sub modules
  • start the tcpip_thread.

Parameters:
initfunca function to call when tcpip_thread is running and finished initializing
argargument to pass to initfunc

Definition at line 507 of file 7/Core/lwIP/api/tcpip.c.

err_t tcpip_input ( struct pbuf *  p,
struct netif inp 
)

Pass a received packet to tcpip_thread for input processing.

Parameters:
pthe received packet, p->payload pointing to the Ethernet header or to an IP header (if netif doesn't got NETIF_FLAG_ETHARP flag)
inpthe network interface on which the packet was received

Definition at line 322 of file 7/Core/lwIP/api/tcpip.c.

err_t tcpip_netifapi ( struct netifapi_msg *  netifapimsg )

Much like tcpip_apimsg, but calls the lower part of a netifapi_* function.

Parameters:
netifapimsga struct containing the function to call and its parameters
Returns:
error code given back by the function that was called

Definition at line 458 of file 7/Core/lwIP/api/tcpip.c.

err_t tcpip_netifapi_lock ( struct netifapi_msg *  netifapimsg )

Call the lower part of a netifapi_* function This function has exclusive access to lwIP core code by locking it before the function is called.

Parameters:
netifapimsga struct containing the function to call and its parameters
Returns:
ERR_OK (only for compatibility fo tcpip_netifapi())

Definition at line 488 of file 7/Core/lwIP/api/tcpip.c.

static void tcpip_tcp_timer ( void *  arg ) [static]

Timer callback function that calls tcp_tmr() and reschedules itself.

Parameters:
argunused argument

Definition at line 77 of file 7/Core/lwIP/api/tcpip.c.

static void tcpip_thread ( void *  arg ) [static]

The main lwIP thread.

This thread has exclusive access to lwIP core functions (unless access to them is not locked). Other threads communicate with this thread using message boxes.

It also starts all the timers to make sure they are running in the right thread context.

Parameters:
argunused argument

Definition at line 233 of file 7/Core/lwIP/api/tcpip.c.


Variable Documentation

sys_sem_t lock_tcpip_core

The global semaphore to lock the stack.

Definition at line 64 of file 7/Core/lwIP/api/tcpip.c.