From: EunBong Song Date: Tue, 21 Mar 2017 02:01:54 +0000 (+0900) Subject: net: add config menus for LwIP IP options X-Git-Tag: 1.1_Public_Release~614^2~229 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=128155252c946fbe3193e60caacd215f8eb4b535;p=rtos%2Ftinyara.git net: add config menus for LwIP IP options This patch adds for config menu for LwIP IP options. Change-Id: Idc3d68bba8618e9fc89416d5fb7078e3bcd4a5d8 Signed-off-by: EunBong Song --- diff --git a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig index 09048f7..8a0e42e 100755 --- a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig +++ b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig @@ -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 diff --git a/os/include/net/lwip/lwipopts.h b/os/include/net/lwip/lwipopts.h index 03ac14c..040a85b 100644 --- a/os/include/net/lwip/lwipopts.h +++ b/os/include/net/lwip/lwipopts.h @@ -107,8 +107,43 @@ /* ---------- 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 ---------- */ diff --git a/os/net/lwip/Kconfig b/os/net/lwip/Kconfig index d785fc9..0f29b2f 100644 --- a/os/net/lwip/Kconfig +++ b/os/net/lwip/Kconfig @@ -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