This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit a90d6a7450e0e1677f0a93d7eff3a8a3b3046053
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Feb 20 09:46:37 2026 +0100

    net/lwip: Some LWIP options are now selectable in syscfg
    
    Package net/ip/lwip_mn/lwipopts provides way to have
    default configuration options for lwip.
    
    Now some options can be changed in syscfg.
    
    User can still use custome lwipopts.h if option packaged
    net/ip/lwip_mn/lwipopts is not added to dependencies.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 net/ip/lwip_mn/lwipopts/include/lwipopts.h | 18 ++++++++++++------
 net/ip/lwip_mn/lwipopts/syscfg.yml         | 27 +++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/net/ip/lwip_mn/lwipopts/include/lwipopts.h 
b/net/ip/lwip_mn/lwipopts/include/lwipopts.h
index 882eb9320..1892a8b3e 100644
--- a/net/ip/lwip_mn/lwipopts/include/lwipopts.h
+++ b/net/ip/lwip_mn/lwipopts/include/lwipopts.h
@@ -23,6 +23,8 @@
 extern "C" {
 #endif
 
+#define LWIP_ICMP MYNEWT_VAL_LWIP_ICMP
+
 #define MEM_LIBC_MALLOC                        1       /* use platform malloc 
*/
 #define LWIP_NETIF_TX_SINGLE_PBUF      1
 #define LWIP_NETIF_LOOPBACK            1       /* yes loopback interface */
@@ -34,9 +36,9 @@ extern "C" {
 #define MEMP_NUM_ARP_QUEUE             4
 #define MEMP_NUM_RAW_PCB               1
 #define LWIP_SO_RCVTIMEO                1
-#define LWIP_IGMP                       1
+#define LWIP_IGMP                       MYNEWT_VAL_LWIP_IGMP
 #define SO_REUSE                        1
-#define LWIP_DNS                        1
+#define LWIP_DNS                        MYNEWT_VAL_LWIP_DNS
 #define DNS_TABLE_SIZE                  3
 #define DNS_MAX_NAME_LENGTH             64
 #define LWIP_NETIF_HOSTNAME             1
@@ -48,9 +50,11 @@ extern "C" {
 #define LWIP_AUTOIP                     0
 #define LWIP_DHCP_AUTOIP_COOP           0
 
-#define LWIP_IPV6                       1
+#define LWIP_IPV4                       MYNEWT_VAL_LWIP_IPV4
+#define LWIP_IPV6                       MYNEWT_VAL_LWIP_IPV6
 #define LWIP_ND6                        0
 #define MEMP_NUM_ND6_QUEUE              4
+#define LWIP_SUPPORT_CUSTOM_PBUF        1
 
 #ifndef LWIP_DEBUG
 #define LWIP_NOASSERT                   1
@@ -116,7 +120,7 @@ extern "C" {
 #define PBUF_LINK_HLEN                  16
 
 /* ---------- TCP options ---------- */
-#define LWIP_TCP                        1
+#define LWIP_TCP                        MYNEWT_VAL_LWIP_TCP
 #define TCP_TTL                         255
 
 /* Controls if TCP should queue segments that arrive out of
@@ -164,14 +168,16 @@ extern "C" {
 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
    interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
    turning this on does currently not work. */
-#define LWIP_DHCP                       1
+#define LWIP_DHCP                       MYNEWT_VAL_LWIP_DHCP
 
 /* 1 if you want to do an ARP check on the offered address
    (recommended). */
+#if LWIP_DHCP || LWIP_ARP
 #define DHCP_DOES_ARP_CHECK             1
+#endif
 
 /* ---------- UDP options ---------- */
-#define LWIP_UDP                        1
+#define LWIP_UDP                        MYNEWT_VAL_LWIP_UDP
 #define UDP_TTL                         255
 
 
diff --git a/net/ip/lwip_mn/lwipopts/syscfg.yml 
b/net/ip/lwip_mn/lwipopts/syscfg.yml
index b95a4f9d6..e18898bbc 100644
--- a/net/ip/lwip_mn/lwipopts/syscfg.yml
+++ b/net/ip/lwip_mn/lwipopts/syscfg.yml
@@ -16,6 +16,33 @@
 # under the License.
 #
 
+syscfg.defs:
+    LWIP_ICMP:
+        description: Enable ICMP support
+        value: 1
+    LWIP_IGMP:
+        description: Enable ICMP support
+        value: 1
+    LWIP_DHCP:
+        description: Enable DHCP support
+        value: 1
+        restrictions: LWIP_UDP
+    LWIP_DNS:
+        description: Enable DNS support
+        value: 1
+    LWIP_UDP:
+        description: Enable UDP support
+        value: 1
+    LWIP_TCP:
+        description: Enable TCP support
+        value: 1
+    LWIP_IPV4:
+        description: Enable IPV4 support
+        value: 1
+    LWIP_IPV6:
+        description: Enable IPV6 support
+        value: 1
+
 syscfg.restrictions:
     # As long as MEM_LIBC_MALLOC is 1 this restriction applies
     - 'BASELIBC_THREAD_SAFE_HEAP_ALLOCATION'

Reply via email to