42#include "lwip/ip_addr.h"
51#if LWIP_NETIF_LOOPBACK_MULTITHREADING
63#if LWIP_NETIF_STATUS_CALLBACK
64#define NETIF_STATUS_CALLBACK(n) do{ if (n->status_callback) { (n->status_callback)(n); }}while(0)
66#define NETIF_STATUS_CALLBACK(n)
69#if LWIP_NETIF_LINK_CALLBACK
70#define NETIF_LINK_CALLBACK(n) do{ if (n->link_callback) { (n->link_callback)(n); }}while(0)
72#define NETIF_LINK_CALLBACK(n)
81static struct netif loop_netif;
109 ip_addr_t loop_ipaddr, loop_netmask, loop_gw;
158#if LWIP_NETIF_STATUS_CALLBACK
161#if LWIP_NETIF_LINK_CALLBACK
177#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
178 netif->loop_cnt_current = 0;
259 struct netif * tmpNetif;
266 if (tmpNetif ==
NULL)
275#if LWIP_NETIF_REMOVE_CALLBACK
276 if (
netif->remove_callback) {
329 struct tcp_pcb_listen *lpcb;
335 pcb = tcp_active_pcbs;
336 while (pcb !=
NULL) {
353 for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb !=
NULL; lpcb = lpcb->next) {
468 etharp_gratuitous(
netif);
475 igmp_report_groups(
netif);
500 etharp_cleanup_netif(
netif);
507#if LWIP_NETIF_STATUS_CALLBACK
514 netif->status_callback = status_callback;
519#if LWIP_NETIF_REMOVE_CALLBACK
527 netif->remove_callback = remove_callback;
542 dhcp_network_changed(
netif);
548 autoip_network_changed(
netif);
556 etharp_gratuitous(
netif);
563 igmp_report_groups(
netif);
582#if LWIP_NETIF_LINK_CALLBACK
589 netif->link_callback = link_callback;
616#if LWIP_LOOPBACK_MAX_PBUFS
623 struct netif *stats_if = &loop_netif;
639#if LWIP_LOOPBACK_MAX_PBUFS
642 if(((
netif->loop_cnt_current + clen) <
netif->loop_cnt_current) ||
650 netif->loop_cnt_current += clen;
672 netif->loop_last = last;
674 netif->loop_first = r;
675 netif->loop_last = last;
683#if LWIP_NETIF_LOOPBACK_MULTITHREADING
705 struct netif *stats_if = &loop_netif;
715 in =
netif->loop_first;
717 struct pbuf *in_end = in;
718#if LWIP_LOOPBACK_MAX_PBUFS
722 ((
netif->loop_cnt_current - clen) <
netif->loop_cnt_current));
723 netif->loop_cnt_current -= clen;
727 in_end = in_end->
next;
730 if (in_end ==
netif->loop_last) {
758#if !LWIP_NETIF_LOOPBACK_MULTITHREADING
#define LWIP_UNUSED_ARG(x)
#define LWIP_DEBUGF(debug, message)
#define LWIP_ASSERT(message, assertion)
err_t ip_input(struct pbuf *p, struct netif *inp)
#define ip_addr_cmp(addr1, addr2)
#define ip_addr_isany(addr1)
#define ip4_addr1_16(ipaddr)
#define ip4_addr2_16(ipaddr)
#define ip_addr_set(dest, src)
#define IP4_ADDR(ipaddr, a, b, c, d)
#define ip_addr_islinklocal(addr1)
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
#define ip4_addr3_16(ipaddr)
#define ip_addr_set_zero(ipaddr)
#define ip4_addr4_16(ipaddr)
#define ip_addr_debug_print(debug, ipaddr)
void netif_set_netmask(struct netif *netif, ip_addr_t *netmask)
struct netif * netif_list
void netif_set_link_down(struct netif *netif)
void netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw)
struct netif * netif_default
struct netif * netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)
void netif_set_down(struct netif *netif)
#define NETIF_STATUS_CALLBACK(n)
struct netif * netif_find(char *name)
void netif_remove(struct netif *netif)
#define NETIF_LINK_CALLBACK(n)
void netif_set_gw(struct netif *netif, ip_addr_t *gw)
void netif_set_default(struct netif *netif)
void netif_set_link_up(struct netif *netif)
void netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)
void netif_set_up(struct netif *netif)
err_t(* netif_init_fn)(struct netif *netif)
void(* netif_status_callback_fn)(struct netif *netif)
#define NETIF_FLAG_LINK_UP
#define NETIF_FLAG_ETHARP
#define netif_is_up(netif)
err_t(* netif_input_fn)(struct pbuf *p, struct netif *inp)
#define NETIF_SET_HWADDRHINT(netif, hint)
#define NETIF_INIT_SNMP(netif, type, speed)
int link(const char *existing, const char *new)
#define LWIP_LOOPBACK_MAX_PBUFS
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
u8_t pbuf_clen(struct pbuf *p)
u8_t pbuf_free(struct pbuf *p)
err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
#define snmp_inc_iflist()
@ snmp_ifType_softwareLoopback
#define snmp_get_sysuptime(value)
#define snmp_inc_ifoutucastpkts(ni)
#define snmp_dec_iflist()
#define snmp_insert_ipaddridx_tree(ni)
#define snmp_delete_iprteidx_tree(dflt, ni)
#define snmp_inc_ifinucastpkts(ni)
#define snmp_add_ifinoctets(ni, value)
#define snmp_add_ifoutoctets(ni, value)
#define snmp_delete_ipaddridx_tree(ni)
#define snmp_insert_iprteidx_tree(dflt, ni)
#define snmp_inc_ifoutdiscards(ni)
#define LINK_STATS_INC(x)
#define SYS_ARCH_UNPROTECT(lev)
#define SYS_ARCH_PROTECT(lev)
#define SYS_ARCH_DECL_PROTECT(lev)
err_t tcpip_input(struct pbuf *p, struct netif *inp)
void(* tcpip_callback_fn)(void *ctx)
#define tcpip_callback(f, ctx)