A version of LWIP, provided for backwards compatibility.

Dependents:   AA_DemoBoard DemoBoard HelloServerDemo DemoBoard_RangeIndicator ... more

Embed: (wiki syntax)

« Back to documentation index

loopif.c File Reference

loopif.c File Reference

Loop Interface. More...

Go to the source code of this file.

Functions

void loopif_poll (struct netif *netif)
 Call loopif_poll() in the main loop of your application.
static err_t loopif_output (struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
 Send an IP packet over the loopback interface.
err_t loopif_init (struct netif *netif)
 Initialize a lwip network interface structure for a loopback interface.

Detailed Description

Loop Interface.

Definition in file tag/0.2/lwIP/netif/loopif.c.


Function Documentation

err_t loopif_init ( struct netif netif )

Initialize a lwip network interface structure for a loopback interface.

Parameters:
netifthe lwip network interface structure for this loopif
Returns:
ERR_OK if the loopif is initialized ERR_MEM if private data couldn't be allocated

Definition at line 194 of file tag/0.2/lwIP/netif/loopif.c.

static err_t loopif_output ( struct netif netif,
struct pbuf *  p,
struct ip_addr *  ipaddr 
) [static]

Send an IP packet over the loopback interface.

The pbuf is simply copied and handed back to netif->input. In multithreaded mode, this is done directly since netif->input must put the packet on a queue. In callback mode, the packet is put on an internal queue and is fed to netif->input by loopif_poll().

Parameters:
netifthe lwip network interface structure for this loopif
pthe (IP) packet to 'send'
ipaddrthe ip address to send the packet to (not used for loopif)
Returns:
ERR_OK if the packet has been sent ERR_MEM if the pbuf used to copy the packet couldn't be allocated

Definition at line 130 of file tag/0.2/lwIP/netif/loopif.c.

void loopif_poll ( struct netif netif )

Call loopif_poll() in the main loop of your application.

This is to prevent reentering non-reentrant functions like tcp_input(). Packets passed to loopif_output() are put on a list that is passed to netif->input() by loopif_poll().

Parameters:
netifthe lwip network interface structure for this loopif

Definition at line 68 of file tag/0.2/lwIP/netif/loopif.c.