netif_add() function
Add a network interface to the list of lwIP netifs.
Arguments
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
callback function that is called to pass ingress packets up in the protocol layer stack.\n It is recommended to use a function that passes the input directly to the stack (netif_input(), NO_SYS=1 mode) or via sending a message to TCPIP thread (tcpip_input(), NO_SYS=0 mode).\n These functions use netif flags NETIF_FLAG_ETHARP and NETIF_FLAG_ETHERNET to decide whether to forward to ethernet_input() or ip_input(). In other words, the functions only work when the netif driver is implemented correctly!\n Most members of struct netif should be be initialized by the netif init function = netif driver (init parameter of this function).\n IPv6: Don't forget to call netif_create_ip6_linklocal_address() after setting the MAC address in struct netif.hwaddr (IPv6 requires a link-local address).
Return value
netif, or NULL if failed.
Examples
netif_add() is referenced by
35 libraries and example projects.
Functions calling netif_add()
Functions called by netif_add()
netif_add()
printf() memset() all items filtered out
Data read by netif_add()
Data written by netif_add()
netif_add()::netif2 netif_add()::num_netifs all items filtered out
netif_add()
netif_add()::netif2 netif_add()::num_netifs all items filtered out
Type of netif_add()
netif_add()