RetroArch
Classes | Macros | Functions | Variables
netif.h File Reference
#include "lwip/opt.h"
#include "lwip/err.h"
#include "lwip/ip_addr.h"
#include "lwip/inet.h"
#include "lwip/pbuf.h"
Include dependency graph for netif.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  netif
 

Macros

#define NETIF_MAX_HWADDR_LEN   6U
 
#define NETIF_FLAG_UP   0x1U
 
#define NETIF_FLAG_BROADCAST   0x2U
 
#define NETIF_FLAG_POINTTOPOINT   0x4U
 
#define NETIF_FLAG_DHCP   0x08U
 
#define NETIF_FLAG_LINK_UP   0x10U
 

Functions

void netif_init (void)
 
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_default (struct netif *netif)
 
void netif_set_ipaddr (struct netif *netif, struct ip_addr *ipaddr)
 
void netif_set_netmask (struct netif *netif, struct ip_addr *netmast)
 
void netif_set_gw (struct netif *netif, struct ip_addr *gw)
 
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
 

Macro Definition Documentation

◆ NETIF_FLAG_BROADCAST

#define NETIF_FLAG_BROADCAST   0x2U

if set, the netif has broadcast capability

◆ NETIF_FLAG_DHCP

#define NETIF_FLAG_DHCP   0x08U

if set, the interface is configured using DHCP

◆ NETIF_FLAG_LINK_UP

#define NETIF_FLAG_LINK_UP   0x10U

if set, the interface has an active link (set by the network interface driver)

◆ NETIF_FLAG_POINTTOPOINT

#define NETIF_FLAG_POINTTOPOINT   0x4U

if set, the netif is one end of a point-to-point connection

◆ NETIF_FLAG_UP

#define NETIF_FLAG_UP   0x1U

TODO: define the use (where, when, whom) of netif flags whether the network interface is 'up'. this is a software flag used to control whether this network interface is enabled and processes traffic.

◆ NETIF_MAX_HWADDR_LEN

#define NETIF_MAX_HWADDR_LEN   6U

must be the maximum of all used hardware address lengths across all types of interfaces in use

Function Documentation

◆ netif_add()

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 
)

Add a network interface to the list of lwIP netifs.

Parameters
netifa pre-allocated netif structure
ipaddrIP address for the new netif
netmasknetwork mask for the new netif
gwdefault gateway IP address for the new netif
stateopaque data passed to the new netif
initcallback function that initializes the interface
inputcallback function that is called to pass ingress packets up in the protocol layer stack.
Returns
netif, or NULL if failed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ netif_find()

struct netif* netif_find ( char *  name)

◆ netif_init()

void netif_init ( void  )
Here is the caller graph for this function:

◆ netif_is_up()

u8_t netif_is_up ( struct netif netif)

Ask if an interface is up

Here is the caller graph for this function:

◆ netif_remove()

void netif_remove ( struct netif netif)

◆ netif_set_addr()

void netif_set_addr ( struct netif netif,
struct ip_addr ipaddr,
struct ip_addr netmask,
struct ip_addr gw 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ netif_set_default()

void netif_set_default ( struct netif netif)
Here is the caller graph for this function:

◆ netif_set_down()

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()

◆ netif_set_gw()

void netif_set_gw ( struct netif netif,
struct ip_addr gw 
)
Here is the caller graph for this function:

◆ netif_set_ipaddr()

void netif_set_ipaddr ( struct netif netif,
struct ip_addr ipaddr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ netif_set_netmask()

void netif_set_netmask ( struct netif netif,
struct ip_addr netmast 
)
Here is the caller graph for this function:

◆ netif_set_up()

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()
Here is the caller graph for this function:

Variable Documentation

◆ netif_default

struct netif* netif_default

The default network interface.

◆ netif_list

struct netif* netif_list

The list of network interfaces.