Tizen RT Libs&Environment  v1.1 D4
Collaboration diagram for DHCP:

Files

file  netif.h
 netif API (to be used from lwIP TCPIP thread)
 

Data Structures

struct  netif
 

Macros

#define MAX_NET_DEV_MTU   1500
 
#define ENABLE_LOOPBACK   (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
 
#define IP_ADDR0   192
 
#define IP_ADDR1   168
 
#define IP_ADDR2   2
 
#define IP_ADDR3   10
 
#define NETMASK_ADDR0   255
 
#define NETMASK_ADDR1   255
 
#define NETMASK_ADDR2   255
 
#define NETMASK_ADDR3   0
 
#define GW_ADDR0   192
 
#define GW_ADDR1   168
 
#define GW_ADDR2   2
 
#define GW_ADDR3   1
 
#define EXTERN   extern
 
#define NETIF_MAX_HWADDR_LEN   6U
 
#define NETIF_FLAG_UP   0x01U
 
#define NETIF_FLAG_BROADCAST   0x02U
 
#define NETIF_FLAG_POINTTOPOINT   0x04U
 
#define NETIF_FLAG_DHCP   0x08U
 
#define NETIF_FLAG_LINK_UP   0x10U
 
#define NETIF_FLAG_ETHARP   0x20U
 
#define NETIF_FLAG_ETHERNET   0x40U
 
#define NETIF_FLAG_IGMP   0x80U
 
#define MAC_ADDRLEN   0
 
#define MAC_HDRLEN   0
 
#define NETIF_INIT_SNMP(netif, type, speed)
 

Typedefs

typedef err_t(* netif_init_fn) (struct netif *netif)
 
typedef err_t(* netif_input_fn) (struct pbuf *p, struct netif *inp)
 
typedef err_t(* netif_output_fn) (struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr)
 
typedef err_t(* netif_linkoutput_fn) (struct netif *netif, struct pbuf *p)
 
typedef void(* netif_status_callback_fn) (struct netif *netif)
 
typedef err_t(* netif_igmp_mac_filter_fn) (struct netif *netif, ip_addr_t *group, u8_t action)
 

Functions

void netif_set_addr (struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw)
 Change IP address configuration for a network interface (including netmask and default gateway). More...
 
struct netifnetif_find (const char *name)
 Find a network interface by searching for its name. More...
 
void netif_set_up (struct netif *netif)
 Bring an interface up, available for processing traffic. More...
 
void netif_set_down (struct netif *netif)
 Bring an interface down, disabling any traffic processing. More...
 

Variables

struct netifnetif_list
 
struct netifnetif_default
 

Detailed Description

Macro Definition Documentation

◆ ENABLE_LOOPBACK

#define ENABLE_LOOPBACK   (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)

Definition at line 72 of file netif.h.

◆ EXTERN

#define EXTERN   extern

Definition at line 111 of file netif.h.

◆ GW_ADDR0

#define GW_ADDR0   192

Definition at line 102 of file netif.h.

◆ GW_ADDR1

#define GW_ADDR1   168

Definition at line 103 of file netif.h.

◆ GW_ADDR2

#define GW_ADDR2   2

Definition at line 104 of file netif.h.

◆ GW_ADDR3

#define GW_ADDR3   1

Definition at line 105 of file netif.h.

◆ IP_ADDR0

#define IP_ADDR0   192

Definition at line 90 of file netif.h.

◆ IP_ADDR1

#define IP_ADDR1   168

Definition at line 91 of file netif.h.

◆ IP_ADDR2

#define IP_ADDR2   2

Definition at line 92 of file netif.h.

◆ IP_ADDR3

#define IP_ADDR3   10

Definition at line 93 of file netif.h.

◆ MAC_ADDRLEN

#define MAC_ADDRLEN   0

Definition at line 196 of file netif.h.

◆ MAC_HDRLEN

#define MAC_HDRLEN   0

Definition at line 197 of file netif.h.

◆ MAX_NET_DEV_MTU

#define MAX_NET_DEV_MTU   1500

Definition at line 69 of file netif.h.

◆ NETIF_FLAG_BROADCAST

#define NETIF_FLAG_BROADCAST   0x02U

If set, the netif has broadcast capability. Set by the netif driver in its init function.

Definition at line 130 of file netif.h.

◆ NETIF_FLAG_DHCP

#define NETIF_FLAG_DHCP   0x08U

If set, the interface is configured using DHCP. Set by the DHCP code when starting or stopping DHCP.

Definition at line 136 of file netif.h.

◆ NETIF_FLAG_ETHARP

#define NETIF_FLAG_ETHARP   0x20U

If set, the netif is an ethernet device using ARP. Set by the netif driver in its init function. Used to check input packet types and use of DHCP.

Definition at line 146 of file netif.h.

◆ NETIF_FLAG_ETHERNET

#define NETIF_FLAG_ETHERNET   0x40U

If set, the netif is an ethernet device. It might not use ARP or TCP/IP if it is used for PPPoE only.

Definition at line 150 of file netif.h.

◆ NETIF_FLAG_IGMP

#define NETIF_FLAG_IGMP   0x80U

If set, the netif has IGMP capability. Set by the netif driver in its init function.

Definition at line 153 of file netif.h.

◆ NETIF_FLAG_LINK_UP

#define NETIF_FLAG_LINK_UP   0x10U

If set, the interface has an active link (set by the network interface driver). Either set by the netif driver in its init function (if the link is up at that time) or at a later point once the link comes up (if link detection is supported by the hardware).

Definition at line 142 of file netif.h.

◆ NETIF_FLAG_POINTTOPOINT

#define NETIF_FLAG_POINTTOPOINT   0x04U

If set, the netif is one end of a point-to-point connection. Set by the netif driver in its init function.

Definition at line 133 of file netif.h.

◆ NETIF_FLAG_UP

#define NETIF_FLAG_UP   0x01U

Whether the network interface is 'up'. This is a software flag used to control whether this network interface is enabled and processes traffic. It is set by the startup code (for static IP configuration) or by dhcp/autoip when an address has been assigned.

Definition at line 127 of file netif.h.

◆ NETIF_INIT_SNMP

#define NETIF_INIT_SNMP (   netif,
  type,
  speed 
)

Definition at line 344 of file netif.h.

◆ 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

Definition at line 119 of file netif.h.

◆ NETMASK_ADDR0

#define NETMASK_ADDR0   255

Definition at line 96 of file netif.h.

◆ NETMASK_ADDR1

#define NETMASK_ADDR1   255

Definition at line 97 of file netif.h.

◆ NETMASK_ADDR2

#define NETMASK_ADDR2   255

Definition at line 98 of file netif.h.

◆ NETMASK_ADDR3

#define NETMASK_ADDR3   0

Definition at line 99 of file netif.h.

Typedef Documentation

◆ netif_igmp_mac_filter_fn

typedef err_t(* netif_igmp_mac_filter_fn) (struct netif *netif, ip_addr_t *group, u8_t action)

Function prototype for netif igmp_mac_filter functions

Definition at line 187 of file netif.h.

◆ netif_init_fn

typedef err_t(* netif_init_fn) (struct netif *netif)

Function prototype for netif init functions. Set up flags and output/linkoutput callback functions in this function.

Parameters
netifThe netif to initialize

Definition at line 160 of file netif.h.

◆ netif_input_fn

typedef err_t(* netif_input_fn) (struct pbuf *p, struct netif *inp)

Function prototype for netif->input functions. This function is saved as 'input' callback function in the netif struct. Call it when a packet has been received.

Parameters
pThe received packet, copied into a pbuf
inpThe netif which received the packet

Definition at line 167 of file netif.h.

◆ netif_linkoutput_fn

typedef err_t(* netif_linkoutput_fn) (struct netif *netif, struct pbuf *p)

Function prototype for netif->linkoutput functions. Only used for ethernet netifs. This function is called by ARP when a packet shall be sent.

Parameters
netifThe netif which shall send a packet
pThe packet to send (raw ethernet packet)

Definition at line 183 of file netif.h.

◆ netif_output_fn

typedef err_t(* netif_output_fn) (struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr)

Function prototype for netif->output functions. Called by lwIP when a packet shall be sent. For ethernet netif, set this to 'etharp_output' and set 'linkoutput'.

Parameters
netifThe netif which shall send a packet
pThe packet to send (p->payload points to IP header)
ipaddrThe IP address to which the packet shall be sent

Definition at line 176 of file netif.h.

◆ netif_status_callback_fn

typedef void(* netif_status_callback_fn) (struct netif *netif)

Function prototype for netif status- or link-callback functions.

Definition at line 185 of file netif.h.

Function Documentation

◆ netif_find()

struct netif* netif_find ( const char *  name)

Find a network interface by searching for its name.

Returns a network interface given its name. The name is of the form "et0", where the first two letters are the "name" field in the netif structure, and the digit is in the num field in the same structure.

#include <net/lwip/netif.h>

Parameters
namethe name of the netif (like netif->name) plus concatenated number in ascii representation (e.g. 'en0')
Returns
netif the network interface
Since
Tizen RT v1.0

◆ netif_set_addr()

void netif_set_addr ( struct netif netif,
ip_addr_t *  ipaddr,
ip_addr_t *  netmask,
ip_addr_t *  gw 
)

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

#include <net/lwip/netif.h>

Parameters
[in]netifthe network interface to change
[in]ipaddrthe new IP address
[in]netmaskthe new netmask
[in]gwthe new default gateway
Note
netif parameter must not be null
Returns
none
Since
Tizen RT v1.0

◆ netif_set_down()

void netif_set_down ( struct netif netif)

Bring an interface down, disabling any traffic processing.

#include <net/lwip/netif.h>

Parameters
[in]netifthe network interface to change
Returns
none
Since
Tizen RT v1.0

◆ netif_set_up()

void netif_set_up ( struct netif netif)

Bring an interface up, available for processing traffic.

#include <net/lwip/netif.h>

Parameters
[in]netifthe network interface to change
Returns
none
Since
Tizen RT v1.0

Variable Documentation

◆ netif_default

struct netif* netif_default

The default network interface.

◆ netif_list

struct netif* netif_list

To be removed Later once netif_list is used in netlib API's List of registered Ethernet device drivers The list of network interfaces.