SAMV71 Xplained Ultra Software Package 1.5

netif.c File Reference

#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/tcp.h"
#include "lwip/snmp.h"
#include "lwip/igmp.h"
#include "netif/etharp.h"

Go to the source code of this file.

Defines

#define NETIF_STATUS_CALLBACK(n)   { /* NOP */ }
#define NETIF_LINK_CALLBACK(n)   { /* NOP */ }

Functions

struct netifnetif_add (struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw, void *state, err_t(*init)(struct netif *netif), err_t(*input)(struct pbuf *p, struct netif *netif))
void netif_set_addr (struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw)
void netif_remove (struct netif *netif)
struct netifnetif_find (char *name)
void netif_set_ipaddr (struct netif *netif, struct ip_addr *ipaddr)
void netif_set_gw (struct netif *netif, struct ip_addr *gw)
void netif_set_netmask (struct netif *netif, struct ip_addr *netmask)
void netif_set_default (struct netif *netif)
void netif_set_up (struct netif *netif)
void netif_set_down (struct netif *netif)
u8_t netif_is_up (struct netif *netif)

Variables

struct netifnetif_list
struct netifnetif_default

Detailed Description

lwIP network interface abstraction

Definition in file netif.c.


Function Documentation

struct netif* netif_add ( struct netif netif,
struct ip_addr ipaddr,
struct ip_addr netmask,
struct ip_addr gw,
void *  state,
err_t(*)(struct netif *netif init,
err_t(*)(struct pbuf *p, struct netif *netif input 
) [read]

Add a network interface to the list of lwIP netifs.

Parameters:
netif a pre-allocated netif structure
ipaddr IP address for the new netif
netmask network mask for the new netif
gw default gateway IP address for the new netif
state opaque data passed to the new netif
init callback function that initializes the interface
input callback function that is called to pass ingress packets up in the protocol layer stack.
Returns:
netif, or NULL if failed.

Definition at line 92 of file netif.c.

Here is the call graph for this function:

struct netif* netif_find ( char *  name  )  [read]

Find a network interface by searching for its name

Parameters:
name the name of the netif (like netif->name) plus concatenated number in ascii representation (e.g. 'en0')

Definition at line 236 of file netif.c.

u8_t netif_is_up ( struct netif netif  ) 

Ask if an interface is up

Definition at line 451 of file netif.c.

void netif_remove ( struct netif netif  ) 

Remove a network interface from the list of lwIP netifs.

Parameters:
netif the network interface to remove

Definition at line 191 of file netif.c.

Here is the call graph for this function:

void netif_set_addr ( struct netif netif,
struct ip_addr ipaddr,
struct ip_addr netmask,
struct ip_addr gw 
)

Change IP address configuration for a network interface (including netmask and default gateway).

Parameters:
netif the network interface to change
ipaddr the new IP address
netmask the new netmask
gw the new default gateway

Definition at line 178 of file netif.c.

Here is the call graph for this function:

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)

Parameters:
netif the default network interface

Definition at line 372 of file netif.c.

void netif_set_down ( struct netif netif  ) 

Bring an interface down, disabling any traffic processing.

Note:
: Enabling DHCP on a down interface will make it come up once configured.
See also:
dhcp_start()

Definition at line 434 of file netif.c.

void netif_set_gw ( struct netif netif,
struct ip_addr gw 
)

Change the default gateway for a network interface

Parameters:
netif the network interface to change
gw the new default gateway
Note:
call netif_set_addr() if you also want to change ip address and netmask

Definition at line 330 of file netif.c.

void netif_set_ipaddr ( struct netif netif,
struct ip_addr ipaddr 
)

Change the IP address of a network interface

Parameters:
netif the network interface to change
ipaddr the new IP address
Note:
call netif_set_addr() if you also want to change netmask and default gateway

Definition at line 269 of file netif.c.

void netif_set_netmask ( struct netif netif,
struct ip_addr netmask 
)

Change the netmask of a network interface

Parameters:
netif the network interface to change
netmask the new netmask
Note:
call netif_set_addr() if you also want to change ip address and default gateway

Definition at line 351 of file netif.c.

void netif_set_up ( struct netif netif  ) 

Bring an interface up, available for processing traffic.

Note:
: Enabling DHCP on a down interface will make it come up once configured.
See also:
dhcp_start()

Definition at line 398 of file netif.c.


Variable Documentation

The default network interface.

Definition at line 75 of file netif.c.

struct netif* netif_list

The list of network interfaces.

Definition at line 74 of file netif.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines