mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
update to lwIP-2.1.0: partial SACK support by default (de-selectable in menu) (#5126)
* update to lwIP-2.1.0rc1: partial SACK support fix #4176 * hash fix * get some flash back due to mistake in conf (fragmentation & reassembly was incorrectly enabled) (ahah I scared you) * add missing include files * update to lwip-2.1.0(release) + remove unused lwIP's include files * lwIP release 2.1.0, SACK is now default, bigger, no-SACK is selectable * fix ldscript * pio * rename 'sack' option to 'feat'ure option, + IP fragmentation/reassembly * merge, fix pio * change internal/hidden string * pio: more lwip2 configuration: + without sack for no change in flash footprint
This commit is contained in:
@ -52,6 +52,8 @@
|
||||
* @ingroup sys_layer
|
||||
* All defines related to this section must not be placed in lwipopts.h,
|
||||
* but in arch/cc.h!
|
||||
* If the compiler does not provide memset() this file must include a
|
||||
* definition of it, or include a file which defines it.
|
||||
* These options cannot be \#defined in lwipopts.h since they are not options
|
||||
* of lwIP itself, but options of the lwIP port to your system.
|
||||
* @{
|
||||
@ -116,12 +118,20 @@
|
||||
/* Define generic types used in lwIP */
|
||||
#if !LWIP_NO_STDINT_H
|
||||
#include <stdint.h>
|
||||
/* stdint.h is C99 which should also provide support for 64-bit integers */
|
||||
#if !defined(LWIP_HAVE_INT64) && defined(UINT64_MAX)
|
||||
#define LWIP_HAVE_INT64 1
|
||||
#endif
|
||||
typedef uint8_t u8_t;
|
||||
typedef int8_t s8_t;
|
||||
typedef uint16_t u16_t;
|
||||
typedef int16_t s16_t;
|
||||
typedef uint32_t u32_t;
|
||||
typedef int32_t s32_t;
|
||||
#if LWIP_HAVE_INT64
|
||||
typedef uint64_t u64_t;
|
||||
typedef int64_t s64_t;
|
||||
#endif
|
||||
typedef uintptr_t mem_ptr_t;
|
||||
#endif
|
||||
|
||||
@ -164,7 +174,7 @@ typedef uintptr_t mem_ptr_t;
|
||||
|
||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
||||
* the limits.h header. You need to define the type limits yourself in this case
|
||||
* (e.g. INT_MAX).
|
||||
* (e.g. INT_MAX, SSIZE_MAX).
|
||||
*/
|
||||
#ifndef LWIP_NO_LIMITS_H
|
||||
#define LWIP_NO_LIMITS_H 0
|
||||
@ -175,6 +185,56 @@ typedef uintptr_t mem_ptr_t;
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
/* Do we need to define ssize_t? This is a compatibility hack:
|
||||
* Unfortunately, this type seems to be unavailable on some systems (even if
|
||||
* sys/types or unistd.h are available).
|
||||
* Being like that, we define it to 'int' if SSIZE_MAX is not defined.
|
||||
*/
|
||||
#ifdef SSIZE_MAX
|
||||
/* If SSIZE_MAX is defined, unistd.h should provide the type as well */
|
||||
#ifndef LWIP_NO_UNISTD_H
|
||||
#define LWIP_NO_UNISTD_H 0
|
||||
#endif
|
||||
#if !LWIP_NO_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#else /* SSIZE_MAX */
|
||||
typedef int ssize_t;
|
||||
#define SSIZE_MAX INT_MAX
|
||||
#endif /* SSIZE_MAX */
|
||||
|
||||
/* some maximum values needed in lwip code */
|
||||
#define LWIP_UINT32_MAX 0xffffffff
|
||||
|
||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
||||
* the ctype.h header. If ctype.h is available, a few character functions
|
||||
* are mapped to the appropriate functions (lwip_islower, lwip_isdigit...), if
|
||||
* not, a private implementation is provided.
|
||||
*/
|
||||
#ifndef LWIP_NO_CTYPE_H
|
||||
#define LWIP_NO_CTYPE_H 0
|
||||
#endif
|
||||
|
||||
#if LWIP_NO_CTYPE_H
|
||||
#define lwip_in_range(c, lo, up) ((u8_t)(c) >= (lo) && (u8_t)(c) <= (up))
|
||||
#define lwip_isdigit(c) lwip_in_range((c), '0', '9')
|
||||
#define lwip_isxdigit(c) (lwip_isdigit(c) || lwip_in_range((c), 'a', 'f') || lwip_in_range((c), 'A', 'F'))
|
||||
#define lwip_islower(c) lwip_in_range((c), 'a', 'z')
|
||||
#define lwip_isspace(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || (c) == '\r' || (c) == '\t' || (c) == '\v')
|
||||
#define lwip_isupper(c) lwip_in_range((c), 'A', 'Z')
|
||||
#define lwip_tolower(c) (lwip_isupper(c) ? (c) - 'A' + 'a' : c)
|
||||
#define lwip_toupper(c) (lwip_islower(c) ? (c) - 'a' + 'A' : c)
|
||||
#else
|
||||
#include <ctype.h>
|
||||
#define lwip_isdigit(c) isdigit((unsigned char)(c))
|
||||
#define lwip_isxdigit(c) isxdigit((unsigned char)(c))
|
||||
#define lwip_islower(c) islower((unsigned char)(c))
|
||||
#define lwip_isspace(c) isspace((unsigned char)(c))
|
||||
#define lwip_isupper(c) isupper((unsigned char)(c))
|
||||
#define lwip_tolower(c) tolower((unsigned char)(c))
|
||||
#define lwip_toupper(c) toupper((unsigned char)(c))
|
||||
#endif
|
||||
|
||||
/** C++ const_cast<target_type>(val) equivalent to remove constness from a value (GCC -Wcast-qual) */
|
||||
#ifndef LWIP_CONST_CAST
|
||||
#define LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val))
|
||||
@ -192,6 +252,11 @@ typedef uintptr_t mem_ptr_t;
|
||||
#define LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)
|
||||
#endif
|
||||
|
||||
/** Avoid warnings/errors related to implicitly casting away packed attributes by doing a explicit cast */
|
||||
#ifndef LWIP_PACKED_CAST
|
||||
#define LWIP_PACKED_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)
|
||||
#endif
|
||||
|
||||
/** Allocates a memory buffer of specified size that is of sufficient size to align
|
||||
* its start address using LWIP_MEM_ALIGN.
|
||||
* You can declare your own version here e.g. to enforce alignment without adding
|
||||
@ -291,7 +356,7 @@ extern "C" {
|
||||
#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x)
|
||||
#endif /* PACK_STRUCT_FLD_S */
|
||||
|
||||
/** Packed structs support using \#include files before and after struct to be packed.\n
|
||||
/** PACK_STRUCT_USE_INCLUDES==1: Packed structs support using \#include files before and after struct to be packed.\n
|
||||
* The file included BEFORE the struct is "arch/bpstruct.h".\n
|
||||
* The file included AFTER the struct is "arch/epstruct.h".\n
|
||||
* This can be used to implement struct packing on MS Visual C compilers, see
|
||||
@ -308,6 +373,15 @@ extern "C" {
|
||||
#define LWIP_UNUSED_ARG(x) (void)x
|
||||
#endif /* LWIP_UNUSED_ARG */
|
||||
|
||||
/** LWIP_PROVIDE_ERRNO==1: Let lwIP provide ERRNO values and the 'errno' variable.
|
||||
* If this is disabled, cc.h must either define 'errno', include <errno.h>,
|
||||
* define LWIP_ERRNO_STDINCLUDE to get <errno.h> included or
|
||||
* define LWIP_ERRNO_INCLUDE to <errno.h> or equivalent.
|
||||
*/
|
||||
#if defined __DOXYGEN__
|
||||
#define LWIP_PROVIDE_ERRNO
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user