ON Semiconductor / mbed-os

Dependents:   mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510

Embed: (wiki syntax)

« Back to documentation index

lwip_netif.c File Reference

lwip_netif.c File Reference

lwIP network interface abstraction More...

Go to the source code of this file.

Functions

static void netif_issue_reports (struct netif *netif, u8_t report_type)
 Send ARP/IGMP/MLD/RS events, e.g.
static err_t netif_null_output_ip6 (struct netif *netif, struct pbuf *p, const ip6_addr_t *ipaddr)
 Dummy IPv6 output function for netifs not supporting IPv6.
static err_t netif_loopif_init (struct netif *netif)
 Initialize a lwip network interface structure for a loopback interface.
err_t netif_input (struct pbuf *p, struct netif *inp)
 Forwards a received packet for input processing with ethernet_input() or ip_input() depending on netif flags.
struct netifnetif_add (struct netif *netif,#if LWIP_IPV4 const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,#endifvoid *state, netif_init_fn init, netif_input_fn input)
 Add a network interface to the list of lwIP netifs.
void netif_set_addr (struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw)
 Change IP address configuration for a network interface (including netmask and default gateway).
void netif_remove (struct netif *netif)
 Remove a network interface from the list of lwIP netifs.
struct netifnetif_find (const char *name)
 Find a network interface by searching for its name.
void netif_set_ipaddr (struct netif *netif, const ip4_addr_t *ipaddr)
 Change the IP address of a network interface.
void netif_set_gw (struct netif *netif, const ip4_addr_t *gw)
 Change the default gateway for a network interface.
void netif_set_netmask (struct netif *netif, const ip4_addr_t *netmask)
 Change the netmask of a network interface.
void netif_set_default (struct netif *netif)
 Set a network interface as the default network interface (used to output all packets for which no specific route is found)
void netif_set_up (struct netif *netif)
 Bring an interface up, available for processing traffic.
void netif_set_down (struct netif *netif)
 Bring an interface down, disabling any traffic processing.
void netif_set_status_callback (struct netif *netif, netif_status_callback_fn status_callback)
 Set callback to be called when interface is brought up/down or address is changed while up.
void netif_set_remove_callback (struct netif *netif, netif_status_callback_fn remove_callback)
 Set callback to be called when the interface has been removed.
void netif_set_link_up (struct netif *netif)
 Called by a driver when its link goes up.
void netif_set_link_down (struct netif *netif)
 Called by a driver when its link goes down.
void netif_set_link_callback (struct netif *netif, netif_status_callback_fn link_callback)
 Set callback to be called when link is brought up/down.
err_t netif_loop_output (struct netif *netif, struct pbuf *p)
 Send an IP packet to be received on the same netif (loopif-like).
void netif_poll (struct netif *netif)
 Call netif_poll() in the main loop of your application.
void netif_poll_all (void)
 Calls netif_poll() for every netif on the netif_list.
s8_t netif_get_ip6_addr_match (struct netif *netif, const ip6_addr_t *ip6addr)
 Checks if a specific address is assigned to the netif and returns its index.
void netif_create_ip6_linklocal_address (struct netif *netif, u8_t from_mac_48bit)
 Create a link-local IPv6 address on a netif (stored in slot 0)
err_t netif_add_ip6_address (struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx)
 This function allows for the easy addition of a new IPv6 address to an interface.

Variables

struct netifnetif_list
 The list of network interfaces.
struct netifnetif_default
 The default network interface.

Detailed Description

lwIP network interface abstraction

Definition in file lwip_netif.c.


Function Documentation

s8_t netif_get_ip6_addr_match ( struct netif netif,
const ip6_addr_t ip6addr 
)

Checks if a specific address is assigned to the netif and returns its index.

Parameters:
netifthe netif to check
ip6addrthe IPv6 address to find
Returns:
>= 0: address found, this is its index -1: address not found on this netif

Definition at line 1036 of file lwip_netif.c.

static void netif_issue_reports ( struct netif netif,
u8_t  report_type 
) [static]

Send ARP/IGMP/MLD/RS events, e.g.

on link-up/netif-up or addr-change

Definition at line 598 of file lwip_netif.c.

static err_t netif_loopif_init ( struct netif netif ) [static]

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 122 of file lwip_netif.c.

static err_t netif_null_output_ip6 ( struct netif netif,
struct pbuf p,
const ip6_addr_t ipaddr 
) [static]

Dummy IPv6 output function for netifs not supporting IPv6.

Definition at line 1145 of file lwip_netif.c.

void netif_poll ( struct netif netif )

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

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

Definition at line 865 of file lwip_netif.c.

void netif_poll_all ( void   )

Calls netif_poll() for every netif on the netif_list.

Definition at line 936 of file lwip_netif.c.


Variable Documentation

The default network interface.

Definition at line 91 of file lwip_netif.c.

struct netif* netif_list

The list of network interfaces.

Definition at line 90 of file lwip_netif.c.