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

Macros

#define LWIP_SOCKET   1
 LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) More...
 
#define LWIP_COMPAT_SOCKETS   1
 LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. More...
 
#define LWIP_POSIX_SOCKETS_IO_NAMES   1
 LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. More...
 
#define LWIP_SOCKET_OFFSET   0
 LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. More...
 
#define LWIP_TCP_KEEPALIVE   0
 LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT options processing. More...
 
#define LWIP_SO_SNDTIMEO   0
 LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and SO_SNDTIMEO processing. More...
 
#define LWIP_SO_RCVTIMEO   0
 LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and SO_RCVTIMEO processing. More...
 
#define LWIP_SO_SNDRCVTIMEO_NONSTANDARD   0
 LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int (milliseconds, much like winsock does) instead of a struct timeval (default). More...
 
#define LWIP_SO_RCVBUF   0
 LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. More...
 
#define LWIP_SO_LINGER   0
 LWIP_SO_LINGER==1: Enable SO_LINGER processing. More...
 
#define RECV_BUFSIZE_DEFAULT   INT_MAX
 If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. More...
 
#define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT   20000
 By default, TCP socket/netconn close waits 20 seconds max to send the FIN. More...
 
#define SO_REUSE   0
 SO_REUSE==1: Enable SO_REUSEADDR option. More...
 
#define SO_REUSE_RXTOALL   0
 SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets to all local matches if SO_REUSEADDR is turned on. More...
 
#define LWIP_FIONREAD_LINUXMODE   0
 LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of pending data in the network buffer. More...
 
#define LWIP_SOCKET_SELECT   1
 LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn callback to keep track of events). More...
 
#define LWIP_SOCKET_POLL   1
 LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including struct pollfd, nfds_t, and constants) More...
 

Detailed Description

Macro Definition Documentation

#define LWIP_COMPAT_SOCKETS   1

LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines.

LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. While this helps code completion, it might conflict with existing libraries. (only used if you use sockets.c)

Definition at line 1952 of file opt.h.

#define LWIP_FIONREAD_LINUXMODE   0

LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of pending data in the network buffer.

This is the way windows does it. It's the default for lwIP since it is smaller. LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next pending datagram in bytes. This is the way linux does it. This code is only here for compatibility.

Definition at line 2061 of file opt.h.

#define LWIP_POSIX_SOCKETS_IO_NAMES   1

LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.

Disable this option if you use a POSIX operating system that uses the same names (read, write & close). (only used if you use sockets.c)

Definition at line 1961 of file opt.h.

#define LWIP_SO_LINGER   0

LWIP_SO_LINGER==1: Enable SO_LINGER processing.

Definition at line 2019 of file opt.h.

#define LWIP_SO_RCVBUF   0

LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.

Definition at line 2012 of file opt.h.

#define LWIP_SO_RCVTIMEO   0

LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and SO_RCVTIMEO processing.

Definition at line 1997 of file opt.h.

#define LWIP_SO_SNDRCVTIMEO_NONSTANDARD   0

LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int (milliseconds, much like winsock does) instead of a struct timeval (default).

Definition at line 2005 of file opt.h.

#define LWIP_SO_SNDTIMEO   0

LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and SO_SNDTIMEO processing.

Definition at line 1989 of file opt.h.

#define LWIP_SOCKET   1

LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)

Definition at line 1942 of file opt.h.

#define LWIP_SOCKET_OFFSET   0

LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n.

This can be useful when there are multiple APIs which create file descriptors. When they all start with a different offset and you won't make them overlap you can re implement read/write/close/ioctl/fnctl to send the requested action to the right library (sharing select will need more work though).

Definition at line 1972 of file opt.h.

#define LWIP_SOCKET_POLL   1

LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including struct pollfd, nfds_t, and constants)

Definition at line 2079 of file opt.h.

#define LWIP_SOCKET_SELECT   1

LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn callback to keep track of events).

This saves RAM (counters per socket) and code (netconn event callback), which should improve performance a bit).

Definition at line 2071 of file opt.h.

#define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT   20000

By default, TCP socket/netconn close waits 20 seconds max to send the FIN.

Definition at line 2033 of file opt.h.

#define LWIP_TCP_KEEPALIVE   0

LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT options processing.

Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set in seconds. (does not require sockets.c, and will affect tcp.c)

Definition at line 1981 of file opt.h.

#define RECV_BUFSIZE_DEFAULT   INT_MAX

If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.

Definition at line 2026 of file opt.h.

#define SO_REUSE   0

SO_REUSE==1: Enable SO_REUSEADDR option.

Definition at line 2040 of file opt.h.

#define SO_REUSE_RXTOALL   0

SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets to all local matches if SO_REUSEADDR is turned on.

WARNING: Adds a memcpy for every packet if passing to more than one pcb!

Definition at line 2049 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.