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) 79 static struct netif loop_netif;
98 netif->
output = netif_loop_output;
107 ip_addr_t loop_ipaddr, loop_netmask, loop_gw;
140 static u8_t netifnum = 0;
152 netif->dhcps_pcb =
NULL;
156 netif->autoip =
NULL;
158 #if LWIP_NETIF_STATUS_CALLBACK 159 netif->status_callback =
NULL;
161 #if LWIP_NETIF_LINK_CALLBACK 162 netif->link_callback =
NULL;
165 netif->igmp_mac_filter =
NULL;
168 netif->loop_first =
NULL;
169 netif->loop_last =
NULL;
174 netif->
num = netifnum++;
176 #if LWIP_NETIF_HWADDRHINT 177 netif->addr_hint =
NULL;
179 #if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS 180 netif->loop_cnt_current = 0;
190 if (init(netif) !=
ERR_OK) {
261 if (netif_list == netif) {
262 netif_list = netif->
next;
265 struct netif * tmpNetif;
266 for (tmpNetif = netif_list; tmpNetif !=
NULL; tmpNetif = tmpNetif->
next) {
267 if (tmpNetif->
next == netif) {
272 if (tmpNetif ==
NULL)
277 if (netif_default == netif) {
302 for(netif = netif_list; netif !=
NULL; netif = netif->
next) {
303 if (num == netif->
num &&
304 name[0] == netif->
name[0] &&
305 name[1] == netif->
name[1]) {
330 struct tcp_pcb_listen *lpcb;
336 pcb = tcp_active_pcbs;
337 while (pcb !=
NULL) {
346 struct tcp_pcb *next = pcb->next;
354 for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb !=
NULL; lpcb = lpcb->next) {
440 netif_default = netif;
442 netif ? netif->
name[0] :
'\'', netif ? netif->
name[1] :
'\''));
469 etharp_gratuitous(netif);
476 igmp_report_groups( netif);
501 etharp_cleanup_netif(netif);
508 #if LWIP_NETIF_STATUS_CALLBACK 515 netif->status_callback = status_callback;
530 dhcp_network_changed(netif);
536 autoip_network_changed(netif);
544 etharp_gratuitous(netif);
551 igmp_report_groups( netif);
570 #if LWIP_NETIF_LINK_CALLBACK 577 netif->link_callback = link_callback;
598 netif_loop_output(
struct netif *netif,
struct pbuf *p,
604 #if LWIP_LOOPBACK_MAX_PBUFS 611 struct netif *stats_if = &loop_netif;
613 struct netif *stats_if = netif;
627 #if LWIP_LOOPBACK_MAX_PBUFS 630 if(((netif->loop_cnt_current + clen) < netif->loop_cnt_current) ||
638 netif->loop_cnt_current += clen;
657 if(netif->loop_first !=
NULL) {
658 LWIP_ASSERT(
"if first != NULL, last must also be != NULL", netif->loop_last !=
NULL);
659 netif->loop_last->
next = r;
660 netif->loop_last = last;
662 netif->loop_first = r;
663 netif->loop_last = last;
671 #if LWIP_NETIF_LOOPBACK_MULTITHREADING 686 netif_poll(
struct netif *netif)
693 struct netif *stats_if = &loop_netif;
695 struct netif *stats_if = netif;
703 in = netif->loop_first;
705 struct pbuf *in_end = in;
706 #if LWIP_LOOPBACK_MAX_PBUFS 710 ((netif->loop_cnt_current - clen) < netif->loop_cnt_current));
711 netif->loop_cnt_current -= clen;
715 in_end = in_end->
next;
718 if (in_end == netif->loop_last) {
720 netif->loop_first = netif->loop_last =
NULL;
723 netif->loop_first = in_end->
next;
724 LWIP_ASSERT(
"should not be null since first != last!", netif->loop_first !=
NULL);
743 }
while (netif->loop_first !=
NULL);
746 #if !LWIP_NETIF_LOOPBACK_MULTITHREADING 755 while (netif !=
NULL) {
err_t(* netif_input_fn)(struct pbuf *p, struct netif *inp)
struct netif * netif_list
void(* netif_status_callback_fn)(struct netif *netif)
#define ip4_addr3_16(ipaddr)
#define snmp_add_ifinoctets(ni, value)
err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from) ICACHE_FLASH_ATTR
void netif_set_gw(struct netif *netif, ip_addr_t *gw)
#define snmp_inc_ifinucastpkts(ni)
struct netif * netif_default
void(* tcpip_callback_fn)(void *ctx)
#define ip_addr_set(dest, src)
void netif_set_link_down(struct netif *netif)
#define ip_addr_debug_print(debug, ipaddr)
#define NETIF_FLAG_LINK_UP
void netif_set_default(struct netif *netif)
#define ICACHE_FLASH_ATTR
#define snmp_insert_ipaddridx_tree(ni)
#define snmp_inc_ifoutucastpkts(ni)
#define SYS_ARCH_DECL_PROTECT(x)
#define snmp_delete_ipaddridx_tree(ni)
void netif_set_up(struct netif *netif)
#define snmp_delete_iprteidx_tree(dflt, ni)
struct netif * netif_find(char *name)
#define NETIF_STATUS_CALLBACK(n)
#define tcpip_callback(f, ctx)
#define ip_addr_islinklocal(addr1)
#define NETIF_FLAG_ETHARP
#define LWIP_DEBUGF(debug, message)
#define snmp_dec_iflist()
#define ip_addr_cmp(addr1, addr2)
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)
#define snmp_inc_iflist()
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
#define LINK_STATS_INC(x)
void netif_remove(struct netif *netif)
err_t(* netif_init_fn)(struct netif *netif)
#define ip4_addr4_16(ipaddr)
err_t tcpip_input(struct pbuf *p, struct netif *inp)
#define ip_addr_isany(addr1)
#define ip_addr_set_zero(ipaddr)
#define NETIF_INIT_SNMP(netif, type, speed)
u8_t pbuf_free(struct pbuf *p) ICACHE_FLASH_ATTR
#define SYS_ARCH_PROTECT(x)
void netif_set_down(struct netif *netif)
void netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)
#define snmp_get_sysuptime(value)
#define NETIF_LINK_CALLBACK(n)
#define snmp_add_ifoutoctets(ni, value)
#define ip4_addr1_16(ipaddr)
#define LWIP_LOOPBACK_MAX_PBUFS
#define LWIP_ASSERT(message, assertion)
err_t ip_input(struct pbuf *p, struct netif *inp) ICACHE_FLASH_ATTR
#define snmp_inc_ifoutdiscards(ni)
void netif_set_netmask(struct netif *netif, ip_addr_t *netmask)
void netif_set_link_up(struct netif *netif)
#define ip4_addr2_16(ipaddr)
#define netif_is_up(netif)
#define snmp_insert_iprteidx_tree(dflt, ni)
#define SYS_ARCH_UNPROTECT(x)
#define LWIP_UNUSED_ARG(x)
struct pbuf * pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type) ICACHE_FLASH_ATTR
void netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw)
u8_t pbuf_clen(struct pbuf *p) ICACHE_FLASH_ATTR
#define IP4_ADDR(ipaddr, a, b, c, d)