This is the aligned version of ip4_addr_t, used as local variable, on the stack, etc.
Main packet buffer struct
Generic data structure used for all lwIP network interfaces. The following fields should be filled in by the initialization function for the device driver: hwaddr_len, hwaddr[], mtu, flags
the TCP protocol control block
the UDP protocol control block
link level hardware address of this interface
next pbuf in singly linked pbuf chain
total length of this buffer and all next buffers in chain belonging to the same packet. For non-queue packet chains this is the invariant: p->tot_len == p->len + (p->next? p->next->tot_len: 0)
pointer to the actual data in the buffer
A custom pbuf: like a pbuf, but following a function pointer to free it.
LWIP_IPV6==1: Enable IPv6
IP address configuration in network byte order
LWIP_IPV4==1: Enable IPv4
The netconn which to process - always needed: it includes the semaphore which is used to block the application thread until the function finished.
the lwIP internal protocol control block
Eliminates compiler warning about unused arguments (GCC -Wextra -Wunused).
protocol specific PCB members
"Network buffer" - contains data and addressing info
This struct includes everything that is necessary to execute a function for a netconn in another thread context (mainly used to process netconns in the tcpip_thread context to be thread safe).
sockets currently are built on netconns, each socket has one netconn
Depending on the executed function, one of these union members is used
Contains all internal pointers and states used for a socket
This function is called by the IP module when it wants to send a packet on the interface. This function typically first resolves the hardware address, then sends the packet. For ethernet physical layer, this is usually etharp_output()
This function is called by ethernet_output() when it wants to send a packet on the interface. This function outputs the pbuf as-is on the link medium.
This function is called by the network device driver to pass a packet up the TCP/IP stack.
A callback function that is informed about events for this netconn
Macro/function to check whether lwIP's threading/locking requirements are satisfied during current function call. This macro usually calls a function that is implemented in the OS-dependent sys layer and performs the following checks: - Not in ISR (this should be checked for NO_SYS==1, too!) - If = 1: TCPIP core lock is held - If = 0: function is called from TCPIP thread @see multithreading
Global data for both IPv4 and IPv6
This function is called when pbuf_free deallocates this pbuf(_custom)
retries of current request
TCP: when data passed to netconn_write doesn't fit into the send buffer, this temporarily stores the message. Also used during connect and close.
protocol specific PCB members
type of the netconn (TCP, UDP or RAW)
The heap is made up as a list of structs of this type. This does not have to be aligned since for getting its size, we only use the macro SIZEOF_STRUCT_MEM, which automatically aligns.
The global semaphore to lock the stack.
maximum transfer unit (in bytes)
minimum set of fields of any DHCP message
LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname field.
If set, the netif is an ethernet device using ARP. Set by the netif driver in its init function.
number of bytes used in hwaddr
index (-> ram[next]) of the next struct
Use this for input packets in a netif driver when calling netif->input() in the most common case - ethernet-layer netif driver.
LWIP_TCPIP_CORE_LOCKING Creates a global mutex that is held during TCPIP thread operations. Can be locked by client code to perform lwIP operations without changing into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and UNLOCK_TCPIP_CORE(). Your system should provide mutexes supporting priority inversion to use this.
flags holding more netconn-internal state, see NETCONN_FLAG_* defines
IP reassembly helper struct. This is exported because memp needs to know the size.
If set, the netif has broadcast capability.
LWIP_IGMP==1: Turn on IGMP module.
current DHCP state machine state
LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
used for lwip_netconn_do_write
current state of the netconn
pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change so it has to be duplicated when queued before transmitting, depending on who has a 'ref' to it.
Get client data. Obtain ID from netif_alloc_client_data_id().
Destination IP address of current_header
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.
Declare a private memory pool Private mempools example: .h: only when pool is used in multiple .c files: LWIP_MEMPOOL_PROTOTYPE(my_private_pool); .c: - in global variables section: LWIP_MEMPOOL_DECLARE(my_private_pool, 10, sizeof(foo), "Some description") - call ONCE before using pool (e.g. in some init() function): LWIP_MEMPOOL_INIT(my_private_pool); - allocate: void* my_new_mem = LWIP_MEMPOOL_ALLOC(my_private_pool); - free: LWIP_MEMPOOL_FREE(my_private_pool, my_new_mem); To relocate a pool, declare it as extern in cc.h. Example for GCC: extern u8_t \_\_attribute\_\_((section(".onchip_mem"))) memp_memory_my_private_pool_base[];
Initialize a private memory pool
Allocate from a private memory pool
Free element from a private memory pool
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.
SYS_ARCH_UNPROTECT Perform a "fast" set of the protection level to "lev". This could be implemented by setting the interrupt level to "lev" within the MACRO or by using a semaphore or mutex. This macro will default to calling the sys_arch_unprotect() function which should be implemented in sys_arch.c. If a particular port needs a different implementation, then this macro may be defined in sys_arch.h
The return value of the function executed in tcpip_thread.
List of all TCP PCBs that are in a state in which they accept or send data.
SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt protection) for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation. ATTENTION: This is required when using lwIP from more than one context! If you disable this, you must be sure what you are doing!
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.
the TCP protocol control block for listening pcbs
MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable amount of bytes before and after each memp element in every pool and fills it with a prominent default value. MEMP_OVERFLOW_CHECK == 0 no checking MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time memp_malloc() or memp_free() is called (useful but slow!)
LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, writing from a 2nd thread and closing from a 3rd thread at the same time. ATTENTION: This is currently really alpha! Some requirements: - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from multiple threads at once - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox and prevent a task pending on this during/after deletion
protocol specific PCB members
Packed structs support. Wraps u8_t members, where some compilers warn that packing is not necessary.\n For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
mbox where received packets are stored until they are fetched by the netconn application thread (can grow quite big)
LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS transport.
Can be used as a fixed/const ip_addr_t for the IP wildcard. Defined to when IPv4 is enabled. Defined to IP6_ADDR_ANY in IPv6 only systems. Use this if you can handle IPv4 _AND_ IPv6 addresses. Use or IP6_ADDR_ANY when the IP type matters.
TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
Includes spare room for transport layer header, e.g. UDP header. Use this if you intend to pass the pbuf to functions like udp_send().
LWIP_ARP==1: Enable ARP functionality.
ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function for several netif related event that supports multiple subscribers. @see netif_ext_status_callback
LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per thread calling socket/netconn functions instead of allocating one semaphore per netconn (and per select etc.) ATTENTION: a thread-local semaphore for API calls is needed: - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). Ports may call these for threads created with sys_thread_new().
LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must indiscriminately pass all inbound IPv6 multicast traffic to lwIP.
Set this to 1 to support SSI (Server-Side-Includes) In contrast to other http servers, this only calls a preregistered callback function (@see http_set_ssi_handler) for each tag (in the format of ) encountered in SSI-enabled pages. SSI-enabled pages must have one of the predefined SSI-enabled file extensions. All files with one of these extensions are parsed when sent. A downside of the current SSI implementation is that persistent connections don't work, as the file length is not known in advance (and httpd currently relies on the Content-Length header for persistent connections). To save memory, the maximum tag length is limited (@see LWIP_HTTPD_MAX_TAG_NAME_LEN). To save memory, the maximum insertion string length is limited (@see LWIP_HTTPD_MAX_TAG_INSERT_LEN). If this is not enought, can be used.
Calculate memory size for an aligned buffer - returns the next highest multiple of MEM_ALIGNMENT (e.g. LWIP_MEM_ALIGN_SIZE(3) and LWIP_MEM_ALIGN_SIZE(4) will both yield 4 for MEM_ALIGNMENT == 4).
Description for a task waiting in select
pbuf payload refers to RAM. This one comes from a pool and should be used for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct pbuf and its payload are allocated in one piece of contiguous memory (so the first payload byte can be calculated from struct pbuf). Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing, you are unable to receive TCP acks!
number of this interface. Used for if_api and netifapi_netif, as well as for IPv6 zones
Common members of all PCB types
MEMCPY: override this if you have a faster implementation at hand than the one included in your C library
LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from application buffers to pbufs.
mbox where new connections are stored until processed by the application thread
TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
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.
TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when tcpip_init is called.
DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_UDP. The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the recvmbox is created.
DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_TCP. The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the recvmbox is created.
DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the acceptmbox is created.
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.
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.
SYS_ARCH_PROTECT Perform a "fast" protect. This could be implemented by disabling interrupts for an embedded system or by using a semaphore or mutex. The implementation should allow calling SYS_ARCH_PROTECT when already protected. The old protection level is returned in the variable "lev". This macro will default to calling the sys_arch_protect() function which should be implemented in sys_arch.c. If a particular port needs a different implementation, then this macro may be defined in sys_arch.h
pointer to the lowest free block, this is used for faster search
The one and only timeout list
SO_REUSE==1: Enable SO_REUSEADDR option.
Ask if an interface is up
Source IP address of current_header
pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload are allocated in one piece of contiguous memory (so the first payload byte can be calculated from struct pbuf). pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might change in future versions). This should be used for all OUTGOING packets (TX).
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.
1: this area is used; 0: this area is unused
Structure defining the base filename (URL) of a CGI and the associated function which is to be called when that URL is requested.
LWIP_AUTOIP==1: Enable AUTOIP module.
LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs).
SYS_LIGHTWEIGHT_PROT define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation. SYS_ARCH_DECL_PROTECT declare a protection variable. This macro will default to defining a variable of type sys_prot_t. If a particular port needs a different implementation, then this macro may be defined in sys_arch.h.
sem that is used to synchronously execute functions in the core context
Set this to 1 to support HTTP POST
protocol specific PCB members
index (-> ram[prev]) of the previous struct
MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution speed (heap alloc can be much slower than pool alloc) and usage from interrupts (especially if your netif driver allocates PBUF_POOL pbufs for received frames from interrupt)! ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, not only for internal pools defined in memp_std.h)!
LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP, as well as (currently only) core support for the corresponding IPv6 options.
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.
LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and SO_SNDTIMEO processing.
used for lwip_netconn_do_bind and lwip_netconn_do_connect
List of all TCP PCBs in TIME-WAIT state
Holds a flag which option was received and is contained in dhcp_rx_options_val, only valid while in dhcp_recv. @todo: move this into struct dhcp?
data that was left from the previous read
counter of how many threads are waiting for this socket using select
pointer to next in linked list
The list of network interfaces.
SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a call to memcpy() if the length is known at compile time and is small.
DNS maximum number of entries to maintain locally.
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).
LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including struct pollfd, nfds_t, and constants)
Can be used as a fixed/const ip_addr_t for the IPv4 wildcard and the broadcast address
Can be used as a fixed/const ip4_addr_t for the wildcard and the broadcast address
Split an u32_t in two u16_ts and add them up
the last entry, always unused!
If set, the interface has an active link (set by the network interface driver). Either set by the netif driver in its init function (if the link is up at that time) or at a later point once the link comes up
Packed structs support. Wraps members that are packed structs themselves, where some compilers warn that packing is not necessary.\n For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
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! ATTENTION: a driver should *NOT* rely on getting single pbufs but check TX pbufs for being in one piece. If not, pbuf_clone can be used to get a single pbuf: if (p->next != NULL) { struct pbuf *q = pbuf_clone(PBUF_RAW, PBUF_RAM, p); if (q == NULL) { return ERR_MEM; } p = q; ATTENTION: do NOT free the old 'p' as the ref belongs to the caller! }
LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
LWIP_SO_LINGER==1: Enable SO_LINGER processing.
used for lwip_netconn_do_getaddr
C++ const_cast(val) equivalent to remove constness from a value (GCC -Wcast-qual)
LWIP_MPU_COMPATIBLE: enables special memory management mechanism which makes lwip able to work on MPU (Memory Protection Unit) system by not passing stack-pointers to other threads (this decreases performance as memory is allocated from pools instead of keeping it on the stack)
MEM_OVERFLOW_CHECK: mem overflow protection reserves a configurable amount of bytes before and after each heap allocation chunk and fills it with a prominent default value. MEM_OVERFLOW_CHECK == 0 no checking MEM_OVERFLOW_CHECK == 1 checks each element when it is freed MEM_OVERFLOW_CHECK >= 2 checks all heap elements every time mem_malloc() or mem_free() is called (useful but slow!)
LWIP_SINGLE_NETIF==1: use a single netif only. This is the common case for small real-life targets. Some code like routing etc. can be left out.
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).
Holds the decoded option values, only valid while in dhcp_recv. @todo: move this into struct dhcp?
Pointer to a single pending outgoing packet on this ARP entry.
Set this to 1 to support CGI (old style). This old style CGI support works by registering an array of URLs and associated CGI handler functions (http_set_cgi_handlers). This list is scanned just before fs_open is called from request handling. The handler can return a new URL that is used internally by the httpd to load the returned page (passed to fs_open). Use this CGI type e.g. to execute specific actions and return a page that does not depend on the CGI parameters.
ports are in host byte order
The maximum of DNS servers The first server can be initialized automatically by defining DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*'
LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
UDP_DEBUG: Enable debugging in UDP.
Function prototype for functions passed to tcpip_callback()
Current state of the netconn. Non-TCP netconns are always in state NETCONN_NONE!
used for lwip_netconn_do_close (/shutdown)
PPP_SUPPORT==1: Enable PPP.
concurrent access protection
A custom pbuf that holds a reference to another pbuf, which is freed when this custom pbuf is freed. This is used to create a custom PBUF_REF that points into the original pbuf.
Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores should be used instead
Create new netconn connection
the reference count always equals the number of pointers that refer to this pbuf. This can be pointers from an application, the stack itself, or pbuf->next pointers from a chain.
Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from interrupt context (or another context that doesn't allow waiting for a semaphore). If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs with each loop so that mem_free can run. ATTENTION: As you can see from the above description, this leads to dis-/ enabling interrupts often, which can be slow! Also, on low memory, mem_malloc can need longer. If you don't want that, at least for NO_SYS=0, you can still use the following functions to enqueue a deallocation call which then runs in the tcpip_thread context: - pbuf_free_callback(p); - mem_free_callback(m);
Set this to 1 to enable querying ".local" names via mDNS using a One-Shot Multicast DNS Query
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)
SOCKETS_DEBUG: Enable debugging in sockets.c.
Protocol family and type of the netconn
This vector type is passed to netconn_write_vectors_partly to send multiple buffers at once. ATTENTION: This type has to directly map struct iovec since one is casted into the other!
Set this to 0 to not send the SSI tag (default is on, so the tag will be sent in the HTML page
Set this to 1 to support fs_read() to dynamically read file data. Without this (default=off), only one-block files are supported, and the contents must be ready after fs_open().
offset into total length/output of bytes written when err == ERR_OK
List of all TCP PCBs in LISTEN state
pointer to the heap (ram_heap): for alignment, ram is now a pointer instead of an array
As lwip_netconn_do_gethostbyname requires more arguments but doesn't require a netconn, it has its own struct (to avoid struct api_msg getting bigger than necessary). lwip_netconn_do_gethostbyname must be called using tcpip_callback instead of tcpip_apimsg (see netconn_gethostbyname).
A struct sockaddr replacement that has the same alignment as sockaddr_in/ sockaddr_in6 if instantiated.
The global array of available sockets
Function prototype for netif->input functions. This function is saved as 'input' callback function in the netif struct. Call it when a packet has been received.
The default network interface.
IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that this option does not affect outgoing packet sizes, which can be controlled via IP_FRAG.
DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name.
DNS maximum host name length supported in the name table.
DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer: \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \ DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)} Instead, you can also use an external function: \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype) that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype).
LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated for an additional encapsulation header before ethernet headers (e.g. 802.11)
Set this to 1 to implement an SSI tag handler callback that gets a const char* to the tag (instead of an index into a pre-registered array of known tags) If this is 0, the SSI handler callback function is only called pre-registered tags.
LWIP_HTTPD_SSI_MULTIPART==1: SSI handler function is called with 2 more arguments indicating a counter for insert string that are too long to be inserted at once: the SSI handler function must then set 'next_tag_part' which will be passed back to it in the next call.
Set this to 1 if you want to include code that creates HTTP headers at runtime. Default is off: HTTP headers are then created statically by the makefsdata tool. Static headers mean smaller code size, but the (readonly) fsdata will grow a bit as every file includes the HTTP header.
Set this to 1 to support HTTP request coming in in multiple packets/pbufs
List of all TCP PCBs bound but not yet (connected || listening)
only used for socket layer
The interface that received the packet for the current callback invocation.
Common members of all PCB types
First free element of each pool. Elements form a linked list.
MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set of memory pools of various sizes. When mem_malloc is called, an element of the smallest pool that can provide the length needed is returned. To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address resolution. By default, only the most recent packet is queued per IP address. This is sufficient for most protocols and mainly reduces TCP connection startup time. Set this to 1 if you know your application sends more than one packet in a row to an IP address that is not in the ARP cache.
ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table entries (using etharp_add_static_entry/etharp_remove_static_entry).
LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each response packet, an callback is called, which has to be provided by the port: void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). This is only needed when no real netifs are available. If at least one other netif is available, loopback traffic uses this netif.
LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and SO_RCVTIMEO processing.
Function prototype for a timeout callback function. Register such a function using sys_timeout().
Set this to 1 to include an application state argument per file that is opened. This allows to keep a state per connection/file.
offset into current vector
Swap the bytes in an u16_t: much like lwip_htons() for little-endian
allow this to be configured in lwipopts.h, but not too small
number of times data was received, set by event_callback(), tested by the receive and select functions
number of times data was ACKed (free send buffer), set by event_callback(), tested by select
Pointer to the next waiting task
semaphore to wake up a task waiting for select
The global list of tasks waiting for select
DNS query message structure. No packing needed: only used locally on the stack.
This function is called when the netif link is set to up or down
a bit field indicating pbuf type and allocation sources (see PBUF_TYPE_FLAG_*, PBUF_ALLOC_FLAG_* and PBUF_TYPE_ALLOC_SRC_MASK)
LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled, this lets tcpip_input() grab the mutex for input packets as well, instead of allocating a message and passing it to tcpip_thread. ATTENTION: this does not work when tcpip_input() is called from interrupt context!
MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library instead of the lwip internal allocator. Can save code size if you already use it.
LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled
LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on the same interface at the same time.
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.
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)
LWIP_IPV6_SCOPES==1: Enable support for IPv6 address scopes, ensuring that e.g. link-local addresses are really treated as link-local. Disable this setting only for single-interface configurations. All addresses that have a scope according to the default policy (link-local unicast addresses, interface-local and link-local multicast addresses) should now have a zone set on them before being passed to the core API, although lwIP will currently attempt to select a zone on the caller's behalf when necessary. Applications that directly assign IPv6 addresses to interfaces (which is NOT recommended) must now ensure that link-local addresses carry the netif's zone. See the new ip6_zone.h header file for more information and relevant macros. For now it is still possible to turn off scopes support through the new LWIP_IPV6_SCOPES option. When upgrading an implementation that uses the core API directly, it is highly recommended to enable LWIP_IPV6_SCOPES_DEBUG at least for a while, to ensure e.g. proper address initialization.
TCP_DEBUG: Enable debugging for TCP.
TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
Whether the network interface is 'up'. This is a software flag used to control whether this network interface is enabled and processes traffic. It must be set by the startup code before this netif can be used (also for dhcp/autoip).
the ARP message, see RFC 826 ("Packet format")
This struct contains information about a stack-internal timer function that has to be called at a defined interval
Same as sys_mbox_valid() but taking a value, not a pointer
size of the application data to send
Set this to 1 to enable HTTP/1.1 persistent connections. ATTENTION: If the generated file system includes HTTP headers, these must include the "Connection: keep-alive" header (pass argument "-11" to makefsdata).
LWIP_HTTPD_FS_ASYNC_READ==1: support asynchronous read operations (fs_read_async returns FS_READ_DELAYED and calls a callback when finished).
protocol specific PCB members
used for lwip_netconn_do_send
Common members of all PCB types
Protocol specific PCB members
An array with all (non-temporary) PCB lists, mainly used for smaller code size
This semaphore is posted when the name is resolved, the application thread should wait on it.
Errors are given back here
Callback which is invoked when a hostname is found. A function of this type must be implemented by the application using the DNS resolver.
Pointer to the previous waiting task
The interface that accepted the packet for the current callback invocation.
Common members of all PCB types
ports are in host byte order
track PCB allocation state
Align a memory pointer to the alignment defined by MEM_ALIGNMENT so that ADDR % MEM_ALIGNMENT == 0
IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note that this option does not affect incoming packet sizes, which can be controlled via IP_REASSEMBLY.
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).
The maximum allowed backlog for TCP listen netconns. This backlog is used unless another is explicitly specified. 0xff is the maximum (u8_t).
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.
LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface changes its up/down status (i.e., due to DHCP IP acquisition)
LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table indices) in struct netif. TCP and UDP can make use of this to prevent scanning the ARP table for every sent packet. While this is faster for big ARP tables or many concurrent connections, it might be counterproductive if you have a tiny ARP table or if there never are concurrent connections.
LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store data in client_data member array of struct netif (max. 256).
LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP address equal to the netif IP address, looping them back up the stack.
LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create timers running in tcpip_thread from another thread.
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)
LWIP_SUPPORT_CUSTOM_PBUF==1: Custom pbufs behave much like their pbuf type but they are allocated by external code (initialised by calling pbuf_alloced_custom()) and when pbuf_free gives up their last reference, they are freed by calling pbuf_custom->custom_free_function(). Currently, the pbuf_custom code is only needed for one specific configuration of IP_FRAG, unless required by external driver/application code.
This array contains all stack-internal cyclic timers. To get the number of timers, use LWIP_ARRAYSIZE()
Used to inform the callback function about changes Event explanation: In the netconn implementation, there are three ways to block a client: - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept()) - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data()) - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write()) The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking connections, you need to know in advance whether a call to a netconn function call would block or not, and these events tell you about that. RCVPLUS events say: Safe to perform a potentially blocking call call once more. They are counted in sockets - three RCVPLUS events for accept mbox means you are safe to call netconn_accept 3 times without being blocked. Same thing for receive mbox. RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged". Socket implementation decrements the counter. For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something. SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again. A SENDMINUS event occurs when the next call to a netconn_send() would be blocking.
A callback prototype to inform about events for a netconn
the last asynchronous unreported error this netconn had
Set this to 1 to support CGI (new style). This new style CGI support works by calling a global function (tCGIHandler) for all URLs that are found. fs_open is called first and the URL can not be written by the CGI handler. Instead, this handler gets passed the http file state, an object where it can store information derived from the CGI URL or parameters. This file state is later passed to SSI, so the SSI code can return data depending on CGI input. Use this CGI handler if you want CGI information passed on to SSI.
Set this to 1 and provide the functions: - "int fs_open_custom(struct fs_file *file, const char *name)" Called first for every opened file to allow opening files that are not included in fsdata(_custom).c - "void fs_close_custom(struct fs_file *file)" Called to free resources allocated by fs_open_custom().
number of unwritten vectors
total length across vectors
Function prototype for tcp error callback functions. Called when the pcb receives a RST or is unexpectedly closed for any other reason.
DHCP_OPTION_MAX_MSG_SIZE is set to the MTU
The IP reassembly code currently has the following limitations: - IP header options are not supported - fragments must not overlap (e.g. due to different routes), currently, overlapping or duplicate fragments are thrown away if IP_REASS_CHECK_OVERLAP=1 (the default)! @todo: work with IP header options Setting this to 0, you can turn off checking the fragments for overlapping regions. The code gets a little smaller. Only use this if you know that overlapping won't occur on your network!
helper struct for gethostbyname_r to access the char* buffer
error happened for this socket, set by event_callback(), tested by select
Function pointer for the SSI tag handler callback. This function will be called each time the HTTPD server detects a tag of the form in files with extensions mentioned in the g_pcSSIExtensions array (currently .shtml, .shtm, .ssi, .xml, .json) where "name" appears as one of the tags supplied to http_set_ssi_handler in the tags array. The returned insert string, which will be appended after the the string "" in file sent back to the client, should be written to pointer pcInsert. iInsertLen contains the size of the buffer pointed to by pcInsert. The iIndex parameter provides the zero-based index of the tag as found in the tags array and identifies the tag that is to be processed. The handler returns the number of characters written to pcInsert excluding any terminating NULL or HTTPD_SSI_TAG_UNKNOWN when tag is not recognized. Note that the behavior of this SSI mechanism is somewhat different from the "normal" SSI processing as found in, for example, the Apache web server. In this case, the inserted text is appended following the SSI tag rather than replacing the tag entirely. This allows for an implementation that does not require significant additional buffering of output data yet which will still offer usable SSI functionality. One downside to this approach is when attempting to use SSI within JavaScript. The SSI tag is structured to resemble an HTML comment but this syntax does not constitute a comment within JavaScript and, hence, leaving the tag in place will result in problems in these cases. In order to avoid these problems, define LWIP_HTTPD_SSI_INCLUDE_TAG as zero in your lwip options file, or use JavaScript style block comments in the form / * # name * / (without the spaces).
Argument supplied to netif_ext_callback_fn.
receive callback function
Includes spare room for link layer header (ethernet header). Use this if you intend to pass the pbuf to functions like ethernet_output(). @see PBUF_LINK_HLEN
pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in totally different memory areas. Since it points to ROM, payload does not have to be copied when queued for transmission.
Function prototype for netif init functions. Set up flags and output/linkoutput callback functions in this function.
ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries. If disabled, duplicate IP address on multiple netifs are not supported (but this should only occur for AutoIP).
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).
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
LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called when a netif has been removed
LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled per netif. ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled!
LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC)
Determine if two address are on the same network. @arg addr1 IP address 1 @arg addr2 IP address 2 @arg mask network identifier mask
Indicates that the payload directly follows the struct pbuf.
This is the common part of all PCB types. It needs to be at the beginning of a PCB type definition. It is located here so that changes to this common part are made in one location instead of
If a nonblocking write has been rejected before, poll_tcp needs to
Set this to 1 to enable timing each file sent
Set this to 1 to kill the oldest connection when running out of memory for 'struct http_state' or 'struct http_ssi_state'. ATTENTION: This puts all connections on a linked list, so may be kind of slow.
HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for predefined (MSS-sized) chunks of the files to prevent having to calculate the checksums at runtime.
ICMP destination unreachable codes
Common members of all PCB types
Protocol specific PCB members
PPPOE_SUPPORT==1: Enable PPP Over Ethernet
Set to 0 to prevent freeing the oldest datagram when the reassembly buffer is full (IP_REASS_MAX_PBUFS pbufs are enqueued). The code gets a little smaller. Datagrams will be freed by timeout only. Especially useful when MEMP_NUM_REASSDATA is set to 1, so one datagram can be reassembled at a time, only.
DNS answer message structure. No packing needed: only used locally on the stack.
DNS request table entry: used when dns_gehostbyname cannot answer the request from the DNS table
Function prototype for netif status- or link-callback functions.
Header of the input packet currently being processed.
Total header length of current_ip4/6_header (i.e. after this, the UDP/TCP header starts)
Function prototype for udp pcb receive callback functions addr and port are in same byte order as in the pcb The callback is responsible for freeing the pbuf if it's not used any more. ATTENTION: Be aware that 'addr' might point into the pbuf 'p' so freeing this pbuf can make 'addr' invalid, too.
user-supplied argument for the recv callback
transaction identifier of last sent request
IP address types for use in ip_addr_t.type member. @see tcp_new_ip_type(), udp_new_ip_type(), raw_new_ip_type().
Includes spare room for IP header. Use this if you intend to pass the pbuf to functions like raw_send().
For incoming packets, this contains the input netif's index
Helper struct for const-correctness only. The only meaning of this one is to provide a const payload pointer for PBUF_ROM type.
pointer to the actual data in the buffer
@name Debug message types (LWIP_DBG_TYPES_ON)
MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h that defines additional pools beyond the "standard" ones required by lwIP. If you set this to 1, you must have lwippools.h in your include path somewhere.
the time an ARP entry stays valid after its last update, for ARP_TMR_INTERVAL = 1000, this is (60 * 5) seconds = 5 minutes.
ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers. Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan) that returns 1 to accept a packet or 0 to drop a packet.
ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure alignment of payload after that header. Since the header is 14 bytes long, without this padding e.g. addresses in the IP header will not be aligned on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
IP_FORWARD==1: 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.
IP_REASS_MAX_PBUFS: 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! When IPv4 *and* IPv6 are enabled, this even changes to (PBUF_POOL_SIZE > 2 * IP_REASS_MAX_PBUFS)!
IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast filter on recv operations.
ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
TCP_MAXRTX: Maximum number of retransmissions of data segments.
TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
LWIP_PBUF_REF_T: Refcount type in pbuf. Default width of u8_t can be increased if 255 refs are not enough for you.
LWIP_NETIF_API==1: Support netif api (in netifapi.c)
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)
LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big.
LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented
LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery with reachability hints for connected destinations. This helps avoid sending unicast neighbor solicitation messages.
LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful/stateless address autoconfiguration.
NETIF_DEBUG: Enable debugging in netif.c.
DNS_DEBUG: Enable debugging for DNS.
LWIP_TESTMODE: Changes to make unit test possible
Indicates the data stored in this pbuf can change. If this pbuf needs
indicates this is a custom pbuf: pbuf_free calls pbuf_custom->custom_free_function()
Must be the maximum of all used hardware address lengths across all types of interfaces in use. This does not have to be changed, normally.
Set client data. Obtain ID from netif_alloc_client_data_id().
Get the interface that accepted the current packet. This may or may not be the receiving netif, depending on your netif/network setup. This function must only be called from a receive callback (udp_recv,
Function prototype for the init_done function passed to tcpip_init
sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. For now we use the same magic value, but we allow this to change in future.
For now, we map straight to sys_arch implementation.
Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes)
Defines the maximum length of a HTTP request line (up to the first CRLF, copied from pbuf into this a global buffer when pbuf- or packet-queues are received - otherwise the input pbuf is used directly)
This is the size of a static buffer used when URIs end with '/'. In this buffer, the directory requested is concatenated with all the configured default file names. Set to 0 to disable checking default filenames on non-root directories.
Function prototype for tcp accept callback functions. Called when a new connection can be accepted on a listening pcb.
Function prototype for tcp receive callback functions. Called when data has been received.
Function prototype for tcp sent callback functions. Called when sent data has been acknowledged by the remote side. Use it to free corresponding resources. This also means that the pcb has now space available to send new data.
Function prototype for tcp poll callback functions. Called periodically as specified by @see tcp_poll.
Function prototype for tcp connected callback functions. Called when a pcb is connected to the remote side after initiating a connection attempt by calling tcp_connect().
Protocol specific PCB members
pointer to the original pbuf that is referenced
global variable that shows if the tcp timer is currently scheduled or not
Try hard to create a new entry - we want the IP address to appear in
The resolved address is stored here
writeset passed to select
unimplemented: exceptset passed to select
fds passed to poll; NULL if select
Options for the lwip_pollscan function.
Global variables of this module, kept in a struct for efficient access using base+index.
Conn already established.
Common members of all PCB types
Allocates a memory buffer of specified size that is of sufficient size to align its start address using LWIP_MEM_ALIGN. You can declare your own version here e.g. to enforce alignment without adding trailing padding bytes (see LWIP_MEM_ALIGN_BUFFER) or your own section placement requirements.\n e.g. if you use gcc and need 32 bit alignment:\n \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[size] \_\_attribute\_\_((aligned(4)))\n or more portable:\n \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)]
Calculate safe memory size for an aligned buffer when using an unaligned type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the start (e.g. if buffer is u8_t[] and actual data will be u32_t*)
LWIP_TIMERS_CUSTOM==1: Provide your own timer implementation. Function prototypes in timeouts.h and the array of lwip-internal cyclic timers are still included, but the implementation is not. The following functions will be required: sys_timeouts_init(), sys_timeout(), sys_untimeout(), sys_timeouts_mbox_fetch()
MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make sure that there are no cycles in the linked lists.
MEM_SANITY_CHECK==1: run a sanity check after each mem_free() to make sure that the linked list of heap elements is not corrupted.
MEMP_NUM_NETCONN: the number of struct netconns. (only needed if you use the sequential API, like api_lib.c)
IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast filter per pcb on udp and raw send operations. To enable broadcast filter on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select. DNS servers received in the response are passed to DNS via dns_setserver() (up to the maximum limit defined here).
DNS maximum number of retries when asking for a name, before "timeout".
If this is turned on, the local host-list can be dynamically changed at runtime.
Define this to something that triggers a watchdog. This is called from tcpip_thread after processing a message.
By default, TCP socket/netconn close waits 20 seconds max to send the FIN
LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update Reachable time and retransmission timers, and netif MTU.
ICMP_DEBUG: Enable debugging in icmp.c.
IP_DEBUG: Enable debugging for IP.
TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
4 bits are reserved for 16 allocation sources (e.g. heap, pool1, pool2, etc)
Define this to 0 to prevent freeing ooseq pbufs when the PBUF_POOL is empty
The size of a fully constructed netif name which the netif can be identified by in APIs. Composed of 2 chars, 3 (max) digits, and 1 \0
If set, the netif is an ethernet device. It might not use ARP or TCP/IP if it is used for PPPoE only.
pbufs passed to IP must have a ref-count of 1 as their payload pointer gets altered as the packet is passed down the stack
Function prototype for thread functions
Address resolution protocol
Returned by sys_timeouts_sleeptime() to indicate there is no timer, so we can sleep forever.
MEMCPY-like copying of IP addresses where addresses are known to be 16-bit-aligned if the port is correctly configured (so a port could define this to copying 2 u16_t's) - no NULL-pointer-checking needed.
MEMCPY-like copying of IP addresses where addresses are known to be 16-bit-aligned if the port is correctly configured (so a port could define this to copying 2 u16_t's) - no NULL-pointer-checking needed.
pointer to the application buffer that contains the data to send
Set this to 0 to prevent parsing the file extension at runtime to decide if a file should be scanned for SSI tags or not. Default is 1 (file extensions are checked using the g_pcSSIExtensions array) Set to 2 to override this runtime test function. This is enabled by default, but if you only use a newer version of makefsdata supporting the "-ssi" option, this info is already present in
Set this to 1 to use a memp pool for allocating struct http_state instead of the heap. If enabled, you'll need to define MEMP_NUM_PARALLEL_HTTPD_CONNS (and MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS for SSI) to set the size of the pool(s).
The poll delay is X*500ms
Priority for tcp pcbs created by HTTPD (very low by default). Lower priorities get killed first when running out of memory.
Number of rx pbufs to enqueue to parse an incoming request (up to the first newline)
used for lwip_netconn_do_recv
Common members of all PCB types
Protocol specific PCB members
members common to struct tcp_pcb and struct tcp_listen_pcb
Flags used on input processing, not on pcb->flags
Table to quickly map an lwIP error (err_t) to a socket error by using -err as an index
LWIP_PPP_API==1: Enable PPP API (in pppapi.c)
DHCP_CREATE_RAND_XID: if this is set to 1, the xid is created using LWIP_RAND() (this overrides DHCP_GLOBAL_XID)
Small optimization: set to 0 if incoming PBUF_POOL pbuf always can be used to modify and send a response packet (and to 1 if this is not the case, e.g. when link header is stripped off when receiving)
The IP header ID of the next outgoing IP packet
HTTP request is copied here from pbufs for simple parsing
h_errno is exported in netdb.h for access by applications.
define "hostent" variables storage: 0 if we use a static (but unprotected) set of variables for lwip_gethostbyname, 1 if we use a local storage
nfds passed to poll; 0 if select
don't signal the same semaphore twice: set to 1 when signalled
Clear revents in each struct pollfd.
Increment select_waiting in each struct lwip_sock.
Decrement select_waiting in each struct lwip_sock.
Random generator function to create random TXIDs and source ports for queries
DNS resource record max. TTL (one week as default)
Function prototype for netif->linkoutput functions. Only used for ethernet netifs. This function is called by ARP when a packet shall be sent.
This field can be set by the device driver and could point to state information for the device.
Extended netif status callback (NSC) reasons flags. May be extended in the future!
Args to LWIP_NSC_LINK_CHANGED callback
Args to LWIP_NSC_STATUS_CHANGED callback
Args to LWIP_NSC_IPV4_ADDRESS_CHANGED|LWIP_NSC_IPV4_GATEWAY_CHANGED|LWIP_NSC_IPV4_NETMASK_CHANGED|LWIP_NSC_IPV4_SETTINGS_CHANGED callback
Args to LWIP_NSC_IPV6_SET callback
Args to LWIP_NSC_IPV6_ADDR_STATE_CHANGED callback
Common members of all PCB types
Prototype for a function to free a custom pbuf
Function prototype for netif->output functions. Called by lwIP when a packet shall be sent. For ethernet netif, set this to 'etharp_output' and set 'linkoutput'.
Define this to 1 in arch/cc.h of your port if you do not want to include stddef.h header to get size_t. You need to typedef size_t by yourself in this case.
Define this to 1 in arch/cc.h of your port if your compiler does not provide the stdint.h header. You need to typedef the generic types listed in lwip/arch.h yourself in this case (u8_t, u16_t...).
Define this to 1 in arch/cc.h of your port if your compiler does not provide the inttypes.h header. You need to define the format strings listed in lwip/arch.h yourself in this case (X8_F, U16_F...).
Define this to 1 in arch/cc.h of your port if your compiler does not provide the limits.h header. You need to define the type limits yourself in this case (e.g. INT_MAX, SSIZE_MAX).
Define this to 1 in arch/cc.h of your port if your compiler does not provide the ctype.h header. If ctype.h is available, a few character functions are mapped to the appropriate functions (lwip_islower, lwip_isdigit...), if not, a private implementation is provided.
Called as first thing in the lwIP TCPIP thread. Can be used in conjunction with to check core locking. @see multithreading
MEMP_MEM_INIT==1: Force use of memset to initialize pool memory. Useful if pool are moved in uninitialized section of memory. This will ensure default values in pcbs struct are well initialized in all conditions.
MEMP_NUM_RAW_PCB: Number of raw connection PCBs (requires the LWIP_RAW option)
MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for reassembly (whole packets, not fragments!)
MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing packets (pbufs) that are waiting for an ARP request (to resolve their destination address) to finish. (requires the ARP_QUEUEING option)
MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces can be members at the same time (one per netif - allsystems group -, plus one per netif membership). (requires the LWIP_IGMP option)
The number of sys timeouts used by the core stack (not apps) The default number of timeouts is calculated here for all enabled modules.
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)
IP_OPTIONS_ALLOWED: Defines the behavior for IP options. IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived in this time, the whole packet is discarded.
IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks. Turn this on to get callbacks needed to implement MIB2. Usually MIB2_STATS should be enabled, too.
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.
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.
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.
TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an explicit window update
LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback sending for each netif (0 = disabled)
LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int (milliseconds, much like winsock does) instead of a struct timeval (default).
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!
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.
CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets.
LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during network startup.
LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862.
LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address is being resolved.
LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache
TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
LWIP_PERF: Enable performance testing for lwIP (if enabled, arch/perf.h is included)
PBUF_NEEDS_COPY(p): return a boolean value indicating whether the given pbuf needs to be copied in order to be kept around beyond the current call stack without risking being corrupted. The default setting provides safety: it will make a copy iof any pbuf chain that does not consist entirely of PBUF_ROM type pbufs. For setups with zero-copy support, it may be redefined to evaluate to true in all cases, for example. However, doing so also has an effect on the application side: any buffers that are *not* copied must also *not* be reused by the application after passing them to lwIP. For example, when setting PBUF_NEEDS_COPY to (0), after using udp_send() with a PBUF_RAM pbuf, the application must free the pbuf immediately, rather than reusing it for other purposes. For more background information on this, see tasks #6735 and #7896, and bugs #11400 and #49914.
Indicates this pbuf is used for RX (if not set, indicates use for TX). This information can be used to keep some spare RX buffers e.g. for
@file lwIP internal memory pools (do not use in application code) This file is deliberately included multiple times: once with empty definition of LWIP_MEMPOOL() to handle all includes and multiple times to build up various lists of mem pools.
Get the interface that received the current packet. This function must only be called from a receive callback (udp_recv,
Get the IPv4 header of the current packet. This function must only be called from a receive callback (udp_recv,
Function prototype for a stack-internal timer function that has to be called at a defined interval
Array size of lwip_cyclic_timers[]
Same as sys_sem_valid() but taking a value, not a pointer
Same as sys_sem_set_invalid() but taking a value, not a pointer
Same as sys_mbox_set_invalid() but taking a value, not a pointer
Define this to 1 and define LWIP_ARP_FILTER_NETIF_FN(pbuf, netif, type) to a filter function that returns the correct netif when using multiple netifs on one hardware interface where the netif's low-level receive routine cannot decide for the correct netif (e.g. when mapping multiple IP addresses to one hardware interface).
For Ethernet network interfaces, we might want to send "gratuitous ARP"; this is an ARP packet sent by a node in order to spontaneously cause other nodes to update an entry in their ARP cache.
Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private pointer type (defaults to 'void' so the default usage is 'void*')
The server port for HTTPD to use
Maximum retries before the connection is aborted/closed. - number of times pcb->poll is called -> default is 4*500ms = 2s; - reset when pcb->sent is called
Set this to one to show error pages when parsing a request fails instead of simply closing the connection.
Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming request (up to the first double-newline)
Set this to 1 to call tcp_abort when tcp_close fails with memory error. This can be used to prevent consuming all memory in situations where the HTTP server has low priority compared to other communication.
Default: Tags are sent from struct http_state and are therefore volatile
Filename (including path) to use as FS data file
used for lwip_netconn_do_newconn
fragment reassembly time exceeded
Function prototype for deallocation of arguments. Called *just before* the pcb is freed, so don't expect to be able to do anything with this pcb!
Function prototype to transition arguments from a listening pcb to an accepted pcb
Common members of all PCB types
Common members of all PCB types
Protocol specific PCB members
This is the Nagle algorithm: try to combine user data to send as few TCP segments as possible. Only send if - no previously transmitted data on the connection remains unacknowledged or - the TF_NODELAY flag is set (nagle algorithm turned off for this pcb) or - the only unsent segment is at least pcb->mss bytes long (or there is more than one unsent segment - with lwIP, this can happen although unsent->len < mss) - or if we are in fast-retransmit (TF_INFR)
For release candidates, this is set to 1..254 For official releases, this is set to 255 (LWIP_RC_RELEASE)
PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP
PPPOS_SUPPORT==1: Enable PPP Over Serial
If you want to relocate the heap to external memory, simply define LWIP_RAM_HEAP_POINTER as a void-pointer to that location. If so, make sure the memory at that location is big enough (see below on how that space is calculated). the heap. we need one struct mem at the end and some room for alignment
All allocated blocks will be MIN_SIZE bytes big, at least! MIN_SIZE can be overridden to suit your needs. Smaller values save space, larger values could prevent too small blocks to fragment the RAM too much.
Timer counter to handle calling slow-timer from tcp_tmr()
Define this to 1 for an extra check that the output checksum is valid (usefule when the checksum is generated by the application, not the stack)
The size of segment pbufs created when TCP_OVERSIZE is enabled
Re-request a used ARP entry 1 minute before it would expire to prevent
the time an ARP entry stays pending after first request, for ARP_TMR_INTERVAL = 1000, this is 10 seconds. @internal Keep this number at least 2, otherwise it might run out instantly if the timeout occurs directly after a request.
This is overridable for the rare case where more than 255 threads select on the same socket...
Limits the source port to be >= 1024 by default
Function pointer for a CGI script handler. This function is called each time the HTTPD server is asked for a file whose name was previously registered as a CGI function using a call to http_set_cgi_handlers. The iIndex parameter provides the index of the CGI within the cgis array passed to http_set_cgi_handlers. Parameters pcParam and pcValue provide access to the parameters provided along with the URI. iNumParams provides a count of the entries in the pcParam and pcValue arrays. Each entry in the pcParam array contains the name of a parameter with the corresponding entry in the pcValue array containing the value for that parameter. Note that pcParam may contain multiple elements with the same name if, for example, a multi-selection list control is used in the form generating the data. The function should return a pointer to a character string which is the path and filename of the response that is to be sent to the connected browser, for example "/thanks.htm" or "/response/error.ssi". The maximum number of parameters that will be passed to this function via iNumParams is defined by LWIP_HTTPD_MAX_CGI_PARAMETERS. Any parameters in the incoming HTTP request above this number will be discarded. Requests intended for use by this CGI mechanism must be sent using the GET method (which encodes all parameters within the URI rather than in a block later in the request). Attempts to use the POST method will result in the request being ignored.
Number of Router Solicitation messages that remain to be sent.
Args to LWIP_NSC_LINK_CHANGED callback
Args to LWIP_NSC_STATUS_CHANGED callback
Args to LWIP_NSC_IPV4_ADDRESS_CHANGED|LWIP_NSC_IPV4_GATEWAY_CHANGED|LWIP_NSC_IPV4_NETMASK_CHANGED|LWIP_NSC_IPV4_SETTINGS_CHANGED callback
Index of changed IPv6 address
Args to LWIP_NSC_IPV6_SET callback
Index of affected IPv6 address
Args to LWIP_NSC_IPV6_ADDR_STATE_CHANGED callback
Function used for extended netif status callbacks Note: When parsing reason argument, keep in mind that more reasons may be added in the future!
Includes spare room for additional encapsulation header before ethernet headers (e.g. 802.11). Use this if you intend to pass the pbuf to functions like netif->linkoutput(). @see PBUF_LINK_ENCAPSULATION_HLEN
next pbuf in singly linked pbuf chain
MAC Filter Actions, these are passed to a netif's igmp_mac_filter or mld_mac_filter callback function.
@file lwIP Options Configuration
@file Debug messages infrastructure
@file Support for different processor and compiler architectures
Platform specific diagnostic output.\n Note the default implementation pulls in printf, which may in turn pull in a lot of standard libary code. In resource-constrained systems, this should be defined to something less resource-consuming.
Get rid of alignment cast warnings (GCC -Wcast-align)
Get rid of warnings related to pointer-to-numeric and vice-versa casts, e.g. "conversion from 'u8_t' to 'void *' of greater size"
Avoid warnings/errors related to implicitly casting away packed attributes by doing a explicit cast
@name Debug level (LWIP_DBG_MIN_LEVEL)
@name Enable/disable debug messages completely (LWIP_DBG_TYPES_ON)
MEMMOVE: override this if you have a faster implementation at hand than the one included in your C library. lwIP currently uses MEMMOVE only when IPv6 fragmentation support is enabled.
MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more reliable.
MEMP_NUM_ALTCP_PCB: the number of simultaneously active altcp layer pcbs. (requires the LWIP_ALTCP option) Connections with multiple layers require more than one altcp_pcb (e.g. TLS over TCP requires 2 altcp_pcbs, one for TLS and one for TCP).
MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent (fragments, not whole packets!). This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs where the packet is not yet sent when netif->output returns.
MEMP_NUM_NETBUF: the number of struct netbufs. (only needed if you use the sequential API, like api_lib.c)
MEMP_NUM_SELECT_CB: the number of struct lwip_select_cb. (Only needed if you have LWIP_MPU_COMPATIBLE==1 and use the socket API. In that case, you need one per thread calling lwip_select.)
MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used for incoming packets. (only needed if you use tcpip.c)
MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls (before freeing the corresponding memory using lwip_freeaddrinfo()).
MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
MEMP_NUM_API_MSG: the number of concurrently active calls to various socket, netconn, and tcpip functions
MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname
MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls to getsockopt/setsockopt
MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the netifapi functions
The maximum number of packets which may be queued for each unresolved address by other network layers. Defaults to 3, 0 means disabled. Old packets are dropped, new packets are queued.
IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back out on the netif where it was received. This should only be used for wireless networks. ATTENTION: When this is 1, make sure your netif driver correctly marks incoming link-layer-broadcast/multicast packets as such using the corresponding pbuf flags!
LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
The maximum of NTP servers requested
LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes that should be sent before falling back on AUTOIP (the DHCP client keeps running in this case). This can be set as low as 1 to get an AutoIP address very quickly, but you should be prepared to handle a changing IP address when DHCP overrides AutoIP.
DNS do a name checking between the query and the response.
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.
LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1).
LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in the system, as netifs must change how they behave depending on this setting for the LWIP_NETIF_LOOPBACK option to work. Setting this is needed to avoid reentering non-reentrant functions like tcp_input(). LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a multithreaded environment like tcpip.c. In this case, netif->input() is called directly. LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. The packets are put on a list and netif_poll() must be called in the main application loop.
SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. The stack size value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.
SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. The priority value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.
DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_RAW. The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the recvmbox is created.
If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets.
CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets
IPV6_REASS_MAXAGE: Maximum time (in multiples of IP6_REASS_TMR_INTERVAL - so seconds, normally) a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived in this time, the whole packet is discarded.
LWIP_IPV6_SCOPES_DEBUG==1: Perform run-time checks to verify that addresses are properly zoned (see ip6_zone.h on what that means) where it matters. Enabling this setting is highly recommended when upgrading from an existing installation that is not yet scope-aware; otherwise it may be too expensive.
LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif.
LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs
LWIP_IPV6_ADDRESS_LIFETIMES==1: Keep valid and preferred lifetimes for each IPv6 address. Required for LWIP_IPV6_AUTOCONFIG. May still be enabled otherwise, in which case the application may assign address lifetimes with the appropriate macros. Addresses with no lifetime are assumed to be static. If this option is disabled, all addresses are assumed to be static.
LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts.
LWIP_ICMP6_DATASIZE: bytes from original packet to send back in ICMPv6 error messages.
LWIP_ICMP6_HL: default hop limit for ICMPv6 messages
MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined. There must be enough groups so that each netif can join the solicited-node multicast group for each of its local addresses, plus one for MDNS if applicable, plus any number of groups to be joined on UDP sockets.
MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution.
LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache
LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache
LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache
LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send (neighbor solicit and router solicit)
LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages to send during neighbor reachability detection.
Unused: See ND RFC (time in milliseconds).
LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). May be updated by router advertisement messages.
LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages
LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation message is sent, during neighbor reachability detection.
LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS servers to the DNS module.
LWIP_IPV6_DHCP6_STATEFUL==1: enable DHCPv6 stateful address autoconfiguration. (not supported, yet!)
LWIP_IPV6_DHCP6_STATELESS==1: enable DHCPv6 stateless address autoconfiguration.
LWIP_DHCP6_GETS_NTP==1: Request NTP servers via DHCPv6. For each response packet, a callback is called, which has to be provided by the port: void dhcp6_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
The maximum of NTP servers requested
LWIP_DHCP6_MAX_DNS_SERVERS > 0: Request DNS servers via DHCPv6. DNS servers received in the response are passed to DNS via dns_setserver() (up to the maximum limit defined here).
LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is compared against this value. If it is smaller, then debugging messages are written. @see debugging_levels
LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable debug messages of certain types. @see debugging_levels
ETHARP_DEBUG: Enable debugging in etharp.c.
PBUF_DEBUG: Enable debugging in pbuf.c.
API_LIB_DEBUG: Enable debugging in api_lib.c.
API_MSG_DEBUG: Enable debugging in api_msg.c.
IGMP_DEBUG: Enable debugging in igmp.c.
INET_DEBUG: Enable debugging in inet.c.
IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
RAW_DEBUG: Enable debugging in raw.c.
MEM_DEBUG: Enable debugging in mem.c.
MEMP_DEBUG: Enable debugging in memp.c.
SYS_DEBUG: Enable debugging in sys.c.
TIMERS_DEBUG: Enable debugging in timers.c.
TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
TCP_RTO_DEBUG: Enable debugging in TCP for retransmit timeout.
TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
TCPIP_DEBUG: Enable debugging in tcpip.c.
SLIP_DEBUG: Enable debugging in slipif.c.
DHCP_DEBUG: Enable debugging in dhcp.c.
AUTOIP_DEBUG: Enable debugging in autoip.c.
IP6_DEBUG: Enable debugging for IPv6.
DHCP6_DEBUG: Enable debugging in dhcp6.c.
@file netif API (to be used from TCPIP thread)
@file IP address API (common IPv4 and IPv6)
@file various utility macros All defines related to this section must not be placed in lwipopts.h, but in arch/perf.h! Measurement calls made throughout lwip, these can be defined to nothing. - PERF_START: start measuring something. - PERF_STOP(x): stop measuring something, and record the result.
Safely copy one IP address to another and change byte order
@file Statistics API (to be used from TCPIP thread)
@file memory pools lwIP internal implementations (do not use in application code)
@file lwIP internal memory implementations (do not use in application code)
Declare prototype for private memory pool if it is used in multiple files
If set, the netif has IGMP capability.
If set, the netif has MLD6 capability.
netif administrative status changed.\n up is called AFTER netif is set up.\n
@file UDP API (to be used from TCPIP thread)\n See also udp_raw
@file IPv4 protocol definitions
@file IP protocol definitions
@file UDP protocol definitions
A list of often ethtypes (although lwIP does not use all of them).
Virtual local area network
PPP Over Ethernet Discovery Stage
PPP Over Ethernet Session Stage
Ethernet for control automation technology
Link layer discovery protocol
Serial real-time communication system
Media redundancy protocol
VLAN header inserted between ethernet header and payload if 'type' in ethernet header is ETHTYPE_VLAN. See IEEE802.Q
@file Timer implementations
@file OS abstraction layer
@file Ethernet input function - handles INCOMING ethernet level traffic To be used in most low-level netif implementations
@file Ethernet protocol definitions
@file IEEE assigned numbers
@file Ethernet output function - handles OUTGOING ethernet level traffic, implements ARP resolving. To be used in most low-level netif implementations
@file ARP protocol definitions
@file SNMP support API for implementing netifs and statitics for MIB2
@file Functions to sync with TCPIP thread
@deprecated use tcpip_try_callback() or tcpip_callback() instead
Port numbers https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt
@file netconn API (to be used from non-TCPIP threads)
@file netbuf API (for netconn API)
@file HTTP server options list
@file IANA assigned numbers (RFC 1700 and successors)
This string is passed in the HTTP header as "Server: "
The https server port for HTTPD to use
Set this to 1 to enable timing each file sent
Maximum length of the filename to send as response to a POST request, filled in by the application when a POST is finished.
Set this to 1 to send URIs without extension without headers (who uses this at all??)
fragmentation needed and DF set
time to live exceeded in transit
A table of callback functions that is invoked for ext arguments
Common members of all PCB types
@file raw API (to be used from TCPIP thread)\n See also raw_raw
@file netconn API lwIP internal implementations (do not use in application code)
@file TCPIP API internal implementations (do not use in application code)
@file TCP internal implementations (do not use in application code)
@file TCP API (to be used from TCPIP thread)\n See also tcp_raw
@file Base TCP API definitions shared by TCP and ALTCP\n See also tcp_raw
@file ICMP protocol definitions
@file TCP protocol definitions
@file DNS API lwip DNS resolver header file. Author: Jim Pettinato April 2007 ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@file Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. No support for MLDv2.
@file Posix Errno defines
@file NETDB API (sockets)
@file lwIP initialization API
@file IP checksum calculation functions
@file Socket API (to be used from non-TCPIP threads)
@file Neighbor discovery and stateless address autoconfiguration for IPv6. Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 (Address autoconfiguration).
PPPOL2TP_AUTH_SUPPORT==1: Enable PPP Over L2TP Auth (enable MD5 support)
ppp.h - Network Point to Point Protocol header file. Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. portions Copyright (c) 1997 Global Election Systems Inc. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice and the following disclaimer are included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. REVISION HISTORY 03-01-01 Marc Boucher <marc@mbsi.ca> Ported to lwIP. 97-11-05 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc. Original derived from BSD codes.
@file Application layered TCP connection API (to be used from TCPIP thread)\n This file contains the generic API. For more details see altcp_api.
@file IP fragmentation/reassembly
@file Sockets API internal implementations (do not use in application code)
@file Neighbor discovery and stateless address autoconfiguration for IPv6. Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 (Address autoconfiguration).
@file IPv6 fragmentation and reassembly.
@file raw API internal implementations (do not use in application code)
@file AutoIP Automatic LinkLocal IP Configuration
@file DHCPv6 client: IPv6 address autoconfiguration as per RFC 3315 (stateful DHCPv6) and RFC 3736 (stateless DHCPv6).
Reserved for expansion of error messages
Multicast listener report
Multicast router advertisement
Multicast router solicitation
Multicast router termination
Reserved for expansion of informational messages
ICMP destination unreachable codes
Communication with destination administratively prohibited
Beyond scope of source address
Source address failed ingress/egress policy
Reject route to destination
Hop limit exceeded in transit
Fragment reassembly time exceeded
Erroneous header field encountered
Unrecognized next header type encountered
Unrecognized IPv6 option encountered
@file IPv6 version of ICMP, as per RFC 4443.
@file ICMP6 protocol definitions
Option handling: options are parsed in dhcp_parse_reply and saved in an array where other functions can load them from. This might be moved into the struct dhcp (not necessarily since lwIP is single-threaded and the array is only used while in recv callback).
@file DHCP protocol definitions
@file Application layered TCP connection API (to be used from TCPIP thread)\n This interface mimics the tcp callback API to the application while preventing direct linking (much like virtual functions). This way, an application can make use of other application layer protocols on top of TCP without knowing the details (e.g. TLS, proxy connection). This file contains the base implementation calling into tcp.
Default: dynamic headers are sent from ROM (non-dynamic headers are handled like file data)
This variable is initialized by the system to contain the wildcard IPv6 address.
@file This file (together with sockets.h) aims to provide structs and functions from - arpa/inet.h - netinet/in.h
This macro can be used to initialize a variable of type struct in6_addr
This macro can be used to initialize a variable of type struct in6_addr
@file DNS - host name to IP address resolver.
UDP port for multicast DNS queries
@file 6LowPAN output for IPv6. Uses ND tables for link-layer addressing. Fragments packets to 6LowPAN units.
@file 6LowPAN options list
LWIP_6LOWPAN_NUM_CONTEXTS: define the number of compression contexts per netif type
LWIP_6LOWPAN_INFER_SHORT_ADDRESS: set this to 0 to disable creating short addresses for matching addresses (debug only)
LWIP_6LOWPAN_IPHC: set this to 0 to disable IP header compression as per RFC 6282 (which is mandatory for BLE)
Set this to 1 if your IEEE 802.15.4 interface can calculate and check the CRC in hardware. This means TX packets get 2 zero bytes added on transmission which are to be filled with the CRC.
If LWIP_6LOWPAN_802154_HW_CRC==0, this can override the default slow implementation of the CRC used for 6LoWPAN over IEEE 802.15.4 (which uses a shift register).
Debug level for 6LoWPAN in general
Debug level for 6LoWPAN over IEEE 802.15.4
LWIP_LOWPAN6_IP_COMPRESSED_DEBUG: enable compressed IP frame output debugging
LWIP_LOWPAN6_DECOMPRESSION_DEBUG: enable decompression debug output
LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG: enable decompressed IP frame output debugging
LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS: Currently, the linux kernel driver for 6lowpan sets/clears a bit in the address, depending on the BD address (either public or not). Might not be RFC7668 conform, so you may select to do that (=1) or not (=0)
For LWIP_HTTPD_SSI_RAW==1, return this to indicate the tag is unknown. In this case, the webserver writes a warning into the page. You can also just return 0 to write nothing for unknown tags.