net: add config menus for LwIP IP options
authorEunBong Song <eunb.song@samsung.com>
Tue, 21 Mar 2017 02:01:54 +0000 (11:01 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 10:58:10 +0000 (19:58 +0900)
This patch adds for config menu for LwIP IP options.

Change-Id: Idc3d68bba8618e9fc89416d5fb7078e3bcd4a5d8
Signed-off-by: EunBong Song <eunb.song@samsung.com>
build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig
os/include/net/lwip/lwipopts.h
os/net/lwip/Kconfig

index 09048f7..8a0e42e 100755 (executable)
@@ -675,6 +675,17 @@ CONFIG_NET_LWIP_ARP_QUEUEING=y
 CONFIG_NET_LWIP_ARP_TRUST_IP_MAC=y
 CONFIG_NET_LWIP_ETH_PAD_SIZE=0
 # CONFIG_NET_LWIP_ARP_STATIC_ENTRIES is not set
+
+#
+# IP options
+#
+# CONFIG_NET_LWIP_IP_FORWARD is not set
+CONFIG_NET_LWIP_IP_OPTIONS_ALLOWED=y
+CONFIG_NET_LWIP_IP_REASSEMBLY=y
+CONFIG_NET_LWIP_IP_REASSEMBLY_MAXAGE=5
+CONFIG_NET_LWIP_IP_REASS_MAX_PBUFS=20
+CONFIG_NET_LWIP_IP_FRAG=y
+CONFIG_NET_LWIP_IP_DEFAULT_TTL=255
 CONFIG_NET_SECURITY_TLS=y
 # CONFIG_TLS_WITH_SSS is not set
 CONFIG_NET_NOINTS=y
index 03ac14c..040a85b 100644 (file)
 
 
 /* ---------- IP options ---------- */
-#define IP_REASS_MAXAGE                 5
-#define IP_REASS_MAX_PBUFS              20
+#ifdef CONFIG_NET_LWIP_IP_FORWARD
+#define IP_FORWARD                      1
+#else
+#define IP_FORWARD                      0
+#endif
+
+#ifdef CONFIG_NET_LWIP_IP_OPTIONS_ALLOWED
+#define IP_OPTIONS_ALLOWED              1
+#else
+#define IP_OPTIONS_ALLOWED              0
+#endif
+
+
+#ifdef CONFIG_NET_LWIP_IP_REASSEMBLY
+#define IP_REASSEMBLY                   1
+#else
+#define IP_REASSEMBLY                   0
+#endif
+
+#ifdef CONFIG_NET_LWIP_IP_FRAG
+#define IP_FRAG                         1
+#else
+#define IP_FRAG                         0
+#endif
+
+#ifdef CONFIG_NET_LWIP_IP_REASSEMBLY_MAXAGE
+#define IP_REASS_MAXAGE                 CONFIG_NET_LWIP_IP_REASSEMBLY_MAXAGE
+#endif
+
+#ifdef CONFIG_NET_LWIP_IP_REASS_MAX_PBUFS
+#define IP_REASS_MAX_PBUFS              CONFIG_NET_LWIP_IP_REASS_MAX_PBUFS
+#endif
+
+#ifdef CONFIG_NET_LWIP_IP_DEFAULT_TTL
+#define IP_DEFAULT_TTL                  CONFIG_NET_LWIP_IP_DEFAULT_TTL
+#endif
+/* ---------- IP options ---------- */
 
 
 /* ---------- ICMP options ---------- */
index d785fc9..0f29b2f 100644 (file)
@@ -313,4 +313,61 @@ config NET_LWIP_ARP_STATIC_ENTRIES
 
 endif #NET_LWIP_ARP
 
+menu "IP options"
+
+config NET_LWIP_IP_FORWARD
+       bool "Support IP packet forwarding"
+       default n
+       ---help---
+               Enables the ability to forward IP packets across network
+               interfaces. If you are going to run lwIP on a device with only one network
+               interface, define this to 0.
+
+config NET_LWIP_IP_OPTIONS_ALLOWED
+       bool "Support IP options"
+       default y
+       ---help---
+               If disabled, all packets with IP options are dropped.
+               If enabled, IP options are allowed (but not parsed).
+
+config NET_LWIP_IP_REASSEMBLY
+       bool "Support IP packet reassembly"
+       default y
+       ---help---
+               Enable reassembling incoming fragmented IP packets.
+
+config NET_LWIP_IP_REASSEMBLY_MAXAGE
+       int "Maximum wait time in seconds for packet reassembly"
+       default 3
+       depends on NET_LWIP_IP_REASSEMBLY
+       ---help---
+               Maximum time in seconds a fragmented IP packet waits
+               for all fragments to arrive. If not all fragments arrived
+               in this time, the whole packet is discarded.
+
+config NET_LWIP_IP_REASS_MAX_PBUFS
+       int "Maximum number of pbufs waiting to be reassembled"
+       default 10
+       depends on NET_LWIP_IP_REASSEMBLY
+       ---help---
+               Total maximum amount of pbufs waiting to be reassembled.
+               Since the received pbufs are enqueued, be sure to configure
+               PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still
+               able to receive packets even if the maximum amount of fragments
+               is enqueued for reassembly!
+
+config NET_LWIP_IP_FRAG
+       bool "Support IP packet fragmentation"
+       default y
+       ---help---
+               Enable fragmentation of  outgoing IP packets if their size exceeds MTU.
+
+config NET_LWIP_IP_DEFAULT_TTL
+       int "Default value for Time-To-Live"
+       default 255
+       ---help---
+               Default value for Time-To-Live used by transport layers.
+
+endmenu #IP options
+
 endmenu #LwIP options