netif API (to be used from TCPIP thread) More...
#include <stdbool.h>
#include "lwip/opt.h"
#include "lwip/err.h"
#include "lwip/ip_addr.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/stats.h"
Go to the source code of this file.
Data Structures | |
struct | netif |
Generic data structure used for all lwIP network interfaces. More... | |
union | netif_ext_callback_args_t |
Argument supplied to netif_ext_callback_fn. More... | |
struct | netif_ext_callback_args_t::link_changed_s |
Args to LWIP_NSC_LINK_CHANGED callback. More... | |
struct | netif_ext_callback_args_t::status_changed_s |
Args to LWIP_NSC_STATUS_CHANGED callback. More... | |
struct | netif_ext_callback_args_t::ipv4_changed_s |
Args to LWIP_NSC_IPV4_ADDRESS_CHANGED|LWIP_NSC_IPV4_GATEWAY_CHANGED|LWIP_NSC_IPV4_NETMASK_CHANGED|LWIP_NSC_IPV4_SETTINGS_CHANGED callback. More... | |
struct | netif_ext_callback_args_t::ipv6_set_s |
Args to LWIP_NSC_IPV6_SET callback. More... | |
struct | netif_ext_callback_args_t::ipv6_addr_state_changed_s |
Args to LWIP_NSC_IPV6_ADDR_STATE_CHANGED callback. More... | |
Macros | |
#define | NETIF_MAX_HWADDR_LEN 6U |
Must be the maximum of all used hardware address lengths across all types of interfaces in use. More... | |
#define | NETIF_NAMESIZE 6 |
The size of a fully constructed netif name which the netif can be identified by in APIs. More... | |
#define | NETIF_FLAG_UP 0x01U |
Whether the network interface is 'up'. More... | |
#define | NETIF_FLAG_BROADCAST 0x02U |
If set, the netif has broadcast capability. More... | |
#define | NETIF_FLAG_LINK_UP 0x04U |
If set, the interface has an active link (set by the network interface driver). More... | |
#define | NETIF_FLAG_ETHARP 0x08U |
If set, the netif is an ethernet device using ARP. More... | |
#define | NETIF_FLAG_ETHERNET 0x10U |
If set, the netif is an ethernet device. More... | |
#define | NETIF_FLAG_IGMP 0x20U |
If set, the netif has IGMP capability. More... | |
#define | NETIF_FLAG_MLD6 0x40U |
If set, the netif has MLD6 capability. More... | |
#define | netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) |
Ask if an interface is up. More... | |
#define | netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) |
Ask if a link is up. More... | |
#define | LWIP_NSC_NETIF_ADDED 0x0001 |
netif was added. More... | |
#define | LWIP_NSC_NETIF_REMOVED 0x0002 |
netif was removed. More... | |
#define | LWIP_NSC_LINK_CHANGED 0x0004 |
link changed More... | |
#define | LWIP_NSC_STATUS_CHANGED 0x0008 |
netif administrative status changed. More... | |
#define | LWIP_NSC_IPV4_ADDRESS_CHANGED 0x0010 |
IPv4 address has changed. More... | |
#define | LWIP_NSC_IPV4_GATEWAY_CHANGED 0x0020 |
IPv4 gateway has changed. More... | |
#define | LWIP_NSC_IPV4_NETMASK_CHANGED 0x0040 |
IPv4 netmask has changed. More... | |
#define | LWIP_NSC_IPV4_SETTINGS_CHANGED 0x0080 |
called AFTER IPv4 address/gateway/netmask changes have been applied More... | |
#define | LWIP_NSC_IPV6_SET 0x0100 |
IPv6 address was added. More... | |
#define | LWIP_NSC_IPV6_ADDR_STATE_CHANGED 0x0200 |
IPv6 address state has changed. More... | |
Typedefs | |
typedef err_t(* | netif_init_fn) (struct netif *netif) |
Function prototype for netif init functions. More... | |
typedef err_t(* | netif_input_fn) (struct pbuf *p, struct netif *inp) |
Function prototype for netif->input functions. More... | |
typedef err_t(* | netif_linkoutput_fn) (struct netif *netif, struct pbuf *p) |
Function prototype for netif->linkoutput functions. More... | |
typedef void(* | netif_status_callback_fn) (struct netif *netif) |
Function prototype for netif status- or link-callback functions. More... | |
typedef u16_t | netif_nsc_reason_t |
Extended netif status callback (NSC) reasons flags. More... | |
typedef void(* | netif_ext_callback_fn) (struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) |
Function used for extended netif status callbacks Note: When parsing reason argument, keep in mind that more reasons may be added in the future! More... | |
Enumerations |
Variables | |
struct netif * | netif_list |
The list of network interfaces. More... | |
struct netif * | netif_default |
The default network interface. More... | |
netif API (to be used from TCPIP thread)
Definition in file netif.h.
#define LWIP_NSC_IPV4_ADDRESS_CHANGED 0x0010 |
#define LWIP_NSC_IPV4_GATEWAY_CHANGED 0x0020 |
#define LWIP_NSC_IPV4_NETMASK_CHANGED 0x0040 |
#define LWIP_NSC_IPV4_SETTINGS_CHANGED 0x0080 |
#define LWIP_NSC_IPV6_ADDR_STATE_CHANGED 0x0200 |
#define LWIP_NSC_NETIF_ADDED 0x0001 |
#define LWIP_NSC_NETIF_REMOVED 0x0002 |
#define LWIP_NSC_STATUS_CHANGED 0x0008 |
#define netif_is_link_up | ( | netif | ) | (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) |
#define netif_is_up | ( | netif | ) | (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) |
#define NETIF_MAX_HWADDR_LEN 6U |
#define NETIF_NAMESIZE 6 |
typedef void(* netif_ext_callback_fn) (struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) |
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.
p | The received packet, copied into a pbuf |
inp | The netif which received the packet |
typedef u16_t netif_nsc_reason_t |
struct netif* netif_default |
The default network interface.
struct netif* netif_list |
The list of network interfaces.