Functions

alexb/lib/lwip/contrib/src/api/tcpip.c File Reference

Sequential API Main thread module. More...

#include "lwip/opt.h"
#include "lwip/sys.h"
#include "lwip/memp.h"
#include "lwip/mem.h"
#include "lwip/pbuf.h"
#include "lwip/tcpip.h"
#include "lwip/init.h"
#include "netif/etharp.h"
#include "netif/ppp_oe.h"

Functions

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 (tcpip_callback_fn function, void *ctx, u8_t block)
 Call a specific function in the thread context of tcpip_thread for easy access synchronization.
void tcpip_init (tcpip_init_done_fn initfunc, void *arg)
 Initialize this module:

  • initialize all sub modules
  • start the tcpip_thread.

err_t pbuf_free_callback (struct pbuf *p)
 A simple wrapper function that allows you to free a pbuf from interrupt context.
err_t mem_free_callback (void *m)
 A simple wrapper function that allows you to free heap memory from interrupt context.

Detailed Description

Sequential API Main thread module.


Function Documentation

err_t mem_free_callback ( void *  m  ) 

A simple wrapper function that allows you to free heap memory from interrupt context.

Parameters:
m the heap memory to free
Returns:
ERR_OK if callback could be enqueued, an err_t if not
err_t pbuf_free_callback ( struct pbuf p  ) 

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
err_t tcpip_callback_with_block ( tcpip_callback_fn  function,
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:
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 ( tcpip_init_done_fn  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
err_t tcpip_input ( struct pbuf p,
struct netif inp 
)

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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines