sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
lwipopts.h File Reference

Go to the source code of this file.

Macros

#define LWIP_TIMEVAL_PRIVATE   0
#define DEFAULT_THREAD_STACKSIZE   0x1000
#define DEFAULT_THREAD_PRIO   0x58
#define TCPIP_THREAD_STACKSIZE   DEFAULT_THREAD_STACKSIZE
#define TCPIP_THREAD_PRIO   DEFAULT_THREAD_PRIO
#define MEM_LIBC_MALLOC   1
#define MEM_ALIGNMENT   16
#define MEM_SIZE   (TCP_SND_BUF * 2)
#define MEMP_NUM_NETCONN   (MEMP_NUM_TCP_PCB+MEMP_NUM_UDP_PCB)
#define PBUF_POOL_SIZE   128
#define MEMP_NUM_TCPIP_MSG_INPKT   50
#define MEMP_NUM_TCPIP_MSG_API   50
#define MEMP_NUM_TCP_SEG   TCP_SND_QUEUELEN
#define LWIP_TCPIP_CORE_LOCKING   1
#define LWIP_TCPIP_CORE_LOCKING_INPUT   1
#define TCP_MSS   1460
#define TCP_SND_BUF   (TCP_MSS*32)
#define TCP_WND   65535
#define PS2IP_DHCP
#define LWIP_DHCP   1
#define PS2IP_DNS
#define LWIP_DNS   1
#define LWIP_STATS   0
#define CHECKSUM_CHECK_IP   0
#define CHECKSUM_CHECK_UDP   0
#define CHECKSUM_CHECK_TCP   0
#define CHECKSUM_CHECK_ICMP   0
#define CHECKSUM_CHECK_ICMP6   0
#define LWIP_CHECKSUM_ON_COPY   1
#define LWIP_POSIX_SOCKETS_IO_NAMES   0
#define LWIP_DNS_SECURE   0
#define LWIP_NETIF_TX_SINGLE_PBUF   1

Macro Definition Documentation

◆ CHECKSUM_CHECK_ICMP

#define CHECKSUM_CHECK_ICMP   0

CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets.

Definition at line 235 of file lwipopts.h.

◆ CHECKSUM_CHECK_ICMP6

#define CHECKSUM_CHECK_ICMP6   0

CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets

Definition at line 240 of file lwipopts.h.

◆ CHECKSUM_CHECK_IP

#define CHECKSUM_CHECK_IP   0

CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.

Definition at line 220 of file lwipopts.h.

◆ CHECKSUM_CHECK_TCP

#define CHECKSUM_CHECK_TCP   0

CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.

Definition at line 230 of file lwipopts.h.

◆ CHECKSUM_CHECK_UDP

#define CHECKSUM_CHECK_UDP   0

CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.

Definition at line 225 of file lwipopts.h.

◆ DEFAULT_THREAD_PRIO

#define DEFAULT_THREAD_PRIO   0x58

DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. The priority value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

Definition at line 26 of file lwipopts.h.

◆ DEFAULT_THREAD_STACKSIZE

#define DEFAULT_THREAD_STACKSIZE   0x1000

DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. The stack size value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

Definition at line 19 of file lwipopts.h.

◆ LWIP_CHECKSUM_ON_COPY

#define LWIP_CHECKSUM_ON_COPY   1

LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from application buffers to pbufs.

Definition at line 246 of file lwipopts.h.

◆ LWIP_DHCP

#define LWIP_DHCP   1

LWIP_DHCP==1: Enable DHCP module.

Definition at line 178 of file lwipopts.h.

◆ LWIP_DNS

#define LWIP_DNS   1

Definition at line 202 of file lwipopts.h.

◆ LWIP_DNS_SECURE

#define LWIP_DNS_SECURE   0

LWIP_DNS_SECURE: controls the security level of the DNS implementation Use all DNS security features by default. This is overridable but should only be needed by very small targets or when using against non standard DNS servers.

Definition at line 269 of file lwipopts.h.

◆ LWIP_NETIF_TX_SINGLE_PBUF

#define LWIP_NETIF_TX_SINGLE_PBUF   1

LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data to be sent into one single pbuf. This is for compatibility with DMA-enabled MACs that do not support scatter-gather. Beware that this might involve CPU-memcpy before transmitting that would not be needed without this flag! Use this only if you need to!

Todo
: TCP and IP-frag do not work with this, yet:

Definition at line 285 of file lwipopts.h.

◆ LWIP_POSIX_SOCKETS_IO_NAMES

#define LWIP_POSIX_SOCKETS_IO_NAMES   0

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 258 of file lwipopts.h.

◆ LWIP_STATS

#define LWIP_STATS   0

LWIP_STATS==1: Enable statistics collection in lwip_stats.

