Commit 5d5be356 authored by Johny Mattsson's avatar Johny Mattsson
Browse files

Upgraded LWIP to 1.4.0 released from Espressif.

Plus directly provided patch for user_interface.h.
parent 711d464a
......@@ -55,6 +55,10 @@
#include <string.h>
#ifdef MEMLEAK_DEBUG
static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
#endif
#if TCP_DEBUG
const char tcp_state_str_rodata[][12] ICACHE_RODATA_ATTR = {
"CLOSED",
......
......@@ -56,6 +56,10 @@
#include "lwip/snmp.h"
#include "arch/perf.h"
#ifdef MEMLEAK_DEBUG
static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
#endif
/* These variables are global to all functions involved in the input
processing of TCP segments. They are set by the tcp_input()
function. */
......@@ -436,6 +440,16 @@ aborted:
pbuf_free(inseg.p);//�ͷ�buffer
inseg.p = NULL;
}
/*add processing queue segments that arrive out of order by LiuHan*/
#if TCP_QUEUE_OOSEQ
extern char RxNodeNum(void);
if (RxNodeNum() < 2){
extern void pbuf_free_ooseq_new(void* arg);
// os_printf("reclaim some memory from queued\n");
pbuf_free_ooseq_new(NULL);
}
#endif
} else {
/* If no matching PCB was found, send a TCP RST (reset) to the
......
......@@ -52,9 +52,14 @@
#include "lwip/inet_chksum.h"
#include "lwip/stats.h"
#include "lwip/snmp.h"
#include "netif/etharp.h"
#include <string.h>
#ifdef MEMLEAK_DEBUG
static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
#endif
/* Define some copy-macros for checksum-on-copy so that the code looks
nicer by preventing too many ifdef's. */
#if TCP_CHECKSUM_ON_COPY
......@@ -226,16 +231,7 @@ tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
LWIP_UNUSED_ARG(apiflags);
LWIP_UNUSED_ARG(first_seg);
/* always create MSS-sized pbufs */
#ifdef ESP_MESH_SUPPORT
if (espconn_mesh_is_on()) {
if (alloc > TCP_MSS)
alloc = TCP_MSS;
} else {
alloc = TCP_MSS;
}
#else
alloc = TCP_MSS;
#endif
#else /* LWIP_NETIF_TX_SINGLE_PBUF */
if (length < max_length) {
/* Should we allocate an oversized pbuf, or just the minimum
......@@ -1451,6 +1447,7 @@ tcp_zero_window_probe(struct tcp_pcb *pcb)
struct pbuf *p;
struct tcp_hdr *tcphdr;
struct tcp_seg *seg;
u16_t offset = 0;
u16_t len;
u8_t is_fin;
......@@ -1469,6 +1466,11 @@ tcp_zero_window_probe(struct tcp_pcb *pcb)
if(seg == NULL) {
seg = pcb->unsent;
} else {
struct ip_hdr *iphdr = NULL;
iphdr = (struct ip_hdr *)((char*)seg->p->payload + SIZEOF_ETH_HDR);
offset = IPH_HL(iphdr)*4;
offset += SIZEOF_ETH_HDR;
}
if(seg == NULL) {
return;
......@@ -1492,7 +1494,12 @@ tcp_zero_window_probe(struct tcp_pcb *pcb)
/* Data segment, copy in one byte from the head of the unacked queue */
struct tcp_hdr *thdr = (struct tcp_hdr *)seg->p->payload;
char *d = ((char *)p->payload + TCP_HLEN);
if (pcb->unacked == NULL)
pbuf_copy_partial(seg->p, d, 1, TCPH_HDRLEN(thdr) * 4);
else {
thdr = (struct tcp_hdr *)((char*)seg->p->payload + offset);
pbuf_copy_partial(seg->p, d, 1, TCPH_HDRLEN(thdr) * 4 + offset);
}
}
#if CHECKSUM_GEN_TCP
......
......@@ -57,6 +57,9 @@
#include "lwip/igmp.h"
#include "lwip/dns.h"
#ifdef MEMLEAK_DEBUG
static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
#endif
/** The one and only timeout list */
static struct sys_timeo *next_timeout = NULL;
......@@ -245,6 +248,7 @@ void sys_timeouts_init(void)
sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
#endif /* LWIP_ARP */
#if LWIP_DHCP
DHCP_MAXRTX = 0;
sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
#endif /* LWIP_DHCP */
......@@ -259,8 +263,8 @@ void sys_timeouts_init(void)
#endif /* LWIP_DNS */
#if LWIP_TCP
//sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
sys_timeout(TCP_TMR_INTERVAL, tcp_timer_coarse, NULL);
sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
// sys_timeout(TCP_TMR_INTERVAL, tcp_timer_coarse, NULL);
#endif
#if NO_SYS
......
......@@ -64,6 +64,10 @@
#include <string.h>
#ifdef MEMLEAK_DEBUG
static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
#endif
/* The list of UDP PCBs */
/* exported in udp.h (was static) */
struct udp_pcb *udp_pcbs;
......
......@@ -62,6 +62,10 @@
#include <string.h>
#ifdef MEMLEAK_DEBUG
static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
#endif
const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}};
const struct eth_addr ethzero = {{0,0,0,0,0,0}};
......
......@@ -275,6 +275,7 @@ struct station_info {
};
struct dhcps_lease {
bool enable;
struct ip_addr start_ip;
struct ip_addr end_ip;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment