Mistake on this page?
Report an issue in GitHub or email us
Macros

Macros

#define LWIP_TCP   1
 LWIP_TCP==1: Turn on TCP. More...
 
#define TCP_TTL   IP_DEFAULT_TTL
 TCP_TTL: Default Time-To-Live value. More...
 
#define TCP_WND   (4 * TCP_MSS)
 TCP_WND: The size of a TCP window. More...
 
#define TCP_MAXRTX   12
 TCP_MAXRTX: Maximum number of retransmissions of data segments. More...
 
#define TCP_SYNMAXRTX   6
 TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. More...
 
#define TCP_QUEUE_OOSEQ   LWIP_TCP
 TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. More...
 
#define LWIP_TCP_SACK_OUT   0
 LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs). More...
 
#define LWIP_TCP_MAX_SACK_NUM   4
 LWIP_TCP_MAX_SACK_NUM: The maximum number of SACK values to include in TCP segments. More...
 
#define TCP_MSS   536
 TCP_MSS: TCP Maximum segment size. More...
 
#define TCP_CALCULATE_EFF_SEND_MSS   1
 TCP_CALCULATE_EFF_SEND_MSS: "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. More...
 
#define TCP_SND_BUF   (2 * TCP_MSS)
 TCP_SND_BUF: TCP sender buffer space (bytes). More...
 
#define TCP_SND_QUEUELEN   ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
 TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). More...
 
#define TCP_SNDLOWAT   LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)
 TCP_SNDLOWAT: TCP writable space (bytes). More...
 
#define TCP_SNDQUEUELOWAT   LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)
 TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). More...
 
#define TCP_OOSEQ_MAX_BYTES   0
 TCP_OOSEQ_MAX_BYTES: The default maximum number of bytes queued on ooseq per pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. More...
 
#define TCP_OOSEQ_MAX_PBUFS   0
 TCP_OOSEQ_BYTES_LIMIT(pcb): Return the maximum number of bytes to be queued on ooseq per pcb, given the pcb. More...
 
#define TCP_LISTEN_BACKLOG   0
 TCP_OOSEQ_PBUFS_LIMIT(pcb): Return the maximum number of pbufs to be queued on ooseq per pcb, given the pcb. More...
 
#define TCP_DEFAULT_LISTEN_BACKLOG   0xff
 The maximum allowed backlog for TCP listen netconns. More...
 
#define TCP_OVERSIZE   TCP_MSS
 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. More...
 
#define LWIP_TCP_TIMESTAMPS   0
 LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. More...
 
#define TCP_WND_UPDATE_THRESHOLD   LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4))
 TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an explicit window update. More...
 
#define LWIP_EVENT_API   0
 LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. More...
 
#define LWIP_WND_SCALE   0
 LWIP_WND_SCALE and TCP_RCV_SCALE: Set LWIP_WND_SCALE to 1 to enable window scaling. More...
 
#define LWIP_TCP_PCB_NUM_EXT_ARGS   0
 LWIP_TCP_PCB_NUM_EXT_ARGS: When this is > 0, every tcp pcb (including listen pcb) includes a number of additional argument entries in an array (see tcp_ext_arg_alloc_id) More...
 
#define LWIP_ALTCP   0
 LWIP_ALTCP==1: enable the altcp API. More...
 
#define LWIP_ALTCP_TLS   0
 LWIP_ALTCP_TLS==1: enable TLS support for altcp API. More...
 

Detailed Description

Macro Definition Documentation

#define LWIP_ALTCP   0

LWIP_ALTCP==1: enable the altcp API.

altcp is an abstraction layer that prevents applications linking against the tcp.h functions but provides the same functionality. It is used to e.g. add SSL/TLS or proxy-connect support to an application written for the tcp callback API without that application knowing the protocol details.

With LWIP_ALTCP==0, applications written against the altcp API can still be compiled but are directly linked against the tcp.h callback API and then cannot use layered protocols.

See altcp_api

Definition at line 1495 of file opt.h.

#define LWIP_ALTCP_TLS   0

LWIP_ALTCP_TLS==1: enable TLS support for altcp API.

This needs a port of the functions in altcp_tls.h to a TLS library. A port to ARM mbedtls is provided with lwIP, see apps/altcp_tls/ directory and LWIP_ALTCP_TLS_MBEDTLS option.

Definition at line 1504 of file opt.h.

#define LWIP_EVENT_API   0

LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.

LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all events (accept, sent, etc) that happen in the system. LWIP_CALLBACK_API==1: The PCB callback function is called directly for the event. This is the default.

Definition at line 1449 of file opt.h.

#define LWIP_TCP   1

LWIP_TCP==1: Turn on TCP.

Definition at line 1221 of file opt.h.

#define LWIP_TCP_MAX_SACK_NUM   4

LWIP_TCP_MAX_SACK_NUM: The maximum number of SACK values to include in TCP segments.

Must be at least 1, but is only used if LWIP_TCP_SACK_OUT is enabled. NOTE: Even though we never send more than 3 or 4 SACK ranges in a single segment (depending on other options), setting this option to values greater than 4 is not pointless. This is basically the max number of SACK ranges we want to keep track of. As new data is delivered, some of the SACK ranges may be removed or merged. In that case some of those older SACK ranges may be used again. The amount of memory used to store SACK ranges is LWIP_TCP_MAX_SACK_NUM * 8 bytes for each TCP PCB.

Definition at line 1282 of file opt.h.

#define LWIP_TCP_PCB_NUM_EXT_ARGS   0

LWIP_TCP_PCB_NUM_EXT_ARGS: When this is > 0, every tcp pcb (including listen pcb) includes a number of additional argument entries in an array (see tcp_ext_arg_alloc_id)

Definition at line 1479 of file opt.h.

#define LWIP_TCP_SACK_OUT   0

LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs).

Definition at line 1268 of file opt.h.

#define LWIP_TCP_TIMESTAMPS   0

LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.

The timestamp option is currently only used to help remote hosts, it is not really used locally. Therefore, it is only enabled when a TS option is received in the initial SYN packet from a remote host.

Definition at line 1430 of file opt.h.

#define LWIP_WND_SCALE   0

LWIP_WND_SCALE and TCP_RCV_SCALE: Set LWIP_WND_SCALE to 1 to enable window scaling.

Set TCP_RCV_SCALE to the desired scaling factor (shift count in the range of [0..14]). When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large send window while having a small receive window only.

Definition at line 1469 of file opt.h.

#define TCP_CALCULATE_EFF_SEND_MSS   1

TCP_CALCULATE_EFF_SEND_MSS: "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.

Definition at line 1305 of file opt.h.

#define TCP_DEFAULT_LISTEN_BACKLOG   0xff

The maximum allowed backlog for TCP listen netconns.

This backlog is used unless another is explicitly specified. 0xff is the maximum (u8_t).

Definition at line 1402 of file opt.h.

#define TCP_LISTEN_BACKLOG   0

TCP_OOSEQ_PBUFS_LIMIT(pcb): Return the maximum number of pbufs to be queued on ooseq per pcb, given the pcb.

Only valid for TCP_QUEUE_OOSEQ==1 && TCP_OOSEQ_MAX_PBUFS==1. Use this to override TCP_OOSEQ_MAX_PBUFS to a dynamic value per pcb. TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.

Definition at line 1393 of file opt.h.

#define TCP_MAXRTX   12

TCP_MAXRTX: Maximum number of retransmissions of data segments.

Definition at line 1246 of file opt.h.

#define TCP_MSS   536

TCP_MSS: 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.

Definition at line 1293 of file opt.h.

#define TCP_OOSEQ_MAX_BYTES   0

TCP_OOSEQ_MAX_BYTES: The default maximum number of bytes queued on ooseq per pcb if TCP_OOSEQ_BYTES_LIMIT is not defined.

Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1.

Definition at line 1349 of file opt.h.

#define TCP_OOSEQ_MAX_PBUFS   0

TCP_OOSEQ_BYTES_LIMIT(pcb): Return the maximum number of bytes to be queued on ooseq per pcb, given the pcb.

Only valid for TCP_QUEUE_OOSEQ==1 && TCP_OOSEQ_MAX_BYTES==1. Use this to override TCP_OOSEQ_MAX_BYTES to a dynamic value per pcb. TCP_OOSEQ_MAX_PBUFS: The default maximum number of pbufs queued on ooseq per pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1.

Definition at line 1372 of file opt.h.

#define TCP_OVERSIZE   TCP_MSS

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.

Definition at line 1420 of file opt.h.

#define TCP_QUEUE_OOSEQ   LWIP_TCP

TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.

Define to 0 if your device is low on memory.

Definition at line 1261 of file opt.h.

#define TCP_SND_BUF   (2 * TCP_MSS)

TCP_SND_BUF: TCP sender buffer space (bytes).

To achieve good performance, this should be at least 2 * TCP_MSS.

Definition at line 1314 of file opt.h.

#define TCP_SND_QUEUELEN   ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))

TCP_SND_QUEUELEN: TCP sender buffer space (pbufs).

This must be at least as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.

Definition at line 1322 of file opt.h.

#define TCP_SNDLOWAT   LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)

TCP_SNDLOWAT: TCP writable space (bytes).

This must be less than TCP_SND_BUF. It is the amount of space which must be available in the TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).

Definition at line 1331 of file opt.h.

#define TCP_SNDQUEUELOWAT   LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)

TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count).

This must be less than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below this number, select returns writable (combined with TCP_SNDLOWAT).

Definition at line 1340 of file opt.h.

#define TCP_SYNMAXRTX   6

TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.

Definition at line 1253 of file opt.h.

#define TCP_TTL   IP_DEFAULT_TTL

TCP_TTL: Default Time-To-Live value.

Definition at line 1228 of file opt.h.

#define TCP_WND   (4 * TCP_MSS)

TCP_WND: The size of a TCP window.

This must be at least (2 * TCP_MSS) for things to work well. ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size with scaling applied. Maximum window value in the TCP header will be TCP_WND >> TCP_RCV_SCALE

Definition at line 1239 of file opt.h.

#define TCP_WND_UPDATE_THRESHOLD   LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4))

TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an explicit window update.

Definition at line 1438 of file opt.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.