Definition at line 209 of file lwipopts.h.

◆ LWIP_TCPIP_CORE_LOCKING

#define LWIP_TCPIP_CORE_LOCKING   1

LWIP_TCPIP_CORE_LOCKING==1: matches lwIP 2.2.1's upstream default. With LWIP_COMPAT_MUTEX in arch/cc.h the core lock is a binary semaphore taken directly on the calling app thread for socket/netconn API calls; lwIP releases it before any blocking I/O wait so the tcpip thread + netif input continue to make progress. Saves a context switch + sem wait per API call versus the message-passing alternative.

Definition at line 147 of file lwipopts.h.

◆ LWIP_TCPIP_CORE_LOCKING_INPUT

#define LWIP_TCPIP_CORE_LOCKING_INPUT   1

LWIP_TCPIP_CORE_LOCKING_INPUT==1: tcpip_input() takes the core mutex directly instead of allocating a message. Safe here because the netif input callback runs in a regular thread, not interrupt context.

Definition at line 154 of file lwipopts.h.

◆ LWIP_TIMEVAL_PRIVATE

#define LWIP_TIMEVAL_PRIVATE   0

Definition at line 11 of file lwipopts.h.

◆ MEM_ALIGNMENT

#define MEM_ALIGNMENT   16

Definition at line 88 of file lwipopts.h.

◆ MEM_LIBC_MALLOC

#define MEM_LIBC_MALLOC   1

MEM_LIBC_MALLOC==1: use libc's malloc/free for lwIP's mem_malloc / mem_free (which serve PBUF_RAM allocations and a handful of other sites — DHCP options, ARP, DNS, slip/ppp/zepif which we don't build). Internally lwIP's pbuf_alloc(PBUF_RAM) computes the payload pointer with LWIP_MEM_ALIGN(p + SIZEOF_STRUCT_PBUF + offset), which only stays inside the allocated chunk when 'p' is already MEM_ALIGNMENT- aligned. That is why MEM_ALIGNMENT must match the underlying allocator's alignment — see MEM_ALIGNMENT below.

Definition at line 57 of file lwipopts.h.

◆ MEM_SIZE

#define MEM_SIZE   (TCP_SND_BUF * 2)

MEM_SIZE: the size of the heap memory. If the application will send a lot of data that needs to be copied, this should be set high.

Definition at line 96 of file lwipopts.h.

◆ MEMP_NUM_NETCONN

#define MEMP_NUM_NETCONN   (MEMP_NUM_TCP_PCB+MEMP_NUM_UDP_PCB)

MEMP_NUM_NETCONN: the number of struct netconns. (only needed if you use the sequential API, like api_lib.c)

Definition at line 107 of file lwipopts.h.

◆ MEMP_NUM_TCP_SEG

#define MEMP_NUM_TCP_SEG   TCP_SND_QUEUELEN

MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. (requires the LWIP_TCP option)

Definition at line 137 of file lwipopts.h.

◆ MEMP_NUM_TCPIP_MSG_API

#define MEMP_NUM_TCPIP_MSG_API   50

MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used for callback/timeout API communication. (only needed if you use tcpip.c)

Definition at line 131 of file lwipopts.h.

◆ MEMP_NUM_TCPIP_MSG_INPKT

#define MEMP_NUM_TCPIP_MSG_INPKT   50

MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used for incoming packets. SP193: this should be around the size of the TCP window because the TCPIP thread may take a while to execute (non-preemptive multitasking), otherwise incoming frames may get dropped.

Definition at line 123 of file lwipopts.h.

◆ PBUF_POOL_SIZE

#define PBUF_POOL_SIZE   128

PBUF_POOL_SIZE: the number of buffers in the pbuf pool.

Definition at line 114 of file lwipopts.h.

◆ PS2IP_DHCP

#define PS2IP_DHCP

Definition at line 172 of file lwipopts.h.

◆ PS2IP_DNS

#define PS2IP_DNS

LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS transport.

Definition at line 199 of file lwipopts.h.

◆ TCP_MSS

#define TCP_MSS   1460

Definition at line 162 of file lwipopts.h.

◆ TCP_SND_BUF

#define TCP_SND_BUF   (TCP_MSS*32)

Definition at line 165 of file lwipopts.h.

◆ TCP_WND

#define TCP_WND   65535

Definition at line 168 of file lwipopts.h.

◆ TCPIP_THREAD_PRIO

#define TCPIP_THREAD_PRIO   DEFAULT_THREAD_PRIO

TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. The priority value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

Definition at line 40 of file lwipopts.h.

◆ TCPIP_THREAD_STACKSIZE

#define TCPIP_THREAD_STACKSIZE   DEFAULT_THREAD_STACKSIZE

TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. The stack size value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

Definition at line 33 of file lwipopts.h.