#
# For a description of the syntax of this configuration file,
# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
#

if NET_TCP

config NET_TCP_TTL
	int "TCP TTL"
	default 255
	---help---
		Default Time-To-Live value

config NET_TCP_WND
	int "TCP Window Size"
	default 2144
	---help---
		The size of a TCP window.  This must be at least (2 * TCP_MSS)
		for things to work well

config NET_TCP_MAXRTX
	int "TCP Max Retransmissions"
	default 12
	---help---
		Maximum number of retransmissions of data segments.

config NET_TCP_SYNMAXRTX
	int "TCP SYN Max Retransmissions"
	default 6
	---help---
		Maximum number of retransmissions of SYN segments.

config NET_TCP_QUEUE_OOSEQ
	bool "TCP out of order support"
	default y
	---help---
		TCP will queue segments that arrive out of order.
		Select 'n' if your device is low on memory.

config NET_TCP_MSS
	int "TCP MSS"
	default 536
	---help---
		TCP Maximum segment size. (default is 536, a conservative default,
		you might want to increase this.) For the receive side, this MSS is
		advertised to the remote side when opening a connection. For the transmit
		size, this MSS sets an upper limit on the MSS advertised by the remote host.

config NET_TCP_CALCULATE_EFF_SEND_MSS
	bool "TCP Enable Effective Send MSS"
	default y
	---help---
		The maximum size of a segment that TCP really sends, the 'effective send MSS,
		' MUST be the smaller of the send MSS (which reflects the available reassembly
		buffer size at the remote host) and the largest size permitted by
		the IP layer (RFC 1122)
		Setting this to 1 enables code that checks TCP_MSS against the MTU of
		the netif used for a connection and limits the MSS if it would be too
		big otherwise.


config NET_TCP_SND_BUF
	int "TCP Send Buffer"
	default 1072
	---help---
		TCP sender buffer space (bytes).
		To achieve good performance, this should be at least 2 * TCP_MSS.


config NET_TCP_SND_QUEUELEN
	int "TCP Send Buffer Pbuf"
	default 8
	---help---
		TCP sender buffer space (pbufs).
		This must be at least as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.

if !NET_TCP_QUEUE_OOSEQ

config NET_TCP_OOSEQ_MAX_BYTES
	int "The maximum number of bytes queued on ooseq"
	default 0
	---help---
		The maximum number of bytes queued on ooseq per pcb.
		Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==n.


config NET_TCP_OOSEQ_MAX_PBUFS
	int "The maximum number of pbufs queued on ooseq per pcb"
	default 0
	---help---
		The maximum number of pbufs queued on ooseq per pcb.
		Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==n.

endif #!NET_TCP_QUEUE_OOSEQ


config NET_TCP_LISTEN_BACKLOG
	bool "Enable the backlog"
	default n
	---help---
		Enable the backlog option for tcp listen pcb.

if NET_TCP_LISTEN_BACKLOG

config NET_TCP_DEFAULT_LISTEN_BACKLOG
	hex "The maximum allowed backlog"
	default 0xff
	range 0x0 0xff
	---help---
		The maximum allowed backlog for TCP listen netconns.
		This backlog is used unless another is explicitly specified.
		0xff is the maximum (u8_t).

endif #NET_TCP_LISTEN_BACKLOG

config NET_TCP_OVERSIZE
	int "TCP Oversize"
	default 536
	---help---
		TCP_OVERSIZE: The maximum number of bytes that tcp_write may
		allocate ahead of time in an attempt to create shorter pbuf chains
		for transmission. The meaningful range is 0 to TCP_MSS. Some
		suggested values are:
		* 0:         Disable oversized allocation.
		             Each tcp_write() allocates a new pbuf (old behaviour).
		* 1:         Allocate size-aligned pbufs with minimal excess.
		             Use this if your scatter-gather DMA requires aligned fragments.
		* 128:       Limit the pbuf/memory overhead to 20%.
		* TCP_MSS:   Try to create unfragmented TCP packets.
		* TCP_MSS/4: Try to create 4 fragments or less per TCP packet.


config NET_TCP_TIMESTAMPS
	bool "Enable Timestamp"
	default n
	---help---
		support the TCP timestamp option.


config NET_TCP_WND_UPDATE_THREASHOLD
	int "TCP Window Update Threshold"
	default 536
	---help---
		Difference in window to trigger an explicit window update

endif #NET_TCP
