lwIP
2.1.0
Lightweight IP stack
|
#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"
Data Structures | |
struct | netif |
union | netif_ext_callback_args_t |
struct | netif_ext_callback_args_t::link_changed_s |
struct | netif_ext_callback_args_t::status_changed_s |
struct | netif_ext_callback_args_t::ipv4_changed_s |
struct | netif_ext_callback_args_t::ipv6_set_s |
struct | netif_ext_callback_args_t::ipv6_addr_state_changed_s |
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, const ip4_addr_t *ipaddr) |
typedef err_t(* | netif_output_ip6_fn) (struct netif *netif, struct pbuf *p, const ip6_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, const ip4_addr_t *group, enum netif_mac_filter_action action) |
typedef err_t(* | netif_mld_mac_filter_fn) (struct netif *netif, const ip6_addr_t *group, enum netif_mac_filter_action action) |
typedef u16_t | netif_nsc_reason_t |
typedef void(* | netif_ext_callback_fn) (struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) |
Enumerations | |
enum | netif_mac_filter_action { NETIF_DEL_MAC_FILTER = 0, NETIF_ADD_MAC_FILTER = 1 } |
Variables | |
struct netif * | netif_list |
struct netif * | netif_default |
netif API (to be used from TCPIP thread)
#define LWIP_NSC_IPV4_ADDRESS_CHANGED 0x0010 |
IPv4 address has changed
#define LWIP_NSC_IPV4_GATEWAY_CHANGED 0x0020 |
IPv4 gateway has changed
#define LWIP_NSC_IPV4_NETMASK_CHANGED 0x0040 |
IPv4 netmask has changed
#define LWIP_NSC_IPV4_SETTINGS_CHANGED 0x0080 |
called AFTER IPv4 address/gateway/netmask changes have been applied
#define LWIP_NSC_IPV6_ADDR_STATE_CHANGED 0x0200 |
IPv6 address state has changed
#define LWIP_NSC_IPV6_SET 0x0100 |
IPv6 address was added
#define LWIP_NSC_LINK_CHANGED 0x0004 |
link changed
#define LWIP_NSC_NETIF_ADDED 0x0001 |
netif was added. arg: NULL. Called AFTER netif was added.
#define LWIP_NSC_NETIF_REMOVED 0x0002 |
netif was removed. arg: NULL. Called BEFORE netif is removed.
#define LWIP_NSC_STATUS_CHANGED 0x0008 |
netif administrative status changed.
up is called AFTER netif is set up.
down is called BEFORE the netif is actually set down.
#define netif_is_link_up | ( | netif | ) | (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) |
Ask if a link is up
#define NETIF_MAX_HWADDR_LEN 6U |
Must be the maximum of all used hardware address lengths across all types of interfaces in use. This does not have to be changed, normally.
#define NETIF_NAMESIZE 6 |
The size of a fully constructed netif name which the netif can be identified by in APIs. Composed of 2 chars, 3 (max) digits, and 1 \0
typedef err_t(* netif_igmp_mac_filter_fn) (struct netif *netif, const ip4_addr_t *group, enum netif_mac_filter_action action) |
Function prototype for netif igmp_mac_filter functions
Function prototype for netif init functions. Set up flags and output/linkoutput callback functions in this function.
netif | The netif to initialize |
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 |
Function prototype for netif->linkoutput functions. Only used for ethernet netifs. This function is called by ARP when a packet shall be sent.
netif | The netif which shall send a packet |
p | The packet to send (raw ethernet packet) |
typedef err_t(* netif_mld_mac_filter_fn) (struct netif *netif, const ip6_addr_t *group, enum netif_mac_filter_action action) |
Function prototype for netif mld_mac_filter functions
typedef err_t(* netif_output_fn) (struct netif *netif, struct pbuf *p, const ip4_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'.
netif | The netif which shall send a packet |
p | The packet to send (p->payload points to IP header) |
ipaddr | The IP address to which the packet shall be sent |
typedef err_t(* netif_output_ip6_fn) (struct netif *netif, struct pbuf *p, const ip6_addr_t *ipaddr) |
Function prototype for netif->output_ip6 functions. Called by lwIP when a packet shall be sent. For ethernet netif, set this to 'ethip6_output' and set 'linkoutput'.
netif | The netif which shall send a packet |
p | The packet to send (p->payload points to IP header) |
ipaddr | The IPv6 address to which the packet shall be sent |
Function prototype for netif status- or link-callback functions.
s8_t netif_get_ip6_addr_match | ( | struct netif * | netif, |
const ip6_addr_t * | ip6addr | ||
) |
Checks if a specific local address is present on the netif and returns its index. Depending on its state, it may or may not be assigned to the interface (as per RFC terminology).
The given address may or may not be zoned (i.e., have a zone index other than IP6_NO_ZONE). If the address is zoned, it must have the correct zone for the given netif, or no match will be found.
netif | the netif to check |
ip6addr | the IPv6 address to find |
void netif_invoke_ext_callback | ( | struct netif * | netif, |
netif_nsc_reason_t | reason, | ||
const netif_ext_callback_args_t * | args | ||
) |
Invoke extended netif status event
netif | netif that is affected by change |
reason | change reason |
args | depends on reason, see reason description |
void netif_poll | ( | struct netif * | netif | ) |
Call netif_poll() in the main loop of your application. This is to prevent reentering non-reentrant functions like tcp_input(). Packets passed to netif_loop_output() are put on a list that is passed to netif->input() by netif_poll().
struct netif* netif_default |
The default network interface.
struct netif* netif_list |
The list of network interfaces.