mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-07 00:04:36 +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:
@@ -38,6 +38,7 @@
|
||||
#define LWIP_HDR_APPS_SNTP_OPTS_H
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/prot/iana.h"
|
||||
|
||||
/**
|
||||
* @defgroup sntp_opts Options
|
||||
@@ -46,8 +47,10 @@
|
||||
*/
|
||||
|
||||
/** SNTP macro to change system time in seconds
|
||||
* Define SNTP_SET_SYSTEM_TIME_US(sec, us) to set the time in microseconds instead of this one
|
||||
* if you need the additional precision.
|
||||
* Define SNTP_SET_SYSTEM_TIME_US(sec, us) to set the time in microseconds
|
||||
* instead of this one if you need the additional precision. Alternatively,
|
||||
* define SNTP_SET_SYSTEM_TIME_NTP(sec, frac) in order to work with native
|
||||
* NTP timestamps instead.
|
||||
*/
|
||||
#if !defined SNTP_SET_SYSTEM_TIME || defined __DOXYGEN__
|
||||
#define SNTP_SET_SYSTEM_TIME(sec) LWIP_UNUSED_ARG(sec)
|
||||
@@ -81,12 +84,7 @@
|
||||
|
||||
/** SNTP server port */
|
||||
#if !defined SNTP_PORT || defined __DOXYGEN__
|
||||
#define SNTP_PORT 123
|
||||
#endif
|
||||
|
||||
/** Set this to 1 to allow config of SNTP server(s) by DNS name */
|
||||
#if !defined SNTP_SERVER_DNS || defined __DOXYGEN__
|
||||
#define SNTP_SERVER_DNS 0
|
||||
#define SNTP_PORT LWIP_IANA_PORT_SNTP
|
||||
#endif
|
||||
|
||||
/** Sanity check:
|
||||
@@ -96,7 +94,7 @@
|
||||
* response comes from the server we sent the request to.
|
||||
* - >= 2 to check returned Originate Timestamp against Transmit Timestamp
|
||||
* sent to the server (to ensure response to older request).
|
||||
* - >= 3 @todo: discard reply if any of the LI, Stratum, or Transmit Timestamp
|
||||
* - >= 3 @todo: discard reply if any of the VN, Stratum, or Transmit Timestamp
|
||||
* fields is 0 or the Mode field is not 4 (unicast) or 5 (broadcast).
|
||||
* - >= 4 @todo: to check that the Root Delay and Root Dispersion fields are each
|
||||
* greater than or equal to 0 and less than infinity, where infinity is
|
||||
@@ -107,6 +105,30 @@
|
||||
#define SNTP_CHECK_RESPONSE 0
|
||||
#endif
|
||||
|
||||
/** Enable round-trip delay compensation.
|
||||
* Compensate for the round-trip delay by calculating the clock offset from
|
||||
* the originate, receive, transmit and destination timestamps, as per RFC.
|
||||
*
|
||||
* The calculation requires compiler support for 64-bit integers. Also, either
|
||||
* SNTP_SET_SYSTEM_TIME_US or SNTP_SET_SYSTEM_TIME_NTP has to be implemented
|
||||
* for setting the system clock with sub-second precision. Likewise, either
|
||||
* SNTP_GET_SYSTEM_TIME or SNTP_GET_SYSTEM_TIME_NTP needs to be implemented
|
||||
* with sub-second precision.
|
||||
*
|
||||
* Although not strictly required, it makes sense to combine this option with
|
||||
* SNTP_CHECK_RESPONSE >= 2 for sanity-checking of the received timestamps.
|
||||
* Also, in order for the round-trip calculation to work, the difference
|
||||
* between the local clock and the NTP server clock must not be larger than
|
||||
* about 34 years. If that limit is exceeded, the implementation will fall back
|
||||
* to setting the clock without compensation. In order to ensure that the local
|
||||
* clock is always within the permitted range for compensation, even at first
|
||||
* try, it may be necessary to store at least the current year in non-volatile
|
||||
* memory.
|
||||
*/
|
||||
#if !defined SNTP_COMP_ROUNDTRIP || defined __DOXYGEN__
|
||||
#define SNTP_COMP_ROUNDTRIP 0
|
||||
#endif
|
||||
|
||||
/** According to the RFC, this shall be a random delay
|
||||
* between 1 and 5 minutes (in milliseconds) to prevent load peaks.
|
||||
* This can be defined to a random generation function,
|
||||
@@ -114,33 +136,40 @@
|
||||
* Turned off by default.
|
||||
*/
|
||||
#if !defined SNTP_STARTUP_DELAY || defined __DOXYGEN__
|
||||
#ifdef LWIP_RAND
|
||||
#define SNTP_STARTUP_DELAY 1
|
||||
#else
|
||||
#define SNTP_STARTUP_DELAY 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** If you want the startup delay to be a function, define this
|
||||
* to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1.
|
||||
*/
|
||||
#if !defined SNTP_STARTUP_DELAY_FUNC || defined __DOXYGEN__
|
||||
#define SNTP_STARTUP_DELAY_FUNC SNTP_STARTUP_DELAY
|
||||
#define SNTP_STARTUP_DELAY_FUNC (LWIP_RAND() % 5000)
|
||||
#endif
|
||||
|
||||
/** SNTP receive timeout - in milliseconds
|
||||
* Also used as retry timeout - this shouldn't be too low.
|
||||
* Default is 3 seconds.
|
||||
* Default is 15 seconds. Must not be beolw 15 seconds by specification (i.e. 15000)
|
||||
*/
|
||||
#if !defined SNTP_RECV_TIMEOUT || defined __DOXYGEN__
|
||||
#define SNTP_RECV_TIMEOUT 3000
|
||||
#define SNTP_RECV_TIMEOUT 15000
|
||||
#endif
|
||||
|
||||
/** SNTP update delay - in milliseconds
|
||||
* Default is 1 hour. Must not be beolw 15 seconds by specification (i.e. 15000)
|
||||
* Default is 1 hour. Must not be beolw 60 seconds by specification (i.e. 60000)
|
||||
*/
|
||||
#if !defined SNTP_UPDATE_DELAY || defined __DOXYGEN__
|
||||
#define SNTP_UPDATE_DELAY 3600000
|
||||
#endif
|
||||
|
||||
/** SNTP macro to get system time, used with SNTP_CHECK_RESPONSE >= 2
|
||||
* to send in request and compare in response.
|
||||
* to send in request and compare in response. Also used for round-trip
|
||||
* delay compensation if SNTP_COMP_ROUNDTRIP != 0.
|
||||
* Alternatively, define SNTP_GET_SYSTEM_TIME_NTP(sec, frac) in order to
|
||||
* work with native NTP timestamps instead.
|
||||
*/
|
||||
#if !defined SNTP_GET_SYSTEM_TIME || defined __DOXYGEN__
|
||||
#define SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0)
|
||||
@@ -166,6 +195,13 @@
|
||||
#define SNTP_RETRY_TIMEOUT_EXP 1
|
||||
#endif
|
||||
|
||||
/** Keep a reachability shift register per server
|
||||
* Default is on to conform to RFC.
|
||||
*/
|
||||
#if !defined SNTP_MONITOR_SERVER_REACHABILITY || defined __DOXYGEN__
|
||||
#define SNTP_MONITOR_SERVER_REACHABILITY 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user