Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync lwipopts.h with opts.h from lwip v2.1.3 #65

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions glue-lwip/arduino/lwipopts.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

#ifndef MYLWIPOPTS_H
#define MYLWIPOPTS_H

// opt.h version lwip-2.1.0rc1 for esp8266
/* opt.h version lwip-2.1.3 for esp8266 */

/**
* @file
Expand Down Expand Up @@ -991,7 +990,7 @@
#if !LWIP_IPV4
/* disable AUTOIP when IPv4 is disabled */
#undef LWIP_AUTOIP
#define LWIP_AUTOIP 0
#define LWIP_AUTOIP 0
#endif /* !LWIP_IPV4 */

/**
Expand Down Expand Up @@ -1559,7 +1558,7 @@
* LWIP_PBUF_REF_T: Refcount type in pbuf.
* Default width of u8_t can be increased if 255 refs are not enough for you.
*/
#ifndef LWIP_PBUF_REF_T
#if !defined LWIP_PBUF_REF_T || defined __DOXYGEN__
#define LWIP_PBUF_REF_T u8_t
#endif

Expand Down Expand Up @@ -2442,7 +2441,7 @@
* LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs
*/
#if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__
#define LWIP_IPV6_FORWARD 0 // 0
#define LWIP_IPV6_FORWARD 0
#endif

/**
Expand Down Expand Up @@ -2678,7 +2677,7 @@
* servers to the DNS module.
*/
#if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 // 0
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0
#endif
/**
* @}
Expand Down Expand Up @@ -2717,7 +2716,7 @@
* void dhcp6_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
*/
#if !defined LWIP_DHCP6_GET_NTP_SRV || defined __DOXYGEN__
#define LWIP_DHCP6_GET_NTP_SRV 1 // with 1: dhcp6_set_ntp_servers() must be implemented
#define LWIP_DHCP6_GET_NTP_SRV 1
#endif

/**
Expand Down Expand Up @@ -3504,9 +3503,6 @@
#if !defined DHCP6_DEBUG || defined __DOXYGEN__
#define DHCP6_DEBUG LWIP_DBG_OFF
#endif
/**
* @}
*/

/**
* NAPT_DEBUG: Enable debugging for NAPT.
Expand All @@ -3515,6 +3511,10 @@
#define NAPT_DEBUG LWIP_DBG_OFF
#endif

/**
* @}
*/

/**
* LWIP_TESTMODE: Changes to make unit test possible
*/
Expand Down Expand Up @@ -3705,4 +3705,4 @@ void tcp_kill_timewait (void);
} // extern "C"
#endif

#endif // MYLWIPOPTS_H
#endif /* MYLWIPOPTS_H */
54 changes: 32 additions & 22 deletions glue-lwip/open/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef MYLWIPOPTS_H
#define MYLWIPOPTS_H

// opt.h version lwip-2.1.0rc1 for esp8266
/* opt.h version lwip-2.1.3 for esp8266 */

/**
* @file
Expand Down Expand Up @@ -1552,16 +1552,24 @@
* TCP_MSS, IP header, and link header.
*/
#if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+PBUF_IP_HLEN+PBUF_TRANSPORT_HLEN+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
#endif

/**
* LWIP_PBUF_REF_T: Refcount type in pbuf.
* Default width of u8_t can be increased if 255 refs are not enough for you.
*/
#ifndef LWIP_PBUF_REF_T
#if !defined LWIP_PBUF_REF_T || defined __DOXYGEN__
#define LWIP_PBUF_REF_T u8_t
#endif

/**
* LWIP_PBUF_CUSTOM_DATA: Store private data on pbufs (e.g. timestamps)
* This extends struct pbuf so user can store custom data on every pbuf.
*/
#if !defined LWIP_PBUF_CUSTOM_DATA || defined __DOXYGEN__
#define LWIP_PBUF_CUSTOM_DATA
#endif
/**
* @}
*/
Expand Down Expand Up @@ -1608,7 +1616,7 @@
#endif

/**
* LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function
* LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function
* for several netif related event that supports multiple subscribers.
* @see netif_ext_status_callback
*/
Expand Down Expand Up @@ -1919,11 +1927,8 @@

/** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread,
* writing from a 2nd thread and closing from a 3rd thread at the same time.
* ATTENTION: This is currently really alpha! Some requirements:
* - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from
* multiple threads at once
* - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox
* and prevent a task pending on this during/after deletion
* LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from
* multiple threads at once!
*/
#if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__
#define LWIP_NETCONN_FULLDUPLEX 0
Expand Down Expand Up @@ -2396,7 +2401,7 @@
* All addresses that have a scope according to the default policy (link-local
* unicast addresses, interface-local and link-local multicast addresses) should
* now have a zone set on them before being passed to the core API, although
* lwIP will currently attempt to select a zone on the caller's behalf when
* lwIP will currently attempt to select a zone on the caller's behalf when
* necessary. Applications that directly assign IPv6 addresses to interfaces
* (which is NOT recommended) must now ensure that link-local addresses carry
* the netif's zone. See the new ip6_zone.h header file for more information and
Expand Down Expand Up @@ -2498,7 +2503,9 @@

/**
* LWIP_ICMP6_DATASIZE: bytes from original packet to send back in
* ICMPv6 error messages.
* ICMPv6 error messages (0 = default of IP6_MIN_MTU_LENGTH)
* ATTENTION: RFC4443 section 2.4 says IP6_MIN_MTU_LENGTH is a MUST,
* so override this only if you absolutely have to!
*/
#if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__
#define LWIP_ICMP6_DATASIZE 8
Expand Down Expand Up @@ -2665,7 +2672,7 @@
* servers to the DNS module.
*/
#if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 // 0
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0
#endif
/**
* @}
Expand Down Expand Up @@ -3034,8 +3041,8 @@
* - src: source eth address
* - dst: destination eth address
* - eth_type: ethernet type to packet to be sent\n
*
*
*
*
* Return values:
* - <0: Packet shall not contain VLAN header.
* - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order.
Expand Down Expand Up @@ -3491,9 +3498,6 @@
#if !defined DHCP6_DEBUG || defined __DOXYGEN__
#define DHCP6_DEBUG LWIP_DBG_OFF
#endif
/**
* @}
*/

/**
* NAPT_DEBUG: Enable debugging for NAPT.
Expand All @@ -3502,6 +3506,10 @@
#define NAPT_DEBUG LWIP_DBG_OFF
#endif

/**
* @}
*/

/**
* LWIP_TESTMODE: Changes to make unit test possible
*/
Expand Down Expand Up @@ -3550,9 +3558,9 @@
// so we do not define it. sntp server can come from dhcp server, or by
// user.
//#define SNTP_SERVER_ADDRESS "pool.ntp.org" // default
//#define SNTP_GET_SERVERS_FROM_DHCP // implicitely enabled by LWIP_DHCP_GET_NTP_SRV
//#define SNTP_GET_SERVERS_FROM_DHCP // implicitely enabled by LWIP_DHCP_GET_NTP_SRV

#define SNTP_SERVER_DNS 1 // enable SNTP support DNS names through sntp_setservername / sntp_getservername
#define SNTP_SERVER_DNS 1 // enable SNTP support DNS names through sntp_setservername / sntp_getservername

#define SNTP_SET_SYSTEM_TIME(t) (sntp_set_system_time(t)) // implemented in lwip2-sntp.c

Expand All @@ -3561,9 +3569,8 @@
#define SNTP_MAX_SERVERS 3
#endif

// turn off random delay before sntp request
// when SNTP_STARTUP_DELAY is not defined,
// LWIP_RAND is used to set a delay
// no delay by default before sntp request
// https://github.com/esp8266/Arduino/pull/5564
// from sntp_opts.h:
/** According to the RFC, this shall be a random delay
* between 1 and 5 minutes (in milliseconds) to prevent load peaks.
Expand Down Expand Up @@ -3591,6 +3598,9 @@ struct netif;
//#define LWIP_ERR_T s8_t
LWIP_ERR_T lwip_unhandled_packet (struct pbuf* pbuf, struct netif* netif);

// called when STA OR AP is set up or down
void netif_status_changed (struct netif*);

/*
--------------------------------------------------
----------------- TIME-WAIT tweak ----------------
Expand Down