diff --git a/components/net/lwip-2.1.2/doc/doxygen/output/html/altcp_8c.html b/components/net/lwip-2.1.2/doc/doxygen/output/html/altcp_8c.html deleted file mode 100644 index d127062e6d1b481bd1110a9f2f0240b816cc4417..0000000000000000000000000000000000000000 --- a/components/net/lwip-2.1.2/doc/doxygen/output/html/altcp_8c.html +++ /dev/null @@ -1,200 +0,0 @@ - - -
- - - - -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/altcp.h"
#include "lwip/priv/altcp_priv.h"
#include "lwip/altcp_tcp.h"
#include "lwip/tcp.h"
#include "lwip/mem.h"
#include <string.h>
-Functions | |
struct altcp_pcb * | altcp_alloc (void) |
void | altcp_free (struct altcp_pcb *conn) |
struct altcp_pcb * | altcp_new_ip6 (altcp_allocator_t *allocator) |
struct altcp_pcb * | altcp_new (altcp_allocator_t *allocator) |
struct altcp_pcb * | altcp_new_ip_type (altcp_allocator_t *allocator, u8_t ip_type) |
void | altcp_arg (struct altcp_pcb *conn, void *arg) |
void | altcp_accept (struct altcp_pcb *conn, altcp_accept_fn accept) |
void | altcp_recv (struct altcp_pcb *conn, altcp_recv_fn recv) |
void | altcp_sent (struct altcp_pcb *conn, altcp_sent_fn sent) |
void | altcp_poll (struct altcp_pcb *conn, altcp_poll_fn poll, u8_t interval) |
void | altcp_err (struct altcp_pcb *conn, altcp_err_fn err) |
void | altcp_recved (struct altcp_pcb *conn, u16_t len) |
err_t | altcp_bind (struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port) |
err_t | altcp_connect (struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected) |
struct altcp_pcb * | altcp_listen_with_backlog_and_err (struct altcp_pcb *conn, u8_t backlog, err_t *err) |
void | altcp_abort (struct altcp_pcb *conn) |
err_t | altcp_close (struct altcp_pcb *conn) |
err_t | altcp_shutdown (struct altcp_pcb *conn, int shut_rx, int shut_tx) |
err_t | altcp_write (struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags) |
err_t | altcp_output (struct altcp_pcb *conn) |
u16_t | altcp_mss (struct altcp_pcb *conn) |
u16_t | altcp_sndbuf (struct altcp_pcb *conn) |
u16_t | altcp_sndqueuelen (struct altcp_pcb *conn) |
void | altcp_setprio (struct altcp_pcb *conn, u8_t prio) |
struct altcp_pcb* altcp_alloc | -( | -void | -) | -- |
For altcp layer implementations only: allocate a new struct altcp_pcb from the pool and zero the memory
- -void altcp_free | -( | -struct altcp_pcb * | -conn | ) | -- |
For altcp layer implementations only: return a struct altcp_pcb to the pool
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/tcpbase.h"
#include "lwip/err.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
-Data Structures | |
struct | altcp_allocator_s |
-Macros | |
#define | altcp_listen(conn) altcp_listen_with_backlog_and_err(conn, TCP_DEFAULT_LISTEN_BACKLOG, NULL) |
-Typedefs | |
typedef struct altcp_allocator_s | altcp_allocator_t |
-Functions | |
struct altcp_pcb * | altcp_new (altcp_allocator_t *allocator) |
struct altcp_pcb * | altcp_new_ip6 (altcp_allocator_t *allocator) |
struct altcp_pcb * | altcp_new_ip_type (altcp_allocator_t *allocator, u8_t ip_type) |
void | altcp_arg (struct altcp_pcb *conn, void *arg) |
void | altcp_accept (struct altcp_pcb *conn, altcp_accept_fn accept) |
void | altcp_recv (struct altcp_pcb *conn, altcp_recv_fn recv) |
void | altcp_sent (struct altcp_pcb *conn, altcp_sent_fn sent) |
void | altcp_poll (struct altcp_pcb *conn, altcp_poll_fn poll, u8_t interval) |
void | altcp_err (struct altcp_pcb *conn, altcp_err_fn err) |
void | altcp_recved (struct altcp_pcb *conn, u16_t len) |
err_t | altcp_bind (struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port) |
err_t | altcp_connect (struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected) |
struct altcp_pcb * | altcp_listen_with_backlog_and_err (struct altcp_pcb *conn, u8_t backlog, err_t *err) |
void | altcp_abort (struct altcp_pcb *conn) |
err_t | altcp_close (struct altcp_pcb *conn) |
err_t | altcp_shutdown (struct altcp_pcb *conn, int shut_rx, int shut_tx) |
err_t | altcp_write (struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags) |
err_t | altcp_output (struct altcp_pcb *conn) |
u16_t | altcp_mss (struct altcp_pcb *conn) |
u16_t | altcp_sndbuf (struct altcp_pcb *conn) |
u16_t | altcp_sndqueuelen (struct altcp_pcb *conn) |
void | altcp_setprio (struct altcp_pcb *conn, u8_t prio) |
Application layered TCP connection API (to be used from TCPIP thread)
- This file contains the generic API. For more details see Application layered TCP Introduction.
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/altcp.h"
#include "lwip/altcp_tcp.h"
#include "lwip/altcp_tls.h"
#include "lwip/priv/altcp_priv.h"
#include "lwip/mem.h"
#include <string.h>
-Functions | |
struct altcp_pcb * | altcp_tls_new (struct altcp_tls_config *config, u8_t ip_type) |
struct altcp_pcb * | altcp_tls_alloc (void *arg, u8_t ip_type) |
Application layered TCP connection API (to be used from TCPIP thread)
-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 allocation implementation that combine several layers.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
struct altcp_pcb * | altcp_alloc (void) |
void | altcp_free (struct altcp_pcb *conn) |
Application layered TCP connection API (to be used from TCPIP thread)
-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).
struct altcp_pcb* altcp_alloc | -( | -void | -) | -- |
For altcp layer implementations only: allocate a new struct altcp_pcb from the pool and zero the memory
- -void altcp_free | -( | -struct altcp_pcb * | -conn | ) | -- |
For altcp layer implementations only: return a struct altcp_pcb to the pool
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/apps/altcp_proxyconnect.h"
#include "lwip/altcp.h"
#include "lwip/priv/altcp_priv.h"
#include "lwip/altcp_tcp.h"
#include "lwip/altcp_tls.h"
#include "lwip/mem.h"
#include "lwip/init.h"
#include <stdio.h>
-Macros | |
#define | ALTCP_PROXYCONNECT_CLIENT_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" |
-Functions | |
struct altcp_pcb * | altcp_proxyconnect_new (struct altcp_proxyconnect_config *config, struct altcp_pcb *inner_pcb) |
struct altcp_pcb * | altcp_proxyconnect_new_tcp (struct altcp_proxyconnect_config *config, u8_t ip_type) |
struct altcp_pcb * | altcp_proxyconnect_alloc (void *arg, u8_t ip_type) |
struct altcp_pcb * | altcp_proxyconnect_tls_alloc (void *arg, u8_t ip_type) |
Application layered TCP connection API that executes a proxy-connect.
-This file provides a starting layer that executes a proxy-connect e.g. to set up TLS connections through a http proxy.
-#define ALTCP_PROXYCONNECT_CLIENT_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" | -
This string is passed in the HTTP header as "User-Agent: "
- -struct altcp_pcb* altcp_proxyconnect_alloc | -( | -void * | -arg, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Allocator function to allocate a proxy connect altcp pcb connecting directly via tcp to the proxy.
-The returned pcb is a chain: altcp_proxyconnect - altcp_tcp - tcp pcb
-This function is meant for use with altcp_new.
-arg | struct altcp_proxyconnect_config that contains the proxy settings |
ip_type | IP type of the connection (lwip_ip_addr_type) |
struct altcp_pcb* altcp_proxyconnect_new | -( | -struct altcp_proxyconnect_config * | -config, | -
- | - | struct altcp_pcb * | -inner_pcb | -
- | ) | -- |
Allocate a new altcp layer connecting through a proxy. This function gets the inner pcb passed.
-config | struct altcp_proxyconnect_config that contains the proxy settings |
inner_pcb | pcb that makes the connection to the proxy (i.e. tcp pcb) |
struct altcp_pcb* altcp_proxyconnect_new_tcp | -( | -struct altcp_proxyconnect_config * | -config, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Allocate a new altcp layer connecting through a proxy. This function allocates the inner pcb as tcp pcb, resulting in a direct tcp connection to the proxy.
-config | struct altcp_proxyconnect_config that contains the proxy settings |
ip_type | IP type of the connection (lwip_ip_addr_type) |
struct altcp_pcb* altcp_proxyconnect_tls_alloc | -( | -void * | -arg, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Allocator function to allocate a TLS connection through a proxy.
-The returned pcb is a chain: altcp_tls - altcp_proxyconnect - altcp_tcp - tcp pcb
-This function is meant for use with altcp_new.
-arg | struct altcp_proxyconnect_tls_config that contains the proxy settings and tls settings |
ip_type | IP type of the connection (lwip_ip_addr_type) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
struct altcp_pcb * | altcp_proxyconnect_new (struct altcp_proxyconnect_config *config, struct altcp_pcb *inner_pcb) |
struct altcp_pcb * | altcp_proxyconnect_new_tcp (struct altcp_proxyconnect_config *config, u8_t ip_type) |
struct altcp_pcb * | altcp_proxyconnect_alloc (void *arg, u8_t ip_type) |
struct altcp_pcb * | altcp_proxyconnect_tls_alloc (void *arg, u8_t ip_type) |
Application layered TCP connection API that executes a proxy-connect.
-This file provides a starting layer that executes a proxy-connect e.g. to set up TLS connections through a http proxy.
-struct altcp_pcb* altcp_proxyconnect_alloc | -( | -void * | -arg, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Allocator function to allocate a proxy connect altcp pcb connecting directly via tcp to the proxy.
-The returned pcb is a chain: altcp_proxyconnect - altcp_tcp - tcp pcb
-This function is meant for use with altcp_new.
-arg | struct altcp_proxyconnect_config that contains the proxy settings |
ip_type | IP type of the connection (lwip_ip_addr_type) |
struct altcp_pcb* altcp_proxyconnect_new | -( | -struct altcp_proxyconnect_config * | -config, | -
- | - | struct altcp_pcb * | -inner_pcb | -
- | ) | -- |
Allocate a new altcp layer connecting through a proxy. This function gets the inner pcb passed.
-config | struct altcp_proxyconnect_config that contains the proxy settings |
inner_pcb | pcb that makes the connection to the proxy (i.e. tcp pcb) |
struct altcp_pcb* altcp_proxyconnect_new_tcp | -( | -struct altcp_proxyconnect_config * | -config, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Allocate a new altcp layer connecting through a proxy. This function allocates the inner pcb as tcp pcb, resulting in a direct tcp connection to the proxy.
-config | struct altcp_proxyconnect_config that contains the proxy settings |
ip_type | IP type of the connection (lwip_ip_addr_type) |
struct altcp_pcb* altcp_proxyconnect_tls_alloc | -( | -void * | -arg, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Allocator function to allocate a TLS connection through a proxy.
-The returned pcb is a chain: altcp_tls - altcp_proxyconnect - altcp_tcp - tcp pcb
-This function is meant for use with altcp_new.
-arg | struct altcp_proxyconnect_tls_config that contains the proxy settings and tls settings |
ip_type | IP type of the connection (lwip_ip_addr_type) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/altcp.h"
#include "lwip/altcp_tcp.h"
#include "lwip/priv/altcp_priv.h"
#include "lwip/tcp.h"
#include "lwip/mem.h"
#include <string.h>
-Functions | |
struct altcp_pcb * | altcp_tcp_alloc (void *arg, u8_t ip_type) |
Application layered TCP connection API (to be used from TCPIP thread)
-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.
-struct altcp_pcb* altcp_tcp_alloc | -( | -void * | -arg, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
altcp_tcp allocator function fitting to altcp_allocator_t / altcp_new.
-arg pointer is not used for TCP.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
struct altcp_pcb * | altcp_tcp_alloc (void *arg, u8_t ip_type) |
Application layered TCP connection API (to be used from TCPIP thread)
-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.
-struct altcp_pcb* altcp_tcp_alloc | -( | -void * | -arg, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
altcp_tcp allocator function fitting to altcp_allocator_t / altcp_new.
-arg pointer is not used for TCP.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
struct altcp_tls_config * | altcp_tls_create_config_server_privkey_cert (const u8_t *privkey, size_t privkey_len, const u8_t *privkey_pass, size_t privkey_pass_len, const u8_t *cert, size_t cert_len) |
struct altcp_tls_config * | altcp_tls_create_config_client (const u8_t *cert, size_t cert_len) |
struct altcp_tls_config * | altcp_tls_create_config_client_2wayauth (const u8_t *ca, size_t ca_len, const u8_t *privkey, size_t privkey_len, const u8_t *privkey_pass, size_t privkey_pass_len, const u8_t *cert, size_t cert_len) |
void | altcp_tls_free_config (struct altcp_tls_config *conf) |
struct altcp_pcb * | altcp_tls_wrap (struct altcp_tls_config *config, struct altcp_pcb *inner_pcb) |
struct altcp_pcb * | altcp_tls_new (struct altcp_tls_config *config, u8_t ip_type) |
struct altcp_pcb * | altcp_tls_alloc (void *arg, u8_t ip_type) |
void * | altcp_tls_context (struct altcp_pcb *conn) |
Application layered TCP/TLS connection API (to be used from TCPIP thread)
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
Application layered TCP connection API (to be used from TCPIP thread)
-This file contains memory management functions for a TLS layer using mbedTLS.
-ATTENTION: For production usage, you might want to override this file with your own implementation since this implementation simply uses the lwIP heap without caring for fragmentation or leaving heap for other parts of lwIP!
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
Application layered TCP/TLS connection API (to be used from TCPIP thread)
-This file contains memory management function prototypes for a TLS layer using mbedTLS.
-Memory management contains:
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
-Macros | |
#define | LWIP_ALTCP_TLS_MBEDTLS 0 |
#define | ALTCP_MBEDTLS_DEBUG LWIP_DBG_OFF |
#define | ALTCP_MBEDTLS_SESSION_CACHE_TIMEOUT_SECONDS 0 |
Application layered TCP/TLS connection API (to be used from TCPIP thread)
-This file contains options for an mbedtls port of the TLS layer.
-#define ALTCP_MBEDTLS_DEBUG LWIP_DBG_OFF | -
Configure debug level of this file
- -#define ALTCP_MBEDTLS_SESSION_CACHE_TIMEOUT_SECONDS 0 | -
Set a session timeout in seconds for the basic session cache ATTENTION: Using a session cache can lower security by reusing keys!
- -#define LWIP_ALTCP_TLS_MBEDTLS 0 | -
LWIP_ALTCP_TLS_MBEDTLS==1: use mbedTLS for TLS support for altcp API mbedtls include directory must be reachable via include search path
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/netbuf.h"
#include "lwip/sys.h"
#include "lwip/ip_addr.h"
#include "lwip/err.h"
-Data Structures | |
struct | netconn |
struct | netvector |
-Macros | |
#define | NETCONN_FLAG_MBOXCLOSED 0x01 |
#define | NETCONN_FLAG_NON_BLOCKING 0x02 |
#define | NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04 |
#define | NETCONN_FLAG_CHECK_WRITESPACE 0x10 |
#define | NETCONN_FLAG_IPV6_V6ONLY 0x20 |
#define | NETCONN_FIN_RX_PENDING 0x80 |
#define | API_EVENT(c, e, l) |
#define | netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL) |
#define | netconn_type(conn) (conn->type) |
#define | netconn_peer(c, i, p) netconn_getaddr(c,i,p,0) |
#define | netconn_addr(c, i, p) netconn_getaddr(c,i,p,1) |
#define | netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG) |
#define | netconn_write(conn, dataptr, size, apiflags) netconn_write_partly(conn, dataptr, size, apiflags, NULL) |
#define | netconn_set_nonblocking(conn, val) |
#define | netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0) |
#define | netconn_set_ipv6only(conn, val) |
#define | netconn_get_ipv6only(conn) (((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0) |
#define | netconn_set_sendtimeout(conn, timeout) ((conn)->send_timeout = (timeout)) |
#define | netconn_get_sendtimeout(conn) ((conn)->send_timeout) |
#define | netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize)) |
#define | netconn_get_recvbufsize(conn) ((conn)->recv_bufsize) |
-Typedefs | |
typedef void(* | netconn_callback) (struct netconn *, enum netconn_evt, u16_t len) |
-Enumerations | |
enum | netconn_type { , - NETCONN_TCP = 0x10, -NETCONN_TCP_IPV6 = NETCONN_TCP | 0x08, -NETCONN_UDP = 0x20, -NETCONN_UDPLITE = 0x21, - - NETCONN_UDPNOCHKSUM = 0x22, -NETCONN_UDP_IPV6 = NETCONN_UDP | 0x08, -NETCONN_UDPLITE_IPV6 = NETCONN_UDPLITE | 0x08, -NETCONN_UDPNOCHKSUM_IPV6 = NETCONN_UDPNOCHKSUM | 0x08, - - NETCONN_RAW = 0x40 - - } |
enum | netconn_state |
enum | netconn_evt |
enum | netconn_igmp |
-Functions | |
struct netconn * | netconn_new_with_proto_and_callback (enum netconn_type t, u8_t proto, netconn_callback callback) |
err_t | netconn_prepare_delete (struct netconn *conn) |
err_t | netconn_delete (struct netconn *conn) |
err_t | netconn_getaddr (struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local) |
err_t | netconn_bind (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_bind_if (struct netconn *conn, u8_t if_idx) |
err_t | netconn_connect (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_disconnect (struct netconn *conn) |
err_t | netconn_listen_with_backlog (struct netconn *conn, u8_t backlog) |
err_t | netconn_accept (struct netconn *conn, struct netconn **new_conn) |
err_t | netconn_recv (struct netconn *conn, struct netbuf **new_buf) |
err_t | netconn_recv_udp_raw_netbuf (struct netconn *conn, struct netbuf **new_buf) |
err_t | netconn_recv_udp_raw_netbuf_flags (struct netconn *conn, struct netbuf **new_buf, u8_t apiflags) |
err_t | netconn_recv_tcp_pbuf (struct netconn *conn, struct pbuf **new_buf) |
err_t | netconn_recv_tcp_pbuf_flags (struct netconn *conn, struct pbuf **new_buf, u8_t apiflags) |
err_t | netconn_sendto (struct netconn *conn, struct netbuf *buf, const ip_addr_t *addr, u16_t port) |
err_t | netconn_send (struct netconn *conn, struct netbuf *buf) |
err_t | netconn_write_partly (struct netconn *conn, const void *dataptr, size_t size, u8_t apiflags, size_t *bytes_written) |
err_t | netconn_write_vectors_partly (struct netconn *conn, struct netvector *vectors, u16_t vectorcnt, u8_t apiflags, size_t *bytes_written) |
err_t | netconn_close (struct netconn *conn) |
err_t | netconn_shutdown (struct netconn *conn, u8_t shut_rx, u8_t shut_tx) |
err_t | netconn_join_leave_group (struct netconn *conn, const ip_addr_t *multiaddr, const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave) |
err_t | netconn_join_leave_group_netif (struct netconn *conn, const ip_addr_t *multiaddr, u8_t if_idx, enum netconn_igmp join_or_leave) |
err_t | netconn_gethostbyname_addrtype (const char *name, ip_addr_t *addr, u8_t dns_addrtype) |
err_t | netconn_err (struct netconn *conn) |
netconn API (to be used from non-TCPIP threads)
-#define API_EVENT | -( | -- | c, | -
- | - | - | e, | -
- | - | - | l | -
- | ) | -- |
Register an Network connection event
- -#define NETCONN_FIN_RX_PENDING 0x80 | -
A FIN has been received but not passed to the application yet
- -#define NETCONN_FLAG_CHECK_WRITESPACE 0x10 | -
If a nonblocking write has been rejected before, poll_tcp needs to check if the netconn is writable again
- -#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04 | -
Was the last connect action a non-blocking one?
- -#define NETCONN_FLAG_IPV6_V6ONLY 0x20 | -
If this flag is set then only IPv6 communication is allowed on the netconn. As per RFC#3493 this features defaults to OFF allowing dual-stack usage by default.
- -#define NETCONN_FLAG_MBOXCLOSED 0x01 | -
This netconn had an error, don't block on recvmbox/acceptmbox any more
- -#define NETCONN_FLAG_NON_BLOCKING 0x02 | -
Should this netconn avoid blocking?
- -#define netconn_get_recvbufsize | -( | -- | conn | ) | -((conn)->recv_bufsize) | -
Get the receive buffer in bytes
- -#define netconn_get_sendtimeout | -( | -- | conn | ) | -((conn)->send_timeout) | -
Get the send timeout in milliseconds
- -#define netconn_is_nonblocking | -( | -- | conn | ) | -(((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0) | -
Get the blocking status of netconn calls (
- -#define netconn_set_nonblocking | -( | -- | conn, | -
- | - | - | val | -
- | ) | -- |
Set the blocking status of netconn calls (
- -#define netconn_set_recvbufsize | -( | -- | conn, | -
- | - | - | recvbufsize | -
- | ) | -((conn)->recv_bufsize = (recvbufsize)) | -
Set the receive buffer in bytes
- -#define netconn_set_sendtimeout | -( | -- | conn, | -
- | - | - | timeout | -
- | ) | -((conn)->send_timeout = (timeout)) | -
Set the send timeout in milliseconds
- -#define netconn_type | -( | -- | conn | ) | -(conn->type) | -
Get the type of a netconn (as enum netconn_type).
- -typedef void(* netconn_callback) (struct netconn *, enum netconn_evt, u16_t len) | -
A callback prototype to inform about events for a netconn
- -enum netconn_evt | -
Used to inform the callback function about changes
-Event explanation:
-In the netconn implementation, there are three ways to block a client:
-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.
- -enum netconn_igmp | -
Used for netconn_join_leave_group()
- -enum netconn_state | -
Current state of the netconn. Non-TCP netconns are always in state NETCONN_NONE!
- -err_t netconn_getaddr | -( | -struct netconn * | -conn, | -
- | - | ip_addr_t * | -addr, | -
- | - | u16_t * | -port, | -
- | - | u8_t | -local | -
- | ) | -- |
Get the local or remote IP address and port of a netconn. For RAW netconns, this returns the protocol instead of a port!
-conn | the netconn to query |
addr | a pointer to which to save the IP address |
port | a pointer to which to save the port (or protocol for RAW) |
local | 1 to get the local IP address, 0 to get the remote one |
struct netconn* netconn_new_with_proto_and_callback | -( | -enum netconn_type | -t, | -
- | - | u8_t | -proto, | -
- | - | netconn_callback | -callback | -
- | ) | -- |
Create a new netconn (of a specific type) that has a callback function. The corresponding pcb is also created.
-t | the type of 'connection' to create ( |
proto | the IP protocol for RAW IP pcbs |
callback | a function to call on status changes (RX available, TX'ed) |
err_t netconn_recv_udp_raw_netbuf | -( | -struct netconn * | -conn, | -
- | - | struct netbuf ** | -new_buf | -
- | ) | -- |
Receive data (in form of a netbuf) from a UDP or RAW netconn
-conn | the netconn from which to receive data |
new_buf | pointer where a new netbuf is stored when received data |
err_t netconn_recv_udp_raw_netbuf_flags | -( | -struct netconn * | -conn, | -
- | - | struct netbuf ** | -new_buf, | -
- | - | u8_t | -apiflags | -
- | ) | -- |
Receive data (in form of a netbuf) from a UDP or RAW netconn
-conn | the netconn from which to receive data |
new_buf | pointer where a new netbuf is stored when received data |
apiflags | flags that control function behaviour. For now only:
|
err_t netconn_write_vectors_partly | -( | -struct netconn * | -conn, | -
- | - | struct netvector * | -vectors, | -
- | - | u16_t | -vectorcnt, | -
- | - | u8_t | -apiflags, | -
- | - | size_t * | -bytes_written | -
- | ) | -- |
Send vectorized data atomically over a TCP netconn.
-conn | the TCP netconn over which to send data |
vectors | array of vectors containing data to send |
vectorcnt | number of vectors in the array |
apiflags | combination of following flags :
|
bytes_written | pointer to a location that receives the number of written bytes |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/api.h"
#include "lwip/memp.h"
#include "lwip/ip.h"
#include "lwip/raw.h"
#include "lwip/udp.h"
#include "lwip/priv/api_msg.h"
#include "lwip/priv/tcp_priv.h"
#include "lwip/priv/tcpip_priv.h"
#include "path/to/my/lwip_hooks.h"
#include <string.h>
-Functions | |
struct netconn * | netconn_new_with_proto_and_callback (enum netconn_type t, u8_t proto, netconn_callback callback) |
err_t | netconn_prepare_delete (struct netconn *conn) |
err_t | netconn_delete (struct netconn *conn) |
err_t | netconn_getaddr (struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local) |
err_t | netconn_bind (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_bind_if (struct netconn *conn, u8_t if_idx) |
err_t | netconn_connect (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_disconnect (struct netconn *conn) |
err_t | netconn_listen_with_backlog (struct netconn *conn, u8_t backlog) |
err_t | netconn_accept (struct netconn *conn, struct netconn **new_conn) |
err_t | netconn_recv_tcp_pbuf (struct netconn *conn, struct pbuf **new_buf) |
err_t | netconn_recv_tcp_pbuf_flags (struct netconn *conn, struct pbuf **new_buf, u8_t apiflags) |
err_t | netconn_recv_udp_raw_netbuf (struct netconn *conn, struct netbuf **new_buf) |
err_t | netconn_recv_udp_raw_netbuf_flags (struct netconn *conn, struct netbuf **new_buf, u8_t apiflags) |
err_t | netconn_recv (struct netconn *conn, struct netbuf **new_buf) |
err_t | netconn_sendto (struct netconn *conn, struct netbuf *buf, const ip_addr_t *addr, u16_t port) |
err_t | netconn_send (struct netconn *conn, struct netbuf *buf) |
err_t | netconn_write_partly (struct netconn *conn, const void *dataptr, size_t size, u8_t apiflags, size_t *bytes_written) |
err_t | netconn_write_vectors_partly (struct netconn *conn, struct netvector *vectors, u16_t vectorcnt, u8_t apiflags, size_t *bytes_written) |
err_t | netconn_close (struct netconn *conn) |
err_t | netconn_err (struct netconn *conn) |
err_t | netconn_shutdown (struct netconn *conn, u8_t shut_rx, u8_t shut_tx) |
err_t | netconn_join_leave_group (struct netconn *conn, const ip_addr_t *multiaddr, const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave) |
err_t | netconn_join_leave_group_netif (struct netconn *conn, const ip_addr_t *multiaddr, u8_t if_idx, enum netconn_igmp join_or_leave) |
err_t | netconn_gethostbyname_addrtype (const char *name, ip_addr_t *addr, u8_t dns_addrtype) |
Sequential API External module
-err_t netconn_getaddr | -( | -struct netconn * | -conn, | -
- | - | ip_addr_t * | -addr, | -
- | - | u16_t * | -port, | -
- | - | u8_t | -local | -
- | ) | -- |
Get the local or remote IP address and port of a netconn. For RAW netconns, this returns the protocol instead of a port!
-conn | the netconn to query |
addr | a pointer to which to save the IP address |
port | a pointer to which to save the port (or protocol for RAW) |
local | 1 to get the local IP address, 0 to get the remote one |
struct netconn* netconn_new_with_proto_and_callback | -( | -enum netconn_type | -t, | -
- | - | u8_t | -proto, | -
- | - | netconn_callback | -callback | -
- | ) | -- |
Create a new netconn (of a specific type) that has a callback function. The corresponding pcb is also created.
-t | the type of 'connection' to create ( |
proto | the IP protocol for RAW IP pcbs |
callback | a function to call on status changes (RX available, TX'ed) |
err_t netconn_recv_udp_raw_netbuf | -( | -struct netconn * | -conn, | -
- | - | struct netbuf ** | -new_buf | -
- | ) | -- |
Receive data (in form of a netbuf) from a UDP or RAW netconn
-conn | the netconn from which to receive data |
new_buf | pointer where a new netbuf is stored when received data |
err_t netconn_recv_udp_raw_netbuf_flags | -( | -struct netconn * | -conn, | -
- | - | struct netbuf ** | -new_buf, | -
- | - | u8_t | -apiflags | -
- | ) | -- |
Receive data (in form of a netbuf) from a UDP or RAW netconn
-conn | the netconn from which to receive data |
new_buf | pointer where a new netbuf is stored when received data |
apiflags | flags that control function behaviour. For now only:
|
err_t netconn_write_vectors_partly | -( | -struct netconn * | -conn, | -
- | - | struct netvector * | -vectors, | -
- | - | u16_t | -vectorcnt, | -
- | - | u8_t | -apiflags, | -
- | - | size_t * | -bytes_written | -
- | ) | -- |
Send vectorized data atomically over a TCP netconn.
-conn | the TCP netconn over which to send data |
vectors | array of vectors containing data to send |
vectorcnt | number of vectors in the array |
apiflags | combination of following flags :
|
bytes_written | pointer to a location that receives the number of written bytes |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/priv/api_msg.h"
#include "lwip/ip.h"
#include "lwip/ip_addr.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include "lwip/raw.h"
#include "lwip/memp.h"
#include "lwip/igmp.h"
#include "lwip/dns.h"
#include "lwip/mld6.h"
#include "lwip/priv/tcpip_priv.h"
#include <string.h>
-Functions | |
void | lwip_netconn_do_newconn (void *m) |
struct netconn * | netconn_alloc (enum netconn_type t, netconn_callback callback) |
void | netconn_free (struct netconn *conn) |
void | lwip_netconn_do_delconn (void *m) |
void | lwip_netconn_do_bind (void *m) |
void | lwip_netconn_do_bind_if (void *m) |
void | lwip_netconn_do_connect (void *m) |
void | lwip_netconn_do_disconnect (void *m) |
void | lwip_netconn_do_listen (void *m) |
void | lwip_netconn_do_send (void *m) |
void | lwip_netconn_do_recv (void *m) |
void | lwip_netconn_do_accepted (void *m) |
void | lwip_netconn_do_write (void *m) |
void | lwip_netconn_do_getaddr (void *m) |
void | lwip_netconn_do_close (void *m) |
void | lwip_netconn_do_join_leave_group (void *m) |
void | lwip_netconn_do_join_leave_group_netif (void *m) |
void | lwip_netconn_do_gethostbyname (void *arg) |
Sequential API Internal module
-void lwip_netconn_do_accepted | -( | -void * | -m | ) | -- |
Indicate that a TCP pcb has been accepted Called from netconn_accept
-m | the api_msg pointing to the connection |
void lwip_netconn_do_bind | -( | -void * | -m | ) | -- |
Bind a pcb contained in a netconn Called from netconn_bind.
-m | the api_msg pointing to the connection and containing the IP address and port to bind to |
void lwip_netconn_do_bind_if | -( | -void * | -m | ) | -- |
Bind a pcb contained in a netconn to an interface Called from netconn_bind_if.
-m | the api_msg pointing to the connection and containing the IP address and port to bind to |
void lwip_netconn_do_close | -( | -void * | -m | ) | -- |
Close or half-shutdown a TCP pcb contained in a netconn Called from netconn_close In contrast to closing sockets, the netconn is not deallocated.
-m | the api_msg pointing to the connection |
void lwip_netconn_do_connect | -( | -void * | -m | ) | -- |
Connect a pcb contained inside a netconn Called from netconn_connect.
-m | the api_msg pointing to the connection and containing the IP address and port to connect to |
void lwip_netconn_do_delconn | -( | -void * | -m | ) | -- |
Delete the pcb inside a netconn. Called from netconn_delete.
-m | the api_msg pointing to the connection |
void lwip_netconn_do_disconnect | -( | -void * | -m | ) | -- |
Disconnect a pcb contained inside a netconn Only used for UDP netconns. Called from netconn_disconnect.
-m | the api_msg pointing to the connection to disconnect |
void lwip_netconn_do_getaddr | -( | -void * | -m | ) | -- |
Return a connection's local or remote address Called from netconn_getaddr
-m | the api_msg pointing to the connection |
void lwip_netconn_do_gethostbyname | -( | -void * | -arg | ) | -- |
Execute a DNS query Called from netconn_gethostbyname
-arg | the dns_api_msg pointing to the query |
void lwip_netconn_do_join_leave_group | -( | -void * | -m | ) | -- |
Join multicast groups for UDP netconns. Called from netconn_join_leave_group
-m | the api_msg pointing to the connection |
void lwip_netconn_do_join_leave_group_netif | -( | -void * | -m | ) | -- |
Join multicast groups for UDP netconns. Called from netconn_join_leave_group_netif
-m | the api_msg pointing to the connection |
void lwip_netconn_do_listen | -( | -void * | -m | ) | -- |
Set a TCP pcb contained in a netconn into listen mode Called from netconn_listen.
-m | the api_msg pointing to the connection |
void lwip_netconn_do_newconn | -( | -void * | -m | ) | -- |
Create a new pcb of a specific type inside a netconn. Called from netconn_new_with_proto_and_callback.
-m | the api_msg describing the connection type |
void lwip_netconn_do_recv | -( | -void * | -m | ) | -- |
Indicate data has been received from a TCP pcb contained in a netconn Called from netconn_recv
-m | the api_msg pointing to the connection |
void lwip_netconn_do_send | -( | -void * | -m | ) | -- |
Send some data on a RAW or UDP pcb contained in a netconn Called from netconn_send
-m | the api_msg pointing to the connection |
void lwip_netconn_do_write | -( | -void * | -m | ) | -- |
Send some data on a TCP pcb contained in a netconn Called from netconn_write
-m | the api_msg pointing to the connection |
struct netconn* netconn_alloc | -( | -enum netconn_type | -t, | -
- | - | netconn_callback | -callback | -
- | ) | -- |
Create a new netconn (of a specific type) that has a callback function. The corresponding pcb is NOT created!
-t | the type of 'connection' to create ( |
callback | a function to call on status changes (RX available, TX'ed) |
void netconn_free | -( | -struct netconn * | -conn | ) | -- |
Delete a netconn and all its resources. The pcb is NOT freed (since we might not be in the right thread context do this).
-conn | the netconn to free |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/ip_addr.h"
#include "lwip/err.h"
#include "lwip/sys.h"
#include "lwip/igmp.h"
#include "lwip/api.h"
#include "lwip/priv/tcpip_priv.h"
-Data Structures | |
struct | api_msg |
struct | dns_api_msg |
-Functions | |
void | lwip_netconn_do_newconn (void *m) |
void | lwip_netconn_do_delconn (void *m) |
void | lwip_netconn_do_bind (void *m) |
void | lwip_netconn_do_bind_if (void *m) |
void | lwip_netconn_do_connect (void *m) |
void | lwip_netconn_do_disconnect (void *m) |
void | lwip_netconn_do_listen (void *m) |
void | lwip_netconn_do_send (void *m) |
void | lwip_netconn_do_recv (void *m) |
void | lwip_netconn_do_accepted (void *m) |
void | lwip_netconn_do_write (void *m) |
void | lwip_netconn_do_getaddr (void *m) |
void | lwip_netconn_do_close (void *m) |
void | lwip_netconn_do_join_leave_group (void *m) |
void | lwip_netconn_do_join_leave_group_netif (void *m) |
void | lwip_netconn_do_gethostbyname (void *arg) |
struct netconn * | netconn_alloc (enum netconn_type t, netconn_callback callback) |
void | netconn_free (struct netconn *conn) |
netconn API lwIP internal implementations (do not use in application code)
-void lwip_netconn_do_accepted | -( | -void * | -m | ) | -- |
Indicate that a TCP pcb has been accepted Called from netconn_accept
-m | the api_msg pointing to the connection |
void lwip_netconn_do_bind | -( | -void * | -m | ) | -- |
Bind a pcb contained in a netconn Called from netconn_bind.
-m | the api_msg pointing to the connection and containing the IP address and port to bind to |
void lwip_netconn_do_bind_if | -( | -void * | -m | ) | -- |
Bind a pcb contained in a netconn to an interface Called from netconn_bind_if.
-m | the api_msg pointing to the connection and containing the IP address and port to bind to |
void lwip_netconn_do_close | -( | -void * | -m | ) | -- |
Close or half-shutdown a TCP pcb contained in a netconn Called from netconn_close In contrast to closing sockets, the netconn is not deallocated.
-m | the api_msg pointing to the connection |
void lwip_netconn_do_connect | -( | -void * | -m | ) | -- |
Connect a pcb contained inside a netconn Called from netconn_connect.
-m | the api_msg pointing to the connection and containing the IP address and port to connect to |
void lwip_netconn_do_delconn | -( | -void * | -m | ) | -- |
Delete the pcb inside a netconn. Called from netconn_delete.
-m | the api_msg pointing to the connection |
void lwip_netconn_do_disconnect | -( | -void * | -m | ) | -- |
Disconnect a pcb contained inside a netconn Only used for UDP netconns. Called from netconn_disconnect.
-m | the api_msg pointing to the connection to disconnect |
void lwip_netconn_do_getaddr | -( | -void * | -m | ) | -- |
Return a connection's local or remote address Called from netconn_getaddr
-m | the api_msg pointing to the connection |
void lwip_netconn_do_gethostbyname | -( | -void * | -arg | ) | -- |
Execute a DNS query Called from netconn_gethostbyname
-arg | the dns_api_msg pointing to the query |
void lwip_netconn_do_join_leave_group | -( | -void * | -m | ) | -- |
Join multicast groups for UDP netconns. Called from netconn_join_leave_group
-m | the api_msg pointing to the connection |
void lwip_netconn_do_join_leave_group_netif | -( | -void * | -m | ) | -- |
Join multicast groups for UDP netconns. Called from netconn_join_leave_group_netif
-m | the api_msg pointing to the connection |
void lwip_netconn_do_listen | -( | -void * | -m | ) | -- |
Set a TCP pcb contained in a netconn into listen mode Called from netconn_listen.
-m | the api_msg pointing to the connection |
void lwip_netconn_do_newconn | -( | -void * | -m | ) | -- |
Create a new pcb of a specific type inside a netconn. Called from netconn_new_with_proto_and_callback.
-m | the api_msg describing the connection type |
void lwip_netconn_do_recv | -( | -void * | -m | ) | -- |
Indicate data has been received from a TCP pcb contained in a netconn Called from netconn_recv
-m | the api_msg pointing to the connection |
void lwip_netconn_do_send | -( | -void * | -m | ) | -- |
Send some data on a RAW or UDP pcb contained in a netconn Called from netconn_send
-m | the api_msg pointing to the connection |
void lwip_netconn_do_write | -( | -void * | -m | ) | -- |
Send some data on a TCP pcb contained in a netconn Called from netconn_write
-m | the api_msg pointing to the connection |
struct netconn* netconn_alloc | -( | -enum netconn_type | -t, | -
- | - | netconn_callback | -callback | -
- | ) | -- |
Create a new netconn (of a specific type) that has a callback function. The corresponding pcb is NOT created!
-t | the type of 'connection' to create ( |
callback | a function to call on status changes (RX available, TX'ed) |
void netconn_free | -( | -struct netconn * | -conn | ) | -- |
Delete a netconn and all its resources. The pcb is NOT freed (since we might not be in the right thread context do this).
-conn | the netconn to free |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | snmp_varbind |
-Macros | |
#define | SNMP_GENTRAP_COLDSTART 0 |
#define | SNMP_GENTRAP_WARMSTART 1 |
#define | SNMP_GENTRAP_LINKDOWN 2 |
#define | SNMP_GENTRAP_LINKUP 3 |
#define | SNMP_GENTRAP_AUTH_FAILURE 4 |
#define | SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5 |
#define | SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6 |
-Functions | |
void | snmp_init (void) |
void | snmp_set_mibs (const struct snmp_mib **mibs, u8_t num_mibs) |
void | snmp_set_device_enterprise_oid (const struct snmp_obj_id *device_enterprise_oid) |
const struct snmp_obj_id * | snmp_get_device_enterprise_oid (void) |
void | snmp_trap_dst_enable (u8_t dst_idx, u8_t enable) |
void | snmp_trap_dst_ip_set (u8_t dst_idx, const ip_addr_t *dst) |
err_t | snmp_send_trap_generic (s32_t generic_trap) |
err_t | snmp_send_trap_specific (s32_t specific_trap, struct snmp_varbind *varbinds) |
err_t | snmp_send_trap (const struct snmp_obj_id *oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds) |
void | snmp_set_auth_traps_enabled (u8_t enable) |
u8_t | snmp_get_auth_traps_enabled (void) |
const char * | snmp_get_community (void) |
const char * | snmp_get_community_write (void) |
const char * | snmp_get_community_trap (void) |
void | snmp_set_community (const char *const community) |
void | snmp_set_community_write (const char *const community) |
void | snmp_set_community_trap (const char *const community) |
void | snmp_coldstart_trap (void) |
void | snmp_authfail_trap (void) |
void | snmp_set_write_callback (snmp_write_callback_fct write_callback, void *callback_arg) |
SNMP server main API - start and basic configuration
-#define SNMP_GENTRAP_AUTH_FAILURE 4 | -
Generic trap: authentication failure
- -#define SNMP_GENTRAP_COLDSTART 0 | -
Generic trap: cold start
- -#define SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5 | -
Generic trap: EGP neighbor lost
- -#define SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6 | -
Generic trap: enterprise specific
- -#define SNMP_GENTRAP_LINKDOWN 2 | -
Generic trap: link down
- -#define SNMP_GENTRAP_LINKUP 3 | -
Generic trap: link up
- -#define SNMP_GENTRAP_WARMSTART 1 | -
Generic trap: warm start
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "arch/cc.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <inttypes.h>
#include <limits.h>
#include <ctype.h>
-Macros | |
#define | BYTE_ORDER LITTLE_ENDIAN |
#define | LWIP_RAND() ((u32_t)rand()) |
#define | LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) |
#define | LWIP_PLATFORM_ASSERT(x) |
#define | LWIP_NO_STDDEF_H 0 |
#define | LWIP_NO_STDINT_H 0 |
#define | LWIP_NO_INTTYPES_H 0 |
#define | LWIP_NO_LIMITS_H 0 |
#define | LWIP_NO_CTYPE_H 0 |
#define | LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val)) |
#define | LWIP_ALIGNMENT_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) |
#define | LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) |
#define | LWIP_PACKED_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) |
#define | LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)] |
#define | LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U)) |
#define | LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1U)) |
#define | LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) |
#define | PACK_STRUCT_BEGIN |
#define | PACK_STRUCT_END |
#define | PACK_STRUCT_STRUCT |
#define | PACK_STRUCT_FIELD(x) x |
#define | PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x) |
#define | PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x) |
#define | PACK_STRUCT_USE_INCLUDES |
#define | LWIP_UNUSED_ARG(x) (void)x |
#define | LWIP_PROVIDE_ERRNO |
Support for different processor and compiler architectures
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/mem.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/autoip.h"
#include "lwip/etharp.h"
#include "lwip/prot/autoip.h"
#include <string.h>
-Macros | |
#define | LWIP_AUTOIP_RAND(netif) |
#define | LWIP_AUTOIP_CREATE_SEED_ADDR(netif) |
-Functions | |
void | autoip_set_struct (struct netif *netif, struct autoip *autoip) |
err_t | autoip_start (struct netif *netif) |
void | autoip_network_changed (struct netif *netif) |
err_t | autoip_stop (struct netif *netif) |
void | autoip_tmr (void) |
void | autoip_arp_reply (struct netif *netif, struct etharp_hdr *hdr) |
u8_t | autoip_supplied_address (const struct netif *netif) |
AutoIP Automatic LinkLocal IP Configuration
-This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform with RFC 3927.
-#define LWIP_AUTOIP_CREATE_SEED_ADDR | -( | -- | netif | ) | -- |
Macro that generates the initial IP address to be tried by AUTOIP. If you want to override this, define it to something else in lwipopts.h.
- -#define LWIP_AUTOIP_RAND | -( | -- | netif | ) | -- |
Pseudo random macro based on netif informations. You could use "rand()" from the C Library if you define LWIP_AUTOIP_RAND in lwipopts.h
- -void autoip_arp_reply | -( | -struct netif * | -netif, | -
- | - | struct etharp_hdr * | -hdr | -
- | ) | -- |
Handles every incoming ARP Packet, called by etharp_input().
-netif | network interface to use for autoip processing |
hdr | Incoming ARP packet |
void autoip_network_changed | -( | -struct netif * | -netif | ) | -- |
Handle a possible change in the network configuration.
-If there is an AutoIP address configured, take the interface down and begin probing with the same address.
- -u8_t autoip_supplied_address | -( | -const struct netif * | -netif | ) | -- |
void autoip_tmr | -( | -void | -) | -- |
Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | autoip |
-Macros | |
#define | AUTOIP_TMR_INTERVAL 100 |
#define | autoip_remove_struct(netif) do { (netif)->autoip = NULL; } while (0) |
-Functions | |
void | autoip_set_struct (struct netif *netif, struct autoip *autoip) |
err_t | autoip_start (struct netif *netif) |
err_t | autoip_stop (struct netif *netif) |
void | autoip_arp_reply (struct netif *netif, struct etharp_hdr *hdr) |
void | autoip_tmr (void) |
void | autoip_network_changed (struct netif *netif) |
u8_t | autoip_supplied_address (const struct netif *netif) |
AutoIP Automatic LinkLocal IP Configuration
-Remove a struct autoip previously set to the netif using autoip_set_struct()
- -#define AUTOIP_TMR_INTERVAL 100 | -
AutoIP Timing
- -void autoip_arp_reply | -( | -struct netif * | -netif, | -
- | - | struct etharp_hdr * | -hdr | -
- | ) | -- |
Handles every incoming ARP Packet, called by etharp_input().
-netif | network interface to use for autoip processing |
hdr | Incoming ARP packet |
void autoip_network_changed | -( | -struct netif * | -netif | ) | -- |
Handle a possible change in the network configuration.
-If there is an AutoIP address configured, take the interface down and begin probing with the same address.
- -u8_t autoip_supplied_address | -( | -const struct netif * | -netif | ) | -- |
void autoip_tmr | -( | -void | -) | -- |
Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "netif/bridgeif.h"
#include "lwip/netif.h"
#include "lwip/sys.h"
#include "lwip/etharp.h"
#include "lwip/ethip6.h"
#include "lwip/snmp.h"
#include "lwip/timeouts.h"
#include <string.h>
-Functions | |
err_t | bridgeif_fdb_add (struct netif *bridgeif, const struct eth_addr *addr, bridgeif_portmask_t ports) |
err_t | bridgeif_fdb_remove (struct netif *bridgeif, const struct eth_addr *addr) |
err_t | bridgeif_init (struct netif *netif) |
err_t | bridgeif_add_port (struct netif *bridgeif, struct netif *portif) |
lwIP netif implementing an IEEE 802.1D MAC Bridge
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "netif/bridgeif_opts.h"
#include "lwip/err.h"
#include "lwip/prot/ethernet.h"
#include "lwip/tcpip.h"
-Data Structures | |
struct | bridgeif_initdata_s |
-Macros | |
#define | BRIDGEIF_INITDATA1(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, ethaddr) {ethaddr, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
#define | BRIDGEIF_INITDATA2(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, e0, e1, e2, e3, e4, e5) {{e0, e1, e2, e3, e4, e5}, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
-Typedefs | |
typedef struct bridgeif_initdata_s | bridgeif_initdata_t |
-Functions | |
err_t | bridgeif_init (struct netif *netif) |
err_t | bridgeif_add_port (struct netif *bridgeif, struct netif *portif) |
err_t | bridgeif_fdb_add (struct netif *bridgeif, const struct eth_addr *addr, bridgeif_portmask_t ports) |
err_t | bridgeif_fdb_remove (struct netif *bridgeif, const struct eth_addr *addr) |
void | bridgeif_fdb_update_src (void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx) |
bridgeif_portmask_t | bridgeif_fdb_get_dst_ports (void *fdb_ptr, struct eth_addr *dst_addr) |
void * | bridgeif_fdb_init (u16_t max_fdb_entries) |
lwIP netif implementing an IEEE 802.1D MAC Bridge
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "netif/bridgeif.h"
#include "lwip/sys.h"
#include "lwip/mem.h"
#include "lwip/timeouts.h"
#include <string.h>
-Functions | |
void | bridgeif_fdb_update_src (void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx) |
bridgeif_portmask_t | bridgeif_fdb_get_dst_ports (void *fdb_ptr, struct eth_addr *dst_addr) |
void * | bridgeif_fdb_init (u16_t max_fdb_entries) |
lwIP netif implementing an FDB for IEEE 802.1D MAC Bridge
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
-Macros | |
#define | BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT NO_SYS |
#define | BRIDGEIF_MAX_PORTS 7 |
#define | BRIDGEIF_DEBUG LWIP_DBG_OFF |
#define | BRIDGEIF_FDB_DEBUG LWIP_DBG_OFF |
#define | BRIDGEIF_FW_DEBUG LWIP_DBG_OFF |
lwIP netif implementing an IEEE 802.1D MAC Bridge
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
Please report bugs in the lwIP bug tracker at savannah.
-BEFORE submitting, please check if the bug has already been reported!
-https://savannah.nongnu.org/bugs/?group=lwip
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
HISTORY - * These are only the most important changes. For a full list, use git log: - http://git.savannah.nongnu.org/cgit/lwip.git - -(git master) - - * [Enter new changes just after this line - do not remove this line] - -(STABLE-2.1.2): - - ++ Bugfixes: - - 2018-11-21: Jens Nielsen - * netbiosns.c: fix expecting too large packet (bug #55069) - - 2018-11-19: Dirk Ziegelmeier - * smtp.c: fix compiling with strict C compatibility because of strnlen (bug #55034) - - 2018-11-12: Simon Goldschmidt - * tcp.c: fix overflow check in tcp_recved triggering invalid assertion (bug #55015) - - 2018-11-12: Simon Goldschmidt - * tcp.c: fix a bug in sending RST segments (sent from port 0) - -(STABLE-2.1.1): - - ++ Bugfixes: - - 2018-11-01: Joan Lledó - * sockets.c: fix bad assertion in lwip_poll_dec_sockets_used() (bug #54933) - - 2018-11-01: Dirk Ziegelmeier - * ip4.c: don't send 127.* to default netif (bug #54670) - - 2018-10-23: David Girault - * altcp_tls_mbedtls.c: fix use-after free (bug #54774) - - 2018-10-23: Ognjen Bjelica, Dirk Ziegelmeier - * snmp_scalar.c: Avoid NULL pointer dereference (bug #54886) - - 2018-10-23: Simon Goldschmidt - * Fix missing standard includes in multiple files - - 2018-10-17: Ivan Warren - * def.h: fix casting htonX and ntohX to u16_t (bug #54850) - - 2018-10-12: Simon Goldschmidt - * Revert "tcp_abandon: no need to buffer pcb->local_port" (fix that source port was 0 for RST - called when aborting a connection) - - 2018-10-11: Jonas Rabenstein - * tcp.c: tcp_recved: check for overflow and warn about too big values (patch #9699) - - 2018-10-06: Joan Lledó - * sockets.c: alloc_socket(): Check for LWIP_SOCKET_POLL when setting select- - related variables (patch #9696) - - 2018-10-04: Spencer - * tcp.c: Update prev pointer when skipping entries in tcp_slowtmr (patch #9694) - - 2018-09-27: Martine Lenders - * lowpan6.c: Fix IEEE 802.15.4 address setting (bug #54749) - -(STABLE-2.1.0): - - ++ New features: - - 2018-06-17: Simon Goldschmidt - * lwiperf: implemented iPerf client mode - - 2018-04-23: Dirk Ziegelmeier - * added cmake build files - - 2018-03-04: Ray Abram - * netbios responder: respond to '*' queries - - 2018-02-23: Benjamin Aigner - * 6lowpan: add 6lowpan-over-BLE netif (based on existing 6lowpan netif) - - 2018-02-22: Simon Goldschmidt - * ipv6: add support for stateless DHCPv6 (to get DNS servers in SLAAC nets) - - 2018-02-16: Simon Goldschmidt - * add raw API http(s) client (with proxy support) - - 2018-02-01: Simon Goldschmidt - * tcp: add hooks to implement additional socket options - - 2018-02-01: Simon Goldschmidt - * tcp: add hooks to implement tcp md5 signatures or similar (see contrib/addons for an example) - - 2018-01-05: Simon Goldschmidt - * Added sys_mbox_trypost_fromisr() and tcpip_callbackmsg_trycallback_fromisr() - These can be used to post preallocated messages from an ISR to the tcpip thread - (e.g. when using FreeRTOS) - - 2018-01-02: Dirk Ziegelmeier - * task #14780: Add debug helper asserts to ensure threading/locking requirements are met - - 2017-11-21: Simon Goldschmidt - * task #14600: tcp_alloc(): kill TF_CLOSEPEND connections before other ESTABLISHED - - 2017-11-21: Simon Goldschmidt - * makefsdata: added option "-ssi:<filename>" to control SSI tag checking/insertion - through a list of filenames, not by checking the file extension at runtime - - 2017-11-20: Joel Cunningham - * netconn: add LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE to use external DNS resolver (patch #9427) - - 2017-11-14: Joel Cunningham - * netifapi: Add thread safe ARP cache APIs (task #14724) - - 2017-11-06: Axel Lin - * TCP: kill existing connections with a LOWER priority than the one currently being opened. - Previous implementations also kill existing connections of the SAME priority. - - 2017-09-21: Kalle Olavi Niemitalo - * sockets: add poll() implementation (patch #9450) - - 2017-09-10: Joel Cunningham - * sockets: add readv() implementation (task #14610) - - 2017-08-04: Simon Goldschmidt - * Clean up DHCP a bit: no need keep msg_out and msg_in as members in struct - dhcp - they are used in a call stack only (p_out and options_out_len as well) - - 2017-08-04: Simon Goldschmidt - * pbuf: split pbuf_header(s16_t) into pbuf_add_header(size_t) and - pbuf_remove_header(size_t) - - 2017-07-20: Douglas - * sys: deprecate sys_arch_sem_wait and sys_arch_mbox_fetch returning the - time waited rather they are now defined to return != SYS_ARCH_TIMEOUT - on success. - - 2017-07-03: Jakub Schmidtke - * tcp: added support for sending TCP SACKs - - 2017-06-20: Joel Cunningham - * netconn/netdb: added core locking support to netconn_gethostbyname (task #14523) - - 2017-04-25: Simon Goldschmidt - * dhcp: added two hooks for adding and parsing user defined DHCP options - - 2017-04-25: Joel Cunningham - * sockets: added recvmsg for UDP (together with CMSG and IP_PKTINFO) (task #14247) - - 2017-04-20: Joel Cunningham - * tcp: added Appropriate Byte Counting support (task #14128) - - 2017-04-11: Simon Goldschmidt - * netconn/sockets: remove fatal error handling, fix asynchronous error handling, - ensure data before RST can be received - - 2017-03-30: Simon Goldschmidt - * added "application layered TCP" connection API (altcp) for seamless integration - of TLS or proxy connections - - 2017-03-09: Simon Goldschmidt - * sockets: add recvmsg for TCP - - 2017-03-02: Joel Cunningham - * netconn/sockets: vectorize netconn_write for TCP, treating a vectored I/O write - atomically in regards to TCP segmentation (patch #8882) - - 2017-03-02: Simon Goldschmidt - * netconn: added nonblocking accept/recv to netconn API (task #14396) - - 2017-02-28: Simon Goldschmidt - * Added LWIP_SINGLE_NETIF for small targets with only one netif - - 2017-02-10: David van Moolenbroek - * Implement UDP and RAW multicast support for IPv6 (core API, not netconn/sockets) - - 2017-02-04: David van Moolenbroek - * IPv6 scopes support - - 2017-01-20: Joel Cunningham - * sockets: add interface name/index APIs (task #14314) - - 2017-01-08: David van Moolenbroek - * Extensions to RAW API (patch #9208) - - Connected RAW PCBs - - Add raw_sendto_if_src() - - Support IP_HDRINCL socket option - - ++ Bugfixes: - - 2018-06-19: Simon Goldschmidt - * tcp: fix RTO timer not working if link is down - - 2018-06-15: Sylvain Rochet - * ppp: multiple smaller bugfixes - - 2018-05-17: Simon Goldschmidt - * etharp: arp table can now be bigger than 127 entries - - 2018-04-25: Jens Nielsen - * tftp server: correctly handle retransmissions - - 2018-04-18: Simon Goldschmidt - sockets: fix race conditions when closing full-duplex sockets - - 2018-03-09: Simon Goldschmidt - * 6lowpan: fix to work against contiki; added ZigBee encapsulation netif for tests - - 2018-02-04: Simon Goldschmidt - * sockets: fix inconsistencies on close (inconsistent error codes, double FIN) - - 2018-01-05: Dirk Ziegelmeier - * Fix bug #52748: the bug in timeouts.c by reimplementing timer logic to use - absolute instead of relative timeout values - - 2017-12-31: Dirk Ziegelmeier - * Fix bug #52704: DHCP and bad OFFER: Stop timeout only if offer is accepted - - 2017-11-08: Joel Cunningham - * netif: ensure link and admin states are up in issue reports (bug #52353) - - 2017-09-12: David Lockyer - * select: allocate select_cb from memp for LWIP_MPU_COMPATIBLE = 1 (bug #51990) - - 2017-09-11: Simon Goldschmidt - * tcp_in.c: fix bug #51937 (leaking tcp_pcbs on passive close with unacked data) - - 2017-08-11: Joel Cunningham - * lwip_itoa: fix converting the number 0 (previously converted to '\0') (bug #51729) - - 2017-08-08: Dirk Ziegelmeier - * ip4_route_src: parameter order is reversed: ip4_route_src(dest, src) -> ip4_route_src(src, dest) - to make parameter order consistent with other ip*_route*() functions - Same also applies to LWIP_HOOK_IP4_ROUTE_SRC() parameter order. - - 2017-08-04: Joel Cunningham - * tcp: re-work persist timer to fully close window (details in bug #50837) - - 2017-07-26: Simon Goldschmidt - * snmp_msg.c: fix bug #51578 (SNMP failed to decode some values on non 32bit platforms) - - 2017-07-20: Simon Goldschmidt - * compatibility headers: moved from 'src/include/posix' to 'src/include/compat/posix', - 'src/include/compat/stdc' etc. - - 2017-05-09: Joel Cunningham - * tcp: add zero-window probe timeout (bug #50837) - - 2017-04-11: Simon Goldschmidt - * sockets.c: task #14420 (Remove sys_sem_signal from inside SYS_ARCH_PROTECT - crit section) done for LWIP_TCPIP_CORE_LOCKING==1 - - 2017-02-24: Simon Goldschmidt - * sockets.c: fixed close race conditions in lwip_select (for LWIP_NETCONN_FULLDUPLEX) - - 2017-02-24: Simon Goldschmidt - * sockets.c: fixed that select ignored invalid/not open sockets in the fd_sets (bug #50392) - - 2017-01-11: David van Moolenbroek - * Lots of IPv6 related fixes and improvements - -(STABLE-2.0.3) - - ++ Bugfixes: - - 2017-09-11: Simon Goldschmidt - * tcp_in.c: fix bug #51937 (leaking tcp_pcbs on passive close with unacked data) - - 2017-08-02: Abroz Bizjak/Simon Goldschmidt - * multiple fixes in IPv4 reassembly (leading to corrupted datagrams received) - - 2017-03-30: Simon Goldschmidt - * dhcp.c: return ERR_VAL instead of asserting on offset-out-of-pbuf - - 2017-03-23: Dirk Ziegelmeier - * dhcp.h: fix bug #50618 (dhcp_remove_struct() macro does not work) - -(STABLE-2.0.2) - - ++ New features: - - 2017-02-10: Dirk Ziegelmeier - * Implement task #14367: Hooks need a better place to be defined: - We now have a #define for a header file name that is #included in every .c - file that provides hooks. - - 2017-02-10: Simon Goldschmidt - * tcp_close does not fail on memory error (instead, FIN is sent from tcp_tmr) - - ++ Bugfixes: - - 2017-03-08 - * tcp: do not keep sending SYNs when getting ACKs - - 2017-03-08: Joel Cunningham - * tcp: Initialize ssthresh to TCP_SND_BUF (bug #50476) - - 2017-03-01: Simon Goldschmidt - * httpd: LWIP_HTTPD_POST_MANUAL_WND: fixed double-free when httpd_post_data_recved - is called nested from httpd_post_receive_data() (bug #50424) - - 2017-02-28: David van Moolenbroek/Simon Goldschmidt - * tcp: fixed bug #50418: LWIP_EVENT_API: fix invalid calbacks for SYN_RCVD pcb - - 2017-02-17: Simon Goldschmidt - * dns: Improved DNS_LOCAL_HOSTLIST interface (bug #50325) - - 2017-02-16: Simon Goldschmidt - * LWIP_NETCONN_FULLDUPLEX: fixed shutdown during write (bug #50274) - - 2017-02-13: Simon Goldschmidt/Dirk Ziegelmeier - * For tiny targtes, LWIP_RAND is optional (fix compile time checks) - - 2017-02-10: Simon Goldschmidt - * tcp: Fixed bug #47485 (tcp_close() should not fail on memory error) by retrying - to send FIN from tcp_fasttmr - - 2017-02-09: Simon Goldschmidt - * sockets: Fixed bug #44032 (LWIP_NETCONN_FULLDUPLEX: select might work on - invalid/reused socket) by not allowing to reallocate a socket that has - "select_waiting != 0" - - 2017-02-09: Simon Goldschmidt - * httpd: Fixed bug #50059 (httpd LWIP_HTTPD_SUPPORT_11_KEEPALIVE vs. - LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED) - - 2017-02-08: Dirk Ziegelmeier - * Rename "IPv6 mapped IPv4 addresses" to their correct name from RFC4191: - "IPv4-mapped IPv6 address" - - 2017-02-08: Luc Revardel - * mld6.c: Fix bug #50220 (mld6_leavegroup does not send ICMP6_TYPE_MLD, even - if last reporter) - - 2017-02-08: David van Moolenbroek - * ip6.c: Patch #9250: fix source substitution in ip6_output_if() - - 2017-02-08: Simon Goldschmidt - * tcp_out.c: Fixed bug #50090 (last_unsent->oversize_left can become wrong value - in tcp_write error path) - - 2017-02-02: Dirk Ziegelmeier - * Fix bug #50206: UDP Netconn bind to IP6_ADDR_ANY fails - - 2017-01-18: Dirk Ziegelmeier - * Fix zero-copy RX, see bug bug #50064. PBUF_REFs were not supported as ARP requests. - - 2017-01-15: Axel Lin, Dirk Ziegelmeier - * minor bug fixes in mqtt - - 2017-01-11: Knut Andre Tidemann - * sockets/netconn: fix broken default ICMPv6 handling of checksums - -(STABLE-2.0.1) - - ++ New features: - - 2016-12-31: Simon Goldschmidt - * tcp.h/.c: added function tcp_listen_with_backlog_and_err() to get the error - reason when listening fails (bug #49861) - - 2016-12-20: Erik Andersen - * Add MQTT client - - 2016-12-14: Jan Breuer: - * opt.h, ndc.h/.c: add support for RDNSS option (as per RFC 6106) - - 2016-12-14: David van Moolenbroek - * opt.h, nd6.c: Added LWIP_HOOK_ND6_GET_GW() - - 2016-12-09: Dirk Ziegelmeier - * ip6_frag.c: Implemented support for LWIP_NETIF_TX_SINGLE_PBUF - - 2016-12-09: Simon Goldschmidt - * dns.c: added one-shot multicast DNS queries - - 2016-11-24: Ambroz Bizjak, David van Moolenbroek - * tcp_out.c: Optimize passing contiguous nocopy buffers to tcp_write (bug #46290) - - 2016-11-16: Dirk Ziegelmeier - * sockets.c: added support for IPv6 mapped IPv4 addresses - - ++ Bugfixes: - - 2016-12-16: Thomas Mueller - * api_lib.c: fixed race condition in return value of netconn_gethostbyname() - (and thus also lwip_gethostbyname/_r() and lwip_getaddrinfo()) - - 2016-12-15: David van Moolenbroek - * opt.h, tcp: added LWIP_HOOK_TCP_ISN() to implement less predictable initial - sequence numbers (see contrib/addons/tcp_isn for an example implementation) - - 2016-12-05: Dirk Ziegelmeier - * fixed compiling with IPv4 disabled (IPv6 only case) - - 2016-11-28: Simon Goldschmidt - * api_lib.c: fixed bug #49725 (send-timeout: netconn_write() can return - ERR_OK without all bytes being written) - - 2016-11-28: Ambroz Bizjak - * tcpi_in.c: fixed bug #49717 (window size in received SYN and SYN-ACK - assumed scaled) - - 2016-11-25: Simon Goldschmidt - * dhcp.c: fixed bug #49676 (Possible endless loop when parsing dhcp options) - - 2016-11-23: Dirk Ziegelmeier - * udp.c: fixed bug #49662: multicast traffic is now only received on a UDP PCB - (and therefore on a UDP socket/netconn) when the PCB is bound to IP_ADDR_ANY - - 2016-11-16: Dirk Ziegelmeier - * *: Fixed dual-stack behaviour, IPv6 mapped IPv4 support in socket API - - 2016-11-14: Joel Cunningham - * tcp_out.c: fixed bug #49533 (start persist timer when unsent seg can't fit - in window) - - 2016-11-16: Roberto Barbieri Carrera - * autoip.c: fixed bug #49610 (sometimes AutoIP fails to reuse the same address) - - 2016-11-11: Dirk Ziegelmeier - * sockets.c: fixed bug #49578 (dropping multicast membership does not work - with LWIP_SOCKET_OFFSET) - -(STABLE-2.0.0) - - ++ New features: - - 2016-07-27: Simon Goldschmidt - * opt.h, timeouts.h/.c: added LWIP_TIMERS_CUSTOM to override the default - implementation of timeouts - - 2016-07-xx: Dirk Ziegelmeier - * Large overhaul of doxygen documentation - - 2016-04-05: Simon Goldschmidt - * timers.h/.c: prepare for overriding current timeout implementation: all - stack-internal caclic timers are avaliable in the lwip_cyclic_timers array - - 2016-03-23: Simon Goldschmidt - * tcp: call accept-callback with ERR_MEM when allocating a pcb fails on - passive open to inform the application about this error - ATTENTION: applications have to handle NULL pcb in accept callback! - - 2016-02-22: Ivan Delamer - * Initial 6LoWPAN support - - 2016-02-XX to 2016-03-XX: Dirk Ziegelmeier - * Cleanup TCPIP thread sync methods in a way that it is possibe to use them - in arbitrary code that needs things to be done in TCPIP thread. Used to - decouple netconn, netif, ppp and 6LoWPAN from LWIP core. - - 2016-02-XX: Dirk Ziegelmeier - * Implement dual-stack support in RAW, UDP and TCP. Add new IP address - type IPADDR_ANY_TYPE for this. Netconn/Socket API: Dual-stack is - automatically supported when an IPv6 netconn/socket is created. - - 2015-12-26: Martin Hentschel and Dirk Ziegelmeier - * Rewrite SNMP agent. SNMPv2c + MIB compiler. - - 2015-11-12: Dirk Ziegelmeier - * Decouple SNMP stack from lwIP core and move stack to apps/ directory. - Breaking change: Users have to call snmp_init() now! - - 2015-11-12: Dirk Ziegelmeier - * Implement possibility to declare private memory pools. This is useful to - decouple some apps from the core (SNMP stack) or make contrib app usage - simpler (httpserver_raw) - - 2015-10-09: Simon Goldschmidt - * started to move "private" header files containing implementation details to - "lwip/priv/" include directory to seperate the API from the implementation. - - 2015-10-07: Simon Goldschmidt - * added sntp client as first "supported" application layer protocol implementation - added 'apps' folder - - 2015-09-30: Dirk Ziegelmeier - * snmp_structs.h, mib_structs.c, mib2.c: snmp: fixed ugly inheritance - implementation by aggregating the "base class" (struct mib_node) in all - derived node classes to get more type-safe code - - 2015-09-23: Simon Goldschmidt - * netif.h/.c, nd6.c: task #13729: Convert netif addresses (IPv4 & IPv6) to - ip_addr_t (so they can be used without conversion/temporary storage) - - 2015-09-08: Dirk Ziegelmeier - * snmp: Separate mib2 counter/table callbacks from snmp agent. This both cleans - up the code and should allow integration of a 3rd party agent/mib2. Simple - counters are kept in MIB2_STATS, tree/table change function prototypes moved to - snmp_mib2.h. - - 2015-09-03: Simon Goldschmidt - * opt.h, dns.h/.c: DNS/IPv6: added support for AAAA records - - 2015-09-01: Simon Goldschmidt - * task #12178: hardware checksum capabilities can be configured per netif - (use NETIF_SET_CHECKSUM_CTRL() in your netif's init function) - - 2015-08-30: Simon Goldschmidt - * PBUF_REF with "custom" pbufs is now supported for RX pbufs (see pcapif in - contrib for an example, LWIP_SUPPORT_CUSTOM_PBUF is required) - - 2015-08-30: Simon Goldschmidt - * support IPv4 source based routing: define LWIP_HOOK_IP4_ROUTE_SRC to point - to a routing function - - 2015-08-05: Simon Goldschmidt - * many files: allow multicast socket options IP_MULTICAST_TTL, IP_MULTICAST_IF - and IP_MULTICAST_LOOP to be used without IGMP - - 2015-04-24: Simon Goldschmidt - * dhcp.h/c, autoip.h/.c: added functions dhcp/autoip_supplied_address() to - check for the source of address assignment (replacement for NETIF_FLAG_DHCP) - - 2015-04-10: Simon Goldschmidt - * many files: task #13480: added LWIP_IPV4 define - IPv4 can be disabled, - leaving an IPv6-only stack - - 2015-04-09: Simon Goldschmidt - * nearly all files: task #12722 (improve IPv4/v6 address handling): renamed - ip_addr_t to ip4_addr_t, renamed ipX_addr_t to ip_addr_t and added IP - version; ip_addr_t is used for all generic IP addresses for the API, - ip(4/6)_addr_t are only used internally or when initializing netifs or when - calling version-related functions - - 2015-03-24: Simon Goldschmidt - * opt.h, ip4_addr.h, ip4.c, ip6.c: loopif is not required for loopback traffic - any more but passed through any netif (ENABLE_LOOPBACK has to be enabled) - - 2015-03-23: Simon Goldschmidt - * opt.h, etharp.c: with ETHARP_TABLE_MATCH_NETIF== 1, duplicate (Auto)-IP - addresses on multiple netifs should now be working correctly (if correctly - addressed by routing, that is) - - 2015-03-23: Simon Goldschmidt - * etharp.c: Stable etharp entries that are about to expire are now refreshed - using unicast to prevent unnecessary broadcast. Only if no answer is received - after 15 seconds, broadcast is used. - - 2015-03-06: Philip Gladstone - * netif.h/.c: patch #8359 (Provide utility function to add an IPv6 address to - an interface) - - 2015-03-05: Simon Goldschmidt - * netif.c, ip4.c, dhcp.c, autoip.c: fixed bug #37068 (netif up/down handling - is unclear): correclty separated administrative status of a netif (up/down) - from 'valid address' status - ATTENTION: netif_set_up() now always has to be called, even when dhcp/autoip - is used! - - 2015-02-26: patch by TabascoEye - * netif.c, udp.h/.c: fixed bug #40753 (re-bind UDP pcbs on change of IP address) - - 2015-02-22: chrysn, Simon Goldschmidt - * *.*: Changed nearly all functions taking 'ip(X)_addr_t' pointer to take - const pointers (changed user callbacks: raw_recv_fn, udp_recv_fn; changed - port callbacks: netif_output_fn, netif_igmp_mac_filter_fn) - - 2015-02-19: Ivan Delamer - * netif.h, dhcp.c: Removed unused netif flag for DHCP. The preferred way to evaluate - if DHCP is active is through netif->dhcp field. - - 2015-02-19: Ivan Delamer - * netif.h, slipif.c, ppp.c: Removed unused netif flag for point to point connections - - 2015-02-18: Simon Goldschmidt - * api_lib.c: fixed bug #37958 "netconn API doesn't handle correctly - connections half-closed by peer" - - 2015-02-18: Simon Goldschmidt - * tcp.c: tcp_alloc() prefers killing CLOSING/LAST_ACK over active connections - (see bug #39565) - - 2015-02-16: Claudius Zingerli, Sergio Caprile - * opt.h, dhcp.h/.c: patch #8361 "Add support for NTP option in DHCP" - - 2015-02-14: Simon Goldschmidt - * opt.h, snmp*: added support for write-access community and dedicated - community for sending traps - - 2015-02-13: Simon Goldschmidt - * opt.h, memp.c: added hook LWIP_HOOK_MEMP_AVAILABLE() to get informed when - a memp pool was empty and an item is now available - - 2015-02-13: Simon Goldschmidt - * opt.h, pbuf.h/.c, etharp.c: Added the option PBUF_LINK_ENCAPSULATION_HLEN to - allocate additional header space for TX on netifs requiring additional headers - - 2015-02-12: chrysn - * timers.h/.c: introduce sys_timeouts_sleeptime (returns the time left before - the next timeout is due, for NO_SYS==1) - - 2015-02-11: Nick van Ijzendoorn - * opt.h, sockets.h/c: patch #7702 "Include ability to increase the socket number - with defined offset" - - 2015-02-11: Frederick Baksik - * opt.h, def.h, others: patch #8423 "arch/perf.h" should be made an optional item - - 2015-02-11: Simon Goldschmidt - * api_msg.c, opt.h: started to implement fullduplex sockets/netconns - (note that this is highly unstable yet!) - - 2015-01-17: Simon Goldschmidt - * api: allow enabling socket API without (public) netconn API - netconn API is - still used by sockets, but keeping it private (static) should allow better - compiler optimizations - - 2015-01-16: Simon Goldschmidt - * tcp_in.c: fixed bug #20506 "Initial congestion window is very small" again - by implementing the calculation formula from RFC3390 - - 2014-12-10: Simon Goldschmidt - * api: added option LWIP_NETCONN_SEM_PER_THREAD to use a semaphore per thread - instead of using one per netconn and per select call - - 2014-12-08: Simon Goldschmidt - * ip6.h: fixed bug #43778: IPv6 header version not set on 16-bit platform - (macro IP6H_VTCFL_SET()) - - 2014-12-08: Simon Goldschmidt - * icmp.c, ip4.c, pbuf.c, udp.c, pbuf.h: task #11472 Support PBUF_REF for RX - (IPv6 and IPv4/v6 reassembly might not work yet) - - 2014-11-06: Simon Goldschmidt - * sockets.c/.h, init.c: lwip_socket_init() is not needed any more - -> compatibility define - - 2014-09-16: Simon Goldschmidt - * dns.c, opt.h: reduced ram usage by parsing DNS responses in place - - 2014-09-16: Simon Goldschmidt - * pbuf.h/.c: added pbuf_take_at() and pbuf_put_at() - - 2014-09-15: Simon Goldschmidt - * dns.c: added source port randomization to make the DNS client more robust - (see bug #43144) - - 2013-09-02: Simon Goldschmidt - * arch.h and many other files: added optional macros PACK_STRUCT_FLD_8() and - PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that - do not need packing - - 2013-08-19: Simon Goldschmidt - * netif.h: bug #42998: made NETIF_MAX_HWADDR_LEN overridable for some special - networks - - 2013-03-17: Simon Goldschmidt (patch by Ghobad Emadi) - * opt.h, etharp.c: Added LWIP_HOOK_ETHARP_GET_GW to implement IPv4 routing with - multiple gateways - - 2013-04-20: Fatih Asici - * opt.h, etharp.h/.c: patch #7993: Added support for transmitting packets - with VLAN headers via hook function LWIP_HOOK_VLAN_SET and to check them - via hook function LWIP_HOOK_VLAN_CHECK - - 2014-02-20: Simon Goldschmidt (based on patch by Artem Pisarenko) - * patch #7885: modification of api modules to support FreeRTOS-MPU - (don't pass stack-pointers to other threads) - - 2014-02-05: Simon Goldschmidt (patch by "xtian" and "alex_ab") - * patch #6537/#7858: TCP window scaling support - - 2014-01-17: Jiri Engelthaler - * icmp, icmp6, opt.h: patch #8027: Completed HW checksuming for IPv4 and - IPv6 ICMP's - - 2012-08-22: Sylvain Rochet - * New PPP stack for lwIP, developed in ppp-new branch. - Based from pppd 2.4.5, released 2009-11-17, with huge changes to match - code size and memory requirements for embedded devices, including: - - Gluing together the previous low-level PPP code in lwIP to pppd 2.4.5, which - is more or less what pppd sys-* files are, so that we get something working - using the unix port. - - Merged some patchs from lwIP Git repository which add interesting features - or fix bugs. - - Merged some patchs from Debian pppd package which add interesting features - or fix bugs. - - Ported PPP timeout handling to the lwIP timers system - - Disabled all the PPP code using filesystem access, replaced in necessary cases - to configuration variables. - - Disabled all the PPP code forking processes. - - Removed IPX support, lwIP does not support IPX. - - Ported and improved random module from the previous PPP port. - - Removed samba TDB (file-driven database) usage, because it needs a filesystem. - - MS-CHAP required a DES implementation, we added the latest PolarSSL DES - implementation which is under a BSD-ish license. - - Also switched to PolarSSL MD4,MD5,SHA1 implementations, which are meant to be - used in embedded devices with reduced memory footprint. - - Removed PPP configuration file parsing support. - - Added macro definition EAP_SUPPORT to make EAP support optional. - - Added macro definition CHAP_SUPPORT to make CHAP support optional. - - Added macro definition MSCHAP_SUPPORT to make MSCHAP support optional. - - Added macro definition PAP_SUPPORT to make PAP support optional. - - Cleared all Linux syscall calls. - - Disabled demand support using a macro, so that it can be ported later. - - Disabled ECP support using a macro, so that it can be ported later. - - Disabled CCP support using a macro, so that it can be ported later. - - Disabled CBCP support using a macro, so that it can be ported later. - - Disabled LQR support using a macro, so that it can be ported later. - - Print packet debug feature optional, through PRINTPKT_SUPPORT - - Removed POSIX signal usage. - - Fully ported PPPoS code from the previous port. - - Fully ported PPPoE code from the previous port. - - Fully ported VJ compression protocol code from the previous port. - - Removed all malloc()/free() use from PPP, replaced by stack usage or PBUF. - - Disabled PPP server support using a macro, so that it can be ported later. - - Switched all PPP debug to lwIP debug system. - - Created PPP Control Block (PPP PCB), removed PPP unit integer everywhere, - removed all global variables everywhere, did everything necessary for - the PPP stack to support more than one PPP session (pppd only support - one session per process). - - Removed the statically allocated output buffer, now using PBUF. - - Improved structure size of all PPP modules, deep analyze of code to reduce - variables size to the bare minimum. Switched all boolean type (char type in - most architecture) to compiler generated bitfields. - - Added PPP IPv6 support, glued lwIP IPv6 support to PPP. - - Now using a persistent netif interface which can then be used in lwIP - functions requiring a netif. - - Now initializing PPP in lwip_init() function. - - Reworked completely the PPP state machine, so that we don't end up in - anymore in inconsistent state, especially with PPPoE. - - Improved the way we handle PPP reconnection after disconnect, cleaning - everything required so that we start the PPP connection again from a - clean state. - - Added PPP holdoff support, allow the lwIP user to wait a little bit before - reconnecting, prevents connection flood, especially when using PPPoL2TP. - - Added PPPoL2TP LAC support (a.k.a. UDP tunnels), adding a VPN client - feature to lwIP, L2TP being a widely used tunnel protocol. - - Switched all used PPP types to lwIP types (u8t, u16t, u32t, ...) - - Added PPP API "sequential" thread-safe API, based from NETIFAPI. - - 2011-07-21: Simon Goldschmidt - * sockets.c, opt.h: (bug #30185): added LWIP_FIONREAD_LINUXMODE that makes - ioctl/FIONREAD return the size of the next pending datagram. - - 2011-05-25: Simon Goldschmidt - * again nearly the whole stack, renamed ip.c to ip4.c, ip_addr.c to ip4_addr.c, - combined ipv4/ipv6 inet_chksum.c, added ip.h, ip_addr.h: Combined IPv4 - and IPv6 code where possible, added defines to access IPv4/IPv6 in non-IP - code so that the code is more readable. - - 2011-05-17: Patch by Ivan Delamer (only checked in by Simon Goldschmidt) - * nearly the whole stack: Finally, we got decent IPv6 support, big thanks to - Ivan! (this is work in progress: we're just post release anyway :-) - - - ++ Bugfixes: - - 2016-08-23: Simon Goldschmidt - * etharp: removed ETHARP_TRUST_IP_MAC since it is insecure and we don't need - it any more after implementing unicast ARP renewal towards arp entry timeout - - 2016-07-20: Simon Goldschmidt - * memp.h/.c: fixed bug #48442 (memp stats don't work for MEMP_MEM_MALLOC) - - 2016-07-21: Simon Goldschmidt (patch by Ambroz Bizjak) - * tcp_in.c, tcp_out.c: fixed bug #48543 (TCP sent callback may prematurely - report sent data when only part of a segment is acked) and don't include - SYN/FIN in snd_buf counter - - 2016-07-19: Simon Goldschmidt - * etharp.c: fixed bug #48477 (ARP input packet might update static entry) - - 2016-07-11: Simon Goldschmidt - * tcp_in.c: fixed bug #48476 (TCP sent callback called wrongly due to picking - up old pcb->acked - - 2016-06-30: Simon Goldschmidt (original patch by Fabian Koch) - * tcp_in.c: fixed bug #48170 (Vulnerable to TCP RST spoofing) - - 2016-05-20: Dirk Ziegelmeier - * sntp.h/.c: Fix return value of sntp_getserver() call to return a pointer - - 2016-04-05: Simon Goldschmidt (patch by Philip Gladstone) - * udp.c: patch #8358: allow more combinations of listening PCB for IPv6 - - 2016-04-05: Simon Goldschmidt - * netconn/socket API: fixed bug# 43739 (Accept not reporting errors about - aborted connections): netconn_accept() returns ERR_ABRT (sockets: ECONNABORTED) - for aborted connections, ERR_CLSD (sockets: EINVAL) if the listening netconn - is closed, which better seems to follow the standard. - - 2016-03-23: Florent Matignon - * dhcp.c: fixed bug #38203: DHCP options are not recorded in all DHCP ack messages - - 2016-03-22: Simon Goldschmidt - * tcp: changed accept handling to be done internally: the application does not - have to call tcp_accepted() any more. Instead, when delaying accept (e.g. sockets - do), call tcp_backlog_delayed()/tcp_backlog_accepted() (fixes bug #46696) - - 2016-03-22: Simon Goldschmidt - * dns.c: ignore dns response parsing errors, only abort resolving for correct - responses or error responses from correct server (bug #47459) - - 2016-03-17: Simon Goldschmidt - * api_msg.c: fixed bug #47448 (netconn/socket leak if RST is received during close) - - 2016-03-17: Joel Cunningham - * api_msg.c: don't fail closing a socket/netconn when failing to allocate the - FIN segment; blocking the calling thread for a while is better than risking - leaking a netconn/socket (see bug #46701) - - 2016-03-16: Joel Cunningham - * tcp_out.c: reset rto timer on fast retransmission - - 2016-03-16: Deomid Ryabkov - * tcp_out.c: fixed bug #46384 Segment size calculation bug with MSS != TCP_MSS - - 2016-03-05: Simon Goldschmidt - * err.h/.c, sockets.c: ERR_IF is not necessarily a fatal error - - 2015-11-19: fix by Kerem Hadimli - * sockets.c: fixed bug #46471: lwip_accept() leaks socket descriptors if new - netconn was already closed because of peer behavior - - 2015-11-12: fix by Valery Ushakov - * tcp_in.c: fixed bug #46365 tcp_accept_null() should call tcp_abort() - - 2015-10-02: Dirk Ziegelmeier/Simon Goldschmidt - * snmp: cleaned up snmp structs API (fixed race conditions from bug #46089, - reduce ram/rom usage of tables): incompatible change for private MIBs - - 2015-09-30: Simon Goldschmidt - * ip4_addr.c: fixed bug #46072: ip4addr_aton() does not check the number range - of all address parts - - 2015-08-28: Simon Goldschmidt - * tcp.c, tcp_in.c: fixed bug #44023: TCP ssthresh value is unclear: ssthresh - is set to the full send window for active open, too, and is updated once - after SYN to ensure the correct send window is used - - 2015-08-28: Simon Goldschmidt - * tcp: fixed bug #45559: Window scaling casts u32_t to u16_t without checks - - 2015-08-26: Simon Goldschmidt - * ip6_frag.h/.c: fixed bug bug #41009: IPv6 reassembly broken on 64-bit platforms: - define IPV6_FRAG_COPYHEADER==1 on these platforms to copy the IPv6 header - instead of referencing it, which gives more room for struct ip6_reass_helper - - 2015-08-25: Simon Goldschmidt - * sockets.c: fixed bug #45827: recvfrom: TCP window is updated with MSG_PEEK - - 2015-08-20: Manoj Kumar - * snmp_msg.h, msg_in.c: fixed bug #43790: Sending octet string of Length >255 - from SNMP agent - - 2015-08-19: Jens Nielsen - * icmp.c, ip4.c, tcp_in.c, udp.c, raw.c: fixed bug #45120: Broadcast & multiple - interfaces handling - - 2015-08-19: Simon Goldschmidt (patch by "Sandra") - * dns.c: fixed bug #45004: dns response without answer might be discarded - - 2015-08-18: Chrysn - * timers.c: patch #8704 fix sys_timeouts_sleeptime function - - 2015-07-01: Erik Ekman - * puf.c: fixed bug #45454 (pbuf_take_at() skips write and returns OK if offset - is at start of pbuf in chain) - - 2015-05-19: Simon Goldschmidt - * dhcp.h/.c: fixed bugs #45140 and #45141 (dhcp was not stopped correctly after - fixing bug #38204) - - 2015-03-21: Simon Goldschmidt (patch by Homyak) - * tcp_in.c: fixed bug #44766 (LWIP_WND_SCALE: tcphdr->wnd was not scaled in - two places) - - 2015-03-21: Simon Goldschmidt - * tcp_impl.h, tcp.c, tcp_in.c: fixed bug #41318 (Bad memory ref in tcp_input() - after tcp_close()) - - 2015-03-21: Simon Goldschmidt - * tcp_in.c: fixed bug #38468 (tcp_sent() not called on half-open connection for - data ACKed with the same ack as FIN) - - 2015-03-21: Simon Goldschmidt (patch by Christoffer Lind) - * dhcp.h/.c: fixed bug #38204 (DHCP lease time not handled correctly) - - 2015-03-20: Simon Goldschmidt - * dhcp.c: fixed bug #38714 (Missing option and client address in DHCPRELEASE message) - - 2015-03-19: Simon Goldschmidt - * api.h, tcpip.h, api_lib.c, api_msg.c: fixed race conditions in assigning - netconn->last_err (fixed bugs #38121 and #37676) - - 2015-03-09: Simon Goldschmidt - * ip4.c: fixed the IPv4 part of bug #43904 (ip_route() must detect linkup status) - - 2015-03-04: Simon Goldschmidt - * nd6.c: fixed bug #43784 (a host should send at least one Router Solicitation) - - 2015-03-04: Valery Ushakov - * ip6.c: fixed bug #41094 (Byte-order bug in IPv6 fragmentation header test) - - 2015-03-04: Zach Smith - * nd6.c: fixed bug #38153 (nd6_input() byte order issues) - - 2015-02-26: Simon Goldschmidt - * netif.c, tcp.h/.c: fixed bug #44378 (TCP connections are not aborted on netif - remove) - - 2015-02-25: Simon Goldschmidt - * ip4.c, etharp.c: fixed bug #40177 (System hangs when dealing with corrupted - packets), implemented task #12357 (Ensure that malicious packets don't - assert-fail): improved some pbuf_header calls to not assert-fail. - - 2015-02-25: patch by Joel Cunningham - * udp.h/.c, sockets.c: fixed bug #43028 (IP_MULTICAST_TTL affects unicast - datagrams) - - 2015-02-25: patch by Greg Renda - * ip4_frag.c: fixed bug #38210 (ip reassembly while remove oldest datagram) - - 2015-02-25: Simon Goldschmidt - * sockets.c: fixed bug #38165 (socket with mulicast): ensure igmp membership - are dropped when socket (not netconn!) is closed. - - 2015-02-25: Simon Goldschmidt - * ip4.h/.c, udp.c: fixed bug #38061 (wrong multicast routing in IPv4) by - adding an optional default netif for multicast routing - - 2015-02-25: Simon Goldschmidt - * netconn API: fixed that netconn_connect still used message passing for - LWIP_TCPIP_CORE_LOCKING==1 - - 2015-02-22: patch by Jens Nielsen - * icmp.c: fixed bug #38803 (Source address in broadcast ping reply) - - 2015-02-22: Simon Goldschmidt - * udp.h, sockets.c: added proper accessor functions for pcb->multicast_ip - (previously used by get/setsockopt only) - - 2015-02-18: Simon Goldschmidt - * sockets.c: Fixed select not reporting received FIN as 'readable' in certain - rare cases (bug #43779: select(), close(), and TCP retransmission error) - - 2015-02-17: Simon Goldschmidt - * err.h, sockets.c, api_msg.c: fixed bug #38853 "connect() use a wrong errno": - return ERR_ALREADY/EALRADY during connect, ERR_ISCONN/EISCONN when already - connected - - 2015-02-17: Simon Goldschmidt - * tcp_impl.h, tcp_out.c, tcp.c, api_msg.c: fixed bug #37614 "Errors from - ipX_output are not processed". Now tcp_output(_segment) checks for the return - value of ipX_output and does not try to send more on error. A netif driver - can call tcp_txnow() (from tcpip_thread!) to try to send again if TX buffers - are available again. - - 2015-02-14: patches by Freddie Chopin - * snmp*: made community writable, fixed some const pointers - - 2015-02-13: Simon Goldschmidt - * msg_in.c: fixed bug #22070 "MIB_OBJECT_WRITE_ONLY not implemented in SNMP" - - 2015-02-12: Simon Goldschmidt - * ip.h, ip4.c, ip6.c: fixed bug #36403 "ip4_input() and ip6_input() always pass - inp to higher layers": now the accepting netif is passed up, but the input - netif is available through ip_current_input_netif() if required. - - 2015-02-11: patch by hichard - * tcpip.c: fixed bug #43094 "The function tcpip_input() forget to handle IPv6" - - 2015-02-10: Simon Goldschmidt - * netconn API: fixed that netconn_close/netconn_delete still used message passing - for LWIP_TCPIP_CORE_LOCKING==1 - - 2015-02-10: Simon Goldschmidt - * netconn/socket api: fixed bug #44225 "closing TCP socket should time out - eventually", implemented task #6930 "Implement SO_LINGER": closing TCP sockets - times out after 20 seconds or after the configured SND_TIMEOUT or depending - on the linger settings. - - 2015-01-27: Simon Goldschmidt - * api_msg.c: fixed that SHUT_RD followed by SHUT_WR was different to SHUT_RDWR, - fixed return value of lwip_netconn_do_close on unconnected netconns - - 2015-01-17: Simon Goldschmidt - * sockets.c: fixed bug #43361 select() crashes with stale FDs - - 2015-01-17: Simon Goldschmidt - * sockets.c/.h, memp_std.h: fixed bug #40788 "lwip_setsockopt_internal() crashes" - by rewriting set/getsockopt functions to combine checks with the actual code - and add more NULL checks; this also fixes that CORE_LOCKING used message - passing for set/getsockopt. - - 2014-12-19: Simon Goldschmidt - * opt.h, dhcp.h/.c: prevent dhcp from starting when netif link is down (only - when LWIP_DHCP_CHECK_LINK_UP==1, which is disabled by default for - compatibility reasons) - - 2014-12-17: Simon Goldschmidt - * tcp_out.c: fixed bug #43840 Checksum error for TCP_CHECKSUM_ON_COPY==1 for - no-copy data with odd length - - 2014-12-10: Simon Goldschmidt - * sockets.c, tcp.c, others: fixed bug #43797 set/getsockopt: SO_SNDTIMEO/SO_RCVTIMEO - take int as option but should take timeval (LWIP_SO_SNDRCVTIMEO_STANDARD==0 can - be used to revert to the old 'winsock' style behaviour) - Fixed implementation of SO_ACCEPTCONN to just look at the pcb state - - 2014-12-09: Simon Goldschmidt - * ip4.c: fixed bug #43596 IGMP queries from 0.0.0.0 are discarded - - 2014-10-21: Simon Goldschmidt (patch by Joel Cunningham and Albert Huitsing) - * sockts.c: fixed bugs #41495 Possible threading issue in select() and #43278 - event_callback() handle context switch when calling sys_sem_signal() - - 2014-10-21: Simon Goldschmidt - * api_msg.c: fixed bug #38219 Assert on TCP netconn_write with sndtimeout set - - 2014-09-16: Kevin Cernekee - * dns.c: patch #8480 Fix handling of dns_seqno wraparound - - 2014-09-16: Simon Goldschmidt - * tcp_out.c: fixed bug #43192 tcp_enqueue_flags() should not check TCP_SND_QUEUELEN - when sending FIN - - 2014-09-03: Simon Goldschmidt - * msg_in.c: fixed bug #39355 SNMP Memory Leak in case of error - - 2014-09-02: Simon Goldschmidt - * err.h/.c, sockets.c, api_msg.c: fixed bug #43110 call getpeername() before - listen() will cause a error - - 2014-09-02: Simon Goldschmidt - * sockets.c: fixed bug #42117 lwip_fcntl does not set errno - - 2014-09-02: Simon Goldschmidt - * tcp.c: fixed bug #42299 tcp_abort() leaves freed pcb on tcp_bound_pcbs list - - 2014-08-20: Simon Goldschmidt - * dns.c: fixed bug #42987 lwIP is vulnerable to DNS cache poisoning due to - non-randomized TXIDs - - 2014-06-03: Simon Goldschmidt - * tcp_impl.h, tcp_in.c: fixed bug #37969 SYN packet dropped as short packet in - tcp_input function - - 2014-05-20: Simon Goldschmidt - * tcp_out.c: fixed bug #37184 tcp_write problem for pcbs in the SYN_SENT state - - 2014-05-19: Simon Goldschmidt - * *.h: Fixed bug #35874 reserved identifier violation (removed leading underscores - from header include guards) - - 2014-04-08: Simon Goldschmidt - * tcp.c: Fixed bug #36167 tcp server crash when client closes (maximum window) - - 2014-04-06: Simon Goldschmidt - * tcp_in.c: Fixed bug #36210 lwIP does not elicit an empty ACK when received - unacceptable ACK - - 2014-04-06: Simon Goldschmidt - * dhcp.c, ip4.c/.h, ip6.c/.h, udp.c/.h, ip.h: Fixed bug #41787 DHCP Discovery - is invalid when an IP is set to thet netif. - - 2014-03-14: Simon Goldschmidt - * tcp_out.c: Fixed bug #36153 TCP Cheksum error if LWIP_CHECKSUM_ON_COPY=1 - - 2014-03-11: Simon Goldschmidt (patch by Mason) - * opt.h, sockets.c: fixed bug #35928 BSD sockets functions must set errno for - POSIX-compliance - - 2014-02-27: Simon Goldschmidt - * dhcp.c: fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST - - 2014-02-27: Simon Goldschmidt - * raw.c: fixed bug #41680 raw socket can not receive IPv6 packet when - IP_SOF_BROADCAST_RECV==1 - - 2014-02-27: Simon Goldschmidt - * api_msg.c, sockets.c: fixed bug #38404 getpeeraddr returns success on - unconnected/listening TCP sockets - - 2014-02-27: Simon Goldschmidt - * sockets.c: fixed bug #41729 Some socket functions return Exyz instead of -1 - - 2014-02-25: Simon Goldschmidt - * ip4.c: fixed bug #39514 ip_route() may return an IPv6-only interface - - 2014-02-25: Simon Goldschmidt, patch by Fatih Asici - * pbuf.c: fixed bug #39356 Wrong increment in pbuf_memfind() - - 2014-02-25: Simon Goldschmidt - * netif.c/.h, udp.c: fixed bug #39225 udp.c uses netif_matches_ip6_addr() incorrectly; - renamed function netif_matches_ip6_addr() to netif_get_ip6_addr_match() - - 2014-02-25: Simon Goldschmidt - * igmp.c: fixed bug #39145 IGMP membership report for 224.0.0.1 - - 2014-02-22: Simon Goldschmidt (patch by Amir Shalem) - * etharp.c, opt.h: fixed bug #34681 Limit ARP queue length by ARP_QUEUE_LEN (=3) - - 2014-02-22: Simon Goldschmidt (patch by Amir Shalem) - * etharp.h/.c: fixed bug #34682 Limit ARP request flood for unresolved entry - - 2014-02-20: Simon Goldschmidt - * tcp_out.c: fixed bug #39683 Assertion "seg->tcphdr not aligned" failed with - MEM_ALIGNMENT = 8 - - 2014-02-20: Simon Goldschmidt - * sockets.c: fixed bug #39882 No function shall set errno to 0 - - 2014-02-20: Simon Goldschmidt - * mib_structs.c: fixed bug #40050 SNMP problem with MIB arrays > 255 - - 2014-02-20: Simon Goldschmidt - * api.h, sockets.c: fixed bug #41499 netconn::recv_avail can overflow - - 2014-01-08: Stathis Voukelatos - * memp_std.h: patch #7928 Fixed size calculation in MALLOC memory pool - creation macro - - 2014-01-18: Brian Fahs - * tcp_out.c: patch #8237: tcp_rexmit_rto fails to update pcb->unsent_oversize - when necessary - - 2014-01-17: Grant Erickson, Jay Logue, Simon Goldschmidt - * ipv6.c, netif.c: patch #7913 Enable Support for IPv6 Loopback - - 2014-01-16: Stathis Voukelatos - * netif.c: patch #7902 Fixed netif_poll() operation when LWIP_LOOPBACK_MAX_PBUFS > 0 - - 2014-01-14: "Freddie Chopin" - * snmp.h, mib2.c: fixed constness and spelling of sysdescr - - 2014-01-14: Simon Goldschmidt (patch by Thomas Faber) - * tcpip.c: patch #8241: Fix implicit declaration of ip_input with - LWIP_TCPIP_CORE_LOCKING_INPUT disabled - - 2014-01-14: chrysn - * timers.c: patch #8244 make timeouts usable reliably from outside of the - timeout routine - - 2014-01-10: Simon Goldschmidt - * ip_frag.c, ip6_frag.c: fixed bug #41041 Potential use-after-free in IPv6 reassembly - - 2014-01-10: Simon Goldschmidt - * memp.c: fixed bug #41188 Alignment error in memp_init() when MEMP_SEPARATE_POOLS==1 - - 2014-01-10: Simon Goldschmidt - * tcp.c: fixed bug #39898 tcp_fasttmr() possible lock due to infinte queue process loop - - 2013-06-29: Simon Goldschmidt - * inet.h, sockets.h: partially fixed bug #37585: IPv6 compatibility (in socket structs) - - 2013-06-29: Simon Goldschmidt - * inet6.h: bug #37585/task #12600: fixed struct in6_addr.s6_addr to conform to spec - - 2013-04-24: patch by Liam <morepork> - * api_msg.c: patch #8008 Fix a potential null pointer dereference in assert - - 2013-04-24: Simon Goldschmidt - * igmp.c: fixed possible division by zero - - 2013-04-24: Simon Goldschmidt - * ip6.h, some ipv6 C files: fixed bug #38526 Coverity: Recursive Header Inclusion in ip6.h - - 2013-04-24: Simon Goldschmidt (patch by Emil Ljungdahl): - * netif.c: fixed bug #38586 netif_loop_output() "deadlocks" - - 2013-01-15: Simon Goldschmidt - * ip4.c: fixed bug #37665 ip_canforward operates on address in wrong byte order - - 2013-01-15: Simon Goldschmidt - * pbuf.h: fixed bug #38097 pbuf_free_ooseq() warning - - 2013-01-14: Simon Goldschmidt - * dns.c: fixed bug #37705 Possible memory corruption in DNS query - - 2013-01-11: Simon Goldschmidt - * raw.c: fixed bug #38066 Raw pcbs can alter packet without eating it - - 2012-08-22: Simon Goldschmidt - * memp.c: fixed bug #37166: memp_sanity check loops itself - - 2012-08-13: Simon Goldschmidt - * dhcp.c: fixed bug #36645: Calling dhcp_release before dhcp_start - dereferences NULL - - 2012-08-13: Simon Goldschmidt - * msg_out.c: fixed bug #36840 snmp_send_trap() NULL de-reference if traps - configured but no interfaces available - - 2012-08-13: Simon Goldschmidt - * dns.c: fixed bug #36899 DNS TTL 0 is cached for a long time - - 2012-05-11: Simon Goldschmidt (patch by Marty) - * memp.c: fixed bug #36412: memp.c does not compile when - MEMP_OVERFLOW_CHECK > zero and MEMP_SEPARATE_POOLS == 1 - - 2012-05-03: Simon Goldschmidt (patch by Sylvain Rochet) - * ppp.c: fixed bug #36283 (PPP struct used on header size computation and - not packed) - - 2012-05-03: Simon Goldschmidt (patch by David Empson) - * ppp.c: fixed bug #36388 (PPP: checksum-only in last pbuf leads to pbuf with - zero length) - - 2012-03-25: Simon Goldschmidt - * api_msg.c: Fixed bug #35817: do_connect() invalidly signals op_completed - for UDP/RAW with LWIP_TCPIP_CORE_LOCKING==1 - - 2012-03-25: Simon Goldschmidt - * api_msg.h, api_lib.c, api_msg.c, netifapi.c: fixed bug #35931: Name space - pollution in api_msg.c and netifapi.c - - 2011-08-24: Simon Goldschmidt - * inet6.h: fixed bug #34124 struct in6_addr does not conform to the standard - - - -(STABLE-1.4.1) - - ++ New features: - - 2012-03-25: Simon Goldschmidt (idea by Mason) - * posix/*: added posix-compatibility include files posix/netdb.h and posix/sys/socket.h - which are a simple wrapper to the correct lwIP include files. - - 2012-01-16: Simon Goldschmidt - * opt.h, icmp.c: Added option CHECKSUM_GEN_ICMP - - 2011-12-17: Simon Goldschmidt - * ip.h: implemented API functions to access so_options of IP pcbs (UDP, TCP, RAW) - (fixes bug #35061) - - 2011-09-27: Simon Goldschmidt - * opt.h, tcp.c, tcp_in.c: Implemented limiting data on ooseq queue (task #9989) - (define TCP_OOSEQ_MAX_BYTES / TCP_OOSEQ_MAX_PBUFS in lwipopts.h) - - 2011-09-21: Simon Goldschmidt - * opt.h, api.h, api_lib.c, api_msg.h/.c, sockets.c: Implemented timeout on - send (TCP only, bug #33820) - - 2011-09-21: Simon Goldschmidt - * init.c: Converted runtime-sanity-checks into compile-time checks that can - be disabled (since runtime checks can often not be seen on embedded targets) - - 2011-09-11: Simon Goldschmidt - * ppp.h, ppp_impl.h: splitted ppp.h to an internal and external header file - to get a clear separation of which functions an application or port may use - (task #11281) - - 2011-09-11: Simon Goldschmidt - * opt.h, tcp_impl.h, tcp.c, udp.h/.c: Added a config option to randomize - initial local TCP/UDP ports (so that different port ranges are used after - a reboot; bug #33818; this one added tcp_init/udp_init functions again) - - 2011-09-03: Simon Goldschmidt - * dhcp.c: DHCP uses LWIP_RAND() for xid's (bug #30302) - - 2011-08-24: Simon Goldschmidt - * opt.h, netif.h/.c: added netif remove callback (bug #32397) - - 2011-07-26: Simon Goldschmidt - * etharp.c: ETHARP_SUPPORT_VLAN: add support for an external VLAN filter - function instead of only checking for one VLAN (define ETHARP_VLAN_CHECK_FN) - - 2011-07-21: Simon Goldschmidt (patch by hanhui) - * ip4.c, etharp.c, pbuf.h: bug #33634 ip_forward() have a faulty behaviour: - Added pbuf flags to mark incoming packets as link-layer broadcast/multicast. - Also added code to allow ip_forward() to forward non-broadcast packets to - the input netif (set IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1). - - 2011-06-26: Simon Goldschmidt (patch by Cameron Gutman) - * tcp.c, tcp_out.c: bug #33604: added some more asserts to check that - pcb->state != LISTEN - - 2011-05-14: Simon Goldschmidt (patch by Stéphane Lesage) - * tcpip.c/.h: patch #7449 allow tcpip callback from interrupt with static - memory message - - - ++ Bugfixes: - - 2012-09-26: Simon Goldschmidt - * api_msg.c: fixed bug #37405 'err_tcp()' uses already freed 'netconn' object - - 2012-09-26: patch by Henrik Persson - * dhcp.c: patch #7843 Fix corner case with dhcp timeouts - - 2012-09-26: patch by Henrik Persson - * dhcp.c: patch #7840 Segfault in dhcp_parse_reply if no end marker in dhcp packet - - 2012-08-22: Simon Goldschmidt - * memp.c: fixed bug #37166: memp_sanity check loops itself - - 2012-05-08: Simon Goldschmidt - * tcp_out.c: fixed bug: #36380 unsent_oversize mismatch in 1.4.1RC1 (this was - a debug-check issue only) - - 2012-03-27: Simon Goldschmidt - * vj.c: fixed bug #35756 header length calculation problem in ppp/vj.c - - 2012-03-27: Simon Goldschmidt (patch by Mason) - * tcp_out.c: fixed bug #35945: SYN packet should provide the recv MSS not the - send MSS - - 2012-03-22: Simon Goldschmidt - * ip4.c: fixed bug #35927: missing refragmentaion in ip_forward - - 2012-03-20: Simon Goldschmidt (patch by Mason) - * netdb.c: fixed bug #35907: lwip_gethostbyname_r returns an invalid h_addr_list - - 2012-03-12: Simon Goldschmidt (patch by Bostjan Meglic) - * ppp.c: fixed bug #35809: PPP GetMask(): Compiler warning on big endian, - possible bug on little endian system - - 2012-02-23: Simon Goldschmidt - * etharp.c: fixed bug #35595: Impossible to send broadcast without a gateway - (introduced when fixing bug# 33551) - - 2012-02-16: Simon Goldschmidt - * ppp.c: fixed pbuf leak when PPP session is aborted through pppSigHUP() - (bug #35541: PPP Memory Leak) - - 2012-02-16: Simon Goldschmidt - * etharp.c: fixed bug #35531: Impossible to send multicast without a gateway - (introduced when fixing bug# 33551) - - 2012-02-16: Simon Goldschmidt (patch by Stéphane Lesage) - * msg_in.c, msg_out.c: fixed bug #35536 SNMP: error too big response is malformed - - 2012-02-15: Simon Goldschmidt - * init.c: fixed bug #35537: MEMP_NUM_* sanity checks should be disabled with - MEMP_MEM_MALLOC==1 - - 2012-02-12: Simon Goldschmidt - * tcp.h, tcp_in.c, tcp_out.c: partly fixed bug #25882: TCP hangs on - MSS > pcb->snd_wnd (by not creating segments bigger than half the window) - - 2012-02-11: Simon Goldschmidt - * tcp.c: fixed bug #35435: No pcb state check before adding it to time-wait - queue while closing - - 2012-01-22: Simon Goldschmidt - * tcp.c, tcp_in.c: fixed bug #35305: pcb may be freed too early on shutdown(WR) - - 2012-01-21: Simon Goldschmidt - * tcp.c: fixed bug #34636: FIN_WAIT_2 - Incorrect shutdown of TCP pcb - - 2012-01-20: Simon Goldschmidt - * dhcp.c: fixed bug #35151: DHCP asserts on incoming option lengths - - 2012-01-20: Simon Goldschmidt - * pbuf.c: fixed bug #35291: NULL pointer in pbuf_copy - - 2011-11-25: Simon Goldschmidt - * tcp.h/.c, tcp_impl.h, tcp_in.c: fixed bug #31177: tcp timers can corrupt - tcp_active_pcbs in some cases - - 2011-11-23: Simon Goldschmidt - * sys.c: fixed bug #34884: sys_msleep() body needs to be surrounded with - '#ifndef sys_msleep' - - 2011-11-22: Simon Goldschmidt - * netif.c, etharp.h/.c: fixed bug #34684: Clear the arp table cache when - netif is brought down - - 2011-10-28: Simon Goldschmidt - * tcp_in.c: fixed bug #34638: Dead code in tcp_receive - pcb->dupacks - - 2011-10-23: Simon Goldschmidt - * mem.c: fixed bug #34429: possible memory corruption with - LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT set to 1 - - 2011-10-18: Simon Goldschmidt - * arch.h, netdb.c: fixed bug #34592: lwip_gethostbyname_r uses nonstandard - error value - - 2011-10-18: Simon Goldschmidt - * opt.h: fixed default values of TCP_SNDLOWAT and TCP_SNDQUEUELOWAT for small - windows (bug #34176 select after non-blocking send times out) - - 2011-10-18: Simon Goldschmidt - * tcp_impl.h, tcp_out.c: fixed bug #34587: TCP_BUILD_MSS_OPTION doesn't - consider netif->mtu, causes slow network - - 2011-10-18: Simon Goldschmidt - * sockets.c: fixed bug #34581 missing parentheses in udplite sockets code - - 2011-10-18: Simon Goldschmidt - * sockets.h: fixed bug #34580 fcntl() is missing in LWIP_COMPAT_SOCKETS - - 2011-10-17: Simon Goldschmidt - * api_msg.c: fixed bug #34569: shutdown(SHUT_WR) crashes netconn/socket api - - 2011-10-13: Simon Goldschmidt - * tcp_in.c, tcp_out.c: fixed bug #34517 (persist timer is started although no - zero window is received) by starting the persist timer when a zero window is - received, not when we have more data queued for sending than fits into the - window - - 2011-10-13: Simon Goldschmidt - * def.h, timers.c: fixed bug #34541: LWIP_U32_DIFF is unnecessarily complex - - 2011-10-13: Simon Goldschmidt - * sockets.c, api_lib.c: fixed bug #34540: compiler error when CORE_LOCKING is - used and not all protocols are enabled - - 2011-10-12: Simon Goldschmidt - * pbuf.c: fixed bug #34534: Error in sending fragmented IP if MEM_ALIGNMENT > 4 - - 2011-10-09: Simon Goldschmidt - * tcp_out.c: fixed bug #34426: tcp_zero_window_probe() transmits incorrect - byte value when pcb->unacked != NULL - - 2011-10-09: Simon Goldschmidt - * ip4.c: fixed bug #34447 LWIP_IP_ACCEPT_UDP_PORT(dst_port) wrong - - 2011-09-27: Simon Goldschmidt - * tcp_in.c, tcp_out.c: Reset pcb->unsent_oversize in 2 more places... - - 2011-09-27: Simon Goldschmidt - * tcp_in.c: fixed bug #28288: Data after FIN in oos queue - - 2011-09-27: Simon Goldschmidt - * dhcp.c: fixed bug #34406 dhcp_option_hostname() can overflow the pbuf - - 2011-09-24: Simon Goldschmidt - * mem.h: fixed bug #34377 MEM_SIZE_F is not defined if MEM_LIBC_MALLOC==1 - - 2011-09-23: Simon Goldschmidt - * pbuf.h, tcp.c, tcp_in.c: fixed bug #33871: rejecting TCP_EVENT_RECV() for - the last packet including FIN can lose data - - 2011-09-22: Simon Goldschmidt - * tcp_impl.h: fixed bug #34355: nagle does not take snd_buf/snd_queuelen into - account - - 2011-09-21: Simon Goldschmidt - * opt.h: fixed default value of TCP_SND_BUF to not violate the sanity checks - in init.c - - 2011-09-20: Simon Goldschmidt - * timers.c: fixed bug #34337 (possible NULL pointer in sys_check_timeouts) - - 2011-09-11: Simon Goldschmidt - * tcp_out.c: use pcb->mss instead of TCP_MSS for preallocate mss-sized pbufs - (bug #34019) - - 2011-09-09: Simon Goldschmidt - * udp.c: fixed bug #34072: UDP broadcast is received from wrong UDP pcb if - udp port matches - - 2011-09-03: Simon Goldschmidt - * tcp_in.c: fixed bug #33952 PUSH flag in incoming packet is lost when packet - is aggregated and sent to application - - 2011-09-01: Simon Goldschmidt - * opt.h: fixed bug #31809 LWIP_EVENT_API in opts.h is inconsistent compared - to other options - - 2011-09-01: Simon Goldschmidt - * tcp_in.c: fixed bug #34111 RST for ACK to listening pcb has wrong seqno - - 2011-08-24: Simon Goldschmidt - * api_msg.c, sockets.c: fixed bug #33956 Wrong error returned when calling - accept() on UDP connections - - 2011-08-24: Simon Goldschmidt - * sockets.h: fixed bug #34057 socklen_t should be a typedef - - 2011-08-24: Simon Goldschmidt - * pbuf.c: fixed bug #34112 Odd check in pbuf_alloced_custom (typo) - - 2011-08-24: Simon Goldschmidt - * dhcp.c: fixed bug #34122 dhcp: hostname can overflow - - 2011-08-24: Simon Goldschmidt - * netif.c: fixed bug #34121 netif_add/netif_set_ipaddr fail on NULL ipaddr - - 2011-08-22: Simon Goldschmidt - * tcp_out.c: fixed bug #33962 TF_FIN not always set after FIN is sent. (This - merely prevents nagle from not transmitting fast after closing.) - - 2011-07-22: Simon Goldschmidt - * api_lib.c, api_msg.c, sockets.c, api.h: fixed bug #31084 (socket API returns - always EMSGSIZE on non-blocking sockets if data size > send buffers) -> now - lwip_send() sends as much as possible for non-blocking sockets - - 2011-07-22: Simon Goldschmidt - * pbuf.c/.h, timers.c: freeing ooseq pbufs when the pbuf pool is empty implemented - for NO_SYS==1: when not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ() - at regular intervals from main level. - - 2011-07-21: Simon Goldschmidt - * etharp.c: fixed bug #33551 (ARP entries may time out although in use) by - sending an ARP request when an ARP entry is used in the last minute before - it would time out. - - 2011-07-04: Simon Goldschmidt - * sys_arch.txt: Fixed documentation after changing sys arch prototypes for 1.4.0. - - 2011-06-26: Simon Goldschmidt - * tcp.c: fixed bug #31723 (tcp_kill_prio() kills pcbs with the same prio) by - updating its documentation only. - - 2011-06-26: Simon Goldschmidt - * mem.c: fixed bug #33545: With MEM_USE_POOLS==1, mem_malloc can return an - unaligned pointer. - - 2011-06-26: Simon Goldschmidt - * mem.c: fixed bug #33544 "warning in mem.c in lwip 1.4.0 with NO_SYS=1" - - 2011-05-25: Simon Goldschmidt - * tcp.c: fixed bug #33398 (pointless conversion when checking TCP port range) - - - -(STABLE-1.4.0) - - ++ New features: - - 2011-03-27: Simon Goldschmidt - * tcp_impl.h, tcp_in.c, tcp_out.c: Removed 'dataptr' from 'struct tcp_seg' and - calculate it in tcp_zero_window_probe (the only place where it was used). - - 2010-11-21: Simon Goldschmidt - * dhcp.c/.h: Added a function to deallocate the struct dhcp from a netif - (fixes bug #31525). - - 2010-07-12: Simon Goldschmidt (patch by Stephane Lesage) - * ip.c, udp.c/.h, pbuf.h, sockets.c: task #10495: Added support for - IP_MULTICAST_LOOP at socket- and raw-API level. - - 2010-06-16: Simon Goldschmidt - * ip.c: Added an optional define (LWIP_IP_ACCEPT_UDP_PORT) that can allow - link-layer-addressed UDP traffic to be received while a netif is down (just - like DHCP during configuration) - - 2010-05-22: Simon Goldschmidt - * many many files: bug #27352: removed packing from ip_addr_t, the packed - version is now only used in protocol headers. Added global storage for - current src/dest IP address while in input functions. - - 2010-05-16: Simon Goldschmidt - * def.h: task #10391: Add preprocessor-macros for compile-time htonl - calculation (and use them throughout the stack where applicable) - - 2010-05-16: Simon Goldschmidt - * opt.h, memp_std.h, memp.c, ppp_oe.h/.c: PPPoE now uses its own MEMP pool - instead of the heap (moved struct pppoe_softc from ppp_oe.c to ppp_oe.h) - - 2010-05-16: Simon Goldschmidt - * opt.h, memp_std.h, dns.h/.c: DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses its own - MEMP pool instead of the heap - - 2010-05-13: Simon Goldschmidt - * tcp.c, udp.c: task #6995: Implement SO_REUSEADDR (correctly), added - new option SO_REUSE_RXTOALL to pass received UDP broadcast/multicast - packets to more than one pcb. - - 2010-05-02: Simon Goldschmidt - * netbuf.h/.c, sockets.c, api_msg.c: use checksum-on-copy for sending - UDP data for LWIP_NETIF_TX_SINGLE_PBUF==1 - - 2010-04-30: Simon Goldschmidt - * udp.h/.c, pbuf.h/.c: task #6849: added udp_send(_to/_if) functions that - take a precalculated checksum, added pbuf_fill_chksum() to copy data - into a pbuf and at the same time calculating the checksum for that data - - 2010-04-29: Simon Goldschmidt - * ip_addr.h, etharp.h/.c, autoip.c: Create overridable macros for copying - 2-byte-aligned IP addresses and MAC addresses - - 2010-04-28: Patch by Bill Auerbach - * ip.c: Inline generating IP checksum to save a function call - - 2010-04-14: Simon Goldschmidt - * tcpip.h/.c, timers.c: Added an overridable define to get informed when the - tcpip_thread processes messages or timeouts to implement a watchdog. - - 2010-03-28: Simon Goldschmidt - * ip_frag.c: create a new (contiguous) PBUF_RAM for every outgoing - fragment if LWIP_NETIF_TX_SINGLE_PBUF==1 - - 2010-03-27: Simon Goldschmidt - * etharp.c: Speedup TX by moving code from find_entry to etharp_output/ - etharp_query to prevent unnecessary function calls (inspired by - patch #7135). - - 2010-03-20: Simon Goldschmidt - * opt.h, tcpip.c/.h: Added an option to disable tcpip_(un)timeout code - since the linker cannot do this automatically to save space. - - 2010-03-20: Simon Goldschmidt - * opt.h, etharp.c/.h: Added support for static ARP table entries - - 2010-03-14: Simon Goldschmidt - * tcp_impl.h, tcp_out.c, inet_chksum.h/.c: task #6849: Calculate checksum - when creating TCP segments, not when (re-)transmitting them. - - 2010-03-07: Simon Goldschmidt - * sockets.c: bug #28775 (select/event_callback: only check select_cb_list - on change) plus use SYS_LIGHTWEIGHT_PROT to protect the select code. - This should speed up receiving data on sockets as the select code in - event_callback is only executed when select is waiting. - - 2010-03-06: Simon Goldschmidt - * tcp_out.c: task #7013 (Create option to have all packets delivered to - netif->output in one piece): Always copy to try to create single pbufs - in tcp_write. - - 2010-03-06: Simon Goldschmidt - * api.h, api_lib.c, sockets.c: task #10167 (sockets: speed up TCP recv - by not allocating a netbuf): added function netconn_recv_tcp_pbuf() - for tcp netconns to receive pbufs, not netbufs; use that function - for tcp sockets. - - 2010-03-05: Jakob Ole Stoklundsen / Simon Goldschmidt - * opt.h, tcp.h, tcp_impl.h, tcp.c, tcp_in.c, tcp_out.c: task #7040: - Work on tcp_enqueue: Don't waste memory when chaining segments, - added option TCP_OVERSIZE to prevent creating many small pbufs when - calling tcp_write with many small blocks of data. Instead, pbufs are - allocated larger than needed and the space is used for later calls to - tcp_write. - - 2010-02-21: Simon Goldschmidt - * stats.c/.h: Added const char* name to mem- and memp-stats for easier - debugging. - - 2010-02-21: Simon Goldschmidt - * tcp.h (and usages), added tcp_impl.h: Splitted API and internal - implementation of tcp to make API usage cleare to application programmers - - 2010-02-14: Simon Goldschmidt/Stephane Lesage - * ip_addr.h: Improved some defines working on ip addresses, added faster - macro to copy addresses that cannot be NULL - - 2010-02-13: Simon Goldschmidt - * api.h, api_lib.c, api_msg.c, sockets.c: task #7865 (implement non- - blocking send operation) - - 2010-02-12: Simon Goldschmidt - * sockets.c/.h: Added a minimal version of posix fctl() to have a - standardised way to set O_NONBLOCK for nonblocking sockets. - - 2010-02-12: Simon Goldschmidt - * dhcp.c/.h, autoip.c/.h: task #10139 (Prefer statically allocated - memory): added autoip_set_struct() and dhcp_set_struct() to let autoip - and dhcp work with user-allocated structs instead of callin mem_malloc - - 2010-02-12: Simon Goldschmidt/Jeff Barber - * tcp.c/h: patch #6865 (SO_REUSEADDR for TCP): if pcb.so_options has - SOF_REUSEADDR set, allow binding to endpoint in TIME_WAIT - - 2010-02-12: Simon Goldschmidt - * sys layer: task #10139 (Prefer statically allocated memory): converted - mbox and semaphore functions to take pointers to sys_mbox_t/sys_sem_t; - converted sys_mbox_new/sys_sem_new to take pointers and return err_t; - task #7212: Add Mutex concept in sys_arch (define LWIP_COMPAT_MUTEX - to let sys.h use binary semaphores instead of mutexes - as before) - - 2010-02-09: Simon Goldschmidt (Simon Kallweit) - * timers.c/.h: Added function sys_restart_timeouts() from patch #7085 - (Restart system timeout handling) - - 2010-02-09: Simon Goldschmidt - * netif.c/.h, removed loopif.c/.h: task #10153 (Integrate loopif into - netif.c) - loopif does not have to be created by the port any more, - just define LWIP_HAVE_LOOPIF to 1. - - 2010-02-08: Simon Goldschmidt - * inet.h, ip_addr.c/.h: Added reentrant versions of inet_ntoa/ipaddr_ntoa - inet_ntoa_r/ipaddr_ntoa_r - - 2010-02-08: Simon Goldschmidt - * netif.h: Added netif_s/get_igmp_mac_filter() macros - - 2010-02-05: Simon Goldschmidt - * netif.h: Added function-like macros to get/set the hostname on a netif - - 2010-02-04: Simon Goldschmidt - * nearly every file: Replaced struct ip_addr by typedef ip_addr_t to - make changing the actual implementation behind the typedef easier. - - 2010-02-01: Simon Goldschmidt - * opt.h, memp_std.h, dns.h, netdb.c, memp.c: Let netdb use a memp pool - for allocating memory when getaddrinfo() is called. - - 2010-01-31: Simon Goldschmidt - * dhcp.h, dhcp.c: Reworked the code that parses DHCP options: parse - them once instead of parsing for every option. This also removes - the need for mem_malloc from dhcp_recv and makes it possible to - correctly retrieve the BOOTP file. - - 2010-01-30: simon Goldschmidt - * sockets.c: Use SYS_LIGHTWEIGHT_PROT instead of a semaphore to protect - the sockets array. - - 2010-01-29: Simon Goldschmidt (patch by Laura Garrett) - * api.h, api_msg.c, sockets.c: Added except set support in select - (patch #6860) - - 2010-01-29: Simon Goldschmidt (patch by Laura Garrett) - * api.h, sockets.h, err.h, api_lib.c, api_msg.c, sockets.c, err.c: - Add non-blocking support for connect (partly from patch #6860), - plus many cleanups in socket & netconn API. - - 2010-01-27: Simon Goldschmidt - * opt.h, tcp.h, init.c, api_msg.c: Added TCP_SNDQUEUELOWAT corresponding - to TCP_SNDLOWAT and added tcp_sndqueuelen() - this fixes bug #28605 - - 2010-01-26: Simon Goldschmidt - * snmp: Use memp pools for snmp instead of the heap; added 4 new pools. - - 2010-01-14: Simon Goldschmidt - * ppp.c/.h: Fixed bug #27856: PPP: Set netif link- and status-callback - by adding ppp_set_netif_statuscallback()/ppp_set_netif_linkcallback() - - 2010-01-13: Simon Goldschmidt - * mem.c: The heap now may be moved to user-defined memory by defining - LWIP_RAM_HEAP_POINTER as a void pointer to that memory's address - (patch #6966 and bug #26133) - - 2010-01-10: Simon Goldschmidt (Bill Auerbach) - * opt.h, memp.c: patch #6822 (Add option to place memory pools in - separate arrays) - - 2010-01-10: Simon Goldschmidt - * init.c, igmp.c: patch #6463 (IGMP - Adding Random Delay): added define - LWIP_RAND() for lwip-wide randomization (to be defined in cc.h) - - 2009-12-31: Simon Goldschmidt - * tcpip.c, init.c, memp.c, sys.c, memp_std.h, sys.h, tcpip.h - added timers.c/.h: Separated timer implementation from semaphore/mbox - implementation, moved timer implementation to timers.c/.h, timers are - now only called from tcpip_thread or by explicitly checking them. - (TASK#7235) - - 2009-12-27: Simon Goldschmidt - * opt.h, etharp.h/.c, init.c, tcpip.c: Added an additional option - LWIP_ETHERNET to support ethernet without ARP (necessary for pure PPPoE) - - - ++ Bugfixes: - - 2011-04-20: Simon Goldschmidt - * sys_arch.txt: sys_arch_timeouts() is not needed any more. - - 2011-04-13: Simon Goldschmidt - * tcp.c, udp.c: Fixed bug #33048 (Bad range for IP source port numbers) by - using ports in the IANA private/dynamic range (49152 through 65535). - - 2011-03-29: Simon Goldschmidt, patch by Emil Lhungdahl: - * etharp.h/.c: Fixed broken VLAN support. - - 2011-03-27: Simon Goldschmidt - * tcp.c: Fixed bug #32926 (TCP_RMV(&tcp_bound_pcbs) is called on unbound tcp - pcbs) by checking if the pcb was bound (local_port != 0). - - 2011-03-27: Simon Goldschmidt - * ppp.c: Fixed bug #32280 (ppp: a pbuf is freed twice) - - 2011-03-27: Simon Goldschmidt - * sockets.c: Fixed bug #32906: lwip_connect+lwip_send did not work for udp and - raw pcbs with LWIP_TCPIP_CORE_LOCKING==1. - - 2011-03-27: Simon Goldschmidt - * tcp_out.c: Fixed bug #32820 (Outgoing TCP connections created before route - is present never times out) by starting retransmission timer before checking - route. - - 2011-03-22: Simon Goldschmidt - * ppp.c: Fixed bug #32648 (PPP code crashes when terminating a link) by only - calling sio_read_abort() if the file descriptor is valid. - - 2011-03-14: Simon Goldschmidt - * err.h/.c, sockets.c, api_msg.c: fixed bug #31748 (Calling non-blocking connect - more than once can render a socket useless) since it mainly involves changing - "FATAL" classification of error codes: ERR_USE and ERR_ISCONN just aren't fatal. - - 2011-03-13: Simon Goldschmidt - * sockets.c: fixed bug #32769 (ESHUTDOWN is linux-specific) by fixing - err_to_errno_table (ERR_CLSD: ENOTCONN instead of ESHUTDOWN), ERR_ISCONN: - use EALRADY instead of -1 - - 2011-03-13: Simon Goldschmidt - * api_lib.c: netconn_accept: return ERR_ABRT instead of ERR_CLSD if the - connection has been aborted by err_tcp (since this is not a normal closing - procedure). - - 2011-03-13: Simon Goldschmidt - * tcp.c: tcp_bind: return ERR_VAL instead of ERR_ISCONN when trying to bind - with pcb->state != CLOSED - - 2011-02-17: Simon Goldschmidt - * rawapi.txt: Fixed bug #32561 tcp_poll argument definition out-of-order in - documentation - - 2011-02-17: Simon Goldschmidt - * many files: Added missing U/UL modifiers to fix 16-bit-arch portability. - - 2011-01-24: Simon Goldschmidt - * sockets.c: Fixed bug #31741: lwip_select seems to have threading problems - - 2010-12-02: Simon Goldschmidt - * err.h: Fixed ERR_IS_FATAL so that ERR_WOULDBLOCK is not fatal. - - 2010-11-23: Simon Goldschmidt - * api.h, api_lib.c, api_msg.c, sockets.c: netconn.recv_avail is only used for - LWIP_SO_RCVBUF and ioctl/FIONREAD. - - 2010-11-23: Simon Goldschmidt - * etharp.c: Fixed bug #31720: ARP-queueing: RFC 1122 recommends to queue at - least 1 packet -> ARP_QUEUEING==0 now queues the most recent packet. - - 2010-11-23: Simon Goldschmidt - * tcp_in.c: Fixed bug #30577: tcp_input: don't discard ACK-only packets after - refusing 'refused_data' again. - - 2010-11-22: Simon Goldschmidt - * sockets.c: Fixed bug #31590: getsockopt(... SO_ERROR ...) gives EINPROGRESS - after a successful nonblocking connection. - - 2010-11-22: Simon Goldschmidt - * etharp.c: Fixed bug #31722: IP packets sent with an AutoIP source addr - must be sent link-local - - 2010-11-22: Simon Goldschmidt - * timers.c: patch #7329: tcp_timer_needed prototype was ifdef'ed out for - LWIP_TIMERS==0 - - 2010-11-20: Simon Goldschmidt - * sockets.c: Fixed bug #31170: lwip_setsockopt() does not set socket number - - 2010-11-20: Simon Goldschmidt - * sockets.h: Fixed bug #31304: Changed SHUT_RD, SHUT_WR and SHUT_RDWR to - resemble other stacks. - - 2010-11-20: Simon Goldschmidt - * dns.c: Fixed bug #31535: TCP_SND_QUEUELEN must be at least 2 or else - no-copy TCP writes will never succeed. - - 2010-11-20: Simon Goldschmidt - * dns.c: Fixed bug #31701: Error return value from dns_gethostbyname() does - not match documentation: return ERR_ARG instead of ERR_VAL if not - initialized or wrong argument. - - 2010-10-20: Simon Goldschmidt - * sockets.h: Fixed bug #31385: sizeof(struct sockaddr) is 30 but should be 16 - - 2010-10-05: Simon Goldschmidt - * dhcp.c: Once again fixed #30038: DHCP/AutoIP cooperation failed when - replugging the network cable after an AutoIP address was assigned. - - 2010-08-10: Simon Goldschmidt - * tcp.c: Fixed bug #30728: tcp_new_port() did not check listen pcbs - - 2010-08-03: Simon Goldschmidt - * udp.c, raw.c: Don't chain empty pbufs when sending them (fixes bug #30625) - - 2010-08-01: Simon Goldschmidt (patch by Greg Renda) - * ppp.c: Applied patch #7264 (PPP protocols are rejected incorrectly on big - endian architectures) - - 2010-07-28: Simon Goldschmidt - * api_lib.c, api_msg.c, sockets.c, mib2.c: Fixed compilation with TCP or UDP - disabled. - - 2010-07-27: Simon Goldschmidt - * tcp.c: Fixed bug #30565 (tcp_connect() check bound list): that check did no - harm but never did anything - - 2010-07-21: Simon Goldschmidt - * ip.c: Fixed invalid fix for bug #30402 (CHECKSUM_GEN_IP_INLINE does not - add IP options) - - 2010-07-16: Kieran Mansley - * msg_in.c: Fixed SNMP ASN constant defines to not use ! operator - - 2010-07-10: Simon Goldschmidt - * ip.c: Fixed bug #30402: CHECKSUM_GEN_IP_INLINE does not add IP options - - 2010-06-30: Simon Goldschmidt - * api_msg.c: fixed bug #30300 (shutdown parameter was not initialized in - netconn_delete) - - 2010-06-28: Kieran Mansley - * timers.c remove unportable printing of C function pointers - - 2010-06-24: Simon Goldschmidt - * init.c, timers.c/.h, opt.h, memp_std.h: From patch #7221: added flag - NO_SYS_NO_TIMERS to drop timer support for NO_SYS==1 for easier upgrading - - 2010-06-24: Simon Goldschmidt - * api(_lib).c/.h, api_msg.c/.h, sockets.c/.h: Fixed bug #10088: Correctly - implemented shutdown at socket level. - - 2010-06-21: Simon Goldschmidt - * pbuf.c/.h, ip_frag.c/.h, opt.h, memp_std.h: Fixed bug #29361 (ip_frag has - problems with zero-copy DMA MACs) by adding custom pbufs and implementing - custom pbufs that reference other (original) pbufs. Additionally set - IP_FRAG_USES_STATIC_BUF=0 as default to be on the safe side. - - 2010-06-15: Simon Goldschmidt - * dhcp.c: Fixed bug #29970: DHCP endian issue parsing option responses - - 2010-06-14: Simon Goldschmidt - * autoip.c: Fixed bug #30039: AutoIP does not reuse previous addresses - - 2010-06-12: Simon Goldschmidt - * dhcp.c: Fixed bug #30038: dhcp_network_changed doesn't reset AUTOIP coop - state - - 2010-05-17: Simon Goldschmidt - * netdb.c: Correctly NULL-terminate h_addr_list - - 2010-05-16: Simon Goldschmidt - * def.h/.c: changed the semantics of LWIP_PREFIX_BYTEORDER_FUNCS to prevent - "symbol already defined" i.e. when linking to winsock - - 2010-05-05: Simon Goldschmidt - * def.h, timers.c: Fixed bug #29769 (sys_check_timeouts: sys_now() may - overflow) - - 2010-04-21: Simon Goldschmidt - * api_msg.c: Fixed bug #29617 (sometime cause stall on delete listening - connection) - - 2010-03-28: Luca Ceresoli - * ip_addr.c/.h: patch #7143: Add a few missing const qualifiers - - 2010-03-27: Luca Ceresoli - * mib2.c: patch #7130: remove meaningless const qualifiers - - 2010-03-26: Simon Goldschmidt - * tcp_out.c: Make LWIP_NETIF_TX_SINGLE_PBUF work for TCP, too - - 2010-03-26: Simon Goldschmidt - * various files: Fixed compiling with different options disabled (TCP/UDP), - triggered by bug #29345; don't allocate acceptmbox if LWIP_TCP is disabled - - 2010-03-25: Simon Goldschmidt - * sockets.c: Fixed bug #29332: lwip_select() processes readset incorrectly - - 2010-03-25: Simon Goldschmidt - * tcp_in.c, test_tcp_oos.c: Fixed bug #29080: Correctly handle remote side - overrunning our rcv_wnd in ooseq case. - - 2010-03-22: Simon Goldschmidt - * tcp.c: tcp_listen() did not copy the pcb's prio. - - 2010-03-19: Simon Goldschmidt - * snmp_msg.c: Fixed bug #29256: SNMP Trap address was not correctly set - - 2010-03-14: Simon Goldschmidt - * opt.h, etharp.h: Fixed bug #29148 (Incorrect PBUF_POOL_BUFSIZE for ports - where ETH_PAD_SIZE > 0) by moving definition of ETH_PAD_SIZE to opt.h - and basing PBUF_LINK_HLEN on it. - - 2010-03-08: Simon Goldschmidt - * netif.c, ipv4/ip.c: task #10241 (AutoIP: don't break existing connections - when assiging routable address): when checking incoming packets and - aborting existing connection on address change, filter out link-local - addresses. - - 2010-03-06: Simon Goldschmidt - * sockets.c: Fixed LWIP_NETIF_TX_SINGLE_PBUF for LWIP_TCPIP_CORE_LOCKING - - 2010-03-06: Simon Goldschmidt - * ipv4/ip.c: Don't try to forward link-local addresses - - 2010-03-06: Simon Goldschmidt - * etharp.c: Fixed bug #29087: etharp: don't send packets for LinkLocal- - addresses to gw - - 2010-03-05: Simon Goldschmidt - * dhcp.c: Fixed bug #29072: Correctly set ciaddr based on message-type - and state. - - 2010-03-05: Simon Goldschmidt - * api_msg.c: Correctly set TCP_WRITE_FLAG_MORE when netconn_write is split - into multiple calls to tcp_write. - - 2010-02-21: Simon Goldschmidt - * opt.h, mem.h, dns.c: task #10140: Remove DNS_USES_STATIC_BUF (keep - the implementation of DNS_USES_STATIC_BUF==1) - - 2010-02-20: Simon Goldschmidt - * tcp.h, tcp.c, tcp_in.c, tcp_out.c: Task #10088: Correctly implement - close() vs. shutdown(). Now the application does not get any more - recv callbacks after calling tcp_close(). Added tcp_shutdown(). - - 2010-02-19: Simon Goldschmidt - * mem.c/.h, pbuf.c: Renamed mem_realloc() to mem_trim() to prevent - confusion with realloc() - - 2010-02-15: Simon Goldschmidt/Stephane Lesage - * netif.c/.h: Link status does not depend on LWIP_NETIF_LINK_CALLBACK - (fixes bug #28899) - - 2010-02-14: Simon Goldschmidt - * netif.c: Fixed bug #28877 (Duplicate ARP gratuitous packet with - LWIP_NETIF_LINK_CALLBACK set on) by only sending if both link- and - admin-status of a netif are up - - 2010-02-14: Simon Goldschmidt - * opt.h: Disable ETHARP_TRUST_IP_MAC by default since it slows down packet - reception and is not really necessary - - 2010-02-14: Simon Goldschmidt - * etharp.c/.h: Fixed ARP input processing: only add a new entry if a - request was directed as us (RFC 826, Packet Reception), otherwise - only update existing entries; internalized some functions - - 2010-02-14: Simon Goldschmidt - * netif.h, etharp.c, tcpip.c: Fixed bug #28183 (ARP and TCP/IP cannot be - disabled on netif used for PPPoE) by adding a new netif flag - (NETIF_FLAG_ETHERNET) that tells the stack the device is an ethernet - device but prevents usage of ARP (so that ethernet_input can be used - for PPPoE). - - 2010-02-12: Simon Goldschmidt - * netif.c: netif_set_link_up/down: only do something if the link state - actually changes - - 2010-02-12: Simon Goldschmidt/Stephane Lesage - * api_msg.c: Fixed bug #28865 (Cannot close socket/netconn in non-blocking - connect) - - 2010-02-12: Simon Goldschmidt - * mem.h: Fixed bug #28866 (mem_realloc function defined in mem.h) - - 2010-02-09: Simon Goldschmidt - * api_lib.c, api_msg.c, sockets.c, api.h, api_msg.h: Fixed bug #22110 - (recv() makes receive window update for data that wasn't received by - application) - - 2010-02-09: Simon Goldschmidt/Stephane Lesage - * sockets.c: Fixed bug #28853 (lwip_recvfrom() returns 0 on receive time-out - or any netconn_recv() error) - - 2010-02-09: Simon Goldschmidt - * ppp.c: task #10154 (PPP: Update snmp in/out counters for tx/rx packets) - - 2010-02-09: Simon Goldschmidt - * netif.c: For loopback packets, adjust the stats- and snmp-counters - for the loopback netif. - - 2010-02-08: Simon Goldschmidt - * igmp.c/.h, ip.h: Moved most defines from igmp.h to igmp.c for clarity - since they are not used anywhere else. - - 2010-02-08: Simon Goldschmidt (Stéphane Lesage) - * igmp.c, igmp.h, stats.c, stats.h: Improved IGMP stats - (patch from bug #28798) - - 2010-02-08: Simon Goldschmidt (Stéphane Lesage) - * igmp.c: Fixed bug #28798 (Error in "Max Response Time" processing) and - another bug when LWIP_RAND() returns zero. - - 2010-02-04: Simon Goldschmidt - * nearly every file: Use macros defined in ip_addr.h (some of them new) - to work with IP addresses (preparation for bug #27352 - Change ip_addr - from struct to typedef (u32_t) - and better code). - - 2010-01-31: Simon Goldschmidt - * netif.c: Don't call the link-callback from netif_set_up/down() since - this invalidly retriggers DHCP. - - 2010-01-29: Simon Goldschmidt - * ip_addr.h, inet.h, def.h, inet.c, def.c, more: Cleanly separate the - portability file inet.h and its contents from the stack: moved htonX- - functions to def.h (and the new def.c - they are not ipv4 dependent), - let inet.h depend on ip_addr.h and not the other way round. - This fixes bug #28732. - - 2010-01-28: Kieran Mansley - * tcp.c: Ensure ssthresh >= 2*MSS - - 2010-01-27: Simon Goldschmidt - * tcp.h, tcp.c, tcp_in.c: Fixed bug #27871: Calling tcp_abort() in recv - callback can lead to accessing unallocated memory. As a consequence, - ERR_ABRT means the application has called tcp_abort()! - - 2010-01-25: Simon Goldschmidt - * snmp_structs.h, msg_in.c: Partly fixed bug #22070 (MIB_OBJECT_WRITE_ONLY - not implemented in SNMP): write-only or not-accessible are still - returned by getnext (though not by get) - - 2010-01-24: Simon Goldschmidt - * snmp: Renamed the private mib node from 'private' to 'mib_private' to - not use reserved C/C++ keywords - - 2010-01-23: Simon Goldschmidt - * sockets.c: Fixed bug #28716: select() returns 0 after waiting for less - than 1 ms - - 2010-01-21: Simon Goldschmidt - * tcp.c, api_msg.c: Fixed bug #28651 (tcp_connect: no callbacks called - if tcp_enqueue fails) both in raw- and netconn-API - - 2010-01-19: Simon Goldschmidt - * api_msg.c: Fixed bug #27316: netconn: Possible deadlock in err_tcp - - 2010-01-18: Iordan Neshev/Simon Goldschmidt - * src/netif/ppp: reorganised PPP sourcecode to 2.3.11 including some - bugfix backports from 2.4.x. - - 2010-01-18: Simon Goldschmidt - * mem.c: Fixed bug #28679: mem_realloc calculates mem_stats wrong - - 2010-01-17: Simon Goldschmidt - * api_lib.c, api_msg.c, (api_msg.h, api.h, sockets.c, tcpip.c): - task #10102: "netconn: clean up conn->err threading issues" by adding - error return value to struct api_msg_msg - - 2010-01-17: Simon Goldschmidt - * api.h, api_lib.c, sockets.c: Changed netconn_recv() and netconn_accept() - to return err_t (bugs #27709 and #28087) - - 2010-01-14: Simon Goldschmidt - * ...: Use typedef for function prototypes throughout the stack. - - 2010-01-13: Simon Goldschmidt - * api_msg.h/.c, api_lib.c: Fixed bug #26672 (close connection when receive - window = 0) by correctly draining recvmbox/acceptmbox - - 2010-01-11: Simon Goldschmidt - * pap.c: Fixed bug #13315 (PPP PAP authentication can result in - erroneous callbacks) by copying the code from recent pppd - - 2010-01-10: Simon Goldschmidt - * raw.c: Fixed bug #28506 (raw_bind should filter received packets) - - 2010-01-10: Simon Goldschmidt - * tcp.h/.c: bug #28127 (remove call to tcp_output() from tcp_ack(_now)()) - - 2010-01-08: Simon Goldschmidt - * sockets.c: Fixed bug #28519 (lwip_recvfrom bug with len > 65535) - - 2010-01-08: Simon Goldschmidt - * dns.c: Copy hostname for DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1 since string - passed to dns_local_addhost() might be volatile - - 2010-01-07: Simon Goldschmidt - * timers.c, tcp.h: Call tcp_timer_needed() with NO_SYS==1, too - - 2010-01-06: Simon Goldschmidt - * netdb.h: Fixed bug #28496: missing include guards in netdb.h - - 2009-12-31: Simon Goldschmidt - * many ppp files: Reorganised PPP source code from ucip structure to pppd - structure to easily compare our code against the pppd code (around v2.3.1) - - 2009-12-27: Simon Goldschmidt - * tcp_in.c: Another fix for bug #28241 (ooseq processing) and adapted - unit test - - -(STABLE-1.3.2) - - ++ New features: - - 2009-10-27 Simon Goldschmidt/Stephan Lesage - * netifapi.c/.h: Added netifapi_netif_set_addr() - - 2009-10-07 Simon Goldschmidt/Fabian Koch - * api_msg.c, netbuf.c/.h, opt.h: patch #6888: Patch for UDP Netbufs to - support dest-addr and dest-port (optional: LWIP_NETBUF_RECVINFO) - - 2009-08-26 Simon Goldschmidt/Simon Kallweit - * slipif.c/.h: bug #26397: SLIP polling support - - 2009-08-25 Simon Goldschmidt - * opt.h, etharp.h/.c: task #9033: Support IEEE 802.1q tagged frame (VLAN), - New configuration options ETHARP_SUPPORT_VLAN and ETHARP_VLAN_CHECK. - - 2009-08-25 Simon Goldschmidt - * ip_addr.h, netdb.c: patch #6900: added define ip_ntoa(struct ip_addr*) - - 2009-08-24 Jakob Stoklund Olesen - * autoip.c, dhcp.c, netif.c: patch #6725: Teach AutoIP and DHCP to respond - to netif_set_link_up(). - - 2009-08-23 Simon Goldschmidt - * tcp.h/.c: Added function tcp_debug_state_str() to convert a tcp state - to a human-readable string. - - ++ Bugfixes: - - 2009-12-24: Kieran Mansley - * tcp_in.c Apply patches from Oleg Tyshev to improve OOS processing - (BUG#28241) - - 2009-12-06: Simon Goldschmidt - * ppp.h/.c: Fixed bug #27079 (Yet another leak in PPP): outpacket_buf can - be statically allocated (like in ucip) - - 2009-12-04: Simon Goldschmidt (patch by Ioardan Neshev) - * pap.c: patch #6969: PPP: missing PAP authentication UNTIMEOUT - - 2009-12-03: Simon Goldschmidt - * tcp.h, tcp_in.c, tcp_out.c: Fixed bug #28106: dup ack for fast retransmit - could have non-zero length - - 2009-12-02: Simon Goldschmidt - * tcp_in.c: Fixed bug #27904: TCP sends too many ACKs: delay resetting - tcp_input_pcb until after calling the pcb's callbacks - - 2009-11-29: Simon Goldschmidt - * tcp_in.c: Fixed bug #28054: Two segments with FIN flag on the out-of- - sequence queue, also fixed PBUF_POOL leak in the out-of-sequence code - - 2009-11-29: Simon Goldschmidt - * pbuf.c: Fixed bug #28064: pbuf_alloc(PBUF_POOL) is not thread-safe by - queueing a call into tcpip_thread to free ooseq-bufs if the pool is empty - - 2009-11-26: Simon Goldschmidt - * tcp.h: Fixed bug #28098: Nagle can prevent fast retransmit from sending - segment - - 2009-11-26: Simon Goldschmidt - * tcp.h, sockets.c: Fixed bug #28099: API required to disable Nagle - algorithm at PCB level - - 2009-11-22: Simon Goldschmidt - * tcp_out.c: Fixed bug #27905: FIN isn't combined with data on unsent - - 2009-11-22: Simon Goldschmidt (suggested by Bill Auerbach) - * tcp.c: tcp_alloc: prevent increasing stats.err for MEMP_TCP_PCB when - reusing time-wait pcb - - 2009-11-20: Simon Goldschmidt (patch by Albert Bartel) - * sockets.c: Fixed bug #28062: Data received directly after accepting - does not wake up select - - 2009-11-11: Simon Goldschmidt - * netdb.h: Fixed bug #27994: incorrect define for freeaddrinfo(addrinfo) - - 2009-10-30: Simon Goldschmidt - * opt.h: Increased default value for TCP_MSS to 536, updated default - value for TCP_WND to 4*TCP_MSS to keep delayed ACK working. - - 2009-10-28: Kieran Mansley - * tcp_in.c, tcp_out.c, tcp.h: re-work the fast retransmission code - to follow algorithm from TCP/IP Illustrated - - 2009-10-27: Kieran Mansley - * tcp_in.c: fix BUG#27445: grow cwnd with every duplicate ACK - - 2009-10-25: Simon Goldschmidt - * tcp.h: bug-fix in the TCP_EVENT_RECV macro (has to call tcp_recved if - pcb->recv is NULL to keep rcv_wnd correct) - - 2009-10-25: Simon Goldschmidt - * tcp_in.c: Fixed bug #26251: RST process in TIME_WAIT TCP state - - 2009-10-23: Simon Goldschmidt (David Empson) - * tcp.c: Fixed bug #27783: Silly window avoidance for small window sizes - - 2009-10-21: Simon Goldschmidt - * tcp_in.c: Fixed bug #27215: TCP sent() callback gives leading and - trailing 1 byte len (SYN/FIN) - - 2009-10-21: Simon Goldschmidt - * tcp_out.c: Fixed bug #27315: zero window probe and FIN - - 2009-10-19: Simon Goldschmidt - * dhcp.c/.h: Minor code simplification (don't store received pbuf, change - conditional code to assert where applicable), check pbuf length before - testing for valid reply - - 2009-10-19: Simon Goldschmidt - * dhcp.c: Removed most calls to udp_connect since they aren't necessary - when using udp_sendto_if() - always stay connected to IP_ADDR_ANY. - - 2009-10-16: Simon Goldschmidt - * ip.c: Fixed bug #27390: Source IP check in ip_input() causes it to drop - valid DHCP packets -> allow 0.0.0.0 as source address when LWIP_DHCP is - enabled - - 2009-10-15: Simon Goldschmidt (Oleg Tyshev) - * tcp_in.c: Fixed bug #27329: dupacks by unidirectional data transmit - - 2009-10-15: Simon Goldschmidt - * api_lib.c: Fixed bug #27709: conn->err race condition on netconn_recv() - timeout - - 2009-10-15: Simon Goldschmidt - * autoip.c: Fixed bug #27704: autoip starts with wrong address - LWIP_AUTOIP_CREATE_SEED_ADDR() returned address in host byte order instead - of network byte order - - 2009-10-11 Simon Goldschmidt (Jörg Kesten) - * tcp_out.c: Fixed bug #27504: tcp_enqueue wrongly concatenates segments - which are not consecutive when retransmitting unacked segments - - 2009-10-09 Simon Goldschmidt - * opt.h: Fixed default values of some stats to only be enabled if used - Fixes bug #27338: sys_stats is defined when NO_SYS = 1 - - 2009-08-30 Simon Goldschmidt - * ip.c: Fixed bug bug #27345: "ip_frag() does not use the LWIP_NETIF_LOOPBACK - function" by checking for loopback before calling ip_frag - - 2009-08-25 Simon Goldschmidt - * dhcp.c: fixed invalid dependency to etharp_query if DHCP_DOES_ARP_CHECK==0 - - 2009-08-23 Simon Goldschmidt - * ppp.c: bug #27078: Possible memory leak in pppInit() - - 2009-08-23 Simon Goldschmidt - * netdb.c, dns.c: bug #26657: DNS, if host name is "localhost", result - is error. - - 2009-08-23 Simon Goldschmidt - * opt.h, init.c: bug #26649: TCP fails when TCP_MSS > TCP_SND_BUF - Fixed wrong parenthesis, added check in init.c - - 2009-08-23 Simon Goldschmidt - * ppp.c: bug #27266: wait-state debug message in pppMain occurs every ms - - 2009-08-23 Simon Goldschmidt - * many ppp files: bug #27267: Added include to string.h where needed - - 2009-08-23 Simon Goldschmidt - * tcp.h: patch #6843: tcp.h macro optimization patch (for little endian) - - -(STABLE-1.3.1) - - ++ New features: - - 2009-05-10 Simon Goldschmidt - * opt.h, sockets.c, pbuf.c, netbuf.h, pbuf.h: task #7013: Added option - LWIP_NETIF_TX_SINGLE_PBUF to try to create transmit packets from only - one pbuf to help MACs that don't support scatter-gather DMA. - - 2009-05-09 Simon Goldschmidt - * icmp.h, icmp.c: Shrinked ICMP code, added option to NOT check icoming - ECHO pbuf for size (just use it): LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN - - 2009-05-05 Simon Goldschmidt, Jakob Stoklund Olesen - * ip.h, ip.c: Added ip_current_netif() & ip_current_header() to receive - extended info about the currently received packet. - - 2009-04-27 Simon Goldschmidt - * sys.h: Made SYS_LIGHTWEIGHT_PROT and sys_now() work with NO_SYS=1 - - 2009-04-25 Simon Goldschmidt - * mem.c, opt.h: Added option MEM_USE_POOLS_TRY_BIGGER_POOL to try the next - bigger malloc pool if one is empty (only usable with MEM_USE_POOLS). - - 2009-04-21 Simon Goldschmidt - * dns.c, init.c, dns.h, opt.h: task #7507, patch #6786: DNS supports static - hosts table. New configuration options DNS_LOCAL_HOSTLIST and - DNS_LOCAL_HOSTLIST_IS_DYNAMIC. Also, DNS_LOOKUP_LOCAL_EXTERN() can be defined - as an external function for lookup. - - 2009-04-15 Simon Goldschmidt - * dhcp.c: patch #6763: Global DHCP XID can be redefined to something more unique - - 2009-03-31 Kieran Mansley - * tcp.c, tcp_out.c, tcp_in.c, sys.h, tcp.h, opts.h: add support for - TCP timestamp options, off by default. Rework tcp_enqueue() to - take option flags rather than specified option data - - 2009-02-18 Simon Goldschmidt - * cc.h: Added printf formatter for size_t: SZT_F - - 2009-02-16 Simon Goldschmidt (patch by Rishi Khan) - * icmp.c, opt.h: patch #6539: (configurable) response to broadcast- and multicast - pings - - 2009-02-12 Simon Goldschmidt - * init.h: Added LWIP_VERSION to get the current version of the stack - - 2009-02-11 Simon Goldschmidt (suggested by Gottfried Spitaler) - * opt.h, memp.h/.c: added MEMP_MEM_MALLOC to use mem_malloc/mem_free instead - of the pool allocator (can save code size with MEM_LIBC_MALLOC if libc-malloc - is otherwise used) - - 2009-01-28 Jonathan Larmour (suggested by Bill Bauerbach) - * ipv4/inet_chksum.c, ipv4/lwip/inet_chksum.h: inet_chksum_pseudo_partial() - is only used by UDPLITE at present, so conditionalise it. - - 2008-12-03 Simon Goldschmidt (base on patch from Luca Ceresoli) - * autoip.c: checked in (slightly modified) patch #6683: Customizable AUTOIP - "seed" address. This should reduce AUTOIP conflicts if - LWIP_AUTOIP_CREATE_SEED_ADDR is overridden. - - 2008-10-02 Jonathan Larmour and Rishi Khan - * sockets.c (lwip_accept): Return EWOULDBLOCK if would block on non-blocking - socket. - - 2008-06-30 Simon Goldschmidt - * mem.c, opt.h, stats.h: fixed bug #21433: Calling mem_free/pbuf_free from - interrupt context isn't safe: LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT allows - mem_free to run between mem_malloc iterations. Added illegal counter for - mem stats. - - 2008-06-27 Simon Goldschmidt - * stats.h/.c, some other files: patch #6483: stats module improvement: - Added defines to display each module's statistic individually, added stats - defines for MEM, MEMP and SYS modules, removed (unused) rexmit counter. - - 2008-06-17 Simon Goldschmidt - * err.h: patch #6459: Made err_t overridable to use a more efficient type - (define LWIP_ERR_T in cc.h) - - 2008-06-17 Simon Goldschmidt - * slipif.c: patch #6480: Added a configuration option for slipif for symmetry - to loopif - - 2008-06-17 Simon Goldschmidt (patch by Luca Ceresoli) - * netif.c, loopif.c, ip.c, netif.h, loopif.h, opt.h: Checked in slightly - modified version of patch # 6370: Moved loopif code to netif.c so that - loopback traffic is supported on all netifs (all local IPs). - Added option to limit loopback packets for each netifs. - - - ++ Bugfixes: - 2009-08-12 Kieran Mansley - * tcp_in.c, tcp.c: Fix bug #27209: handle trimming of segments when - out of window or out of order properly - - 2009-08-12 Kieran Mansley - * tcp_in.c: Fix bug #27199: use snd_wl2 instead of snd_wl1 - - 2009-07-28 Simon Goldschmidt - * mem.h: Fixed bug #27105: "realloc() cannot replace mem_realloc()"s - - 2009-07-27 Kieran Mansley - * api.h api_msg.h netdb.h sockets.h: add missing #include directives - - 2009-07-09 Kieran Mansley - * api_msg.c, sockets.c, api.h: BUG23240 use signed counters for - recv_avail and don't increment counters until message successfully - sent to mbox - - 2009-06-25 Kieran Mansley - * api_msg.c api.h: BUG26722: initialise netconn write variables - in netconn_alloc - - 2009-06-25 Kieran Mansley - * tcp.h: BUG26879: set ret value in TCP_EVENT macros when function is not set - - 2009-06-25 Kieran Mansley - * tcp.c, tcp_in.c, tcp_out.c, tcp.h: BUG26301 and BUG26267: correct - simultaneous close behaviour, and make snd_nxt have the same meaning - as in the RFCs. - - 2009-05-12 Simon Goldschmidt - * etharp.h, etharp.c, netif.c: fixed bug #26507: "Gratuitous ARP depends on - arp_table / uses etharp_query" by adding etharp_gratuitous() - - 2009-05-12 Simon Goldschmidt - * ip.h, ip.c, igmp.c: bug #26487: Added ip_output_if_opt that can add IP options - to the IP header (used by igmp_ip_output_if) - - 2009-05-06 Simon Goldschmidt - * inet_chksum.c: On little endian architectures, use LWIP_PLATFORM_HTONS (if - defined) for SWAP_BYTES_IN_WORD to speed up checksumming. - - 2009-05-05 Simon Goldschmidt - * sockets.c: bug #26405: Prematurely released semaphore causes lwip_select() - to crash - - 2009-05-04 Simon Goldschmidt - * init.c: snmp was not initialized in lwip_init() - - 2009-05-04 Frédéric Bernon - * dhcp.c, netbios.c: Changes if IP_SOF_BROADCAST is enabled. - - 2009-05-03 Simon Goldschmidt - * tcp.h: bug #26349: Nagle algorithm doesn't send although segment is full - (and unsent->next == NULL) - - 2009-05-02 Simon Goldschmidt - * tcpip.h, tcpip.c: fixed tcpip_untimeout (does not need the time, broken after - 1.3.0 in CVS only) - fixes compilation of ppp_oe.c - - 2009-05-02 Simon Goldschmidt - * msg_in.c: fixed bug #25636: SNMPSET value is ignored for integer fields - - 2009-05-01 Simon Goldschmidt - * pap.c: bug #21680: PPP upap_rauthnak() drops legal NAK packets - - 2009-05-01 Simon Goldschmidt - * ppp.c: bug #24228: Memory corruption with PPP and DHCP - - 2009-04-29 Frédéric Bernon - * raw.c, udp.c, init.c, opt.h, ip.h, sockets.h: bug #26309: Implement the - SO(F)_BROADCAST filter for all API layers. Avoid the unindented reception - of broadcast packets even when this option wasn't set. Port maintainers - which want to enable this filter have to set IP_SOF_BROADCAST=1 in opt.h. - If you want this option also filter broadcast on recv operations, you also - have to set IP_SOF_BROADCAST_RECV=1 in opt.h. - - 2009-04-28 Simon Goldschmidt, Jakob Stoklund Olesen - * dhcp.c: patch #6721, bugs #25575, #25576: Some small fixes to DHCP and - DHCP/AUTOIP cooperation - - 2009-04-25 Simon Goldschmidt, Oleg Tyshev - * tcp_out.c: bug #24212: Deadlocked tcp_retransmit due to exceeded pcb->cwnd - Fixed by sorting the unsent and unacked queues (segments are inserted at the - right place in tcp_output and tcp_rexmit). - - 2009-04-25 Simon Goldschmidt - * memp.c, mem.c, memp.h, mem_std.h: bug #26213 "Problem with memory allocation - when debugging": memp_sizes contained the wrong sizes (including sanity - regions); memp pools for MEM_USE_POOLS were too small - - 2009-04-24 Simon Goldschmidt, Frédéric Bernon - * inet.c: patch #6765: Fix a small problem with the last changes (incorrect - behavior, with with ip address string not ended by a '\0', a space or a - end of line) - - 2009-04-19 Simon Goldschmidt - * rawapi.txt: Fixed bug #26069: Corrected documentation: if tcp_connect fails, - pcb->err is called, not pcb->connected (with an error code). - - 2009-04-19 Simon Goldschmidt - * tcp_out.c: Fixed bug #26236: "TCP options (timestamp) don't work with - no-copy-tcpwrite": deallocate option data, only concat segments with same flags - - 2009-04-19 Simon Goldschmidt - * tcp_out.c: Fixed bug #25094: "Zero-length pbuf" (options are now allocated - in the header pbuf, not the data pbuf) - - 2009-04-18 Simon Goldschmidt - * api_msg.c: fixed bug #25695: Segmentation fault in do_writemore() - - 2009-04-15 Simon Goldschmidt - * sockets.c: tried to fix bug #23559: lwip_recvfrom problem with tcp - - 2009-04-15 Simon Goldschmidt - * dhcp.c: task #9192: mem_free of dhcp->options_in and dhcp->msg_in - - 2009-04-15 Simon Goldschmidt - * ip.c, ip6.c, tcp_out.c, ip.h: patch #6808: Add a utility function - ip_hinted_output() (for smaller code mainly) - - 2009-04-15 Simon Goldschmidt - * inet.c: patch #6765: Supporting new line characters in inet_aton() - - 2009-04-15 Simon Goldschmidt - * dhcp.c: patch #6764: DHCP rebind and renew did not send hostnam option; - Converted constant OPTION_MAX_MSG_SIZE to netif->mtu, check if netif->mtu - is big enough in dhcp_start - - 2009-04-15 Simon Goldschmidt - * netbuf.c: bug #26027: netbuf_chain resulted in pbuf memory leak - - 2009-04-15 Simon Goldschmidt - * sockets.c, ppp.c: bug #25763: corrected 4 occurrences of SMEMCPY to MEMCPY - - 2009-04-15 Simon Goldschmidt - * sockets.c: bug #26121: set_errno can be overridden - - 2009-04-09 Kieran Mansley (patch from Luca Ceresoli <lucaceresoli>) - * init.c, opt.h: Patch#6774 TCP_QUEUE_OOSEQ breaks compilation when - LWIP_TCP==0 - - 2009-04-09 Kieran Mansley (patch from Roy Lee <roylee17>) - * tcp.h: Patch#6802 Add do-while-clauses to those function like - macros in tcp.h - - 2009-03-31 Kieran Mansley - * tcp.c, tcp_in.c, tcp_out.c, tcp.h, opt.h: Rework the way window - updates are calculated and sent (BUG20515) - - * tcp_in.c: cope with SYN packets received during established states, - and retransmission of initial SYN. - - * tcp_out.c: set push bit correctly when tcp segments are merged - - 2009-03-27 Kieran Mansley - * tcp_out.c set window correctly on probes (correcting change made - yesterday) - - 2009-03-26 Kieran Mansley - * tcp.c, tcp_in.c, tcp.h: add tcp_abandon() to cope with dropping - connections where no reset required (bug #25622) - - * tcp_out.c: set TCP_ACK flag on keepalive and zero window probes - (bug #20779) - - 2009-02-18 Simon Goldschmidt (Jonathan Larmour and Bill Auerbach) - * ip_frag.c: patch #6528: the buffer used for IP_FRAG_USES_STATIC_BUF could be - too small depending on MEM_ALIGNMENT - - 2009-02-16 Simon Goldschmidt - * sockets.h/.c, api_*.h/.c: fixed arguments of socket functions to match the standard; - converted size argument of netconn_write to 'size_t' - - 2009-02-16 Simon Goldschmidt - * tcp.h, tcp.c: fixed bug #24440: TCP connection close problem on 64-bit host - by moving accept callback function pointer to TCP_PCB_COMMON - - 2009-02-12 Simon Goldschmidt - * dhcp.c: fixed bug #25345 (DHCPDECLINE is sent with "Maximum message size" - option) - - 2009-02-11 Simon Goldschmidt - * dhcp.c: fixed bug #24480 (releasing old udp_pdb and pbuf in dhcp_start) - - 2009-02-11 Simon Goldschmidt - * opt.h, api_msg.c: added configurable default valud for netconn->recv_bufsize: - RECV_BUFSIZE_DEFAULT (fixes bug #23726: pbuf pool exhaustion on slow recv()) - - 2009-02-10 Simon Goldschmidt - * tcp.c: fixed bug #25467: Listen backlog is not reset on timeout in SYN_RCVD: - Accepts_pending is decrease on a corresponding listen pcb when a connection - in state SYN_RCVD is close. - - 2009-01-28 Jonathan Larmour - * pbuf.c: reclaim pbufs from TCP out-of-sequence segments if we run - out of pool pbufs. - - 2008-12-19 Simon Goldschmidt - * many files: patch #6699: fixed some warnings on platform where sizeof(int) == 2 - - 2008-12-10 Tamas Somogyi, Frédéric Bernon - * sockets.c: fixed bug #25051: lwip_recvfrom problem with udp: fromaddr and - port uses deleted netbuf. - - 2008-10-18 Simon Goldschmidt - * tcp_in.c: fixed bug ##24596: Vulnerability on faulty TCP options length - in tcp_parseopt - - 2008-10-15 Simon Goldschmidt - * ip_frag.c: fixed bug #24517: IP reassembly crashes on unaligned IP headers - by packing the struct ip_reass_helper. - - 2008-10-03 David Woodhouse, Jonathan Larmour - * etharp.c (etharp_arp_input): Fix type aliasing problem copying ip address. - - 2008-10-02 Jonathan Larmour - * dns.c: Hard-code structure sizes, to avoid issues on some compilers where - padding is included. - - 2008-09-30 Jonathan Larmour - * sockets.c (lwip_accept): check addr isn't NULL. If it's valid, do an - assertion check that addrlen isn't NULL. - - 2008-09-30 Jonathan Larmour - * tcp.c: Fix bug #24227, wrong error message in tcp_bind. - - 2008-08-26 Simon Goldschmidt - * inet.h, ip_addr.h: fixed bug #24132: Cross-dependency between ip_addr.h and - inet.h -> moved declaration of struct in_addr from ip_addr.h to inet.h - - 2008-08-14 Simon Goldschmidt - * api_msg.c: fixed bug #23847: do_close_internal references freed memory (when - tcp_close returns != ERR_OK) - - 2008-07-08 Frédéric Bernon - * stats.h: Fix some build bugs introduced with patch #6483 (missing some parameters - in macros, mainly if MEM_STATS=0 and MEMP_STATS=0). - - 2008-06-24 Jonathan Larmour - * tcp_in.c: Fix for bug #23693 as suggested by Art R. Ensure cseg is unused - if tcp_seg_copy fails. - - 2008-06-17 Simon Goldschmidt - * inet_chksum.c: Checked in some ideas of patch #6460 (loop optimizations) - and created defines for swapping bytes and folding u32 to u16. - - 2008-05-30 Kieran Mansley - * tcp_in.c Remove redundant "if" statement, and use real rcv_wnd - rather than rcv_ann_wnd when deciding if packets are in-window. - Contributed by <arasmussen@consultant.datasys.swri.edu> - - 2008-05-30 Kieran Mansley - * mem.h: Fix BUG#23254. Change macro definition of mem_* to allow - passing as function pointers when MEM_LIBC_MALLOC is defined. - - 2008-05-09 Jonathan Larmour - * err.h, err.c, sockets.c: Fix bug #23119: Reorder timeout error code to - stop it being treated as a fatal error. - - 2008-04-15 Simon Goldschmidt - * dhcp.c: fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP - (flag now cleared) - - 2008-03-27 Simon Goldschmidt - * mem.c, tcpip.c, tcpip.h, opt.h: fixed bug #21433 (Calling mem_free/pbuf_free - from interrupt context isn't safe): set LWIP_USE_HEAP_FROM_INTERRUPT to 1 - in lwipopts.h or use pbuf_free_callback(p)/mem_free_callback(m) to free pbufs - or heap memory from interrupt context - - 2008-03-26 Simon Goldschmidt - * tcp_in.c, tcp.c: fixed bug #22249: division by zero could occur if a remote - host sent a zero mss as TCP option. - - -(STABLE-1.3.0) - - ++ New features: - - 2008-03-10 Jonathan Larmour - * inet_chksum.c: Allow choice of one of the sample algorithms to be - made from lwipopts.h. Fix comment on how to override LWIP_CHKSUM. - - 2008-01-22 Frédéric Bernon - * tcp.c, tcp_in.c, tcp.h, opt.h: Rename LWIP_CALCULATE_EFF_SEND_MSS in - TCP_CALCULATE_EFF_SEND_MSS to have coherent TCP options names. - - 2008-01-14 Frédéric Bernon - * rawapi.txt, api_msg.c, tcp.c, tcp_in.c, tcp.h: changes for task #7675 "Enable - to refuse data on a TCP_EVENT_RECV call". Important, behavior changes for the - tcp_recv callback (see rawapi.txt). - - 2008-01-14 Frédéric Bernon, Marc Chaland - * ip.c: Integrate patch #6369" ip_input : checking before realloc". - - 2008-01-12 Frédéric Bernon - * tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field - netconn::sem per netconn::op_completed like suggested for the task #7490 - "Add return value to sys_mbox_post". - - 2008-01-12 Frédéric Bernon - * api_msg.c, opt.h: replace DEFAULT_RECVMBOX_SIZE per DEFAULT_TCP_RECVMBOX_SIZE, - DEFAULT_UDP_RECVMBOX_SIZE and DEFAULT_RAW_RECVMBOX_SIZE (to optimize queues - sizes), like suggested for the task #7490 "Add return value to sys_mbox_post". - - 2008-01-10 Frédéric Bernon - * tcpip.h, tcpip.c: add tcpip_callback_with_block function for the task #7490 - "Add return value to sys_mbox_post". tcpip_callback is always defined as - "blocking" ("block" parameter = 1). - - 2008-01-10 Frédéric Bernon - * tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field - netconn::mbox (sys_mbox_t) per netconn::sem (sys_sem_t) for the task #7490 - "Add return value to sys_mbox_post". - - 2008-01-05 Frédéric Bernon - * sys_arch.txt, api.h, api_lib.c, api_msg.h, api_msg.c, tcpip.c, sys.h, opt.h: - Introduce changes for task #7490 "Add return value to sys_mbox_post" with some - modifications in the sys_mbox api: sys_mbox_new take a "size" parameters which - indicate the number of pointers query by the mailbox. There is three defines - in opt.h to indicate sizes for tcpip::mbox, netconn::recvmbox, and for the - netconn::acceptmbox. Port maintainers, you can decide to just add this new - parameter in your implementation, but to ignore it to keep the previous behavior. - The new sys_mbox_trypost function return a value to know if the mailbox is - full or if the message is posted. Take a look to sys_arch.txt for more details. - This new function is used in tcpip_input (so, can be called in an interrupt - context since the function is not blocking), and in recv_udp and recv_raw. - - 2008-01-04 Frédéric Bernon, Simon Goldschmidt, Jonathan Larmour - * rawapi.txt, api.h, api_lib.c, api_msg.h, api_msg.c, sockets.c, tcp.h, tcp.c, - tcp_in.c, init.c, opt.h: rename backlog options with TCP_ prefix, limit the - "backlog" parameter in an u8_t, 0 is interpreted as "smallest queue", add - documentation in the rawapi.txt file. - - 2007-12-31 Kieran Mansley (based on patch from Per-Henrik Lundbolm) - * tcp.c, tcp_in.c, tcp_out.c, tcp.h: Add TCP persist timer - - 2007-12-31 Frédéric Bernon, Luca Ceresoli - * autoip.c, etharp.c: ip_addr.h: Integrate patch #6348: "Broadcast ARP packets - in autoip". The change in etharp_raw could be removed, since all calls to - etharp_raw use ethbroadcast for the "ethdst_addr" parameter. But it could be - wrong in the future. - - 2007-12-30 Frédéric Bernon, Tom Evans - * ip.c: Fix bug #21846 "LwIP doesn't appear to perform any IP Source Address - Filtering" reported by Tom Evans. - - 2007-12-21 Frédéric Bernon, Simon Goldschmidt, Jonathan Larmour - * tcp.h, opt.h, api.h, api_msg.h, tcp.c, tcp_in.c, api_lib.c, api_msg.c, - sockets.c, init.c: task #7252: Implement TCP listen backlog: Warning: raw API - applications have to call 'tcp_accepted(pcb)' in their accept callback to - keep accepting new connections. - - 2007-12-13 Frédéric Bernon - * api_msg.c, err.h, err.c, sockets.c, dns.c, dns.h: replace "enum dns_result" - by err_t type. Add a new err_t code "ERR_INPROGRESS". - - 2007-12-12 Frédéric Bernon - * dns.h, dns.c, opt.h: move DNS options to the "right" place. Most visibles - are the one which have ram usage. - - 2007-12-05 Frédéric Bernon - * netdb.c: add a LWIP_DNS_API_HOSTENT_STORAGE option to decide to use a static - set of variables (=0) or a local one (=1). In this last case, your port should - provide a function "struct hostent* sys_thread_hostent( struct hostent* h)" - which have to do a copy of "h" and return a pointer ont the "per-thread" copy. - - 2007-12-03 Simon Goldschmidt - * ip.c: ip_input: check if a packet is for inp first before checking all other - netifs on netif_list (speeds up packet receiving in most cases) - - 2007-11-30 Simon Goldschmidt - * udp.c, raw.c: task #7497: Sort lists (pcb, netif, ...) for faster access - UDP: move a (connected) pcb selected for input to the front of the list of - pcbs so that it is found faster next time. Same for RAW pcbs that have eaten - a packet. - - 2007-11-28 Simon Goldschmidt - * etharp.c, stats.c, stats.h, opt.h: Introduced ETHARP_STATS - - 2007-11-25 Simon Goldschmidt - * dhcp.c: dhcp_unfold_reply() uses pbuf_copy_partial instead of its own copy - algorithm. - - 2007-11-24 Simon Goldschmidt - * netdb.h, netdb.c, sockets.h/.c: Moved lwip_gethostbyname from sockets.c - to the new file netdb.c; included lwip_getaddrinfo. - - 2007-11-21 Simon Goldschmidt - * tcp.h, opt.h, tcp.c, tcp_in.c: implemented calculating the effective send-mss - based on the MTU of the netif used to send. Enabled by default. Disable by - setting LWIP_CALCULATE_EFF_SEND_MSS to 0. This fixes bug #21492. - - 2007-11-19 Frédéric Bernon - * api_msg.c, dns.h, dns.c: Implement DNS_DOES_NAME_CHECK option (check if name - received match the name query), implement DNS_USES_STATIC_BUF (the place where - copy dns payload to parse the response), return an error if there is no place - for a new query, and fix some minor problems. - - 2007-11-16 Simon Goldschmidt - * new files: ipv4/inet.c, ipv4/inet_chksum.c, ipv6/inet6.c - removed files: core/inet.c, core/inet6.c - Moved inet files into ipv4/ipv6 directory; splitted inet.c/inet.h into - inet and chksum part; changed includes in all lwIP files as appropriate - - 2007-11-16 Simon Goldschmidt - * api.h, api_msg.h, api_lib.c, api_msg.c, socket.h, socket.c: Added sequential - dns resolver function for netconn api (netconn_gethostbyname) and socket api - (gethostbyname/gethostbyname_r). - - 2007-11-15 Jim Pettinato, Frédéric Bernon - * opt.h, init.c, tcpip.c, dhcp.c, dns.h, dns.c: add DNS client for simple name - requests with RAW api interface. Initialization is done in lwip_init() with - build time options. DNS timer is added in tcpip_thread context. DHCP can set - DNS server ip addresses when options are received. You need to set LWIP_DNS=1 - in your lwipopts.h file (LWIP_DNS=0 in opt.h). DNS_DEBUG can be set to get - some traces with LWIP_DEBUGF. Sanity check have been added. There is a "todo" - list with points to improve. - - 2007-11-06 Simon Goldschmidt - * opt.h, mib2.c: Patch #6215: added ifAdminStatus write support (if explicitly - enabled by defining SNMP_SAFE_REQUESTS to 0); added code to check link status - for ifOperStatus if LWIP_NETIF_LINK_CALLBACK is defined. - - 2007-11-06 Simon Goldschmidt - * api.h, api_msg.h and dependent files: Task #7410: Removed the need to include - core header files in api.h (ip/tcp/udp/raw.h) to hide the internal - implementation from netconn api applications. - - 2007-11-03 Frédéric Bernon - * api.h, api_lib.c, api_msg.c, sockets.c, opt.h: add SO_RCVBUF option for UDP & - RAW netconn. You need to set LWIP_SO_RCVBUF=1 in your lwipopts.h (it's disabled - by default). Netconn API users can use the netconn_recv_bufsize macro to access - it. This is a first release which have to be improve for TCP. Note it used the - netconn::recv_avail which need to be more "thread-safe" (note there is already - the problem for FIONREAD with lwip_ioctl/ioctlsocket). - - 2007-11-01 Frédéric Bernon, Marc Chaland - * sockets.h, sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c, tcp.h, tcp_out.c: - Integrate "patch #6250 : MSG_MORE flag for send". MSG_MORE is used at socket api - layer, NETCONN_MORE at netconn api layer, and TCP_WRITE_FLAG_MORE at raw api - layer. This option enable to delayed TCP PUSH flag on multiple "write" calls. - Note that previous "copy" parameter for "write" APIs is now called "apiflags". - - 2007-10-24 Frédéric Bernon - * api.h, api_lib.c, api_msg.c: Add macro API_EVENT in the same spirit than - TCP_EVENT_xxx macros to get a code more readable. It could also help to remove - some code (like we have talk in "patch #5919 : Create compile switch to remove - select code"), but it could be done later. - - 2007-10-08 Simon Goldschmidt - * many files: Changed initialization: many init functions are not needed any - more since we now rely on the compiler initializing global and static - variables to zero! - - 2007-10-06 Simon Goldschmidt - * ip_frag.c, memp.c, mib2.c, ip_frag.h, memp_std.h, opt.h: Changed IP_REASSEMBLY - to enqueue the received pbufs so that multiple packets can be reassembled - simultaneously and no static reassembly buffer is needed. - - 2007-10-05 Simon Goldschmidt - * tcpip.c, etharp.h, etharp.c: moved ethernet_input from tcpip.c to etharp.c so - all netifs (or ports) can use it. - - 2007-10-05 Frédéric Bernon - * netifapi.h, netifapi.c: add function netifapi_netif_set_default. Change the - common function to reduce a little bit the footprint (for all functions using - only the "netif" parameter). - - 2007-10-03 Frédéric Bernon - * netifapi.h, netifapi.c: add functions netifapi_netif_set_up, netifapi_netif_set_down, - netifapi_autoip_start and netifapi_autoip_stop. Use a common function to reduce - a little bit the footprint (for all functions using only the "netif" parameter). - - 2007-09-15 Frédéric Bernon - * udp.h, udp.c, sockets.c: Changes for "#20503 IGMP Improvement". Add IP_MULTICAST_IF - option in socket API, and a new field "multicast_ip" in "struct udp_pcb" (for - netconn and raw API users), only if LWIP_IGMP=1. Add getsockopt processing for - IP_MULTICAST_TTL and IP_MULTICAST_IF. - - 2007-09-10 Frédéric Bernon - * snmp.h, mib2.c: enable to remove SNMP timer (which consumne several cycles - even when it's not necessary). snmp_agent.txt tell to call snmp_inc_sysuptime() - each 10ms (but, it's intrusive if you use sys_timeout feature). Now, you can - decide to call snmp_add_sysuptime(100) each 1000ms (which is bigger "step", but - call to a lower frequency). Or, you can decide to not call snmp_inc_sysuptime() - or snmp_add_sysuptime(), and to define the SNMP_GET_SYSUPTIME(sysuptime) macro. - This one is undefined by default in mib2.c. SNMP_GET_SYSUPTIME is called inside - snmp_get_sysuptime(u32_t *value), and enable to change "sysuptime" value only - when it's queried (any direct call to "sysuptime" is changed by a call to - snmp_get_sysuptime). - - 2007-09-09 Frédéric Bernon, Bill Florac - * igmp.h, igmp.c, netif.h, netif.c, ip.c: To enable to have interfaces with IGMP, - and others without it, there is a new NETIF_FLAG_IGMP flag to set in netif->flags - if you want IGMP on an interface. igmp_stop() is now called inside netif_remove(). - igmp_report_groups() is now called inside netif_set_link_up() (need to have - LWIP_NETIF_LINK_CALLBACK=1) to resend reports once the link is up (avoid to wait - the next query message to receive the matching multicast streams). - - 2007-09-08 Frédéric Bernon - * sockets.c, ip.h, api.h, tcp.h: declare a "struct ip_pcb" which only contains - IP_PCB. Add in the netconn's "pcb" union a "struct ip_pcb *ip;" (no size change). - Use this new field to access to common pcb fields (ttl, tos, so_options, etc...). - Enable to access to these fields with LWIP_TCP=0. - - 2007-09-05 Frédéric Bernon - * udp.c, ipv4/icmp.c, ipv4/ip.c, ipv6/icmp.c, ipv6/ip6.c, ipv4/icmp.h, - ipv6/icmp.h, opt.h: Integrate "task #7272 : LWIP_ICMP option". The new option - LWIP_ICMP enable/disable ICMP module inside the IP stack (enable per default). - Be careful, disabling ICMP make your product non-compliant to RFC1122, but - help to reduce footprint, and to reduce "visibility" on the Internet. - - 2007-09-05 Frédéric Bernon, Bill Florac - * opt.h, sys.h, tcpip.c, slipif.c, ppp.c, sys_arch.txt: Change parameters list - for sys_thread_new (see "task #7252 : Create sys_thread_new_ex()"). Two new - parameters have to be provided: a task name, and a task stack size. For this - one, since it's platform dependant, you could define the best one for you in - your lwipopts.h. For port maintainers, you can just add these new parameters - in your sys_arch.c file, and but it's not mandatory, use them in your OS - specific functions. - - 2007-09-05 Frédéric Bernon - * inet.c, autoip.c, msg_in.c, msg_out.c, init.c: Move some build time checkings - inside init.c for task #7142 "Sanity check user-configurable values". - - 2007-09-04 Frédéric Bernon, Bill Florac - * igmp.h, igmp.c, memp_std.h, memp.c, init.c, opt.h: Replace mem_malloc call by - memp_malloc, and use a new MEMP_NUM_IGMP_GROUP option (see opt.h to define the - value). It will avoid potential fragmentation problems, use a counter to know - how many times a group is used on an netif, and free it when all applications - leave it. MEMP_NUM_IGMP_GROUP got 8 as default value (and init.c got a sanity - check if LWIP_IGMP!=0). - - 2007-09-03 Frédéric Bernon - * igmp.h, igmp.c, sockets.c, api_msg.c: Changes for "#20503 IGMP Improvement". - Initialize igmp_mac_filter to NULL in netif_add (this field should be set in - the netif's "init" function). Use the "imr_interface" field (for socket layer) - and/or the "interface" field (for netconn layer), for join/leave operations. - The igmp_join/leavegroup first parameter change from a netif to an ipaddr. - This field could be a netif's ipaddr, or "any" (same meaning than ip_addr_isany). - - 2007-08-30 Frédéric Bernon - * Add netbuf.h, netbuf.c, Change api.h, api_lib.c: #7249 "Split netbuf functions - from api/api_lib". Now netbuf API is independant of netconn, and can be used - with other API (application based on raw API, or future "socket2" API). Ports - maintainers just have to add src/api/netbuf.c in their makefile/projects. - - 2007-08-30 Frédéric Bernon, Jonathan Larmour - * init.c: Add first version of lwip_sanity_check for task #7142 "Sanity check - user-configurable values". - - 2007-08-29 Frédéric Bernon - * igmp.h, igmp.c, tcpip.c, init.c, netif.c: change igmp_init and add igmp_start. - igmp_start is call inside netif_add. Now, igmp initialization is in the same - spirit than the others modules. Modify some IGMP debug traces. - - 2007-08-29 Frédéric Bernon - * Add init.h, init.c, Change opt.h, tcpip.c: Task #7213 "Add a lwip_init function" - Add lwip_init function to regroup all modules initializations, and to provide - a place to add code for task #7142 "Sanity check user-configurable values". - Ports maintainers should remove direct initializations calls from their code, - and add init.c in their makefiles. Note that lwip_init() function is called - inside tcpip_init, but can also be used by raw api users since all calls are - disabled when matching options are disabled. Also note that their is new options - in opt.h, you should configure in your lwipopts.h (they are enabled per default). - - 2007-08-26 Marc Boucher - * api_msg.c: do_close_internal(): Reset the callbacks and arg (conn) to NULL - since they can under certain circumstances be called with an invalid conn - pointer after the connection has been closed (and conn has been freed). - - 2007-08-25 Frédéric Bernon (Artem Migaev's Patch) - * netif.h, netif.c: Integrate "patch #6163 : Function to check if link layer is up". - Add a netif_is_link_up() function if LWIP_NETIF_LINK_CALLBACK option is set. - - 2007-08-22 Frédéric Bernon - * netif.h, netif.c, opt.h: Rename LWIP_NETIF_CALLBACK in LWIP_NETIF_STATUS_CALLBACK - to be coherent with new LWIP_NETIF_LINK_CALLBACK option before next release. - - 2007-08-22 Frédéric Bernon - * tcpip.h, tcpip.c, ethernetif.c, opt.h: remove options ETHARP_TCPIP_INPUT & - ETHARP_TCPIP_ETHINPUT, now, only "ethinput" code is supported, even if the - name is tcpip_input (we keep the name of 1.2.0 function). - - 2007-08-17 Jared Grubb - * memp_std.h, memp.h, memp.c, mem.c, stats.c: (Task #7136) Centralize mempool - settings into new memp_std.h and optional user file lwippools.h. This adds - more dynamic mempools, and allows the user to create an arbitrary number of - mempools for mem_malloc. - - 2007-08-16 Marc Boucher - * api_msg.c: Initialize newconn->state to NETCONN_NONE in accept_function; - otherwise it was left to NETCONN_CLOSE and sent_tcp() could prematurely - close the connection. - - 2007-08-16 Marc Boucher - * sockets.c: lwip_accept(): check netconn_peer() error return. - - 2007-08-16 Marc Boucher - * mem.c, mem.h: Added mem_calloc(). - - 2007-08-16 Marc Boucher - * tcpip.c, tcpip.h memp.c, memp.h: Added distinct memp (MEMP_TCPIP_MSG_INPKT) - for input packets to prevent floods from consuming all of MEMP_TCPIP_MSG - and starving other message types. - Renamed MEMP_TCPIP_MSG to MEMP_TCPIP_MSG_API - - 2007-08-16 Marc Boucher - * pbuf.c, pbuf.h, etharp.c, tcp_in.c, sockets.c: Split pbuf flags in pbuf - type and flgs (later renamed to flags). - Use enum pbuf_flag as pbuf_type. Renumber PBUF_FLAG_*. - Improved lwip_recvfrom(). TCP push now propagated. - - 2007-08-16 Marc Boucher - * ethernetif.c, contrib/ports/various: ethbroadcast now a shared global - provided by etharp. - - 2007-08-16 Marc Boucher - * ppp_oe.c ppp_oe.h, auth.c chap.c fsm.c lcp.c ppp.c ppp.h, - etharp.c ethernetif.c, etharp.h, opt.h tcpip.h, tcpip.c: - Added PPPoE support and various PPP improvements. - - 2007-07-25 Simon Goldschmidt - * api_lib.c, ip_frag.c, pbuf.c, api.h, pbuf.h: Introduced pbuf_copy_partial, - making netbuf_copy_partial use this function. - - 2007-07-25 Simon Goldschmidt - * tcp_in.c: Fix bug #20506: Slow start / initial congestion window starts with - 2 * mss (instead of 1 * mss previously) to comply with some newer RFCs and - other stacks. - - 2007-07-13 Jared Grubb (integrated by Frédéric Bernon) - * opt.h, netif.h, netif.c, ethernetif.c: Add new configuration option to add - a link callback in the netif struct, and functions to handle it. Be carefull - for port maintainers to add the NETIF_FLAG_LINK_UP flag (like in ethernetif.c) - if you want to be sure to be compatible with future changes... - - 2007-06-30 Frédéric Bernon - * sockets.h, sockets.c: Implement MSG_PEEK flag for recv/recvfrom functions. - - 2007-06-21 Simon Goldschmidt - * etharp.h, etharp.c: Combined etharp_request with etharp_raw for both - LWIP_AUTOIP =0 and =1 to remove redundant code. - - 2007-06-21 Simon Goldschmidt - * mem.c, memp.c, mem.h, memp.h, opt.h: task #6863: Introduced the option - MEM_USE_POOLS to use 4 pools with different sized elements instead of a - heap. This both prevents memory fragmentation and gives a higher speed - at the cost of more memory consumption. Turned off by default. - - 2007-06-21 Simon Goldschmidt - * api_lib.c, api_msg.c, api.h, api_msg.h: Converted the length argument of - netconn_write (and therefore also api_msg_msg.msg.w.len) from u16_t into - int to be able to send a bigger buffer than 64K with one time (mainly - used from lwip_send). - - 2007-06-21 Simon Goldschmidt - * tcp.h, api_msg.c: Moved the nagle algorithm from netconn_write/do_write - into a define (tcp_output_nagle) in tcp.h to provide it to raw api users, too. - - 2007-06-21 Simon Goldschmidt - * api.h, api_lib.c, api_msg.c: Fixed bug #20021: Moved sendbuf-processing in - netconn_write from api_lib.c to api_msg.c to also prevent multiple context- - changes on low memory or empty send-buffer. - - 2007-06-18 Simon Goldschmidt - * etharp.c, etharp.h: Changed etharp to use a defined hardware address length - of 6 to avoid loading netif->hwaddr_len every time (since this file is only - used for ethernet and struct eth_addr already had a defined length of 6). - - 2007-06-17 Simon Goldschmidt - * sockets.c, sockets.h: Implemented socket options SO_NO_CHECK for UDP sockets - to disable UDP checksum generation on transmit. - - 2007-06-13 Frédéric Bernon, Simon Goldschmidt - * debug.h, api_msg.c: change LWIP_ERROR to use it to check errors like invalid - pointers or parameters, and let the possibility to redefined it in cc.h. Use - this macro to check "conn" parameter in api_msg.c functions. - - 2007-06-11 Simon Goldschmidt - * sockets.c, sockets.h: Added UDP lite support for sockets - - 2007-06-10 Simon Goldschmidt - * udp.h, opt.h, api_msg.c, ip.c, udp.c: Included switch LWIP_UDPLITE (enabled - by default) to switch off UDP-Lite support if not needed (reduces udp.c code - size) - - 2007-06-09 Dominik Spies (integrated by Frédéric Bernon) - * autoip.h, autoip.c, dhcp.h, dhcp.c, netif.h, netif.c, etharp.h, etharp.c, opt.h: - AutoIP implementation available for IPv4, with new options LWIP_AUTOIP and - LWIP_DHCP_AUTOIP_COOP if you want to cooperate with DHCP. Some tips to adapt - (see TODO mark in the source code). - - 2007-06-09 Simon Goldschmidt - * etharp.h, etharp.c, ethernetif.c: Modified order of parameters for - etharp_output() to match netif->output so etharp_output() can be used - directly as netif->output to save one function call. - - 2007-06-08 Simon Goldschmidt - * netif.h, ethernetif.c, slipif.c, loopif.c: Added define - NETIF_INIT_SNMP(netif, type, speed) to initialize per-netif snmp variables, - added initialization of those to ethernetif, slipif and loopif. - - 2007-05-18 Simon Goldschmidt - * opt.h, ip_frag.c, ip_frag.h, ip.c: Added option IP_FRAG_USES_STATIC_BUF - (defaulting to off for now) that can be set to 0 to send fragmented - packets by passing PBUF_REFs down the stack. - - 2007-05-23 Frédéric Bernon - * api_lib.c: Implement SO_RCVTIMEO for accept and recv on TCP - connections, such present in patch #5959. - - 2007-05-23 Frédéric Bernon - * api.h, api_lib.c, api_msg.c, sockets.c: group the different NETCONN_UDPxxx - code in only one part... - - 2007-05-18 Simon Goldschmidt - * opt.h, memp.h, memp.c: Added option MEMP_OVERFLOW_CHECK to check for memp - elements to overflow. This is achieved by adding some bytes before and after - each pool element (increasing their size, of course), filling them with a - prominent value and checking them on freeing the element. - Set it to 2 to also check every element in every pool each time memp_malloc() - or memp_free() is called (slower but more helpful). - - 2007-05-10 Simon Goldschmidt - * opt.h, memp.h, memp.c, pbuf.c (see task #6831): use a new memp pool for - PBUF_POOL pbufs instead of the old pool implementation in pbuf.c to reduce - code size. - - 2007-05-11 Frédéric Bernon - * sockets.c, api_lib.c, api_msg.h, api_msg.c, netifapi.h, netifapi.c, tcpip.c: - Include a function pointer instead of a table index in the message to reduce - footprint. Disable some part of lwip_send and lwip_sendto if some options are - not set (LWIP_TCP, LWIP_UDP, LWIP_RAW). - - 2007-05-10 Simon Goldschmidt - * *.h (except netif/ppp/*.h): Included patch #5448: include '#ifdef __cplusplus - \ extern "C" {' in all header files. Now you can write your application using - the lwIP stack in C++ and simply #include the core files. Note I have left - out the netif/ppp/*h header files for now, since I don't know which files are - included by applications and which are for internal use only. - - 2007-05-09 Simon Goldschmidt - * opt.h, *.c/*.h: Included patch #5920: Create define to override C-library - memcpy. 2 Defines are created: MEMCPY() for normal memcpy, SMEMCPY() for - situations where some compilers might inline the copy and save a function - call. Also replaced all calls to memcpy() with calls to (S)MEMCPY(). - - 2007-05-08 Simon Goldschmidt - * mem.h: If MEM_LIBC_MALLOC==1, allow the defines (e.g. mem_malloc() -> malloc()) - to be overriden in case the C-library malloc implementation is not protected - against concurrent access. - - 2007-05-04 Simon Goldschmidt (Atte Kojo) - * etharp.c: Introduced fast one-entry-cache to speed up ARP lookup when sending - multiple packets to the same host. - - 2007-05-04 Frédéric Bernon, Jonathan Larmour - * sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fix bug #19162 "lwip_sento: a possible - to corrupt remote addr/port connection state". Reduce problems "not enought memory" with - netbuf (if we receive lot of datagrams). Improve lwip_sendto (only one exchange between - sockets api and api_msg which run in tcpip_thread context). Add netconn_sento function. - Warning, if you directly access to "fromaddr" & "fromport" field from netbuf struct, - these fields are now renamed "addr" & "port". - - 2007-04-11 Jonathan Larmour - * sys.h, api_lib.c: Provide new sys_mbox_tryfetch function. Require ports to provide new - sys_arch_mbox_tryfetch function to get a message if one is there, otherwise return - with SYS_MBOX_EMPTY. sys_arch_mbox_tryfetch can be implemented as a function-like macro - by the port in sys_arch.h if desired. - - 2007-04-06 Frédéric Bernon, Simon Goldschmidt - * opt.h, tcpip.h, tcpip.c, netifapi.h, netifapi.c: New configuration option LWIP_NETIF_API - allow to use thread-safe functions to add/remove netif in list, and to start/stop dhcp - clients, using new functions from netifapi.h. Disable as default (no port change to do). - - 2007-04-05 Frédéric Bernon - * sockets.c: remplace ENOBUFS errors on alloc_socket by ENFILE to be more BSD compliant. - - 2007-04-04 Simon Goldschmidt - * arch.h, api_msg.c, dhcp.c, msg_in.c, sockets.c: Introduced #define LWIP_UNUSED_ARG(x) - use this for and architecture-independent form to tell the compiler you intentionally - are not using this variable. Can be overriden in cc.h. - - 2007-03-28 Frédéric Bernon - * opt.h, netif.h, dhcp.h, dhcp.c: New configuration option LWIP_NETIF_HOSTNAME allow to - define a hostname in netif struct (this is just a pointer, so, you can use a hardcoded - string, point on one of your's ethernetif field, or alloc a string you will free yourself). - It will be used by DHCP to register a client hostname, but can also be use when you call - snmp_set_sysname. - - 2007-03-28 Frédéric Bernon - * netif.h, netif.c: A new NETIF_FLAG_ETHARP flag is defined in netif.h, to allow to - initialize a network interface's flag with. It tell this interface is an ethernet - device, and we can use ARP with it to do a "gratuitous ARP" (RFC 3220 "IP Mobility - Support for IPv4" section 4.6) when interface is "up" with netif_set_up(). - - 2007-03-26 Frédéric Bernon, Jonathan Larmour - * opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build - time if you only use PPP or SLIP. The default is enable. Note we don't have to call - etharp_init in your port's initilization sequence if you use tcpip.c, because this call - is done in tcpip_init function. - - 2007-03-22 Frédéric Bernon - * stats.h, stats.c, msg_in.c: Stats counters can be change to u32_t if necessary with the - new option LWIP_STATS_LARGE. If you need this option, define LWIP_STATS_LARGE to 1 in - your lwipopts.h. More, unused counters are not defined in the stats structs, and not - display by stats_display(). Note that some options (SYS_STATS and RAW_STATS) are defined - but never used. Fix msg_in.c with the correct #if test for a stat display. - - 2007-03-21 Kieran Mansley - * netif.c, netif.h: Apply patch#4197 with some changes (originator: rireland@hmgsl.com). - Provides callback on netif up/down state change. - - 2007-03-11 Frédéric Bernon, Mace Gael, Steve Reynolds - * sockets.h, sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c, igmp.h, igmp.c, - ip.c, netif.h, tcpip.c, opt.h: - New configuration option LWIP_IGMP to enable IGMP processing. Based on only one - filter per all network interfaces. Declare a new function in netif to enable to - control the MAC filter (to reduce lwIP traffic processing). - - 2007-03-11 Frédéric Bernon - * tcp.h, tcp.c, sockets.c, tcp_out.c, tcp_in.c, opt.h: Keepalive values can - be configured at run time with LWIP_TCP_KEEPALIVE, but don't change this - unless you know what you're doing (default are RFC1122 compliant). Note - that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set in seconds. - - 2007-03-08 Frédéric Bernon - * tcp.h: Keepalive values can be configured at compile time, but don't change - this unless you know what you're doing (default are RFC1122 compliant). - - 2007-03-08 Frédéric Bernon - * sockets.c, api.h, api_lib.c, tcpip.c, sys.h, sys.c, err.c, opt.h: - Implement LWIP_SO_RCVTIMEO configuration option to enable/disable SO_RCVTIMEO - on UDP sockets/netconn. - - 2007-03-08 Simon Goldschmidt - * snmp_msg.h, msg_in.c: SNMP UDP ports can be configured at compile time. - - 2007-03-06 Frédéric Bernon - * api.h, api_lib.c, sockets.h, sockets.c, tcpip.c, sys.h, sys.c, err.h: - Implement SO_RCVTIMEO on UDP sockets/netconn. - - 2007-02-28 Kieran Mansley (based on patch from Simon Goldschmidt) - * api_lib.c, tcpip.c, memp.c, memp.h: make API msg structs allocated - on the stack and remove the API msg type from memp - - 2007-02-26 Jonathan Larmour (based on patch from Simon Goldschmidt) - * sockets.h, sockets.c: Move socket initialization to new - lwip_socket_init() function. - NOTE: this changes the API with ports. Ports will have to be - updated to call lwip_socket_init() now. - - 2007-02-26 Jonathan Larmour (based on patch from Simon Goldschmidt) - * api_lib.c: Use memcpy in netbuf_copy_partial. - - - ++ Bug fixes: - - 2008-03-17 Frédéric Bernon, Ed Kerekes - * igmp.h, igmp.c: Fix bug #22613 "IGMP iphdr problem" (could have - some problems to fill the IP header on some targets, use now the - ip.h macros to do it). - - 2008-03-13 Frédéric Bernon - * sockets.c: Fix bug #22435 "lwip_recvfrom with TCP break;". Using - (lwip_)recvfrom with valid "from" and "fromlen" parameters, on a - TCP connection caused a crash. Note that using (lwip_)recvfrom - like this is a bit slow and that using (lwip)getpeername is the - good lwip way to do it (so, using recv is faster on tcp sockets). - - 2008-03-12 Frédéric Bernon, Jonathan Larmour - * api_msg.c, contrib/apps/ping.c: Fix bug #22530 "api_msg.c's - recv_raw() does not consume data", and the ping sample (with - LWIP_SOCKET=1, the code did the wrong supposition that lwip_recvfrom - returned the IP payload, without the IP header). - - 2008-03-04 Jonathan Larmour - * mem.c, stats.c, mem.h: apply patch #6414 to avoid compiler errors - and/or warnings on some systems where mem_size_t and size_t differ. - * pbuf.c, ppp.c: Fix warnings on some systems with mem_malloc. - - 2008-03-04 Kieran Mansley (contributions by others) - * Numerous small compiler error/warning fixes from contributions to - mailing list after 1.3.0 release candidate made. - - 2008-01-25 Cui hengbin (integrated by Frédéric Bernon) - * dns.c: Fix bug #22108 "DNS problem" caused by unaligned structures. - - 2008-01-15 Kieran Mansley - * tcp_out.c: BUG20511. Modify persist timer to start when we are - prevented from sending by a small send window, not just a zero - send window. - - 2008-01-09 Jonathan Larmour - * opt.h, ip.c: Rename IP_OPTIONS define to IP_OPTIONS_ALLOWED to avoid - conflict with Linux system headers. - - 2008-01-06 Jonathan Larmour - * dhcp.c: fix bug #19927: "DHCP NACK problem" by clearing any existing set IP - address entirely on receiving a DHCPNAK, and restarting discovery. - - 2007-12-21 Simon Goldschmidt - * sys.h, api_lib.c, api_msg.c, sockets.c: fix bug #21698: "netconn->recv_avail - is not protected" by using new macros for interlocked access to modify/test - netconn->recv_avail. - - 2007-12-20 Kieran Mansley (based on patch from Oleg Tyshev) - * tcp_in.c: fix bug# 21535 (nrtx not reset correctly in SYN_SENT state) - - 2007-12-20 Kieran Mansley (based on patch from Per-Henrik Lundbolm) - * tcp.c, tcp_in.c, tcp_out.c, tcp.h: fix bug #20199 (better handling - of silly window avoidance and prevent lwIP from shrinking the window) - - 2007-12-04 Simon Goldschmidt - * tcp.c, tcp_in.c: fix bug #21699 (segment leak in ooseq processing when last - data packet was lost): add assert that all segment lists are empty in - tcp_pcb_remove before setting pcb to CLOSED state; don't directly set CLOSED - state from LAST_ACK in tcp_process - - 2007-12-02 Simon Goldschmidt - * sockets.h: fix bug #21654: exclude definition of struct timeval from #ifndef FD_SET - If including <sys/time.h> for system-struct timeval, LWIP_TIMEVAL_PRIVATE now - has to be set to 0 in lwipopts.h - - 2007-12-02 Simon Goldschmidt - * api_msg.c, api_lib.c: fix bug #21656 (recvmbox problem in netconn API): always - allocate a recvmbox in netconn_new_with_proto_and_callback. For a tcp-listen - netconn, this recvmbox is later freed and a new mbox is allocated for acceptmbox. - This is a fix for thread-safety and allocates all items needed for a netconn - when the netconn is created. - - 2007-11-30 Simon Goldschmidt - * udp.c: first attempt to fix bug #21655 (DHCP doesn't work reliably with multiple - netifs): if LWIP_DHCP is enabled, UDP packets to DHCP_CLIENT_PORT are passed - to netif->dhcp->pcb only (if that exists) and not to any other pcb for the same - port (only solution to let UDP pcbs 'bind' to a netif instead of an IP address) - - 2007-11-27 Simon Goldschmidt - * ip.c: fixed bug #21643 (udp_send/raw_send don't fail if netif is down) by - letting ip_route only use netifs that are up. - - 2007-11-27 Simon Goldschmidt - * err.h, api_lib.c, api_msg.c, sockets.c: Changed error handling: ERR_MEM, ERR_BUF - and ERR_RTE are seen as non-fatal, all other errors are fatal. netconns and - sockets block most operations once they have seen a fatal error. - - 2007-11-27 Simon Goldschmidt - * udp.h, udp.c, dhcp.c: Implemented new function udp_sendto_if which takes the - netif to send as an argument (to be able to send on netifs that are down). - - 2007-11-26 Simon Goldschmidt - * tcp_in.c: Fixed bug #21582: pcb->acked accounting can be wrong when ACKs - arrive out-of-order - - 2007-11-21 Simon Goldschmidt - * tcp.h, tcp_out.c, api_msg.c: Fixed bug #20287: tcp_output_nagle sends too early - Fixed the nagle algorithm; nagle now also works for all raw API applications - and has to be explicitly disabled with 'tcp_pcb->flags |= TF_NODELAY' - - 2007-11-12 Frédéric Bernon - * sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fixed bug #20900. Now, most - of the netconn_peer and netconn_addr processing is done inside tcpip_thread - context in do_getaddr. - - 2007-11-10 Simon Goldschmidt - * etharp.c: Fixed bug: assert fired when MEMP_ARP_QUEUE was empty (which can - happen any time). Now the packet simply isn't enqueued when out of memory. - - 2007-11-01 Simon Goldschmidt - * tcp.c, tcp_in.c: Fixed bug #21494: The send mss (pcb->mss) is set to 536 (or - TCP_MSS if that is smaller) as long as no MSS option is received from the - remote host. - - 2007-11-01 Simon Goldschmidt - * tcp.h, tcp.c, tcp_in.c: Fixed bug #21491: The MSS option sent (with SYN) - is now based on TCP_MSS instead of pcb->mss (on passive open now effectively - sending our configured TCP_MSS instead of the one received). - - 2007-11-01 Simon Goldschmidt - * tcp_in.c: Fixed bug #21181: On active open, the initial congestion window was - calculated based on the configured TCP_MSS, not on the MSS option received - with SYN+ACK. - - 2007-10-09 Simon Goldschmidt - * udp.c, inet.c, inet.h: Fixed UDPLite: send: Checksum was always generated too - short and also was generated wrong if checksum coverage != tot_len; - receive: checksum was calculated wrong if checksum coverage != tot_len - - 2007-10-08 Simon Goldschmidt - * mem.c: lfree was not updated in mem_realloc! - - 2007-10-07 Frédéric Bernon - * sockets.c, api.h, api_lib.c: First step to fix "bug #20900 : Potential - crash error problem with netconn_peer & netconn_addr". VERY IMPORTANT: - this change cause an API breakage for netconn_addr, since a parameter - type change. Any compiler should cause an error without any changes in - yours netconn_peer calls (so, it can't be a "silent change"). It also - reduce a little bit the footprint for socket layer (lwip_getpeername & - lwip_getsockname use now a common lwip_getaddrname function since - netconn_peer & netconn_addr have the same parameters). - - 2007-09-20 Simon Goldschmidt - * tcp.c: Fixed bug #21080 (tcp_bind without check pcbs in TIME_WAIT state) - by checking tcp_tw_pcbs also - - 2007-09-19 Simon Goldschmidt - * icmp.c: Fixed bug #21107 (didn't reset IP TTL in ICMP echo replies) - - 2007-09-15 Mike Kleshov - * mem.c: Fixed bug #21077 (inaccuracy in calculation of lwip_stat.mem.used) - - 2007-09-06 Frédéric Bernon - * several-files: replace some #include "arch/cc.h" by "lwip/arch.h", or simply remove - it as long as "lwip/opt.h" is included before (this one include "lwip/debug.h" which - already include "lwip/arch.h"). Like that, default defines are provided by "lwip/arch.h" - if they are not defined in cc.h, in the same spirit than "lwip/opt.h" for lwipopts.h. - - 2007-08-30 Frédéric Bernon - * igmp.h, igmp.c: Some changes to remove some redundant code, add some traces, - and fix some coding style. - - 2007-08-28 Frédéric Bernon - * tcpip.c: Fix TCPIP_MSG_INPKT processing: now, tcpip_input can be used for any - kind of packets. These packets are considered like Ethernet packets (payload - pointing to ethhdr) if the netif got the NETIF_FLAG_ETHARP flag. Else, packets - are considered like IP packets (payload pointing to iphdr). - - 2007-08-27 Frédéric Bernon - * api.h, api_lib.c, api_msg.c: First fix for "bug #20900 : Potential crash error - problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state - and remove obsolete ones (NETCONN_RECV & NETCONN_ACCEPT). - - 2007-08-24 Kieran Mansley - * inet.c Modify (acc >> 16) test to ((acc >> 16) != 0) to help buggy - compiler (Paradigm C++) - - 2007-08-09 Frédéric Bernon, Bill Florac - * stats.h, stats.c, igmp.h, igmp.c, opt.h: Fix for bug #20503 : IGMP Improvement. - Introduce IGMP_STATS to centralize statistics management. - - 2007-08-09 Frédéric Bernon, Bill Florac - * udp.c: Fix for bug #20503 : IGMP Improvement. Enable to receive a multicast - packet on a udp pcb binded on an netif's IP address, and not on "any". - - 2007-08-09 Frédéric Bernon, Bill Florac - * igmp.h, igmp.c, ip.c: Fix minor changes from bug #20503 : IGMP Improvement. - This is mainly on using lookup/lookfor, and some coding styles... - - 2007-07-26 Frédéric Bernon (and "thedoctor") - * igmp.c: Fix bug #20595 to accept IGMPv3 "Query" messages. - - 2007-07-25 Simon Goldschmidt - * api_msg.c, tcp.c: Another fix for bug #20021: by not returning an error if - tcp_output fails in tcp_close, the code in do_close_internal gets simpler - (tcp_output is called again later from tcp timers). - - 2007-07-25 Simon Goldschmidt - * ip_frag.c: Fixed bug #20429: use the new pbuf_copy_partial instead of the old - copy_from_pbuf, which illegally modified the given pbuf. - - 2007-07-25 Simon Goldschmidt - * tcp_out.c: tcp_enqueue: pcb->snd_queuelen didn't work for chaine PBUF_RAMs: - changed snd_queuelen++ to snd_queuelen += pbuf_clen(p). - - 2007-07-24 Simon Goldschmidt - * api_msg.c, tcp.c: Fix bug #20480: Check the pcb passed to tcp_listen() for the - correct state (must be CLOSED). - - 2007-07-13 Thomas Taranowski (commited by Jared Grubb) - * memp.c: Fix bug #20478: memp_malloc returned NULL+MEMP_SIZE on failed - allocation. It now returns NULL. - - 2007-07-13 Frédéric Bernon - * api_msg.c: Fix bug #20318: api_msg "recv" callbacks don't call pbuf_free in - all error cases. - - 2007-07-13 Frédéric Bernon - * api_msg.c: Fix bug #20315: possible memory leak problem if tcp_listen failed, - because current code doesn't follow rawapi.txt documentation. - - 2007-07-13 Kieran Mansley - * src/core/tcp_in.c Apply patch#5741 from Oleg Tyshev to fix bug in - out of sequence processing of received packets - - 2007-07-03 Simon Goldschmidt - * nearly-all-files: Added assertions where PBUF_RAM pbufs are used and an - assumption is made that this pbuf is in one piece (i.e. not chained). These - assumptions clash with the possibility of converting to fully pool-based - pbuf implementations, where PBUF_RAM pbufs might be chained. - - 2007-07-03 Simon Goldschmidt - * api.h, api_lib.c, api_msg.c: Final fix for bug #20021 and some other problems - when closing tcp netconns: removed conn->sem, less context switches when - closing, both netconn_close and netconn_delete should safely close tcp - connections. - - 2007-07-02 Simon Goldschmidt - * ipv4/ip.h, ipv6/ip.h, opt.h, netif.h, etharp.h, ipv4/ip.c, netif.c, raw.c, - tcp_out.c, udp.c, etharp.c: Added option LWIP_NETIF_HWADDRHINT (default=off) - to cache ARP table indices with each pcb instead of single-entry cache for - the complete stack. - - 2007-07-02 Simon Goldschmidt - * tcp.h, tcp.c, tcp_in.c, tcp_out.c: Added some ASSERTS and casts to prevent - warnings when assigning to smaller types. - - 2007-06-28 Simon Goldschmidt - * tcp_out.c: Added check to prevent tcp_pcb->snd_queuelen from overflowing. - - 2007-06-28 Simon Goldschmidt - * tcp.h: Fixed bug #20287: Fixed nagle algorithm (sending was done too early if - a segment contained chained pbufs) - - 2007-06-28 Frédéric Bernon - * autoip.c: replace most of rand() calls by a macro LWIP_AUTOIP_RAND which compute - a "pseudo-random" value based on netif's MAC and some autoip fields. It's always - possible to define this macro in your own lwipopts.h to always use C library's - rand(). Note that autoip_create_rand_addr doesn't use this macro. - - 2007-06-28 Frédéric Bernon - * netifapi.h, netifapi.c, tcpip.h, tcpip.c: Update code to handle the option - LWIP_TCPIP_CORE_LOCKING, and do some changes to be coherent with last modifications - in api_lib/api_msg (use pointers and not type with table, etc...) - - 2007-06-26 Simon Goldschmidt - * udp.h: Fixed bug #20259: struct udp_hdr was lacking the packin defines. - - 2007-06-25 Simon Goldschmidt - * udp.c: Fixed bug #20253: icmp_dest_unreach was called with a wrong p->payload - for udp packets with no matching pcb. - - 2007-06-25 Simon Goldschmidt - * udp.c: Fixed bug #20220: UDP PCB search in udp_input(): a non-local match - could get udp input packets if the remote side matched. - - 2007-06-13 Simon Goldschmidt - * netif.c: Fixed bug #20180 (TCP pcbs listening on IP_ADDR_ANY could get - changed in netif_set_ipaddr if previous netif->ip_addr.addr was 0. - - 2007-06-13 Simon Goldschmidt - * api_msg.c: pcb_new sets conn->err if protocol is not implemented - -> netconn_new_..() does not allocate a new connection for unsupported - protocols. - - 2007-06-13 Frédéric Bernon, Simon Goldschmidt - * api_lib.c: change return expression in netconn_addr and netconn_peer, because - conn->err was reset to ERR_OK without any reasons (and error was lost)... - - 2007-06-13 Frédéric Bernon, Matthias Weisser - * opt.h, mem.h, mem.c, memp.c, pbuf.c, ip_frag.c, vj.c: Fix bug #20162. Rename - MEM_ALIGN in LWIP_MEM_ALIGN and MEM_ALIGN_SIZE in LWIP_MEM_ALIGN_SIZE to avoid - some macro names collision with some OS macros. - - 2007-06-11 Simon Goldschmidt - * udp.c: UDP Lite: corrected the use of chksum_len (based on RFC3828: if it's 0, - create checksum over the complete packet. On RX, if it's < 8 (and not 0), - discard the packet. Also removed the duplicate 'udphdr->chksum = 0' for both - UDP & UDP Lite. - - 2007-06-11 Srinivas Gollakota & Oleg Tyshev - * tcp_out.c: Fix for bug #20075 : "A problem with keep-alive timer and TCP flags" - where TCP flags wasn't initialized in tcp_keepalive. - - 2007-06-03 Simon Goldschmidt - * udp.c: udp_input(): Input pbuf was not freed if pcb had no recv function - registered, p->payload was modified without modifying p->len if sending - icmp_dest_unreach() (had no negative effect but was definitively wrong). - - 2007-06-03 Simon Goldschmidt - * icmp.c: Corrected bug #19937: For responding to an icmp echo request, icmp - re-used the input pbuf even if that didn't have enough space to include the - link headers. Now the space is tested and a new pbuf is allocated for the - echo response packet if the echo request pbuf isn't big enough. - - 2007-06-01 Simon Goldschmidt - * sockets.c: Checked in patch #5914: Moved sockopt processing into tcpip_thread. - - 2007-05-23 Frédéric Bernon - * api_lib.c, sockets.c: Fixed bug #5958 for netconn_listen (acceptmbox only - allocated by do_listen if success) and netconn_accept errors handling. In - most of api_lib functions, we replace some errors checkings like "if (conn==NULL)" - by ASSERT, except for netconn_delete. - - 2007-05-23 Frédéric Bernon - * api_lib.c: Fixed bug #5957 "Safe-thread problem inside netconn_recv" to return - an error code if it's impossible to fetch a pbuf on a TCP connection (and not - directly close the recvmbox). - - 2007-05-22 Simon Goldschmidt - * tcp.c: Fixed bug #1895 (tcp_bind not correct) by introducing a list of - bound but unconnected (and non-listening) tcp_pcbs. - - 2007-05-22 Frédéric Bernon - * sys.h, sys.c, api_lib.c, tcpip.c: remove sys_mbox_fetch_timeout() (was only - used for LWIP_SO_RCVTIMEO option) and use sys_arch_mbox_fetch() instead of - sys_mbox_fetch() in api files. Now, users SHOULD NOT use internal lwIP features - like "sys_timeout" in their application threads. - - 2007-05-22 Frédéric Bernon - * api.h, api_lib.c, api_msg.h, api_msg.c: change the struct api_msg_msg to see - which parameters are used by which do_xxx function, and to avoid "misusing" - parameters (patch #5938). - - 2007-05-22 Simon Goldschmidt - * api_lib.c, api_msg.c, raw.c, api.h, api_msg.h, raw.h: Included patch #5938: - changed raw_pcb.protocol from u16_t to u8_t since for IPv4 and IPv6, proto - is only 8 bits wide. This affects the api, as there, the protocol was - u16_t, too. - - 2007-05-18 Simon Goldschmidt - * memp.c: addition to patch #5913: smaller pointer was returned but - memp_memory was the same size -> did not save memory. - - 2007-05-16 Simon Goldschmidt - * loopif.c, slipif.c: Fix bug #19729: free pbuf if netif->input() returns - != ERR_OK. - - 2007-05-16 Simon Goldschmidt - * api_msg.c, udp.c: If a udp_pcb has a local_ip set, check if it is the same - as the one of the netif used for sending to prevent sending from old - addresses after a netif address gets changed (partly fixes bug #3168). - - 2007-05-16 Frédéric Bernon - * tcpip.c, igmp.h, igmp.c: Fixed bug "#19800 : IGMP: igmp_tick() will not work - with NO_SYS=1". Note that igmp_init is always in tcpip_thread (and not in - tcpip_init) because we have to be sure that network interfaces are already - added (mac filter is updated only in igmp_init for the moment). - - 2007-05-16 Simon Goldschmidt - * mem.c, memp.c: Removed semaphores from memp, changed sys_sem_wait calls - into sys_arch_sem_wait calls to prevent timers from running while waiting - for the heap. This fixes bug #19167. - - 2007-05-13 Simon Goldschmidt - * tcp.h, sockets.h, sockets.c: Fixed bug from patch #5865 by moving the defines - for socket options (lwip_set/-getsockopt) used with level IPPROTO_TCP from - tcp.h to sockets.h. - - 2007-05-07 Simon Goldschmidt - * mem.c: Another attempt to fix bug #17922. - - 2007-05-04 Simon Goldschmidt - * pbuf.c, pbuf.h, etharp.c: Further update to ARP queueing: Changed pbuf_copy() - implementation so that it can be reused (don't allocate the target - pbuf inside pbuf_copy()). - - 2007-05-04 Simon Goldschmidt - * memp.c: checked in patch #5913: in memp_malloc() we can return memp as mem - to save a little RAM (next pointer of memp is not used while not in pool). - - 2007-05-03 "maq" - * sockets.c: Fix ioctl FIONREAD when some data remains from last recv. - (patch #3574). - - 2007-04-23 Simon Goldschmidt - * loopif.c, loopif.h, opt.h, src/netif/FILES: fix bug #2595: "loopif results - in NULL reference for incoming TCP packets". Loopif has to be configured - (using LWIP_LOOPIF_MULTITHREADING) to directly call netif->input() - (multithreading environments, e.g. netif->input() = tcpip_input()) or - putting packets on a list that is fed to the stack by calling loopif_poll() - (single-thread / NO_SYS / polling environment where e.g. - netif->input() = ip_input). - - 2007-04-17 Jonathan Larmour - * pbuf.c: Use s32_t in pbuf_realloc(), as an s16_t can't reliably hold - the difference between two u16_t's. - * sockets.h: FD_SETSIZE needs to match number of sockets, which is - MEMP_NUM_NETCONN in sockets.c right now. - - 2007-04-12 Jonathan Larmour - * icmp.c: Reset IP header TTL in ICMP ECHO responses (bug #19580). - - 2007-04-12 Kieran Mansley - * tcp.c, tcp_in.c, tcp_out.c, tcp.h: Modify way the retransmission - timer is reset to fix bug#19434, with help from Oleg Tyshev. - - 2007-04-11 Simon Goldschmidt - * etharp.c, pbuf.c, pbuf.h: 3rd fix for bug #11400 (arp-queuing): More pbufs than - previously thought need to be copied (everything but PBUF_ROM!). Cleaned up - pbuf.c: removed functions no needed any more (by etharp). - - 2007-04-11 Kieran Mansley - * inet.c, ip_addr.h, sockets.h, sys.h, tcp.h: Apply patch #5745: Fix - "Constant is long" warnings with 16bit compilers. Contributed by - avatar@mmlab.cse.yzu.edu.tw - - 2007-04-05 Frédéric Bernon, Jonathan Larmour - * api_msg.c: Fix bug #16830: "err_tcp() posts to connection mailbox when no pend on - the mailbox is active". Now, the post is only done during a connect, and do_send, - do_write and do_join_leave_group don't do anything if a previous error was signaled. - - 2007-04-03 Frédéric Bernon - * ip.c: Don't set the IP_DF ("Don't fragment") flag in the IP header in IP output - packets. See patch #5834. - - 2007-03-30 Frédéric Bernon - * api_msg.c: add a "pcb_new" helper function to avoid redundant code, and to add - missing pcb allocations checking (in do_bind, and for each raw_new). Fix style. - - 2007-03-30 Frédéric Bernon - * most of files: prefix all debug.h define with "LWIP_" to avoid any conflict with - others environment defines (these were too "generic"). - - 2007-03-28 Frédéric Bernon - * api.h, api_lib.c, sockets.c: netbuf_ref doesn't check its internal pbuf_alloc call - result and can cause a crash. lwip_send now check netbuf_ref result. - - 2007-03-28 Simon Goldschmidt - * sockets.c Remove "#include <errno.h>" from sockets.c to avoid multiple - definition of macros (in errno.h and lwip/arch.h) if LWIP_PROVIDE_ERRNO is - defined. This is the way it should have been already (looking at - doc/sys_arch.txt) - - 2007-03-28 Kieran Mansley - * opt.h Change default PBUF_POOL_BUFSIZE (again) to accomodate default MSS + - IP and TCP headers *and* physical link headers - - 2007-03-26 Frédéric Bernon (based on patch from Dmitry Potapov) - * api_lib.c: patch for netconn_write(), fixes a possible race condition which cause - to send some garbage. It is not a definitive solution, but the patch does solve - the problem for most cases. - - 2007-03-22 Frédéric Bernon - * api_msg.h, api_msg.c: Remove obsolete API_MSG_ACCEPT and do_accept (never used). - - 2007-03-22 Frédéric Bernon - * api_lib.c: somes resources couldn't be freed if there was errors during - netconn_new_with_proto_and_callback. - - 2007-03-22 Frédéric Bernon - * ethernetif.c: update netif->input calls to check return value. In older ports, - it's a good idea to upgrade them, even if before, there could be another problem - (access to an uninitialized mailbox). - - 2007-03-21 Simon Goldschmidt - * sockets.c: fixed bug #5067 (essentialy a signed/unsigned warning fixed - by casting to unsigned). - - 2007-03-21 Frédéric Bernon - * api_lib.c, api_msg.c, tcpip.c: integrate sys_mbox_fetch(conn->mbox, NULL) calls from - api_lib.c to tcpip.c's tcpip_apimsg(). Now, use a local variable and not a - dynamic one from memp to send tcpip_msg to tcpip_thread in a synchrone call. - Free tcpip_msg from tcpip_apimsg is not done in tcpip_thread. This give a - faster and more reliable communication between api_lib and tcpip. - - 2007-03-21 Frédéric Bernon - * opt.h: Add LWIP_NETIF_CALLBACK (to avoid compiler warning) and set it to 0. - - 2007-03-21 Frédéric Bernon - * api_msg.c, igmp.c, igmp.h: Fix C++ style comments - - 2007-03-21 Kieran Mansley - * opt.h Change default PBUF_POOL_BUFSIZE to accomodate default MSS + - IP and TCP headers - - 2007-03-21 Kieran Mansley - * Fix all uses of pbuf_header to check the return value. In some - cases just assert if it fails as I'm not sure how to fix them, but - this is no worse than before when they would carry on regardless - of the failure. - - 2007-03-21 Kieran Mansley - * sockets.c, igmp.c, igmp.h, memp.h: Fix C++ style comments and - comment out missing header include in icmp.c - - 2007-03-20 Frédéric Bernon - * memp.h, stats.c: Fix stats_display function where memp_names table wasn't - synchronized with memp.h. - - 2007-03-20 Frédéric Bernon - * tcpip.c: Initialize tcpip's mbox, and verify if initialized in tcpip_input, - tcpip_ethinput, tcpip_callback, tcpip_apimsg, to fix a init problem with - network interfaces. Also fix a compiler warning. - - 2007-03-20 Kieran Mansley - * udp.c: Only try and use pbuf_header() to make space for headers if - not a ROM or REF pbuf. - - 2007-03-19 Frédéric Bernon - * api_msg.h, api_msg.c, tcpip.h, tcpip.c: Add return types to tcpip_apimsg() - and api_msg_post(). - - 2007-03-19 Frédéric Bernon - * Remove unimplemented "memp_realloc" function from memp.h. - - 2007-03-11 Simon Goldschmidt - * pbuf.c: checked in patch #5796: pbuf_alloc: len field claculation caused - memory corruption. - - 2007-03-11 Simon Goldschmidt (based on patch from Dmitry Potapov) - * api_lib.c, sockets.c, api.h, api_msg.h, sockets.h: Fixed bug #19251 - (missing `const' qualifier in socket functions), to get more compatible to - standard POSIX sockets. - - 2007-03-11 Frédéric Bernon (based on patch from Dmitry Potapov) - * sockets.c: Add asserts inside bind, connect and sendto to check input - parameters. Remove excessive set_errno() calls after get_socket(), because - errno is set inside of get_socket(). Move last sock_set_errno() inside - lwip_close. - - 2007-03-09 Simon Goldschmidt - * memp.c: Fixed bug #11400: New etharp queueing introduced bug: memp_memory - was allocated too small. - - 2007-03-06 Simon Goldschmidt - * tcpip.c: Initialize dhcp timers in tcpip_thread (if LWIP_DHCP) to protect - the stack from concurrent access. - - 2007-03-06 Frédéric Bernon, Dmitry Potapov - * tcpip.c, ip_frag.c, ethernetif.c: Fix some build problems, and a redundancy - call to "lwip_stats.link.recv++;" in low_level_input() & ethernetif_input(). - - 2007-03-06 Simon Goldschmidt - * ip_frag.c, ip_frag.h: Reduce code size: don't include code in those files - if IP_FRAG == 0 and IP_REASSEMBLY == 0 - - 2007-03-06 Frédéric Bernon, Simon Goldschmidt - * opt.h, ip_frag.h, tcpip.h, tcpip.c, ethernetif.c: add new configuration - option named ETHARP_TCPIP_ETHINPUT, which enable the new tcpip_ethinput. - Allow to do ARP processing for incoming packets inside tcpip_thread - (protecting ARP layer against concurrent access). You can also disable - old code using tcp_input with new define ETHARP_TCPIP_INPUT set to 0. - Older ports have to use tcpip_ethinput. - - 2007-03-06 Simon Goldschmidt (based on patch from Dmitry Potapov) - * err.h, err.c: fixed compiler warning "initialization dircards qualifiers - from pointer target type" - - 2007-03-05 Frédéric Bernon - * opt.h, sockets.h: add new configuration options (LWIP_POSIX_SOCKETS_IO_NAMES, - ETHARP_TRUST_IP_MAC, review SO_REUSE) - - 2007-03-04 Frédéric Bernon - * api_msg.c: Remove some compiler warnings : parameter "pcb" was never - referenced. - - 2007-03-04 Frédéric Bernon - * api_lib.c: Fix "[patch #5764] api_lib.c cleanup: after patch #5687" (from - Dmitry Potapov). - The api_msg struct stay on the stack (not moved to netconn struct). - - 2007-03-04 Simon Goldschmidt (based on patch from Dmitry Potapov) - * pbuf.c: Fix BUG#19168 - pbuf_free can cause deadlock (if - SYS_LIGHTWEIGHT_PROT=1 & freeing PBUF_RAM when mem_sem is not available) - Also fixed cast warning in pbuf_alloc() - - 2007-03-04 Simon Goldschmidt - * etharp.c, etharp.h, memp.c, memp.h, opt.h: Fix BUG#11400 - don't corrupt - existing pbuf chain when enqueuing multiple pbufs to a pending ARP request - - 2007-03-03 Frédéric Bernon - * udp.c: remove obsolete line "static struct udp_pcb *pcb_cache = NULL;" - It is static, and never used in udp.c except udp_init(). - - 2007-03-02 Simon Goldschmidt - * tcpip.c: Moved call to ip_init(), udp_init() and tcp_init() from - tcpip_thread() to tcpip_init(). This way, raw API connections can be - initialized before tcpip_thread is running (e.g. before OS is started) - - 2007-03-02 Frédéric Bernon - * rawapi.txt: Fix documentation mismatch with etharp.h about etharp_tmr's call - interval. - - 2007-02-28 Kieran Mansley - * pbuf.c: Fix BUG#17645 - ensure pbuf payload pointer is not moved - outside the region of the pbuf by pbuf_header() - - 2007-02-28 Kieran Mansley - * sockets.c: Fix BUG#19161 - ensure milliseconds timeout is non-zero - when supplied timeout is also non-zero - -(STABLE-1.2.0) - - 2006-12-05 Leon Woestenberg - * CHANGELOG: Mention STABLE-1.2.0 release. - - ++ New features: - - 2006-12-01 Christiaan Simons - * mem.h, opt.h: Added MEM_LIBC_MALLOC option. - Note this is a workaround. Currently I have no other options left. - - 2006-10-26 Christiaan Simons (accepted patch by Jonathan Larmour) - * ipv4/ip_frag.c: rename MAX_MTU to IP_FRAG_MAX_MTU and move define - to include/lwip/opt.h. - * ipv4/lwip/ip_frag.h: Remove unused IP_REASS_INTERVAL. - Move IP_REASS_MAXAGE and IP_REASS_BUFSIZE to include/lwip/opt.h. - * opt.h: Add above new options. - - 2006-08-18 Christiaan Simons - * tcp_{in,out}.c: added SNMP counters. - * ipv4/ip.c: added SNMP counters. - * ipv4/ip_frag.c: added SNMP counters. - - 2006-08-08 Christiaan Simons - * etharp.{c,h}: added etharp_find_addr() to read - (stable) ethernet/IP address pair from ARP table - - 2006-07-14 Christiaan Simons - * mib_structs.c: added - * include/lwip/snmp_structs.h: added - * netif.{c,h}, netif/ethernetif.c: added SNMP statistics to netif struct - - 2006-07-06 Christiaan Simons - * snmp/asn1_{enc,dec}.c added - * snmp/mib2.c added - * snmp/msg_{in,out}.c added - * include/lwip/snmp_asn1.h added - * include/lwip/snmp_msg.h added - * doc/snmp_agent.txt added - - 2006-03-29 Christiaan Simons - * inet.c, inet.h: Added platform byteswap support. - Added LWIP_PLATFORM_BYTESWAP define (defaults to 0) and - optional LWIP_PLATFORM_HTONS(), LWIP_PLATFORM_HTONL() macros. - - ++ Bug fixes: - - 2006-11-30 Christiaan Simons - * dhcp.c: Fixed false triggers of request_timeout. - - 2006-11-28 Christiaan Simons - * netif.c: In netif_add() fixed missing clear of ip_addr, netmask, gw and flags. - - 2006-10-11 Christiaan Simons - * api_lib.c etharp.c, ip.c, memp.c, stats.c, sys.{c,h} tcp.h: - Partially accepted patch #5449 for ANSI C compatibility / build fixes. - * ipv4/lwip/ip.h ipv6/lwip/ip.h: Corrected UDP-Lite protocol - identifier from 170 to 136 (bug #17574). - - 2006-10-10 Christiaan Simons - * api_msg.c: Fixed Nagle algorithm as reported by Bob Grice. - - 2006-08-17 Christiaan Simons - * udp.c: Fixed bug #17200, added check for broadcast - destinations for PCBs bound to a unicast address. - - 2006-08-07 Christiaan Simons - * api_msg.c: Flushing TCP output in do_close() (bug #15926). - - 2006-06-27 Christiaan Simons - * api_msg.c: Applied patch for cold case (bug #11135). - In accept_function() ensure newconn->callback is always initialized. - - 2006-06-15 Christiaan Simons - * mem.h: added MEM_SIZE_F alias to fix an ancient cold case (bug #1748), - facilitate printing of mem_size_t and u16_t statistics. - - 2006-06-14 Christiaan Simons - * api_msg.c: Applied patch #5146 to handle allocation failures - in accept() by Kevin Lawson. - - 2006-05-26 Christiaan Simons - * api_lib.c: Removed conn->sem creation and destruction - from netconn_write() and added sys_sem_new to netconn_new_*. - -(STABLE-1_1_1) - - 2006-03-03 Christiaan Simons - * ipv4/ip_frag.c: Added bound-checking assertions on ip_reassbitmap - access and added pbuf_alloc() return value checks. - - 2006-01-01 Leon Woestenberg <leon.woestenberg@gmx.net> - * tcp_{in,out}.c, tcp_out.c: Removed 'even sndbuf' fix in TCP, which is - now handled by the checksum routine properly. - - 2006-02-27 Leon Woestenberg <leon.woestenberg@gmx.net> - * pbuf.c: Fix alignment; pbuf_init() would not work unless - pbuf_pool_memory[] was properly aligned. (Patch by Curt McDowell.) - - 2005-12-20 Leon Woestenberg <leon.woestenberg@gmx.net> - * tcp.c: Remove PCBs which stay in LAST_ACK state too long. Patch - submitted by Mitrani Hiroshi. - - 2005-12-15 Christiaan Simons - * inet.c: Disabled the added summing routine to preserve code space. - - 2005-12-14 Leon Woestenberg <leon.woestenberg@gmx.net> - * tcp_in.c: Duplicate FIN ACK race condition fix by Kelvin Lawson. - Added Curt McDowell's optimized checksumming routine for future - inclusion. Need to create test case for unaliged, aligned, odd, - even length combination of cases on various endianess machines. - - 2005-12-09 Christiaan Simons - * inet.c: Rewrote standard checksum routine in proper portable C. - - 2005-11-25 Christiaan Simons - * udp.c tcp.c: Removed SO_REUSE hack. Should reside in socket code only. - * *.c: introduced cc.h LWIP_DEBUG formatters matching the u16_t, s16_t, - u32_t, s32_t typedefs. This solves most debug word-length assumes. - - 2005-07-17 Leon Woestenberg <leon.woestenberg@gmx.net> - * inet.c: Fixed unaligned 16-bit access in the standard checksum - routine by Peter Jolasson. - * slipif.c: Fixed implementation assumption of single-pbuf datagrams. - - 2005-02-04 Leon Woestenberg <leon.woestenberg@gmx.net> - * tcp_out.c: Fixed uninitialized 'queue' referenced in memerr branch. - * tcp_{out|in}.c: Applied patch fixing unaligned access. - - 2005-01-04 Leon Woestenberg <leon.woestenberg@gmx.net> - * pbuf.c: Fixed missing semicolon after LWIP_DEBUG statement. - - 2005-01-03 Leon Woestenberg <leon.woestenberg@gmx.net> - * udp.c: UDP pcb->recv() was called even when it was NULL. - -(STABLE-1_1_0) - - 2004-12-28 Leon Woestenberg <leon.woestenberg@gmx.net> - * etharp.*: Disabled multiple packets on the ARP queue. - This clashes with TCP queueing. - - 2004-11-28 Leon Woestenberg <leon.woestenberg@gmx.net> - * etharp.*: Fixed race condition from ARP request to ARP timeout. - Halved the ARP period, doubled the period counts. - ETHARP_MAX_PENDING now should be at least 2. This prevents - the counter from reaching 0 right away (which would allow - too little time for ARP responses to be received). - - 2004-11-25 Leon Woestenberg <leon.woestenberg@gmx.net> - * dhcp.c: Decline messages were not multicast but unicast. - * etharp.c: ETHARP_CREATE is renamed to ETHARP_TRY_HARD. - Do not try hard to insert arbitrary packet's source address, - etharp_ip_input() now calls etharp_update() without ETHARP_TRY_HARD. - etharp_query() now always DOES call ETHARP_TRY_HARD so that users - querying an address will see it appear in the cache (DHCP could - suffer from this when a server invalidly gave an in-use address.) - * ipv4/ip_addr.h: Renamed ip_addr_maskcmp() to _netcmp() as we are - comparing network addresses (identifiers), not the network masks - themselves. - * ipv4/ip_addr.c: ip_addr_isbroadcast() now checks that the given - IP address actually belongs to the network of the given interface. - - 2004-11-24 Kieran Mansley <kjm25@cam.ac.uk> - * tcp.c: Increment pcb->snd_buf when ACK is received in SYN_SENT state. - -(STABLE-1_1_0-RC1) - - 2004-10-16 Kieran Mansley <kjm25@cam.ac.uk> - * tcp.c: Add code to tcp_recved() to send an ACK (window update) immediately, - even if one is already pending, if the rcv_wnd is above a threshold - (currently TCP_WND/2). This avoids waiting for a timer to expire to send a - delayed ACK in order to open the window if the stack is only receiving data. - - 2004-09-12 Kieran Mansley <kjm25@cam.ac.uk> - * tcp*.*: Retransmit time-out handling improvement by Sam Jansen. - - 2004-08-20 Tony Mountifield <tony@softins.co.uk> - * etharp.c: Make sure the first pbuf queued on an ARP entry - is properly ref counted. - - 2004-07-27 Tony Mountifield <tony@softins.co.uk> - * debug.h: Added (int) cast in LWIP_DEBUGF() to avoid compiler - warnings about comparison. - * pbuf.c: Stopped compiler complaining of empty if statement - when LWIP_DEBUGF() empty. Closed an unclosed comment. - * tcp.c: Stopped compiler complaining of empty if statement - when LWIP_DEBUGF() empty. - * ip.h Corrected IPH_TOS() macro: returns a byte, so doesn't need htons(). - * inet.c: Added a couple of casts to quiet the compiler. - No need to test isascii(c) before isdigit(c) or isxdigit(c). - - 2004-07-22 Tony Mountifield <tony@softins.co.uk> - * inet.c: Made data types consistent in inet_ntoa(). - Added casts for return values of checksum routines, to pacify compiler. - * ip_frag.c, tcp_out.c, sockets.c, pbuf.c - Small corrections to some debugging statements, to pacify compiler. - - 2004-07-21 Tony Mountifield <tony@softins.co.uk> - * etharp.c: Removed spurious semicolon and added missing end-of-comment. - * ethernetif.c Updated low_level_output() to match prototype for - netif->linkoutput and changed low_level_input() similarly for consistency. - * api_msg.c: Changed recv_raw() from int to u8_t, to match prototype - of raw_recv() in raw.h and so avoid compiler error. - * sockets.c: Added trivial (int) cast to keep compiler happier. - * ip.c, netif.c Changed debug statements to use the tidier ip4_addrN() macros. - -(STABLE-1_0_0) - - ++ Changes: - - 2004-07-05 Leon Woestenberg <leon.woestenberg@gmx.net> - * sockets.*: Restructured LWIP_PRIVATE_TIMEVAL. Make sure - your cc.h file defines this either 1 or 0. If non-defined, - defaults to 1. - * .c: Added <string.h> and <errno.h> includes where used. - * etharp.c: Made some array indices unsigned. - - 2004-06-27 Leon Woestenberg <leon.woestenberg@gmx.net> - * netif.*: Added netif_set_up()/down(). - * dhcp.c: Changes to restart program flow. - - 2004-05-07 Leon Woestenberg <leon.woestenberg@gmx.net> - * etharp.c: In find_entry(), instead of a list traversal per candidate, do a - single-pass lookup for different candidates. Should exploit locality. - - 2004-04-29 Leon Woestenberg <leon.woestenberg@gmx.net> - * tcp*.c: Cleaned up source comment documentation for Doxygen processing. - * opt.h: ETHARP_ALWAYS_INSERT option removed to comply with ARP RFC. - * etharp.c: update_arp_entry() only adds new ARP entries when adviced to by - the caller. This deprecates the ETHARP_ALWAYS_INSERT overrule option. - - ++ Bug fixes: - - 2004-04-27 Leon Woestenberg <leon.woestenberg@gmx.net> - * etharp.c: Applied patch of bug #8708 by Toni Mountifield with a solution - suggested by Timmy Brolin. Fix for 32-bit processors that cannot access - non-aligned 32-bit words, such as soms 32-bit TCP/IP header fields. Fix - is to prefix the 14-bit Ethernet headers with two padding bytes. - - 2004-04-23 Leon Woestenberg <leon.woestenberg@gmx.net> - * ip_addr.c: Fix in the ip_addr_isbroadcast() check. - * etharp.c: Fixed the case where the packet that initiates the ARP request - is not queued, and gets lost. Fixed the case where the packets destination - address is already known; we now always queue the packet and perform an ARP - request. - -(STABLE-0_7_0) - - ++ Bug fixes: - - * Fixed TCP bug for SYN_SENT to ESTABLISHED state transition. - * Fixed TCP bug in dequeueing of FIN from out of order segment queue. - * Fixed two possible NULL references in rare cases. - -(STABLE-0_6_6) - - ++ Bug fixes: - - * Fixed DHCP which did not include the IP address in DECLINE messages. - - ++ Changes: - - * etharp.c has been hauled over a bit. - -(STABLE-0_6_5) - - ++ Bug fixes: - - * Fixed TCP bug induced by bad window resizing with unidirectional TCP traffic. - * Packets sent from ARP queue had invalid source hardware address. - - ++ Changes: - - * Pass-by ARP requests do now update the cache. - - ++ New features: - - * No longer dependent on ctype.h. - * New socket options. - * Raw IP pcb support. - -(STABLE-0_6_4) - - ++ Bug fixes: - - * Some debug formatters and casts fixed. - * Numereous fixes in PPP. - - ++ Changes: - - * DEBUGF now is LWIP_DEBUGF - * pbuf_dechain() has been re-enabled. - * Mentioned the changed use of CVS branches in README. - -(STABLE-0_6_3) - - ++ Bug fixes: - - * Fixed pool pbuf memory leak in pbuf_alloc(). - Occured if not enough PBUF_POOL pbufs for a packet pbuf chain. - Reported by Savin Zlobec. - - * PBUF_POOL chains had their tot_len field not set for non-first - pbufs. Fixed in pbuf_alloc(). - - ++ New features: - - * Added PPP stack contributed by Marc Boucher - - ++ Changes: - - * Now drops short packets for ICMP/UDP/TCP protocols. More robust. - - * ARP queueuing now queues the latest packet instead of the first. - This is the RFC recommended behaviour, but can be overridden in - lwipopts.h. - -(0.6.2) - - ++ Bugfixes: - - * TCP has been fixed to deal with the new use of the pbuf->ref - counter. - - * DHCP dhcp_inform() crash bug fixed. - - ++ Changes: - - * Removed pbuf_pool_free_cache and pbuf_pool_alloc_cache. Also removed - pbuf_refresh(). This has sped up pbuf pool operations considerably. - Implemented by David Haas. - -(0.6.1) - - ++ New features: - - * The packet buffer implementation has been enhanced to support - zero-copy and copy-on-demand for packet buffers which have their - payloads in application-managed memory. - Implemented by David Haas. - - Use PBUF_REF to make a pbuf refer to RAM. lwIP will use zero-copy - if an outgoing packet can be directly sent on the link, or perform - a copy-on-demand when necessary. - - The application can safely assume the packet is sent, and the RAM - is available to the application directly after calling udp_send() - or similar function. - - ++ Bugfixes: - - * ARP_QUEUEING should now correctly work for all cases, including - PBUF_REF. - Implemented by Leon Woestenberg. - - ++ Changes: - - * IP_ADDR_ANY is no longer a NULL pointer. Instead, it is a pointer - to a '0.0.0.0' IP address. - - * The packet buffer implementation is changed. The pbuf->ref counter - meaning has changed, and several pbuf functions have been - adapted accordingly. - - * netif drivers have to be changed to set the hardware address length field - that must be initialized correctly by the driver (hint: 6 for Ethernet MAC). - See the contrib/ports/c16x cs8900 driver as a driver example. - - * netif's have a dhcp field that must be initialized to NULL by the driver. - See the contrib/ports/c16x cs8900 driver as a driver example. - -(0.5.x) This file has been unmaintained up to 0.6.1. All changes are - logged in CVS but have not been explained here. - -(0.5.3) Changes since version 0.5.2 - - ++ Bugfixes: - - * memp_malloc(MEMP_API_MSG) could fail with multiple application - threads because it wasn't protected by semaphores. - - ++ Other changes: - - * struct ip_addr now packed. - - * The name of the time variable in arp.c has been changed to ctime - to avoid conflicts with the time() function. - -(0.5.2) Changes since version 0.5.1 - - ++ New features: - - * A new TCP function, tcp_tmr(), now handles both TCP timers. - - ++ Bugfixes: - - * A bug in tcp_parseopt() could cause the stack to hang because of a - malformed TCP option. - - * The address of new connections in the accept() function in the BSD - socket library was not handled correctly. - - * pbuf_dechain() did not update the ->tot_len field of the tail. - - * Aborted TCP connections were not handled correctly in all - situations. - - ++ Other changes: - - * All protocol header structs are now packed. - - * The ->len field in the tcp_seg structure now counts the actual - amount of data, and does not add one for SYN and FIN segments. - -(0.5.1) Changes since version 0.5.0 - - ++ New features: - - * Possible to run as a user process under Linux. - - * Preliminary support for cross platform packed structs. - - * ARP timer now implemented. - - ++ Bugfixes: - - * TCP output queue length was badly initialized when opening - connections. - - * TCP delayed ACKs were not sent correctly. - - * Explicit initialization of BSS segment variables. - - * read() in BSD socket library could drop data. - - * Problems with memory alignment. - - * Situations when all TCP buffers were used could lead to - starvation. - - * TCP MSS option wasn't parsed correctly. - - * Problems with UDP checksum calculation. - - * IP multicast address tests had endianess problems. - - * ARP requests had wrong destination hardware address. - - ++ Other changes: - - * struct eth_addr changed from u16_t[3] array to u8_t[6]. - - * A ->linkoutput() member was added to struct netif. - - * TCP and UDP ->dest_* struct members where changed to ->remote_*. - - * ntoh* macros are now null definitions for big endian CPUs. - -(0.5.0) Changes since version 0.4.2 - - ++ New features: - - * Redesigned operating system emulation layer to make porting easier. - - * Better control over TCP output buffers. - - * Documenation added. - - ++ Bugfixes: - - * Locking issues in buffer management. - - * Bugfixes in the sequential API. - - * IP forwarding could cause memory leakage. This has been fixed. - - ++ Other changes: - - * Directory structure somewhat changed; the core/ tree has been - collapsed. - -(0.4.2) Changes since version 0.4.1 - - ++ New features: - - * Experimental ARP implementation added. - - * Skeleton Ethernet driver added. - - * Experimental BSD socket API library added. - - ++ Bugfixes: - - * In very intense situations, memory leakage could occur. This has - been fixed. - - ++ Other changes: - - * Variables named "data" and "code" have been renamed in order to - avoid name conflicts in certain compilers. - - * Variable++ have in appliciable cases been translated to ++variable - since some compilers generate better code in the latter case. - -(0.4.1) Changes since version 0.4 - - ++ New features: - - * TCP: Connection attempts time out earlier than data - transmissions. Nagle algorithm implemented. Push flag set on the - last segment in a burst. - - * UDP: experimental support for UDP-Lite extensions. - - ++ Bugfixes: - - * TCP: out of order segments were in some cases handled incorrectly, - and this has now been fixed. Delayed acknowledgements was broken - in 0.4, has now been fixed. Binding to an address that is in use - now results in an error. Reset connections sometimes hung an - application; this has been fixed. - - * Checksum calculation sometimes failed for chained pbufs with odd - lengths. This has been fixed. - - * API: a lot of bug fixes in the API. The UDP API has been improved - and tested. Error reporting and handling has been - improved. Logical flaws and race conditions for incoming TCP - connections has been found and removed. - - * Memory manager: alignment issues. Reallocating memory sometimes - failed, this has been fixed. - - * Generic library: bcopy was flawed and has been fixed. - - ++ Other changes: - - * API: all datatypes has been changed from generic ones such as - ints, to specified ones such as u16_t. Functions that return - errors now have the correct type (err_t). - - * General: A lot of code cleaned up and debugging code removed. Many - portability issues have been fixed. - - * The license was changed; the advertising clause was removed. - - * C64 port added. - - * Thanks: Huge thanks go to Dagan Galarneau, Horst Garnetzke, Petri - Kosunen, Mikael Caleres, and Frits Wilmink for reporting and - fixing bugs! - -(0.4) Changes since version 0.3.1 - - * Memory management has been radically changed; instead of - allocating memory from a shared heap, memory for objects that are - rapidly allocated and deallocated is now kept in pools. Allocation - and deallocation from those memory pools is very fast. The shared - heap is still present but is used less frequently. - - * The memory, memory pool, and packet buffer subsystems now support - 4-, 2-, or 1-byte alignment. - - * "Out of memory" situations are handled in a more robust way. - - * Stack usage has been reduced. - - * Easier configuration of lwIP parameters such as memory usage, - TTLs, statistics gathering, etc. All configuration parameters are - now kept in a single header file "lwipopts.h". - - * The directory structure has been changed slightly so that all - architecture specific files are kept under the src/arch - hierarchy. - - * Error propagation has been improved, both in the protocol modules - and in the API. - - * The code for the RTXC architecture has been implemented, tested - and put to use. - - * Bugs have been found and corrected in the TCP, UDP, IP, API, and - the Internet checksum modules. - - * Bugs related to porting between a 32-bit and a 16-bit architecture - have been found and corrected. - - * The license has been changed slightly to conform more with the - original BSD license, including the advertisement clause. - -(0.3.1) Changes since version 0.3 - - * Fix of a fatal bug in the buffer management. Pbufs with allocated - RAM never returned the RAM when the pbuf was deallocated. - - * TCP congestion control, window updates and retransmissions did not - work correctly. This has now been fixed. - - * Bugfixes in the API. - -(0.3) Changes since version 0.2 - - * New and improved directory structure. All include files are now - kept in a dedicated include/ directory. - - * The API now has proper error handling. A new function, - netconn_err(), now returns an error code for the connection in - case of errors. - - * Improvements in the memory management subsystem. The system now - keeps a pointer to the lowest free memory block. A new function, - mem_malloc2() tries to allocate memory once, and if it fails tries - to free some memory and retry the allocation. - - * Much testing has been done with limited memory - configurations. lwIP now does a better job when overloaded. - - * Some bugfixes and improvements to the buffer (pbuf) subsystem. - - * Many bugfixes in the TCP code: - - - Fixed a bug in tcp_close(). - - - The TCP receive window was incorrectly closed when out of - sequence segments was received. This has been fixed. - - - Connections are now timed-out of the FIN-WAIT-2 state. - - - The initial congestion window could in some cases be too - large. This has been fixed. - - - The retransmission queue could in some cases be screwed up. This - has been fixed. - - - TCP RST flag now handled correctly. - - - Out of sequence data was in some cases never delivered to the - application. This has been fixed. - - - Retransmitted segments now contain the correct acknowledgment - number and advertised window. - - - TCP retransmission timeout backoffs are not correctly computed - (ala BSD). After a number of retransmissions, TCP now gives up - the connection. - - * TCP connections now are kept on three lists, one for active - connections, one for listening connections, and one for - connections that are in TIME-WAIT. This greatly speeds up the fast - timeout processing for sending delayed ACKs. - - * TCP now provides proper feedback to the application when a - connection has been successfully set up. - - * More comments have been added to the code. The code has also been - somewhat cleaned up. - -(0.2) Initial public release. -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/sockets.h"
This file is a posix wrapper for lwip/sockets.h.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/errno.h"
This file is a posix/stdc wrapper for lwip/errno.h.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
1 Introduction - -This document describes some guidelines for people participating -in lwIP development. - -2 How to contribute to lwIP - -Here is a short list of suggestions to anybody working with lwIP and -trying to contribute bug reports, fixes, enhancements, platform ports etc. -First of all as you may already know lwIP is a volunteer project so feedback -to fixes or questions might often come late. Hopefully the bug and patch tracking -features of Savannah help us not lose users' input. - -2.1 Source code style: - -1. do not use tabs. -2. indentation is two spaces per level (i.e. per tab). -3. end debug messages with a trailing newline (\n). -4. one space between keyword and opening bracket. -5. no space between function and opening bracket. -6. one space and no newline before opening curly braces of a block. -7. closing curly brace on a single line. -8. spaces surrounding assignment and comparisons. -9. don't initialize static and/or global variables to zero, the compiler takes care of that. -10. use current source code style as further reference. - -2.2 Source code documentation style: - -1. JavaDoc compliant and Doxygen compatible. -2. Function documentation above functions in .c files, not .h files. - (This forces you to synchronize documentation and implementation.) -3. Use current documentation style as further reference. - -2.3 Bug reports and patches: - -1. Make sure you are reporting bugs or send patches against the latest - sources. (From the latest release and/or the current Git sources.) -2. If you think you found a bug make sure it's not already filed in the - bugtracker at Savannah. -3. If you have a fix put the patch on Savannah. If it is a patch that affects - both core and arch specific stuff please separate them so that the core can - be applied separately while leaving the other patch 'open'. The preferred way - is to NOT touch archs you can't test and let maintainers take care of them. - This is a good way to see if they are used at all - the same goes for unix - netifs except tapif. -4. Do not file a bug and post a fix to it to the patch area. Either a bug report - or a patch will be enough. - If you correct an existing bug then attach the patch to the bug rather than creating a new entry in the patch area. -5. Patches should be specific to a single change or to related changes. Do not mix bugfixes with spelling and other - trivial fixes unless the bugfix is trivial too. Do not reorganize code and rename identifiers in the same patch you - change behaviour if not necessary. A patch is easier to read and understand if it's to the point and short than - if it's not to the point and long :) so the chances for it to be applied are greater. - -2.4 Platform porters: - -1. If you have ported lwIP to a platform (an OS, a uC/processor or a combination of these) and - you think it could benefit others[1] you might want discuss this on the mailing list. You - can also ask for Git access to submit and maintain your port in the contrib Git module. -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_NOASSERT |
#define | LWIP_DEBUG |
Debug level (LWIP_DBG_MIN_LEVEL) | |
#define | LWIP_DBG_LEVEL_ALL 0x00 |
#define | LWIP_DBG_LEVEL_WARNING 0x01 |
#define | LWIP_DBG_LEVEL_SERIOUS 0x02 |
#define | LWIP_DBG_LEVEL_SEVERE 0x03 |
Enable/disable debug messages completely (LWIP_DBG_TYPES_ON) | |
#define | LWIP_DBG_ON 0x80U |
#define | LWIP_DBG_OFF 0x00U |
Debug message types (LWIP_DBG_TYPES_ON) | |
#define | LWIP_DBG_TRACE 0x40U |
#define | LWIP_DBG_STATE 0x20U |
#define | LWIP_DBG_FRESH 0x10U |
#define | LWIP_DBG_HALT 0x08U |
Debug messages infrastructure
-#define LWIP_DEBUG | -
Enable debug message printing, but only if debug message type is enabled AND is of correct type AND is at least LWIP_DBG_LEVEL.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
u16_t | lwip_htons (u16_t n) |
u32_t | lwip_htonl (u32_t n) |
char * | lwip_strnstr (const char *buffer, const char *token, size_t n) |
int | lwip_stricmp (const char *str1, const char *str2) |
int | lwip_strnicmp (const char *str1, const char *str2, size_t len) |
void | lwip_itoa (char *result, size_t bufsize, int number) |
Common functions used throughout the stack.
-These are reference implementations of the byte swapping functions. Again with the aim of being simple, correct and fully portable. Byte swapping is the second thing you would want to optimize. You will need to port it to your architecture and in your cc.h:
-#define lwip_htons(x) your_htons #define lwip_htonl(x) your_htonl
-Note lwip_ntohs() and lwip_ntohl() are merely references to the htonx counterparts.
-If you #define them to htons() and htonl(), you should #define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS to prevent lwIP from defining htonx/ntohx compatibility macros.
-u32_t lwip_htonl | -( | -u32_t | -n | ) | -- |
Convert an u32_t from host- to network byte order.
-n | u32_t in host byte order |
u16_t lwip_htons | -( | -u16_t | -n | ) | -- |
Convert an u16_t from host- to network byte order.
-n | u16_t in host byte order |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_MAKEU32(a, b, c, d) |
-Functions | |
u16_t | lwip_htons (u16_t x) |
u32_t | lwip_htonl (u32_t x) |
void | lwip_itoa (char *result, size_t bufsize, int number) |
int | lwip_strnicmp (const char *str1, const char *str2, size_t len) |
int | lwip_stricmp (const char *str1, const char *str2) |
char * | lwip_strnstr (const char *buffer, const char *token, size_t n) |
various utility macros
-#define LWIP_MAKEU32 | -( | -- | a, | -
- | - | - | b, | -
- | - | - | c, | -
- | - | - | d | -
- | ) | -- |
Create u32_t value from bytes
- -u32_t lwip_htonl | -( | -u32_t | -n | ) | -- |
Convert an u32_t from host- to network byte order.
-n | u32_t in host byte order |
u16_t lwip_htons | -( | -u16_t | -n | ) | -- |
Convert an u16_t from host- to network byte order.
-n | u16_t in host byte order |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/dhcp6.h"
#include "lwip/prot/dhcp6.h"
#include "lwip/def.h"
#include "lwip/udp.h"
#include "lwip/dns.h"
#include <string.h>
#include "path/to/my/lwip_hooks.h"
-Enumerations | |
enum | dhcp6_option_idx |
-Functions | |
void | dhcp6_set_struct (struct netif *netif, struct dhcp6 *dhcp6) |
void | dhcp6_cleanup (struct netif *netif) |
err_t | dhcp6_enable_stateful (struct netif *netif) |
err_t | dhcp6_enable_stateless (struct netif *netif) |
void | dhcp6_disable (struct netif *netif) |
void | dhcp6_nd6_ra_trigger (struct netif *netif, u8_t managed_addr_config, u8_t other_config) |
void | dhcp6_tmr (void) |
-Variables | |
struct dhcp6_option_info | dhcp6_rx_options [DHCP6_OPTION_IDX_MAX] |
enum dhcp6_option_idx | -
Option handling: options are parsed in dhcp6_parse_reply and saved in an array where other functions can load them from. This might be moved into the struct dhcp6 (not necessarily since lwIP is single-threaded and the array is only used while in recv callback).
- -void dhcp6_nd6_ra_trigger | -( | -struct netif * | -netif, | -
- | - | u8_t | -managed_addr_config, | -
- | - | u8_t | -other_config | -
- | ) | -- |
This function is called from nd6 module when an RA messsage is received It triggers DHCPv6 requests (if enabled).
- -void dhcp6_tmr | -( | -void | -) | -- |
DHCPv6 timeout handling (this function must be called every 500ms, see DHCP6_TIMER_MSECS).
-A DHCPv6 server is expected to respond within a short period of time. This timer checks whether an outstanding DHCPv6 request is timed out.
- -struct dhcp6_option_info dhcp6_rx_options[DHCP6_OPTION_IDX_MAX] | -
Holds the decoded option info, only valid while in dhcp6_recv.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | DHCP6_TIMER_MSECS 500 |
#define | dhcp6_remove_struct(netif) netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6, NULL) |
-Functions | |
void | dhcp6_set_struct (struct netif *netif, struct dhcp6 *dhcp6) |
void | dhcp6_cleanup (struct netif *netif) |
err_t | dhcp6_enable_stateful (struct netif *netif) |
err_t | dhcp6_enable_stateless (struct netif *netif) |
void | dhcp6_disable (struct netif *netif) |
void | dhcp6_tmr (void) |
void | dhcp6_nd6_ra_trigger (struct netif *netif, u8_t managed_addr_config, u8_t other_config) |
DHCPv6 client: IPv6 address autoconfiguration as per RFC 3315 (stateful DHCPv6) and RFC 3736 (stateless DHCPv6).
-#define dhcp6_remove_struct | -( | -- | netif | ) | -netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6, NULL) | -
Remove a struct dhcp6 previously set to the netif using dhcp6_set_struct()
- -#define DHCP6_TIMER_MSECS 500 | -
period (in milliseconds) of the application calling dhcp6_tmr()
- -void dhcp6_nd6_ra_trigger | -( | -struct netif * | -netif, | -
- | - | u8_t | -managed_addr_config, | -
- | - | u8_t | -other_config | -
- | ) | -- |
This function is called from nd6 module when an RA messsage is received It triggers DHCPv6 requests (if enabled).
- -void dhcp6_tmr | -( | -void | -) | -- |
DHCPv6 timeout handling (this function must be called every 500ms, see DHCP6_TIMER_MSECS).
-A DHCPv6 server is expected to respond within a short period of time. This timer checks whether an outstanding DHCPv6 request is timed out.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/stats.h"
#include "lwip/mem.h"
#include "lwip/udp.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/def.h"
#include "lwip/dhcp.h"
#include "lwip/autoip.h"
#include "lwip/dns.h"
#include "lwip/etharp.h"
#include "lwip/prot/dhcp.h"
#include "lwip/prot/iana.h"
#include <string.h>
#include "path/to/my/lwip_hooks.h"
-Macros | |
#define | DHCP_CREATE_RAND_XID 1 |
#define | DHCP_MAX_MSG_LEN(netif) (netif->mtu) |
#define | DHCP_MIN_REPLY_LEN 44 |
-Enumerations | |
enum | dhcp_option_idx |
-Functions | |
void | dhcp_coarse_tmr (void) |
void | dhcp_fine_tmr (void) |
void | dhcp_set_struct (struct netif *netif, struct dhcp *dhcp) |
void | dhcp_cleanup (struct netif *netif) |
err_t | dhcp_start (struct netif *netif) |
void | dhcp_inform (struct netif *netif) |
void | dhcp_network_changed (struct netif *netif) |
void | dhcp_arp_reply (struct netif *netif, const ip4_addr_t *addr) |
err_t | dhcp_renew (struct netif *netif) |
void | dhcp_release_and_stop (struct netif *netif) |
err_t | dhcp_release (struct netif *netif) |
void | dhcp_stop (struct netif *netif) |
u8_t | dhcp_supplied_address (const struct netif *netif) |
-Variables | |
u32_t | dhcp_rx_options_val [DHCP_OPTION_IDX_MAX] |
u8_t | dhcp_rx_options_given [DHCP_OPTION_IDX_MAX] |
Dynamic Host Configuration Protocol client
-#define DHCP_CREATE_RAND_XID 1 | -
DHCP_CREATE_RAND_XID: if this is set to 1, the xid is created using LWIP_RAND() (this overrides DHCP_GLOBAL_XID)
- -Default for DHCP_GLOBAL_XID is 0xABCD0000 This can be changed by defining DHCP_GLOBAL_XID and DHCP_GLOBAL_XID_HEADER, e.g. #define DHCP_GLOBAL_XID_HEADER "stdlib.h" #define DHCP_GLOBAL_XID rand() DHCP_OPTION_MAX_MSG_SIZE is set to the MTU MTU is checked to be big enough in dhcp_start
- -#define DHCP_MIN_REPLY_LEN 44 | -
Minimum length for reply before packet is parsed
- -enum dhcp_option_idx | -
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).
- -void dhcp_arp_reply | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -addr | -
- | ) | -- |
Match an ARP reply with the offered IP address: check whether the offered IP address is not in use using ARP
-netif | the network interface on which the reply was received |
addr | The IP address we received a reply from |
void dhcp_coarse_tmr | -( | -void | -) | -- |
The DHCP timer that checks for lease renewal/rebind timeouts. Must be called once a minute (see DHCP_COARSE_TIMER_SECS).
- -void dhcp_fine_tmr | -( | -void | -) | -- |
DHCP transaction timeout handling (this function must be called every 500ms, see DHCP_FINE_TIMER_MSECS).
-A DHCP server is expected to respond within a short period of time. This timer checks whether an outstanding DHCP request is timed out.
- -void dhcp_network_changed | -( | -struct netif * | -netif | ) | -- |
Handle a possible change in the network configuration.
-This enters the REBOOTING state to verify that the currently bound address is still valid.
- -u8_t dhcp_supplied_address | -( | -const struct netif * | -netif | ) | -- |
u8_t dhcp_rx_options_given[DHCP_OPTION_IDX_MAX] | -
Holds a flag which option was received and is contained in dhcp_rx_options_val, only valid while in dhcp_recv.
- -u32_t dhcp_rx_options_val[DHCP_OPTION_IDX_MAX] | -
Holds the decoded option values, only valid while in dhcp_recv.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | DHCP_COARSE_TIMER_SECS 60 |
#define | DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) |
#define | DHCP_FINE_TIMER_MSECS 500 |
#define | dhcp_remove_struct(netif) netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL) |
-Functions | |
void | dhcp_set_struct (struct netif *netif, struct dhcp *dhcp) |
void | dhcp_cleanup (struct netif *netif) |
err_t | dhcp_start (struct netif *netif) |
err_t | dhcp_renew (struct netif *netif) |
err_t | dhcp_release (struct netif *netif) |
void | dhcp_stop (struct netif *netif) |
void | dhcp_release_and_stop (struct netif *netif) |
void | dhcp_inform (struct netif *netif) |
void | dhcp_network_changed (struct netif *netif) |
void | dhcp_arp_reply (struct netif *netif, const ip4_addr_t *addr) |
u8_t | dhcp_supplied_address (const struct netif *netif) |
void | dhcp_coarse_tmr (void) |
void | dhcp_fine_tmr (void) |
DHCP client API
-#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) | -
period (in milliseconds) of the application calling dhcp_coarse_tmr()
- -#define DHCP_COARSE_TIMER_SECS 60 | -
period (in seconds) of the application calling dhcp_coarse_tmr()
- -#define DHCP_FINE_TIMER_MSECS 500 | -
period (in milliseconds) of the application calling dhcp_fine_tmr()
- -#define dhcp_remove_struct | -( | -- | netif | ) | -netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL) | -
Remove a struct dhcp previously set to the netif using dhcp_set_struct()
- -void dhcp_arp_reply | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -addr | -
- | ) | -- |
Match an ARP reply with the offered IP address: check whether the offered IP address is not in use using ARP
-netif | the network interface on which the reply was received |
addr | The IP address we received a reply from |
void dhcp_coarse_tmr | -( | -void | -) | -- |
The DHCP timer that checks for lease renewal/rebind timeouts. Must be called once a minute (see DHCP_COARSE_TIMER_SECS).
- -void dhcp_fine_tmr | -( | -void | -) | -- |
DHCP transaction timeout handling (this function must be called every 500ms, see DHCP_FINE_TIMER_MSECS).
-A DHCP server is expected to respond within a short period of time. This timer checks whether an outstanding DHCP request is timed out.
- -void dhcp_network_changed | -( | -struct netif * | -netif | ) | -- |
Handle a possible change in the network configuration.
-This enters the REBOOTING state to verify that the currently bound address is still valid.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | altcp_tls_mbedtls.c |
file | altcp_tls_mbedtls_mem.c |
file | altcp_tls_mbedtls_mem.h |
file | altcp_tls_mbedtls_structs.h |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Directories |
-Files | |
file | altcp_proxyconnect.c |
file | http_client.c |
file | httpd.c |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | tftp_server.c |
Trivial File Transfer Protocol (RFC 1350) | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | pppol2tp.h |
file | pppos.h |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | altcp_priv.h |
file | api_msg.h |
file | mem_priv.h |
file | memp_priv.h |
file | memp_std.h |
file | nd6_priv.h |
file | raw_priv.h |
file | sockets_priv.h |
file | tcp_priv.h |
file | tcpip_priv.h |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Directories |
-Files | |
file | altcp.h |
file | altcp_tcp.h |
file | altcp_tls.h |
file | api.h |
file | arch.h |
file | autoip.h |
file | debug.h |
file | def.h |
file | dhcp.h |
file | dhcp6.h |
file | dns.h |
file | err.h |
file | errno.h |
file | etharp.h |
file | ethip6.h |
file | icmp.h |
file | icmp6.h |
file | if_api.h |
file | igmp.h |
file | inet.h |
file | inet_chksum.h |
file | init.h |
file | ip.h |
file | ip4.h |
file | ip4_addr.h |
file | ip4_frag.h |
file | ip6.h |
file | ip6_addr.h |
file | ip6_frag.h |
file | ip6_zone.h |
file | ip_addr.h |
file | mem.h |
file | memp.h |
file | mld6.h |
file | nd6.h |
file | netbuf.h |
file | netdb.h |
file | netif.h |
file | netifapi.h |
file | opt.h |
file | pbuf.h |
file | raw.h |
file | snmp.h |
file | sockets.h |
file | stats.h |
file | sys.h |
file | tcp.h |
file | tcpbase.h |
file | tcpip.h |
file | timeouts.h |
file | udp.h |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Directories |
-Files | |
file | pppapi.c |
file | pppol2tp.c |
file | pppos.c |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Directories |
-Files | |
file | bridgeif.c |
file | bridgeif_fdb.c |
file | ethernet.c |
file | lowpan6.c |
file | lowpan6_ble.c |
file | lowpan6_common.c |
file | slipif.c |
file | zepif.c |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | autoip.c |
file | dhcp.c |
file | etharp.c |
file | icmp.c |
file | igmp.c |
file | ip4.c |
file | ip4_addr.c |
file | ip4_frag.c |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Directories |
-Files | |
file | altcp.c |
file | altcp_alloc.c |
file | altcp_tcp.c |
file | def.c |
file | dns.c |
file | inet_chksum.c |
file | init.c |
file | ip.c |
file | mem.c |
file | memp.c |
file | netif.c |
file | pbuf.c |
file | raw.c |
file | stats.c |
file | sys.c |
file | tcp.c |
file | tcp_in.c |
file | tcp_out.c |
file | timeouts.c |
file | udp.c |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Directories |
-Files | |
file | bridgeif.h |
file | bridgeif_opts.h |
file | ethernet.h |
file | ieee802154.h |
file | lowpan6.h |
file | lowpan6_ble.h |
file | lowpan6_common.h |
file | lowpan6_opts.h |
file | slipif.h |
file | zepif.h |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | dhcp6.c |
file | ethip6.c |
file | icmp6.c |
file | inet6.c |
file | ip6.c |
file | ip6_addr.c |
file | ip6_frag.c |
file | mld6.c |
file | nd6.c |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | altcp_proxyconnect.h |
file | altcp_tls_mbedtls_opts.h |
file | http_client.h |
file | httpd.h |
file | httpd_opts.h |
file | lwiperf.h |
file | mdns.h |
file | mdns_opts.h |
file | mdns_priv.h |
file | mqtt.h |
file | mqtt_opts.h |
file | mqtt_priv.h |
file | netbiosns.h |
file | netbiosns_opts.h |
file | snmp.h |
file | snmp_core.h |
file | snmp_mib2.h |
file | snmp_opts.h |
file | snmp_scalar.h |
file | snmp_table.h |
file | snmp_threadsync.h |
file | snmpv3.h |
file | sntp.h |
file | sntp_opts.h |
file | tftp_opts.h |
Trivial File Transfer Protocol (RFC 1350) implementation options. | |
file | tftp_server.h |
Trivial File Transfer Protocol (RFC 1350) | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Files | |
file | snmp_asn1.c |
file | snmp_asn1.h |
file | snmp_core.c |
file | snmp_mib2.c |
file | snmp_mib2_icmp.c |
file | snmp_mib2_interfaces.c |
file | snmp_mib2_ip.c |
file | snmp_mib2_snmp.c |
file | snmp_mib2_system.c |
file | snmp_mib2_tcp.c |
file | snmp_mib2_udp.c |
file | snmp_msg.c |
file | snmp_msg.h |
file | snmp_netconn.c |
file | snmp_pbuf_stream.c |
file | snmp_pbuf_stream.h |
file | snmp_raw.c |
file | snmp_scalar.c |
file | snmp_table.c |
file | snmp_threadsync.c |
file | snmp_traps.c |
file | snmpv3.c |
file | snmpv3_mbedtls.c |
file | snmpv3_priv.h |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Directories |
-Files | |
file | netdb.h |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/udp.h"
#include "lwip/mem.h"
#include "lwip/memp.h"
#include "lwip/dns.h"
#include "lwip/prot/dns.h"
#include <string.h>
-Data Structures | |
struct | dns_query |
struct | dns_answer |
struct | dns_table_entry |
struct | dns_req_entry |
-Macros | |
#define | DNS_RAND_TXID LWIP_RAND |
#define | DNS_PORT_ALLOWED(port) ((port) >= 1024) |
#define | DNS_MAX_TTL 604800 |
-Functions | |
void | dns_init (void) |
void | dns_setserver (u8_t numdns, const ip_addr_t *dnsserver) |
const ip_addr_t * | dns_getserver (u8_t numdns) |
void | dns_tmr (void) |
err_t | dns_gethostbyname (const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg) |
err_t | dns_gethostbyname_addrtype (const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg, u8_t dns_addrtype) |
DNS - host name to IP address resolver.
-#define DNS_MAX_TTL 604800 | -
DNS resource record max. TTL (one week as default)
- -#define DNS_PORT_ALLOWED | -( | -- | port | ) | -((port) >= 1024) | -
Limits the source port to be >= 1024 by default
- -#define DNS_RAND_TXID LWIP_RAND | -
Random generator function to create random TXIDs and source ports for queries
- -void dns_init | -( | -void | -) | -- |
Initialize the resolver: set up the UDP pcb and configure the default server (if DNS_SERVER_ADDRESS is set).
- -void dns_tmr | -( | -void | -) | -- |
The DNS resolver client timer - handle retries and timeouts and should be called every DNS_TMR_INTERVAL milliseconds (every second by default).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | DNS_TMR_INTERVAL 1000 |
-Typedefs | |
typedef void(* | dns_found_callback) (const char *name, const ip_addr_t *ipaddr, void *callback_arg) |
-Functions | |
void | dns_init (void) |
void | dns_tmr (void) |
void | dns_setserver (u8_t numdns, const ip_addr_t *dnsserver) |
const ip_addr_t * | dns_getserver (u8_t numdns) |
err_t | dns_gethostbyname (const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg) |
err_t | dns_gethostbyname_addrtype (const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg, u8_t dns_addrtype) |
DNS API
-#define DNS_TMR_INTERVAL 1000 | -
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:
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.DNS timer period
- -typedef void(* dns_found_callback) (const char *name, const ip_addr_t *ipaddr, void *callback_arg) | -
Callback which is invoked when a hostname is found. A function of this type must be implemented by the application using the DNS resolver.
name | pointer to the name that was looked up. |
ipaddr | pointer to an ip_addr_t containing the IP address of the hostname, or NULL if the name could not be found (or on any other error). |
callback_arg | a user-specified callback argument passed to dns_gethostbyname |
void dns_init | -( | -void | -) | -- |
Initialize the resolver: set up the UDP pcb and configure the default server (if DNS_SERVER_ADDRESS is set).
- -void dns_tmr | -( | -void | -) | -- |
The DNS resolver client timer - handle retries and timeouts and should be called every DNS_TMR_INTERVAL milliseconds (every second by default).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Typedefs | |
typedef s8_t | err_t |
-Enumerations | |
enum | err_enum_t { - ERR_OK = 0, -ERR_MEM = -1, -ERR_BUF = -2, -ERR_TIMEOUT = -3, - - ERR_RTE = -4, -ERR_INPROGRESS = -5, -ERR_VAL = -6, -ERR_WOULDBLOCK = -7, - - ERR_USE = -8, -ERR_ALREADY = -9, -ERR_ISCONN = -10, -ERR_CONN = -11, - - ERR_IF = -12, -ERR_ABRT = -13, -ERR_RST = -14, -ERR_CLSD = -15, - - ERR_ARG = -16 - - } |
lwIP Error codes
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/etharp.h"
#include "lwip/stats.h"
#include "lwip/snmp.h"
#include "lwip/dhcp.h"
#include "lwip/autoip.h"
#include "lwip/prot/iana.h"
#include "netif/ethernet.h"
#include <string.h>
#include "path/to/my/lwip_hooks.h"
-Macros | |
#define | ARP_AGE_REREQUEST_USED_UNICAST (ARP_MAXAGE - 30) |
#define | ARP_MAXPENDING 5 |
#define | ETHARP_FLAG_TRY_HARD 1 |
-Enumerations | |
enum | etharp_state |
-Functions | |
void | etharp_tmr (void) |
void | etharp_cleanup_netif (struct netif *netif) |
ssize_t | etharp_find_addr (struct netif *netif, const ip4_addr_t *ipaddr, struct eth_addr **eth_ret, const ip4_addr_t **ip_ret) |
int | etharp_get_entry (size_t i, ip4_addr_t **ipaddr, struct netif **netif, struct eth_addr **eth_ret) |
void | etharp_input (struct pbuf *p, struct netif *netif) |
err_t | etharp_output (struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr) |
err_t | etharp_query (struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q) |
err_t | etharp_request (struct netif *netif, const ip4_addr_t *ipaddr) |
Address Resolution Protocol module for IP over Ethernet
-Functionally, ARP is divided into two parts. The first maps an IP address to a physical address when sending a packet, and the second part answers requests from other machines for our physical address.
-This implementation complies with RFC 826 (Ethernet ARP). It supports Gratuitious ARP from RFC3220 (IP Mobility Support for IPv4) section 4.6 if an interface calls etharp_gratuitous(our_netif) upon address change.
-#define ARP_AGE_REREQUEST_USED_UNICAST (ARP_MAXAGE - 30) | -
Re-request a used ARP entry 1 minute before it would expire to prevent breaking a steadily used connection because the ARP entry timed out.
- -#define ARP_MAXPENDING 5 | -
the time an ARP entry stays pending after first request, for ARP_TMR_INTERVAL = 1000, this is 10 seconds.
- -#define ETHARP_FLAG_TRY_HARD 1 | -
Try hard to create a new entry - we want the IP address to appear in the cache (even if this means removing an active entry or so).
- -enum etharp_state | -
ARP states
- -void etharp_cleanup_netif | -( | -struct netif * | -netif | ) | -- |
Remove all ARP table entries of the specified netif.
-netif | points to a network interface |
ssize_t etharp_find_addr | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr, | -
- | - | struct eth_addr ** | -eth_ret, | -
- | - | const ip4_addr_t ** | -ip_ret | -
- | ) | -- |
Finds (stable) ethernet/IP address pair from ARP table using interface and IP address index.
netif | points to interface index |
ipaddr | points to the (network order) IP address index |
eth_ret | points to return pointer |
ip_ret | points to return pointer |
int etharp_get_entry | -( | -size_t | -i, | -
- | - | ip4_addr_t ** | -ipaddr, | -
- | - | struct netif ** | -netif, | -
- | - | struct eth_addr ** | -eth_ret | -
- | ) | -- |
Possibility to iterate over stable ARP table entries
-i | entry number, 0 to ARP_TABLE_SIZE |
ipaddr | return value: IP address |
netif | return value: points to interface |
eth_ret | return value: ETH address |
Responds to ARP requests to us. Upon ARP replies to us, add entry to cache send out queued IP packets. Updates cache with snooped address pairs.
-Should be called for incoming ARP packets. The pbuf in the argument is freed by this function.
-p | The ARP packet that arrived on netif. Is freed by this function. |
netif | The lwIP network interface on which the ARP packet pbuf arrived. |
err_t etharp_output | -( | -struct netif * | -netif, | -
- | - | struct pbuf * | -q, | -
- | - | const ip4_addr_t * | -ipaddr | -
- | ) | -- |
Resolve and fill-in Ethernet address header for outgoing IP packet.
-For IP multicast and broadcast, corresponding Ethernet addresses are selected and the packet is transmitted on the link.
-For unicast addresses, the packet is submitted to etharp_query(). In case the IP address is outside the local network, the IP address of the gateway is used.
-netif | The lwIP network interface which the IP packet will be sent on. |
q | The pbuf(s) containing the IP packet to be sent. |
ipaddr | The IP address of the packet destination. |
err_t etharp_query | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr, | -
- | - | struct pbuf * | -q | -
- | ) | -- |
Send an ARP request for the given IP address and/or queue a packet.
-If the IP address was not yet in the cache, a pending ARP cache entry is added and an ARP request is sent for the given address. The packet is queued on this entry.
-If the IP address was already pending in the cache, a new ARP request is sent for the given address. The packet is queued on this entry.
-If the IP address was already stable in the cache, and a packet is given, it is directly sent and no ARP request is sent out.
-If the IP address was already stable in the cache, and no packet is given, an ARP request is sent out.
-netif | The lwIP network interface on which ipaddr must be queried for. |
ipaddr | The IP address to be resolved. |
q | If non-NULL, a pbuf that must be delivered to the IP address. q is not freed by this function. |
err_t etharp_request | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr | -
- | ) | -- |
Send an ARP request packet asking for ipaddr.
-netif | the lwip network interface on which to send the request |
ipaddr | the IP address for which to ask |
void etharp_tmr | -( | -void | -) | -- |
Clears expired entries in the ARP table.
-This function should be called every ARP_TMR_INTERVAL milliseconds (1 second), in order to expire entries in the ARP table.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "netif/ethernet.h"
#include "lwip/def.h"
#include "lwip/stats.h"
#include "lwip/etharp.h"
#include "lwip/ip.h"
#include "lwip/snmp.h"
#include <string.h>
#include "netif/ppp/ppp_opts.h"
#include "path/to/my/lwip_hooks.h"
-Functions | |
err_t | ethernet_input (struct pbuf *p, struct netif *netif) |
err_t | ethernet_output (struct netif *netif, struct pbuf *p, const struct eth_addr *src, const struct eth_addr *dst, u16_t eth_type) |
Ethernet common functions
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/ethip6.h"
#include "lwip/nd6.h"
#include "lwip/pbuf.h"
#include "lwip/ip6.h"
#include "lwip/ip6_addr.h"
#include "lwip/inet_chksum.h"
#include "lwip/netif.h"
#include "lwip/icmp6.h"
#include "lwip/prot/ethernet.h"
#include "netif/ethernet.h"
#include <string.h>
-Functions | |
err_t | ethip6_output (struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) |
Ethernet output for IPv6. Uses ND tables for link-layer addressing.
-err_t ethip6_output | -( | -struct netif * | -netif, | -
- | - | struct pbuf * | -q, | -
- | - | const ip6_addr_t * | -ip6addr | -
- | ) | -- |
Resolve and fill-in Ethernet address header for outgoing IPv6 packet.
-For IPv6 multicast, corresponding Ethernet addresses are selected and the packet is transmitted on the link.
-For unicast addresses, ask the ND6 module what to do. It will either let us send the the packet right away, or queue the packet for later itself, unless an error occurs.
-netif | The lwIP network interface which the IP packet will be sent on. |
q | The pbuf(s) containing the IP packet to be sent. |
ip6addr | The IP address of the packet destination. |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip6.h"
#include "lwip/ip6_addr.h"
#include "lwip/netif.h"
-Functions | |
err_t | ethip6_output (struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) |
Ethernet output for IPv6. Uses ND tables for link-layer addressing.
-err_t ethip6_output | -( | -struct netif * | -netif, | -
- | - | struct pbuf * | -q, | -
- | - | const ip6_addr_t * | -ip6addr | -
- | ) | -- |
Resolve and fill-in Ethernet address header for outgoing IPv6 packet.
-For IPv6 multicast, corresponding Ethernet addresses are selected and the packet is transmitted on the link.
-For unicast addresses, ask the ND6 module what to do. It will either let us send the the packet right away, or queue the packet for later itself, unless an error occurs.
-netif | The lwIP network interface which the IP packet will be sent on. |
q | The pbuf(s) containing the IP packet to be sent. |
ip6addr | The IP address of the packet destination. |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
▼ src | |
▼ api | |
api_lib.c | |
api_msg.c | |
err.c | |
if_api.c | |
netbuf.c | |
netdb.c | |
netifapi.c | |
sockets.c | |
tcpip.c | |
▼ apps | |
► altcp_tls | |
► http | |
► lwiperf | |
► mdns | |
► mqtt | |
► netbiosns | |
► smtp | |
► snmp | |
► sntp | |
► tftp | |
▼ core | |
► ipv4 | |
► ipv6 | |
altcp.c | |
altcp_alloc.c | |
altcp_tcp.c | |
def.c | |
dns.c | |
inet_chksum.c | |
init.c | |
ip.c | |
mem.c | |
memp.c | |
netif.c | |
pbuf.c | |
raw.c | |
stats.c | |
sys.c | |
tcp.c | |
tcp_in.c | |
tcp_out.c | |
timeouts.c | |
udp.c | |
▼ include | |
► compat | |
► lwip | |
► netif | |
▼ netif | |
► ppp | |
bridgeif.c | |
bridgeif_fdb.c | |
ethernet.c | |
lowpan6.c | |
lowpan6_ble.c | |
lowpan6_common.c | |
slipif.c | |
zepif.c |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
TLS layer | |
-Data Structures | |
struct | altcp_allocator_s |
-Macros | |
#define | altcp_listen(conn) altcp_listen_with_backlog_and_err(conn, TCP_DEFAULT_LISTEN_BACKLOG, NULL) |
-Typedefs | |
typedef struct altcp_allocator_s | altcp_allocator_t |
-Functions | |
struct altcp_pcb * | altcp_new_ip6 (altcp_allocator_t *allocator) |
struct altcp_pcb * | altcp_new (altcp_allocator_t *allocator) |
struct altcp_pcb * | altcp_new_ip_type (altcp_allocator_t *allocator, u8_t ip_type) |
void | altcp_arg (struct altcp_pcb *conn, void *arg) |
void | altcp_accept (struct altcp_pcb *conn, altcp_accept_fn accept) |
void | altcp_recv (struct altcp_pcb *conn, altcp_recv_fn recv) |
void | altcp_sent (struct altcp_pcb *conn, altcp_sent_fn sent) |
void | altcp_poll (struct altcp_pcb *conn, altcp_poll_fn poll, u8_t interval) |
void | altcp_err (struct altcp_pcb *conn, altcp_err_fn err) |
void | altcp_recved (struct altcp_pcb *conn, u16_t len) |
err_t | altcp_bind (struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port) |
err_t | altcp_connect (struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected) |
struct altcp_pcb * | altcp_listen_with_backlog_and_err (struct altcp_pcb *conn, u8_t backlog, err_t *err) |
void | altcp_abort (struct altcp_pcb *conn) |
err_t | altcp_close (struct altcp_pcb *conn) |
err_t | altcp_shutdown (struct altcp_pcb *conn, int shut_rx, int shut_tx) |
err_t | altcp_write (struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags) |
err_t | altcp_output (struct altcp_pcb *conn) |
u16_t | altcp_mss (struct altcp_pcb *conn) |
u16_t | altcp_sndbuf (struct altcp_pcb *conn) |
u16_t | altcp_sndqueuelen (struct altcp_pcb *conn) |
void | altcp_setprio (struct altcp_pcb *conn, u8_t prio) |
This file contains the common functions for altcp to work. For more details see Application layered TCP Introduction.
-#define altcp_listen | -( | -- | conn | ) | -altcp_listen_with_backlog_and_err(conn, TCP_DEFAULT_LISTEN_BACKLOG, NULL) | -
typedef struct altcp_allocator_s altcp_allocator_t | -
void altcp_abort | -( | -struct altcp_pcb * | -conn | ) | -- |
void altcp_accept | -( | -struct altcp_pcb * | -conn, | -
- | - | altcp_accept_fn | -accept | -
- | ) | -- |
void altcp_arg | -( | -struct altcp_pcb * | -conn, | -
- | - | void * | -arg | -
- | ) | -- |
err_t altcp_bind | -( | -struct altcp_pcb * | -conn, | -
- | - | const ip_addr_t * | -ipaddr, | -
- | - | u16_t | -port | -
- | ) | -- |
err_t altcp_close | -( | -struct altcp_pcb * | -conn | ) | -- |
err_t altcp_connect | -( | -struct altcp_pcb * | -conn, | -
- | - | const ip_addr_t * | -ipaddr, | -
- | - | u16_t | -port, | -
- | - | altcp_connected_fn | -connected | -
- | ) | -- |
void altcp_err | -( | -struct altcp_pcb * | -conn, | -
- | - | altcp_err_fn | -err | -
- | ) | -- |
struct altcp_pcb* altcp_listen_with_backlog_and_err | -( | -struct altcp_pcb * | -conn, | -
- | - | u8_t | -backlog, | -
- | - | err_t * | -err | -
- | ) | -- |
u16_t altcp_mss | -( | -struct altcp_pcb * | -conn | ) | -- |
struct altcp_pcb* altcp_new | -( | -altcp_allocator_t * | -allocator | ) | -- |
altcp_new: altcp_new for IPv4
- -struct altcp_pcb* altcp_new_ip6 | -( | -altcp_allocator_t * | -allocator | ) | -- |
altcp_new_ip6: altcp_new for IPv6
- -struct altcp_pcb* altcp_new_ip_type | -( | -altcp_allocator_t * | -allocator, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
altcp_new_ip_type: called by applications to allocate a new pcb with the help of an allocator function.
-allocator | allocator function and argument |
ip_type | IP version of the pcb (lwip_ip_addr_type) |
err_t altcp_output | -( | -struct altcp_pcb * | -conn | ) | -- |
void altcp_poll | -( | -struct altcp_pcb * | -conn, | -
- | - | altcp_poll_fn | -poll, | -
- | - | u8_t | -interval | -
- | ) | -- |
void altcp_recv | -( | -struct altcp_pcb * | -conn, | -
- | - | altcp_recv_fn | -recv | -
- | ) | -- |
void altcp_recved | -( | -struct altcp_pcb * | -conn, | -
- | - | u16_t | -len | -
- | ) | -- |
void altcp_sent | -( | -struct altcp_pcb * | -conn, | -
- | - | altcp_sent_fn | -sent | -
- | ) | -- |
void altcp_setprio | -( | -struct altcp_pcb * | -conn, | -
- | - | u8_t | -prio | -
- | ) | -- |
err_t altcp_shutdown | -( | -struct altcp_pcb * | -conn, | -
- | - | int | -shut_rx, | -
- | - | int | -shut_tx | -
- | ) | -- |
u16_t altcp_sndbuf | -( | -struct altcp_pcb * | -conn | ) | -- |
u16_t altcp_sndqueuelen | -( | -struct altcp_pcb * | -conn | ) | -- |
err_t altcp_write | -( | -struct altcp_pcb * | -conn, | -
- | - | const void * | -dataptr, | -
- | - | u16_t | -len, | -
- | - | u8_t | -apiflags | -
- | ) | -- |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Application layered TCP Functions | |
altcp (application layered TCP connection API; to be used from TCPIP thread) is an abstraction layer that prevents applications linking hard against the tcp.h functions while providing the same functionality. It is used to e.g. add SSL/TLS (see LWIP_ALTCP_TLS) or proxy-connect support to an application written for the tcp callback API without that application knowing the protocol details.
-With altcp support disabled (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. To minimize code changes in this case, the use of altcp_allocators is strongly suggested.
-To make use of this API from an existing tcp raw API application:
An altcp allocator is created by the application by combining an allocator callback function and a corresponding state, e.g.:
The struct altcp_tls_config holds state that is needed to create new TLS client or server connections (e.g. certificates and private keys).
-It is not defined by lwIP itself but by the TLS port (e.g. altcp_tls to mbedTLS adaption). However, the parameters used to create it are defined in altcp_tls.h (see altcp_tls_create_config_server_privkey_cert for servers and altcp_tls_create_config_client/altcp_tls_create_config_client_2wayauth for clients).
-For mbedTLS, ensure that certificates can be parsed by 'mbedtls_x509_crt_parse()' and private keys can be parsed by 'mbedtls_pk_parse_key()'.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
struct altcp_tls_config * | altcp_tls_create_config_server_privkey_cert (const u8_t *privkey, size_t privkey_len, const u8_t *privkey_pass, size_t privkey_pass_len, const u8_t *cert, size_t cert_len) |
struct altcp_tls_config * | altcp_tls_create_config_client (const u8_t *cert, size_t cert_len) |
struct altcp_tls_config * | altcp_tls_create_config_client_2wayauth (const u8_t *ca, size_t ca_len, const u8_t *privkey, size_t privkey_len, const u8_t *privkey_pass, size_t privkey_pass_len, const u8_t *cert, size_t cert_len) |
void | altcp_tls_free_config (struct altcp_tls_config *conf) |
struct altcp_pcb * | altcp_tls_wrap (struct altcp_tls_config *config, struct altcp_pcb *inner_pcb) |
struct altcp_pcb * | altcp_tls_new (struct altcp_tls_config *config, u8_t ip_type) |
struct altcp_pcb * | altcp_tls_alloc (void *arg, u8_t ip_type) |
void * | altcp_tls_context (struct altcp_pcb *conn) |
This file contains function prototypes for a TLS layer. A port to ARM mbedtls is provided in the apps/ tree (LWIP_ALTCP_TLS_MBEDTLS option).
-struct altcp_pcb* altcp_tls_alloc | -( | -void * | -arg, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Create new ALTCP_TLS layer pcb and its inner tcp pcb. Same as altcp_tls_new but this allocator function fits to altcp_allocator_t / altcp_new.
-'arg' must contain a struct altcp_tls_config *.
This standard allocator function creates an altcp pcb for TLS over TCP
- -void* altcp_tls_context | -( | -struct altcp_pcb * | -conn | ) | -- |
Return pointer to internal TLS context so application can tweak it. Real type depends on port (e.g. mbedtls)
- -struct altcp_tls_config* altcp_tls_create_config_client | -( | -const u8_t * | -cert, | -
- | - | size_t | -cert_len | -
- | ) | -- |
Create an ALTCP_TLS client configuration handle
- -struct altcp_tls_config* altcp_tls_create_config_client_2wayauth | -( | -const u8_t * | -ca, | -
- | - | size_t | -ca_len, | -
- | - | const u8_t * | -privkey, | -
- | - | size_t | -privkey_len, | -
- | - | const u8_t * | -privkey_pass, | -
- | - | size_t | -privkey_pass_len, | -
- | - | const u8_t * | -cert, | -
- | - | size_t | -cert_len | -
- | ) | -- |
Create an ALTCP_TLS client configuration handle with two-way server/client authentication
- -struct altcp_tls_config* altcp_tls_create_config_server_privkey_cert | -( | -const u8_t * | -privkey, | -
- | - | size_t | -privkey_len, | -
- | - | const u8_t * | -privkey_pass, | -
- | - | size_t | -privkey_pass_len, | -
- | - | const u8_t * | -cert, | -
- | - | size_t | -cert_len | -
- | ) | -- |
Create an ALTCP_TLS server configuration handle
- -void altcp_tls_free_config | -( | -struct altcp_tls_config * | -conf | ) | -- |
Free an ALTCP_TLS configuration handle
- -struct altcp_pcb* altcp_tls_new | -( | -struct altcp_tls_config * | -config, | -
- | - | u8_t | -ip_type | -
- | ) | -- |
Create new ALTCP_TLS pcb and its inner tcp pcb
-This standard allocator function creates an altcp pcb for TLS over TCP
- -struct altcp_pcb* altcp_tls_wrap | -( | -struct altcp_tls_config * | -config, | -
- | - | struct altcp_pcb * | -inner_pcb | -
- | ) | -- |
Create new ALTCP_TLS layer wrapping an existing pcb as inner connection (e.g. TLS over TCP)
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
"raw" APIs | |
Sequential-style APIs | |
Socket API | |
lwIP provides three Application Program's Interfaces (APIs) for programs to use for communication with the TCP/IP code:
The raw TCP/IP interface allows the application program to integrate better with the TCP/IP code. Program execution is event based by having callback functions being called from within the TCP/IP code. The TCP/IP code and the application program both run in the same thread. The sequential API has a much higher overhead and is not very well suited for small systems since it forces a multithreaded paradigm on the application.
-The raw TCP/IP interface is not only faster in terms of code execution time but is also less memory intensive. The drawback is that program development is somewhat harder and application programs written for the raw TCP/IP interface are more difficult to understand. Still, this is the preferred way of writing applications that should be small in code size and memory usage.
-All APIs can be used simultaneously by different application programs. In fact, the sequential API is implemented as an application program using the raw TCP/IP interface.
-Do not confuse the lwIP raw API with raw Ethernet or IP sockets. The former is a way of interfacing the lwIP network stack (including TCP and UDP), the latter refers to processing raw Ethernet or IP data instead of TCP connections or UDP packets.
-Raw API applications may never block since all packet processing (input and output) as well as timer processing (TCP mainly) is done in a single execution context.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
HTTP client | |
HTTP server | |
Iperf server | |
MDNS | |
MQTT client | |
NETBIOS responder | |
SMTP client | |
SNMPv2c/v3 agent | |
SNTP | |
TFTP server | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | autoip_set_struct (struct netif *netif, struct autoip *autoip) |
err_t | autoip_start (struct netif *netif) |
err_t | autoip_stop (struct netif *netif) |
AUTOIP related functions USAGE:
-define LWIP_AUTOIP 1 in your lwipopts.h Options: AUTOIP_TMR_INTERVAL msecs, I recommend a value of 100. The value must divide 1000 with a remainder almost 0. Possible values are 1000, 500, 333, 250, 200, 166, 142, 125, 111, 100 ....
-Without DHCP:
With DHCP:
void autoip_set_struct | -( | -struct netif * | -netif, | -
- | - | struct autoip * | -autoip | -
- | ) | -- |
Set a statically allocated struct autoip to work with. Using this prevents autoip_start to allocate it using mem_malloc.
-netif | the netif for which to set the struct autoip |
autoip | (uninitialised) autoip struct allocated by the application |
Start AutoIP client
-netif | network interface on which start the AutoIP client |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
FDB example code | |
-Data Structures | |
struct | bridgeif_initdata_s |
-Macros | |
#define | BRIDGEIF_INITDATA1(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, ethaddr) {ethaddr, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
#define | BRIDGEIF_INITDATA2(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, e0, e1, e2, e3, e4, e5) {{e0, e1, e2, e3, e4, e5}, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} |
-Typedefs | |
typedef struct bridgeif_initdata_s | bridgeif_initdata_t |
-Functions | |
err_t | bridgeif_fdb_add (struct netif *bridgeif, const struct eth_addr *addr, bridgeif_portmask_t ports) |
err_t | bridgeif_fdb_remove (struct netif *bridgeif, const struct eth_addr *addr) |
err_t | bridgeif_init (struct netif *netif) |
err_t | bridgeif_add_port (struct netif *bridgeif, struct netif *portif) |
This file implements an IEEE 802.1D bridge by using a multilayer netif approach (one hardware-independent netif for the bridge that uses hardware netifs for its ports). On transmit, the bridge selects the outgoing port(s). On receive, the port netif calls into the bridge (via its netif->input function) and the bridge selects the port(s) (and/or its netif->input function) to pass the received pbuf to.
-Usage:
#define BRIDGEIF_INITDATA1 | -( | -- | max_ports, | -
- | - | - | max_fdb_dynamic_entries, | -
- | - | - | max_fdb_static_entries, | -
- | - | - | ethaddr | -
- | ) | -{ethaddr, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} | -
Use this for constant initialization of a bridgeif_initdat_t (ethaddr must be passed as ETH_ADDR())
- -#define BRIDGEIF_INITDATA2 | -( | -- | max_ports, | -
- | - | - | max_fdb_dynamic_entries, | -
- | - | - | max_fdb_static_entries, | -
- | - | - | e0, | -
- | - | - | e1, | -
- | - | - | e2, | -
- | - | - | e3, | -
- | - | - | e4, | -
- | - | - | e5 | -
- | ) | -{{e0, e1, e2, e3, e4, e5}, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries} | -
Use this for constant initialization of a bridgeif_initdat_t (each byte of ethaddr must be passed)
- -typedef struct bridgeif_initdata_s bridgeif_initdata_t | -
Initialisation data for bridgeif_init. An instance of this type must be passed as parameter 'state' to netif_add when the bridge is added.
- -err_t bridgeif_add_port | -( | -struct netif * | -bridgeif, | -
- | - | struct netif * | -portif | -
- | ) | -- |
Add a port to the bridge
- -err_t bridgeif_fdb_add | -( | -struct netif * | -bridgeif, | -
- | - | const struct eth_addr * | -addr, | -
- | - | bridgeif_portmask_t | -ports | -
- | ) | -- |
Add a static entry to the forwarding database. A static entry marks where frames to a specific eth address (unicast or group address) are forwarded. bits [0..(BRIDGEIF_MAX_PORTS-1)]: hw ports bit [BRIDGEIF_MAX_PORTS]: cpu port 0: drop
- -err_t bridgeif_fdb_remove | -( | -struct netif * | -bridgeif, | -
- | - | const struct eth_addr * | -addr | -
- | ) | -- |
Remove a static entry from the forwarding database
- -Initialization function passed to netif_add().
-ATTENTION: A pointer to a bridgeif_initdata_t must be passed as 'state' to netif_add when adding the bridge. I supplies MAC address and controls memory allocation (number of ports, FDB size).
-netif | the lwip network interface structure for this ethernetif |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | bridgeif_fdb_update_src (void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx) |
bridgeif_portmask_t | bridgeif_fdb_get_dst_ports (void *fdb_ptr, struct eth_addr *dst_addr) |
void * | bridgeif_fdb_init (u16_t max_fdb_entries) |
This file implements an example for an FDB (Forwarding DataBase)
-bridgeif_portmask_t bridgeif_fdb_get_dst_ports | -( | -void * | -fdb_ptr, | -
- | - | struct eth_addr * | -dst_addr | -
- | ) | -- |
Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown
- -void* bridgeif_fdb_init | -( | -u16_t | -max_fdb_entries | ) | -- |
Init our simple fdb list
- -void bridgeif_fdb_update_src | -( | -void * | -fdb_ptr, | -
- | - | struct eth_addr * | -src_addr, | -
- | - | u8_t | -port_idx | -
- | ) | -- |
A real simple and slow implementation of an auto-learning forwarding database that remembers known src mac addresses to know which port to send frames destined for that mac address.
-ATTENTION: This is meant as an example only, in real-world use, you should provide a better implementation :-)
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT NO_SYS |
#define | BRIDGEIF_MAX_PORTS 7 |
#define | BRIDGEIF_DEBUG LWIP_DBG_OFF |
#define | BRIDGEIF_FDB_DEBUG LWIP_DBG_OFF |
#define | BRIDGEIF_FW_DEBUG LWIP_DBG_OFF |
#define BRIDGEIF_DEBUG LWIP_DBG_OFF | -
BRIDGEIF_DEBUG: Enable generic debugging in bridgeif.c.
- -#define BRIDGEIF_FDB_DEBUG LWIP_DBG_OFF | -
BRIDGEIF_DEBUG: Enable FDB debugging in bridgeif.c.
- -#define BRIDGEIF_FW_DEBUG LWIP_DBG_OFF | -
BRIDGEIF_DEBUG: Enable forwarding debugging in bridgeif.c.
- -#define BRIDGEIF_MAX_PORTS 7 | -
BRIDGEIF_MAX_PORTS: this is used to create a typedef used for forwarding bit-fields: the number of bits required is this + 1 (for the internal/cpu port) (63 is the maximum, resulting in an u64_t for the bit mask) ATTENTION: this controls the maximum number of the implementation only! The max. number of ports per bridge must still be passed via netif_add parameter!
- -#define BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT NO_SYS | -
BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT==1: set port netif's 'input' function to call directly into bridgeif code and on top of that, directly call into the selected forwarding port's 'linkoutput' function. This means that the bridgeif input/output path is protected from concurrent access but as well, all bridge port netif's drivers must correctly handle concurrent access! == 0: get into tcpip_thread for every input packet (no multithreading) ATTENTION: as ==0 relies on tcpip.h, the default depends on NO_SYS setting
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Application layered TCP Introduction | |
DNS | |
IP | |
Network interface (NETIF) | |
RAW | |
TCP | |
UDP | |
Ethernet | |
Non thread-safe APIs, callback style for maximum performance and minimum memory footprint. Program execution is driven by callbacks functions, which are then invoked by the lwIP core when activity related to that application occurs. A particular application may register to be notified via a callback function for events such as incoming data available, outgoing data sent, error notifications, poll timer expiration, connection closed, etc. An application can provide a callback function to perform processing for any or all of these events. Each callback is an ordinary C function that is called from within the TCP/IP code. Every callback function is passed the current TCP or UDP connection state as an argument. Also, in order to be able to keep program specific state, the callback functions are called with a program specified argument that is independent of the TCP/IP state. The raw API (sometimes called native API) is an event-driven API designed to be used without an operating system that implements zero-copy send and receive. This API is also used by the core stack for interaction between the various protocols. It is the only API available when running lwIP without an operating system.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | BYTE_ORDER LITTLE_ENDIAN |
#define | LWIP_RAND() ((u32_t)rand()) |
#define | LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) |
#define | LWIP_PLATFORM_ASSERT(x) |
#define | LWIP_NO_STDDEF_H 0 |
#define | LWIP_NO_STDINT_H 0 |
#define | LWIP_NO_INTTYPES_H 0 |
#define | LWIP_NO_LIMITS_H 0 |
#define | LWIP_NO_CTYPE_H 0 |
#define | LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val)) |
#define | LWIP_ALIGNMENT_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) |
#define | LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) |
#define | LWIP_PACKED_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) |
#define | LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)] |
#define | LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U)) |
#define | LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1U)) |
#define | LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) |
#define | PACK_STRUCT_BEGIN |
#define | PACK_STRUCT_END |
#define | PACK_STRUCT_STRUCT |
#define | PACK_STRUCT_FIELD(x) x |
#define | PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x) |
#define | PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x) |
#define | PACK_STRUCT_USE_INCLUDES |
#define | LWIP_UNUSED_ARG(x) (void)x |
#define | LWIP_PROVIDE_ERRNO |
All defines related to this section must not be placed in lwipopts.h, but in arch/cc.h! If the compiler does not provide memset() this file must include a definition of it, or include a file which defines it. These options cannot be #defined in lwipopts.h since they are not options of lwIP itself, but options of the lwIP port to your system.
-#define BYTE_ORDER LITTLE_ENDIAN | -
Define the byte order of the system. Needed for conversion of network data to host byte order. Allowed values: LITTLE_ENDIAN and BIG_ENDIAN
- -#define LWIP_ALIGNMENT_CAST | -( | -- | target_type, | -
- | - | - | val | -
- | ) | -LWIP_CONST_CAST(target_type, val) | -
Get rid of alignment cast warnings (GCC -Wcast-align)
- -#define LWIP_CONST_CAST | -( | -- | target_type, | -
- | - | - | val | -
- | ) | -((target_type)((ptrdiff_t)val)) | -
C++ const_cast<target_type>(val) equivalent to remove constness from a value (GCC -Wcast-qual)
- -#define LWIP_DECLARE_MEMORY_ALIGNED | -( | -- | variable_name, | -
- | - | - | size | -
- | ) | -u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)] | -
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.
-e.g. if you use gcc and need 32 bit alignment:
-#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[size] __attribute__((aligned(4)))
-or more portable:
-#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)]
#define LWIP_MEM_ALIGN | -( | -- | addr | ) | -((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) | -
Align a memory pointer to the alignment defined by MEM_ALIGNMENT so that ADDR % MEM_ALIGNMENT == 0
- -#define LWIP_MEM_ALIGN_BUFFER | -( | -- | size | ) | -(((size) + MEM_ALIGNMENT - 1U)) | -
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*)
- -#define LWIP_MEM_ALIGN_SIZE | -( | -- | size | ) | -(((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U)) | -
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).
- -#define LWIP_NO_CTYPE_H 0 | -
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.
- -#define LWIP_NO_INTTYPES_H 0 | -
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 LWIP_NO_LIMITS_H 0 | -
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 LWIP_NO_STDDEF_H 0 | -
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 LWIP_NO_STDINT_H 0 | -
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 LWIP_PACKED_CAST | -( | -- | target_type, | -
- | - | - | val | -
- | ) | -LWIP_CONST_CAST(target_type, val) | -
Avoid warnings/errors related to implicitly casting away packed attributes by doing a explicit cast
- -#define LWIP_PLATFORM_ASSERT | -( | -- | x | ) | -- |
Platform specific assertion handling.
-Note the default implementation pulls in printf, fflush and abort, 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.
#define LWIP_PLATFORM_DIAG | -( | -- | x | ) | -do {printf x;} while(0) | -
Platform specific diagnostic output.
-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.
#define LWIP_PROVIDE_ERRNO | -
LWIP_PROVIDE_ERRNO==1: Let lwIP provide ERRNO values and the 'errno' variable. If this is disabled, cc.h must either define 'errno', include <errno.h>, define LWIP_ERRNO_STDINCLUDE to get <errno.h> included or define LWIP_ERRNO_INCLUDE to <errno.h> or equivalent.
- -#define LWIP_PTR_NUMERIC_CAST | -( | -- | target_type, | -
- | - | - | val | -
- | ) | -LWIP_CONST_CAST(target_type, val) | -
Get rid of warnings related to pointer-to-numeric and vice-versa casts, e.g. "conversion from 'u8_t' to 'void *' of greater size"
- -#define LWIP_RAND | -( | -) | -((u32_t)rand()) | -
Define random number generator function of your system
- -#define LWIP_UNUSED_ARG | -( | -- | x | ) | -(void)x | -
Eliminates compiler warning about unused arguments (GCC -Wextra -Wunused).
- -#define PACK_STRUCT_BEGIN | -
Packed structs support. Placed BEFORE declaration of a packed struct.
-For examples of packed struct declarations, see include/lwip/prot/ subfolder.
-A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
#define PACK_STRUCT_END | -
Packed structs support. Placed AFTER declaration of a packed struct.
-For examples of packed struct declarations, see include/lwip/prot/ subfolder.
-A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
#define PACK_STRUCT_FIELD | -( | -- | x | ) | -x | -
Packed structs support. Wraps u32_t and u16_t members.
-For examples of packed struct declarations, see include/lwip/prot/ subfolder.
-A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
#define PACK_STRUCT_FLD_8 | -( | -- | x | ) | -PACK_STRUCT_FIELD(x) | -
Packed structs support. Wraps u8_t members, where some compilers warn that packing is not necessary.
-For examples of packed struct declarations, see include/lwip/prot/ subfolder.
-A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
#define PACK_STRUCT_FLD_S | -( | -- | x | ) | -PACK_STRUCT_FIELD(x) | -
Packed structs support. Wraps members that are packed structs themselves, where some compilers warn that packing is not necessary.
-For examples of packed struct declarations, see include/lwip/prot/ subfolder.
-A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
#define PACK_STRUCT_STRUCT | -
Packed structs support. Placed between end of declaration of a packed struct and trailing semicolon.
-For examples of packed struct declarations, see include/lwip/prot/ subfolder.
-A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
#define PACK_STRUCT_USE_INCLUDES | -
PACK_STRUCT_USE_INCLUDES==1: Packed structs support using #include files before and after struct to be packed.
-The file included BEFORE the struct is "arch/bpstruct.h".
-The file included AFTER the struct is "arch/epstruct.h".
-This can be used to implement struct packing on MS Visual C compilers, see the Win32 port in the lwIP contrib repository for reference. For examples of packed struct declarations, see include/lwip/prot/ subfolder.
-A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Debug level (LWIP_DBG_MIN_LEVEL) | |
#define | LWIP_DBG_LEVEL_ALL 0x00 |
#define | LWIP_DBG_LEVEL_WARNING 0x01 |
#define | LWIP_DBG_LEVEL_SERIOUS 0x02 |
#define | LWIP_DBG_LEVEL_SEVERE 0x03 |
-Enable/disable debug messages completely (LWIP_DBG_TYPES_ON) | |
#define | LWIP_DBG_ON 0x80U |
#define | LWIP_DBG_OFF 0x00U |
-Debug message types (LWIP_DBG_TYPES_ON) | |
#define | LWIP_DBG_TRACE 0x40U |
#define | LWIP_DBG_STATE 0x20U |
#define | LWIP_DBG_FRESH 0x10U |
#define | LWIP_DBG_HALT 0x08U |
#define LWIP_DBG_FRESH 0x10U | -
flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet
- -#define LWIP_DBG_HALT 0x08U | -
flag for LWIP_DEBUGF to halt after printing this debug message
- -#define LWIP_DBG_LEVEL_ALL 0x00 | -
Debug level: ALL messages
- -#define LWIP_DBG_LEVEL_SERIOUS 0x02 | -
Debug level: Serious. memory allocation failures, ...
- -#define LWIP_DBG_LEVEL_SEVERE 0x03 | -
Debug level: Severe
- -#define LWIP_DBG_LEVEL_WARNING 0x01 | -
Debug level: Warnings. bad checksums, dropped packets, ...
- -#define LWIP_DBG_OFF 0x00U | -
flag for LWIP_DEBUGF to disable that debug message
- -#define LWIP_DBG_ON 0x80U | -
flag for LWIP_DEBUGF to enable that debug message
- -#define LWIP_DBG_STATE 0x20U | -
flag for LWIP_DEBUGF indicating a state debug message (to follow module states)
- -#define LWIP_DBG_TRACE 0x40U | -
flag for LWIP_DEBUGF indicating a tracing message (to follow program flow)
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | dhcp_set_struct (struct netif *netif, struct dhcp *dhcp) |
void | dhcp_cleanup (struct netif *netif) |
err_t | dhcp_start (struct netif *netif) |
void | dhcp_inform (struct netif *netif) |
err_t | dhcp_renew (struct netif *netif) |
void | dhcp_release_and_stop (struct netif *netif) |
err_t | dhcp_release (struct netif *netif) |
void | dhcp_stop (struct netif *netif) |
DHCP (IPv4) related functions This is a DHCP client for the lwIP TCP/IP stack. It aims to conform with RFC 2131 and RFC 2132.
-Options: DHCP_COARSE_TIMER_SECS (recommended 60 which is a minute) DHCP_FINE_TIMER_MSECS (recommended 500 which equals TCP coarse timer)
-dhcp_start() starts a DHCP client instance which configures the interface by obtaining an IP address lease and maintaining it.
-Use dhcp_release() to end the lease and use dhcp_stop() to remove the DHCP client.
-void dhcp_cleanup | -( | -struct netif * | -netif | ) | -- |
Removes a struct dhcp from a netif.
-ATTENTION: Only use this when not using dhcp_set_struct() to allocate the struct dhcp since the memory is passed back to the heap.
-netif | the netif from which to remove the struct dhcp |
void dhcp_inform | -( | -struct netif * | -netif | ) | -- |
Inform a DHCP server of our manual configuration.
-This informs DHCP servers of our fixed IP address configuration by sending an INFORM message. It does not involve DHCP address configuration, it is just here to be nice to the network.
-netif | The lwIP network interface |
This function calls dhcp_release_and_stop() internally.
void dhcp_release_and_stop | -( | -struct netif * | -netif | ) | -- |
Release a DHCP lease and stop DHCP statemachine (and AUTOIP if LWIP_DHCP_AUTOIP_COOP).
-netif | network interface |
Renew an existing DHCP lease at the involved DHCP server.
-netif | network interface which must renew its lease |
void dhcp_set_struct | -( | -struct netif * | -netif, | -
- | - | struct dhcp * | -dhcp | -
- | ) | -- |
Set a statically allocated struct dhcp to work with. Using this prevents dhcp_start to allocate it using mem_malloc.
-netif | the netif for which to set the struct dhcp |
dhcp | (uninitialised) dhcp struct allocated by the application |
Start DHCP negotiation for a network interface.
-If no DHCP client instance was attached to this interface, a new client is created first. If a DHCP client instance was already present, it restarts negotiation.
-netif | The lwIP network interface |
void dhcp_stop | -( | -struct netif * | -netif | ) | -- |
This function calls dhcp_release_and_stop() internally.
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | dhcp6_set_struct (struct netif *netif, struct dhcp6 *dhcp6) |
void | dhcp6_cleanup (struct netif *netif) |
err_t | dhcp6_enable_stateful (struct netif *netif) |
err_t | dhcp6_enable_stateless (struct netif *netif) |
void | dhcp6_disable (struct netif *netif) |
DHCPv6 client: IPv6 address autoconfiguration as per RFC 3315 (stateful DHCPv6) and RFC 3736 (stateless DHCPv6).
-For now, only stateless DHCPv6 is implemented!
-TODO:
dhcp6_enable_stateful() enables stateful DHCPv6 for a netif (stateless disabled)
-dhcp6_enable_stateless() enables stateless DHCPv6 for a netif (stateful disabled)
-dhcp6_disable() disable DHCPv6 for a netif
When enabled, requests are only issued after receipt of RA with the corresponding bits set.
-void dhcp6_cleanup | -( | -struct netif * | -netif | ) | -- |
Removes a struct dhcp6 from a netif.
-ATTENTION: Only use this when not using dhcp6_set_struct() to allocate the struct dhcp6 since the memory is passed back to the heap.
-netif | the netif from which to remove the struct dhcp |
void dhcp6_disable | -( | -struct netif * | -netif | ) | -- |
Disable stateful or stateless DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_OTHER_CONFIG flag set.
- -Enable stateful DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_MANAGED_ADDR_CONFIG flag set.
-A struct dhcp6 will be allocated for this netif if not set via dhcp6_set_struct before.
- -Enable stateless DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_OTHER_CONFIG flag set.
-A struct dhcp6 will be allocated for this netif if not set via dhcp6_set_struct before.
- -void dhcp6_set_struct | -( | -struct netif * | -netif, | -
- | - | struct dhcp6 * | -dhcp6 | -
- | ) | -- |
Set a statically allocated struct dhcp6 to work with. Using this prevents dhcp6_start to allocate it using mem_malloc.
-netif | the netif for which to set the struct dhcp |
dhcp6 | (uninitialised) dhcp6 struct allocated by the application |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | dns_setserver (u8_t numdns, const ip_addr_t *dnsserver) |
const ip_addr_t * | dns_getserver (u8_t numdns) |
err_t | dns_gethostbyname (const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg) |
err_t | dns_gethostbyname_addrtype (const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg, u8_t dns_addrtype) |
Implements a DNS host name to IP address resolver.
-The lwIP DNS resolver functions are used to lookup a host name and map it to a numerical IP address. It maintains a list of resolved hostnames that can be queried with the dns_lookup() function. New hostnames can be resolved using the dns_query() function.
-The lwIP version of the resolver also adds a non-blocking version of gethostbyname() that will work with a raw API application. This function checks for an IP address string first and converts it if it is valid. gethostbyname() then does a dns_lookup() to see if the name is already in the table. If so, the IP is returned. If not, a query is issued and the function returns with a ERR_INPROGRESS status. The app using the dns client must then go into a waiting state.
-Once a hostname has been resolved (or found to be non-existent), the resolver code calls a specified callback function (which must be implemented by the module that uses the resolver).
-Multicast DNS queries are supported for names ending on ".local". However, only "One-Shot Multicast DNS Queries" are supported (RFC 6762 chapter 5.1), this is not a fully compliant implementation of continuous mDNS querying!
-All functions must be called from TCPIP thread.
-err_t dns_gethostbyname | -( | -const char * | -hostname, | -
- | - | ip_addr_t * | -addr, | -
- | - | dns_found_callback | -found, | -
- | - | void * | -callback_arg | -
- | ) | -- |
Resolve a hostname (string) into an IP address. NON-BLOCKING callback version for use with raw API!!!
-Returns immediately with one of err_t return codes:
hostname | the hostname that is to be queried |
addr | pointer to a ip_addr_t where to store the address if it is already cached in the dns_table (only valid if ERR_OK is returned!) |
found | a callback function to be called on success, failure or timeout (only if ERR_INPROGRESS is returned!) |
callback_arg | argument to pass to the callback function |
err_t dns_gethostbyname_addrtype | -( | -const char * | -hostname, | -
- | - | ip_addr_t * | -addr, | -
- | - | dns_found_callback | -found, | -
- | - | void * | -callback_arg, | -
- | - | u8_t | -dns_addrtype | -
- | ) | -- |
Like dns_gethostbyname, but returned address type can be controlled:
hostname | the hostname that is to be queried |
addr | pointer to a ip_addr_t where to store the address if it is already cached in the dns_table (only valid if ERR_OK is returned!) |
found | a callback function to be called on success, failure or timeout (only if ERR_INPROGRESS is returned!) |
callback_arg | argument to pass to the callback function |
dns_addrtype | - LWIP_DNS_ADDRTYPE_IPV4_IPV6: try to resolve IPv4 first, try IPv6 if IPv4 fails only
|
const ip_addr_t* dns_getserver | -( | -u8_t | -numdns | ) | -- |
Obtain one of the currently configured DNS server.
-numdns | the index of the DNS server |
void dns_setserver | -( | -u8_t | -numdns, | -
- | - | const ip_addr_t * | -dnsserver | -
- | ) | -- |
Initialize one of the DNS servers.
-numdns | the index of the DNS server to set must be < DNS_MAX_SERVERS |
dnsserver | IP address of the DNS server to set |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | ethernet_output (struct netif *netif, struct pbuf *p, const struct eth_addr *src, const struct eth_addr *dst, u16_t eth_type) |
err_t ethernet_output | -( | -struct netif * | -netif, | -
- | - | struct pbuf * | -p, | -
- | - | const struct eth_addr * | -src, | -
- | - | const struct eth_addr * | -dst, | -
- | - | u16_t | -eth_type | -
- | ) | -- |
Send an ethernet packet on the network using netif->linkoutput(). The ethernet header is filled in before sending.
-netif | the lwIP network interface on which to send the packet |
p | the packet to send. pbuf layer must be PBUF_LINK. |
src | the source MAC address to be copied into the ethernet header |
dst | the destination MAC address to be copied into the ethernet header |
eth_type | ethernet type (lwip_ieee_eth_type) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_HTTPC_HAVE_FILE_IO 0 |
#define | HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP |
-Typedefs | |
typedef enum ehttpc_result | httpc_result_t |
typedef void(* | httpc_result_fn) (void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err) |
typedef err_t(* | httpc_headers_done_fn) (httpc_state_t *connection, void *arg, struct pbuf *hdr, u16_t hdr_len, u32_t content_len) |
-Enumerations | |
enum | ehttpc_result { - HTTPC_RESULT_OK = 0, -HTTPC_RESULT_ERR_UNKNOWN = 1, -HTTPC_RESULT_ERR_CONNECT = 2, -HTTPC_RESULT_ERR_HOSTNAME = 3, - - HTTPC_RESULT_ERR_CLOSED = 4, -HTTPC_RESULT_ERR_TIMEOUT = 5, -HTTPC_RESULT_ERR_SVR_RESP = 6, -HTTPC_RESULT_ERR_MEM = 7, - - HTTPC_RESULT_LOCAL_ABORT = 8, -HTTPC_RESULT_ERR_CONTENT_LEN = 9 - - } |
-Functions | |
err_t | httpc_get_file (const ip_addr_t *server_addr, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection) |
err_t | httpc_get_file_dns (const char *server_name, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection) |
#define HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP | -
The default TCP port used for HTTP
- -#define LWIP_HTTPC_HAVE_FILE_IO 0 | -
HTTPC_HAVE_FILE_IO: define this to 1 to have functions dowloading directly to disk via fopen/fwrite. These functions are example implementations of the interface only.
- -typedef err_t(* httpc_headers_done_fn) (httpc_state_t *connection, void *arg, struct pbuf *hdr, u16_t hdr_len, u32_t content_len) | -
Prototype of http client callback: called when the headers are received
-connection | http client connection |
arg | argument specified when initiating the request |
hdr | header pbuf(s) (may contain data also) |
hdr_len | length of the heders in 'hdr' |
content_len | content length as received in the headers (-1 if not received) |
typedef void(* httpc_result_fn) (void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err) | -
Prototype of a http client callback function
-arg | argument specified when initiating the request |
httpc_result | result of the http transfer (see enum httpc_result_t) |
rx_content_len | number of bytes received (without headers) |
srv_res | this contains the http status code received (if any) |
err | an error returned by internal lwip functions, can help to specify the source of the error but must not necessarily be != ERR_OK |
typedef enum ehttpc_result httpc_result_t | -
HTTP client result codes
- -enum ehttpc_result | -
HTTP client result codes
-Enumerator | |
---|---|
HTTPC_RESULT_OK | File successfully received - |
HTTPC_RESULT_ERR_UNKNOWN | Unknown error - |
HTTPC_RESULT_ERR_CONNECT | Connection to server failed - |
HTTPC_RESULT_ERR_HOSTNAME | Failed to resolve server hostname - |
HTTPC_RESULT_ERR_CLOSED | Connection unexpectedly closed by remote server - |
HTTPC_RESULT_ERR_TIMEOUT | Connection timed out (server didn't respond in time) - |
HTTPC_RESULT_ERR_SVR_RESP | Server responded with an error code - |
HTTPC_RESULT_ERR_MEM | Local memory error - |
HTTPC_RESULT_LOCAL_ABORT | Local abort - |
HTTPC_RESULT_ERR_CONTENT_LEN | Content length mismatch - |
err_t httpc_get_file | -( | -const ip_addr_t * | -server_addr, | -
- | - | u16_t | -port, | -
- | - | const char * | -uri, | -
- | - | const httpc_connection_t * | -settings, | -
- | - | altcp_recv_fn | -recv_fn, | -
- | - | void * | -callback_arg, | -
- | - | httpc_state_t ** | -connection | -
- | ) | -- |
HTTP client API: get a file by passing server IP address
-server_addr | IP address of the server to connect |
port | tcp port of the server |
uri | uri to get from the server, remember leading "/"! |
settings | connection settings (callbacks, proxy, etc.) |
recv_fn | the http body (not the headers) are passed to this callback |
callback_arg | argument passed to all the callbacks |
connection | retreives the connection handle (to match in callbacks) |
err_t httpc_get_file_dns | -( | -const char * | -server_name, | -
- | - | u16_t | -port, | -
- | - | const char * | -uri, | -
- | - | const httpc_connection_t * | -settings, | -
- | - | altcp_recv_fn | -recv_fn, | -
- | - | void * | -callback_arg, | -
- | - | httpc_state_t ** | -connection | -
- | ) | -- |
HTTP client API: get a file by passing server name as string (DNS name or IP address string)
-server_name | server name as string (DNS name or IP address string) |
port | tcp port of the server |
uri | uri to get from the server, remember leading "/"! |
settings | connection settings (callbacks, proxy, etc.) |
recv_fn | the http body (not the headers) are passed to this callback |
callback_arg | argument passed to all the callbacks |
connection | retreives the connection handle (to match in callbacks) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
-Data Structures | |
struct | tCGI |
-Typedefs | |
typedef const char *(* | tCGIHandler) (int iIndex, int iNumParams, char *pcParam[], char *pcValue[]) |
typedef u16_t(* | tSSIHandler) (const char *ssi_tag_name, char *pcInsert, int iInsertLen) |
-Functions | |
void | httpd_post_data_recved (void *connection, u16_t recved_len) |
void | httpd_init (void) |
void | httpd_inits (struct altcp_tls_config *conf) |
void | http_set_ssi_handler (tSSIHandler ssi_handler, const char **tags, int num_tags) |
void | http_set_cgi_handlers (const tCGI *cgis, int num_handlers) |
err_t | httpd_post_begin (void *connection, const char *uri, const char *http_request, u16_t http_request_len, int content_len, char *response_uri, u16_t response_uri_len, u8_t *post_auto_wnd) |
err_t | httpd_post_receive_data (void *connection, struct pbuf *p) |
void | httpd_post_finished (void *connection, char *response_uri, u16_t response_uri_len) |
This httpd supports for a rudimentary server-side-include facility which will replace tags of the form in any file whose extension is .shtml, .shtm or .ssi with strings provided by an include handler whose pointer is provided to the module via function http_set_ssi_handler(). Additionally, a simple common gateway interface (CGI) handling mechanism has been added to allow clients to hook functions to particular request URIs.
-To enable SSI support, define label LWIP_HTTPD_SSI in lwipopts.h. To enable CGI support, define label LWIP_HTTPD_CGI in lwipopts.h.
-By default, the server assumes that HTTP headers are already present in each file stored in the file system. By defining LWIP_HTTPD_DYNAMIC_HEADERS in lwipopts.h, this behavior can be changed such that the server inserts the headers automatically based on the extension of the file being served. If this mode is used, be careful to ensure that the file system image used does not already contain the header information.
-File system images without headers can be created using the makefsfile tool with the -h command line option.
-The following assumptions are made about tags used in SSI markers:
-The simple CGI support offered here works with GET method requests only and can handle up to 16 parameters encoded into the URI. The handler function may not write directly to the HTTP output but must return a filename that the HTTP server will send to the browser as a response to the incoming CGI request.
-The list of supported file types is quite short, so if makefsdata complains about an unknown extension, make sure to add it (and its doctype) to the 'g_psHTTPHeaders' list.
-typedef const char*(* tCGIHandler) (int iIndex, int iNumParams, char *pcParam[], char *pcValue[]) | -
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.
- -typedef u16_t(* tSSIHandler) (const char *ssi_tag_name, char *pcInsert, int iInsertLen) | -
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 "<!--#name-->" 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).
- -void http_set_cgi_handlers | -( | -const tCGI * | -cgis, | -
- | - | int | -num_handlers | -
- | ) | -- |
Set an array of CGI filenames/handler functions
-cgis | an array of CGI filenames/handler functions |
num_handlers | number of elements in the 'cgis' array |
void http_set_ssi_handler | -( | -tSSIHandler | -ssi_handler, | -
- | - | const char ** | -tags, | -
- | - | int | -num_tags | -
- | ) | -- |
Set the SSI handler function.
-ssi_handler | the SSI handler function |
tags | an array of SSI tag strings to search for in SSI-enabled files |
num_tags | number of tags in the 'tags' array |
void httpd_init | -( | -void | -) | -- |
Initialize the httpd: set up a listening PCB and bind it to the defined port
- -void httpd_inits | -( | -struct altcp_tls_config * | -conf | ) | -- |
Initialize the httpd: set up a listening PCB and bind it to the defined port. Also set up TLS connection handling (HTTPS).
- -err_t httpd_post_begin | -( | -void * | -connection, | -
- | - | const char * | -uri, | -
- | - | const char * | -http_request, | -
- | - | u16_t | -http_request_len, | -
- | - | int | -content_len, | -
- | - | char * | -response_uri, | -
- | - | u16_t | -response_uri_len, | -
- | - | u8_t * | -post_auto_wnd | -
- | ) | -- |
Called when a POST request has been received. The application can decide whether to accept it or not.
-connection | Unique connection identifier, valid until httpd_post_end is called. |
uri | The HTTP header URI receiving the POST request. |
http_request | The raw HTTP request (the first packet, normally). |
http_request_len | Size of 'http_request'. |
content_len | Content-Length from HTTP header. |
response_uri | Filename of response file, to be filled when denying the request |
response_uri_len | Size of the 'response_uri' buffer. |
post_auto_wnd | Set this to 0 to let the callback code handle window updates by calling 'httpd_post_data_recved' (to throttle rx speed) default is 1 (httpd handles window updates automatically) |
void httpd_post_data_recved | -( | -void * | -connection, | -
- | - | u16_t | -recved_len | -
- | ) | -- |
A POST implementation can call this function to update the TCP window. This can be used to throttle data reception (e.g. when received data is programmed to flash and data is received faster than programmed).
-connection | A connection handle passed to httpd_post_begin for which httpd_post_finished has NOT been called yet! |
recved_len | Length of data received (for window update) |
void httpd_post_finished | -( | -void * | -connection, | -
- | - | char * | -response_uri, | -
- | - | u16_t | -response_uri_len | -
- | ) | -- |
Called when all data is received or when the connection is closed. The application must return the filename/URI of a file to send in response to this POST request. If the response_uri buffer is untouched, a 404 response is returned.
-connection | Unique connection identifier. |
response_uri | Filename of response file, to be filled when denying the request |
response_uri_len | Size of the 'response_uri' buffer. |
err_t httpd_post_receive_data | -( | -void * | -connection, | -
- | - | struct pbuf * | -p | -
- | ) | -- |
Called for each pbuf of data that has been received for a POST. ATTENTION: The application is responsible for freeing the pbufs passed in!
-connection | Unique connection identifier. |
p | Received data. |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_HTTPD_CGI 0 |
#define | LWIP_HTTPD_CGI_SSI 0 |
#define | LWIP_HTTPD_SSI 0 |
#define | LWIP_HTTPD_SSI_RAW 0 |
#define | LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1 |
#define | LWIP_HTTPD_SUPPORT_POST 0 |
#define | LWIP_HTTPD_SSI_MULTIPART 0 |
#define | HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" |
#define | LWIP_HTTPD_DYNAMIC_HEADERS 0 |
#define | HTTPD_USE_MEM_POOL 0 |
#define | HTTPD_SERVER_PORT LWIP_IANA_PORT_HTTP |
#define | HTTPD_SERVER_PORT_HTTPS LWIP_IANA_PORT_HTTPS |
#define | HTTPD_ENABLE_HTTPS 0 |
#define | HTTPD_MAX_RETRIES 4 |
#define | HTTPD_POLL_INTERVAL 4 |
#define | HTTPD_TCP_PRIO TCP_PRIO_MIN |
#define | LWIP_HTTPD_TIMING 0 |
#define | HTTPD_DEBUG_TIMING LWIP_DBG_OFF |
#define | LWIP_HTTPD_SUPPORT_EXTSTATUS 0 |
#define | LWIP_HTTPD_SUPPORT_V09 1 |
#define | LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0 |
#define | LWIP_HTTPD_SUPPORT_REQUESTLIST 1 |
#define | LWIP_HTTPD_REQ_QUEUELEN 5 |
#define | LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH |
#define | LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE)) |
#define | LWIP_HTTPD_MAX_REQUEST_URI_LEN 63 |
#define | LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63 |
#define | LWIP_HTTPD_SSI_INCLUDE_TAG 1 |
#define | LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0 |
#define | LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0 |
#define | LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0 |
#define | HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY |
#define | LWIP_HTTPD_CUSTOM_FILES 0 |
#define | LWIP_HTTPD_DYNAMIC_FILE_READ 0 |
#define | LWIP_HTTPD_FILE_STATE 0 |
#define | HTTPD_PRECALCULATED_CHECKSUM 0 |
#define | LWIP_HTTPD_FS_ASYNC_READ 0 |
#define | HTTPD_FSDATA_FILE "fsdata.c" |
#define HTTP_IS_TAG_VOLATILE | -( | -- | ptr | ) | -TCP_WRITE_FLAG_COPY | -
Default: Tags are sent from struct http_state and are therefore volatile
- -#define HTTPD_DEBUG_TIMING LWIP_DBG_OFF | -
Set this to 1 to enable timing each file sent
- -#define HTTPD_ENABLE_HTTPS 0 | -
Enable https support?
- -#define HTTPD_FSDATA_FILE "fsdata.c" | -
Filename (including path) to use as FS data file
- -#define HTTPD_MAX_RETRIES 4 | -
Maximum retries before the connection is aborted/closed.
#define HTTPD_POLL_INTERVAL 4 | -
The poll delay is X*500ms
- -#define HTTPD_PRECALCULATED_CHECKSUM 0 | -
HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for predefined (MSS-sized) chunks of the files to prevent having to calculate the checksums at runtime.
- -#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" | -
This string is passed in the HTTP header as "Server: "
- -#define HTTPD_SERVER_PORT LWIP_IANA_PORT_HTTP | -
The server port for HTTPD to use
- -#define HTTPD_SERVER_PORT_HTTPS LWIP_IANA_PORT_HTTPS | -
The https server port for HTTPD to use
- -#define HTTPD_TCP_PRIO TCP_PRIO_MIN | -
Priority for tcp pcbs created by HTTPD (very low by default). Lower priorities get killed first when running out of memory.
- -#define HTTPD_USE_MEM_POOL 0 | -
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).
- -#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0 | -
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.
- -#define LWIP_HTTPD_CGI 0 | -
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.
- -#define LWIP_HTTPD_CGI_SSI 0 | -
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.
- -#define LWIP_HTTPD_CUSTOM_FILES 0 | -
Set this to 1 and provide the functions:
#define LWIP_HTTPD_DYNAMIC_FILE_READ 0 | -
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().
- -#define LWIP_HTTPD_DYNAMIC_HEADERS 0 | -
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.
- -#define LWIP_HTTPD_FILE_STATE 0 | -
Set this to 1 to include an application state argument per file that is opened. This allows to keep a state per connection/file.
- -#define LWIP_HTTPD_FS_ASYNC_READ 0 | -
LWIP_HTTPD_FS_ASYNC_READ==1: support asynchronous read operations (fs_read_async returns FS_READ_DELAYED and calls a callback when finished).
- -#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0 | -
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.
- -#define LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE)) | -
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)
- -#define LWIP_HTTPD_MAX_REQUEST_URI_LEN 63 | -
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.
- -#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0 | -
Set this to 1 to send URIs without extension without headers (who uses this at all??)
- -#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63 | -
Maximum length of the filename to send as response to a POST request, filled in by the application when a POST is finished.
- -#define LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH | -
Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming request (up to the first double-newline)
- -#define LWIP_HTTPD_REQ_QUEUELEN 5 | -
Number of rx pbufs to enqueue to parse an incoming request (up to the first newline)
- -#define LWIP_HTTPD_SSI 0 | -
Set this to 1 to support SSI (Server-Side-Includes)
-In contrast to other http servers, this only calls a preregistered callback function (
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 (
#define LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1 | -
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
- -#define LWIP_HTTPD_SSI_INCLUDE_TAG 1 | -
Set this to 0 to not send the SSI tag (default is on, so the tag will be sent in the HTML page
- -#define LWIP_HTTPD_SSI_MULTIPART 0 | -
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.
- -#define LWIP_HTTPD_SSI_RAW 0 | -
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.
- -#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0 | -
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).
- -#define LWIP_HTTPD_SUPPORT_EXTSTATUS 0 | -
Set this to one to show error pages when parsing a request fails instead of simply closing the connection.
- -#define LWIP_HTTPD_SUPPORT_POST 0 | -
Set this to 1 to support HTTP POST
- -#define LWIP_HTTPD_SUPPORT_REQUESTLIST 1 | -
Set this to 1 to support HTTP request coming in in multiple packets/pbufs
- -#define LWIP_HTTPD_SUPPORT_V09 1 | -
Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes)
- -#define LWIP_HTTPD_TIMING 0 | -
Set this to 1 to enable timing each file sent
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Enumerations | |
enum | lwip_iana_hwtype { LWIP_IANA_HWTYPE_ETHERNET = 1 - } |
enum | lwip_iana_port_number { - LWIP_IANA_PORT_SMTP = 25, -LWIP_IANA_PORT_DHCP_SERVER = 67, -LWIP_IANA_PORT_DHCP_CLIENT = 68, -LWIP_IANA_PORT_TFTP = 69, - - LWIP_IANA_PORT_HTTP = 80, -LWIP_IANA_PORT_SNTP = 123, -LWIP_IANA_PORT_NETBIOS = 137, -LWIP_IANA_PORT_SNMP = 161, - - LWIP_IANA_PORT_SNMP_TRAP = 162, -LWIP_IANA_PORT_HTTPS = 443, -LWIP_IANA_PORT_SMTPS = 465, -LWIP_IANA_PORT_MQTT = 1883, - - LWIP_IANA_PORT_MDNS = 5353, -LWIP_IANA_PORT_SECURE_MQTT = 8883 - - } |
enum lwip_iana_hwtype | -
enum lwip_iana_port_number | -
Port numbers https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt
-Enumerator | |
---|---|
LWIP_IANA_PORT_SMTP | SMTP - |
LWIP_IANA_PORT_DHCP_SERVER | DHCP server - |
LWIP_IANA_PORT_DHCP_CLIENT | DHCP client - |
LWIP_IANA_PORT_TFTP | TFTP - |
LWIP_IANA_PORT_HTTP | HTTP - |
LWIP_IANA_PORT_SNTP | SNTP - |
LWIP_IANA_PORT_NETBIOS | NETBIOS - |
LWIP_IANA_PORT_SNMP | SNMP - |
LWIP_IANA_PORT_SNMP_TRAP | SNMP traps - |
LWIP_IANA_PORT_HTTPS | HTTPS - |
LWIP_IANA_PORT_SMTPS | SMTPS - |
LWIP_IANA_PORT_MQTT | MQTT - |
LWIP_IANA_PORT_MDNS | MDNS - |
LWIP_IANA_PORT_SECURE_MQTT | Secure MQTT - |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Enumerations | |
enum | lwip_ieee_eth_type { - ETHTYPE_IP = 0x0800U, -ETHTYPE_ARP = 0x0806U, -ETHTYPE_WOL = 0x0842U, -ETHTYPE_RARP = 0x8035U, - - ETHTYPE_VLAN = 0x8100U, -ETHTYPE_IPV6 = 0x86DDU, -ETHTYPE_PPPOEDISC = 0x8863U, -ETHTYPE_PPPOE = 0x8864U, - - ETHTYPE_JUMBO = 0x8870U, -ETHTYPE_PROFINET = 0x8892U, -ETHTYPE_ETHERCAT = 0x88A4U, -ETHTYPE_LLDP = 0x88CCU, - - ETHTYPE_SERCOS = 0x88CDU, -ETHTYPE_MRP = 0x88E3U, -ETHTYPE_PTP = 0x88F7U, -ETHTYPE_QINQ = 0x9100U - - } |
enum lwip_ieee_eth_type | -
A list of often ethtypes (although lwIP does not use all of them).
-Enumerator | |
---|---|
ETHTYPE_IP | Internet protocol v4 - |
ETHTYPE_ARP | Address resolution protocol - |
ETHTYPE_WOL | Wake on lan - |
ETHTYPE_RARP | RARP - |
ETHTYPE_VLAN | Virtual local area network - |
ETHTYPE_IPV6 | Internet protocol v6 - |
ETHTYPE_PPPOEDISC | PPP Over Ethernet Discovery Stage - |
ETHTYPE_PPPOE | PPP Over Ethernet Session Stage - |
ETHTYPE_JUMBO | Jumbo Frames - |
ETHTYPE_PROFINET | Process field network - |
ETHTYPE_ETHERCAT | Ethernet for control automation technology - |
ETHTYPE_LLDP | Link layer discovery protocol - |
ETHTYPE_SERCOS | Serial real-time communication system - |
ETHTYPE_MRP | Media redundancy protocol - |
ETHTYPE_PTP | Precision time protocol - |
ETHTYPE_QINQ | Q-in-Q, 802.1ad - |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
char * | lwip_if_indextoname (unsigned int ifindex, char *ifname) |
unsigned int | lwip_if_nametoindex (const char *ifname) |
char* lwip_if_indextoname | -( | -unsigned int | -ifindex, | -
- | - | char * | -ifname | -
- | ) | -- |
Maps an interface index to its corresponding name.
ifindex | interface index |
ifname | shall point to a buffer of at least {IF_NAMESIZE} bytes |
unsigned int lwip_if_nametoindex | -( | -const char * | -ifname | ) | -- |
Returs the interface index corresponding to name ifname.
ifname | Interface name |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netif_igmp_data(netif) ((struct igmp_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP)) |
-Functions | |
err_t | igmp_joingroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) |
err_t | igmp_joingroup_netif (struct netif *netif, const ip4_addr_t *groupaddr) |
err_t | igmp_leavegroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) |
err_t | igmp_leavegroup_netif (struct netif *netif, const ip4_addr_t *groupaddr) |
To be called from TCPIP thread
-#define netif_igmp_data | -( | -- | netif | ) | -((struct igmp_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP)) | -
Get list head of IGMP groups for netif. Note: The allsystems group IP is contained in the list as first entry.
err_t igmp_joingroup | -( | -const ip4_addr_t * | -ifaddr, | -
- | - | const ip4_addr_t * | -groupaddr | -
- | ) | -- |
Join a group on one network interface.
-ifaddr | ip address of the network interface which should join a new group |
groupaddr | the ip address of the group which to join |
err_t igmp_joingroup_netif | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -groupaddr | -
- | ) | -- |
Join a group on one network interface.
-netif | the network interface which should join a new group |
groupaddr | the ip address of the group which to join |
err_t igmp_leavegroup | -( | -const ip4_addr_t * | -ifaddr, | -
- | - | const ip4_addr_t * | -groupaddr | -
- | ) | -- |
Leave a group on one network interface.
-ifaddr | ip address of the network interface which should leave a group |
groupaddr | the ip address of the group which to leave |
err_t igmp_leavegroup_netif | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -groupaddr | -
- | ) | -- |
Leave a group on one network interface.
-netif | the network interface which should leave a group |
groupaddr | the ip address of the group which to leave |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
IP address handling | |
Memory pools | |
Packet buffers (PBUF) | |
Error codes | |
IANA assigned numbers | |
IEEE assigned numbers | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Typedefs | |
typedef s8_t | err_t |
-Enumerations | |
enum | err_enum_t { - ERR_OK = 0, -ERR_MEM = -1, -ERR_BUF = -2, -ERR_TIMEOUT = -3, - - ERR_RTE = -4, -ERR_INPROGRESS = -5, -ERR_VAL = -6, -ERR_WOULDBLOCK = -7, - - ERR_USE = -8, -ERR_ALREADY = -9, -ERR_ISCONN = -10, -ERR_CONN = -11, - - ERR_IF = -12, -ERR_ABRT = -13, -ERR_RST = -14, -ERR_CLSD = -15, - - ERR_ARG = -16 - - } |
typedef s8_t err_t | -
Define LWIP_ERR_T in cc.h if you want to use a different type for your platform (must be signed).
- -enum err_enum_t | -
Definitions for error constants.
-Enumerator | |
---|---|
ERR_OK | No error, everything OK. - |
ERR_MEM | Out of memory error. - |
ERR_BUF | Buffer error. - |
ERR_TIMEOUT | Timeout. - |
ERR_RTE | Routing problem. - |
ERR_INPROGRESS | Operation in progress - |
ERR_VAL | Illegal value. - |
ERR_WOULDBLOCK | Operation would block. - |
ERR_USE | Address in use. - |
ERR_ALREADY | Already connecting. - |
ERR_ISCONN | Conn already established. - |
ERR_CONN | Not connected. - |
ERR_IF | Low-level netif error - |
ERR_ABRT | Connection aborted. - |
ERR_RST | Connection reset. - |
ERR_CLSD | Connection closed. - |
ERR_ARG | Illegal argument. - |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
IPv4 | |
IPv6 | |
-Macros | |
#define | ip_output(p, src, dest, ttl, tos, proto) |
#define | ip_output_if(p, src, dest, ttl, tos, proto, netif) |
#define | ip_output_if_src(p, src, dest, ttl, tos, proto, netif) |
#define | ip_route(src, dest) |
#define | ip_netif_get_local_ip(netif, dest) |
#define ip_netif_get_local_ip | -( | -- | netif, | -
- | - | - | dest | -
- | ) | -- |
#define ip_output | -( | -- | p, | -
- | - | - | src, | -
- | - | - | dest, | -
- | - | - | ttl, | -
- | - | - | tos, | -
- | - | - | proto | -
- | ) | -- |
Output IP packet, netif is selected by source address
- -#define ip_output_if | -( | -- | p, | -
- | - | - | src, | -
- | - | - | dest, | -
- | - | - | ttl, | -
- | - | - | tos, | -
- | - | - | proto, | -
- | - | - | netif | -
- | ) | -- |
Output IP packet to specified interface
- -#define ip_output_if_src | -( | -- | p, | -
- | - | - | src, | -
- | - | - | dest, | -
- | - | - | ttl, | -
- | - | - | tos, | -
- | - | - | proto, | -
- | - | - | netif | -
- | ) | -- |
Output IP packet to interface specifying source address
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
AUTOIP | |
DHCPv4 | |
IGMP | |
-Functions | |
void | ip4_set_default_multicast_netif (struct netif *default_multicast_netif) |
void ip4_set_default_multicast_netif | -( | -struct netif * | -default_multicast_netif | ) | -- |
Set a default netif for IPv4 multicast.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | IPADDR4_INIT(u32val) { { { { u32val, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V4 } |
#define | IPADDR4_INIT_BYTES(a, b, c, d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d))) |
#define | IP_IS_V4_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4) |
#define | IP_IS_V4(ipaddr) (((ipaddr) == NULL) || IP_IS_V4_VAL(*(ipaddr))) |
#define | ip_2_ip4(ipaddr) (&((ipaddr)->u_addr.ip4)) |
#define | IP_ADDR4(ipaddr, a, b, c, d) |
#define | ip_addr_copy_from_ip4(dest, src) |
#define | ip_addr_set_ip4_u32(ipaddr, val) |
#define | ip_addr_set_ip4_u32_val(ipaddr, val) |
#define | ip_addr_get_ip4_u32(ipaddr) |
#define | IP_ADDR_ANY IP4_ADDR_ANY |
#define | IP4_ADDR_ANY (&ip_addr_any) |
#define | IP4_ADDR_ANY4 (ip_2_ip4(&ip_addr_any)) |
#define | IP_ADDR_BROADCAST (&ip_addr_broadcast) |
#define | IP4_ADDR_BROADCAST (ip_2_ip4(&ip_addr_broadcast)) |
#define IP4_ADDR_ANY (&ip_addr_any) | -
Can be used as a fixed/const ip_addr_t for the IPv4 wildcard and the broadcast address
- -#define IP4_ADDR_ANY4 (ip_2_ip4(&ip_addr_any)) | -
Can be used as a fixed/const ip4_addr_t for the wildcard and the broadcast address
- -#define IP4_ADDR_BROADCAST (ip_2_ip4(&ip_addr_broadcast)) | -
#define ip_2_ip4 | -( | -- | ipaddr | ) | -(&((ipaddr)->u_addr.ip4)) | -
Convert generic ip address to specific protocol version
- -#define IP_ADDR4 | -( | -- | ipaddr, | -
- | - | - | a, | -
- | - | - | b, | -
- | - | - | c, | -
- | - | - | d | -
- | ) | -- |
#define IP_ADDR_ANY IP4_ADDR_ANY | -
Can be used as a fixed/const ip_addr_t for the IP wildcard. Defined to IP4_ADDR_ANY when IPv4 is enabled. Defined to IP6_ADDR_ANY in IPv6 only systems. Use this if you can handle IPv4 AND IPv6 addresses. Use IP4_ADDR_ANY or IP6_ADDR_ANY when the IP type matters.
- -#define IP_ADDR_BROADCAST (&ip_addr_broadcast) | -
#define ip_addr_copy_from_ip4 | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
#define ip_addr_get_ip4_u32 | -( | -- | ipaddr | ) | -- |
#define ip_addr_set_ip4_u32 | -( | -- | ipaddr, | -
- | - | - | val | -
- | ) | -- |
#define ip_addr_set_ip4_u32_val | -( | -- | ipaddr, | -
- | - | - | val | -
- | ) | -- |
#define IP_IS_V4 | -( | -- | ipaddr | ) | -(((ipaddr) == NULL) || IP_IS_V4_VAL(*(ipaddr))) | -
#define IP_IS_V4_VAL | -( | -- | ipaddr | ) | -(IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4) | -
#define IPADDR4_INIT | -( | -- | u32val | ) | -{ { { { u32val, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V4 } | -
#define IPADDR4_INIT_BYTES | -( | -- | a, | -
- | - | - | b, | -
- | - | - | c, | -
- | - | - | d | -
- | ) | -IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d))) | -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
DHCPv6 | |
MLD6 | |
IPv6 Zones | |
-Functions | |
const ip_addr_t * | ip6_select_source_address (struct netif *netif, const ip6_addr_t *dest) |
const ip_addr_t* ip6_select_source_address | -( | -struct netif * | -netif, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Select the best IPv6 source address for a given destination IPv6 address.
-This implementation follows RFC 6724 Sec. 5 to the following extent:
For Rule 2, we deliberately deviate from RFC 6724 Sec. 3.1 by considering ULAs to be of smaller scope than global addresses, to avoid that a preferred ULA is picked over a deprecated global address when given a global address as destination, as that would likely result in broken two-way communication.
-As long as temporary addresses are not supported (as used in Rule 7), a proper implementation of Rule 8 would obviate the need to implement Rule 6.
-netif | the netif on which to send a packet |
dest | the destination we are trying to reach (possibly not properly zoned) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | IP6_NO_ZONE 0 |
#define | IPADDR6_ZONE_INIT , IP6_NO_ZONE |
#define | ip6_addr_zone(ip6addr) ((ip6addr)->zone) |
#define | ip6_addr_has_zone(ip6addr) (ip6_addr_zone(ip6addr) != IP6_NO_ZONE) |
#define | ip6_addr_set_zone(ip6addr, zone_idx) ((ip6addr)->zone = (zone_idx)) |
#define | ip6_addr_clear_zone(ip6addr) ((ip6addr)->zone = IP6_NO_ZONE) |
#define | ip6_addr_copy_zone(ip6addr1, ip6addr2) ((ip6addr1).zone = (ip6addr2).zone) |
#define | ip6_addr_equals_zone(ip6addr, zone_idx) ((ip6addr)->zone == (zone_idx)) |
#define | ip6_addr_cmp_zone(ip6addr1, ip6addr2) ((ip6addr1)->zone == (ip6addr2)->zone) |
#define | IPV6_CUSTOM_SCOPES 0 |
#define | ip6_addr_has_scope(ip6addr, type) |
#define | ip6_addr_assign_zone(ip6addr, type, netif) |
#define | ip6_addr_test_zone(ip6addr, netif) (ip6_addr_equals_zone((ip6addr), netif_get_index(netif))) |
#define | ip6_addr_lacks_zone(ip6addr, type) (!ip6_addr_has_zone(ip6addr) && ip6_addr_has_scope((ip6addr), (type))) |
#define | ip6_addr_select_zone(dest, src) |
-Enumerations | |
enum | lwip_ipv6_scope_type { IP6_UNKNOWN = 0, -IP6_UNICAST = 1, -IP6_MULTICAST = 2 - } |
#define ip6_addr_assign_zone | -( | -- | ip6addr, | -
- | - | - | type, | -
- | - | - | netif | -
- | ) | -- |
Assign a zone index to an IPv6 address, based on a network interface. If the given address has a scope, the assigned zone index is that scope's zone of the given netif; otherwise, the assigned zone index is "no zone".
-This default implementation follows the default model of RFC 4007, where only interface-local and link-local scopes are defined, and the zone index of both of those scopes always equals the index of the network interface. As such, this default implementation need not distinguish between different constrained scopes when assigning the zone.
-ip6addr | the IPv6 address; its address part is examined, and its zone index is assigned. |
type | address type; see lwip_ipv6_scope_type. |
netif | the network interface (const). |
#define ip6_addr_clear_zone | -( | -- | ip6addr | ) | -((ip6addr)->zone = IP6_NO_ZONE) | -
Clear the zone field of an IPv6 address, setting it to "no zone".
- -#define ip6_addr_cmp_zone | -( | -- | ip6addr1, | -
- | - | - | ip6addr2 | -
- | ) | -((ip6addr1)->zone == (ip6addr2)->zone) | -
Are the zone fields of the given IPv6 addresses equal? (0/1) This macro must only be used on IPv6 addresses of the same scope.
- -#define ip6_addr_copy_zone | -( | -- | ip6addr1, | -
- | - | - | ip6addr2 | -
- | ) | -((ip6addr1).zone = (ip6addr2).zone) | -
Copy the zone field from the second IPv6 address to the first one.
- -#define ip6_addr_equals_zone | -( | -- | ip6addr, | -
- | - | - | zone_idx | -
- | ) | -((ip6addr)->zone == (zone_idx)) | -
Is the zone field of the given IPv6 address equal to the given zone index? (0/1)
- -#define ip6_addr_has_scope | -( | -- | ip6addr, | -
- | - | - | type | -
- | ) | -- |
Determine whether an IPv6 address has a constrained scope, and as such is meaningful only if accompanied by a zone index to identify the scope's zone. The given address type may be used to eliminate at compile time certain checks that will evaluate to false at run time anyway.
-This default implementation follows the default model of RFC 4007, where only interface-local and link-local scopes are defined.
-Even though the unicast loopback address does have an implied link-local scope, in this implementation it does not have an explicitly assigned zone index. As such it should not be tested for in this macro.
-ip6addr | the IPv6 address (const); only its address part is examined. |
type | address type; see lwip_ipv6_scope_type. |
#define ip6_addr_has_zone | -( | -- | ip6addr | ) | -(ip6_addr_zone(ip6addr) != IP6_NO_ZONE) | -
Does the given IPv6 address have a zone set? (0/1)
- -#define ip6_addr_lacks_zone | -( | -- | ip6addr, | -
- | - | - | type | -
- | ) | -(!ip6_addr_has_zone(ip6addr) && ip6_addr_has_scope((ip6addr), (type))) | -
Does the given IPv6 address have a scope, and as such should also have a zone to be meaningful, but does not actually have a zone? (0/1)
- -#define ip6_addr_select_zone | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Try to select a zone for a scoped address that does not yet have a zone. Called from PCB bind and connect routines, for two reasons: 1) to save on this (relatively expensive) selection for every individual packet route operation and 2) to allow the application to obtain the selected zone from the PCB as is customary for e.g. getsockname/getpeername BSD socket calls.
-Ideally, callers would always supply a properly zoned address, in which case this function would not be needed. It exists both for compatibility with the BSD socket API (which accepts zoneless destination addresses) and for backward compatibility with pre-scoping lwIP code.
-It may be impossible to select a zone, e.g. if there are no netifs. In that case, the address's zone field will be left as is.
-dest | the IPv6 address for which to select and set a zone. |
src | source IPv6 address (const); may be equal to dest. |
#define ip6_addr_set_zone | -( | -- | ip6addr, | -
- | - | - | zone_idx | -
- | ) | -((ip6addr)->zone = (zone_idx)) | -
Set the zone field of an IPv6 address to a particular value.
- -#define ip6_addr_test_zone | -( | -- | ip6addr, | -
- | - | - | netif | -
- | ) | -(ip6_addr_equals_zone((ip6addr), netif_get_index(netif))) | -
Test whether an IPv6 address is "zone-compatible" with a network interface. That is, test whether the network interface is part of the zone associated with the address. For efficiency, this macro is only ever called if the given address is either scoped or zoned, and thus, it need not test this. If an address is scoped but not zoned, or zoned and not scoped, it is considered not zone-compatible with any netif.
-This default implementation follows the default model of RFC 4007, where only interface-local and link-local scopes are defined, and the zone index of both of those scopes always equals the index of the network interface. As such, there is always only one matching netif for a specific zone index, but all call sites of this macro currently support multiple matching netifs as well (at no additional expense in the common case).
-ip6addr | the IPv6 address (const). |
netif | the network interface (const). |
#define ip6_addr_zone | -( | -- | ip6addr | ) | -((ip6addr)->zone) | -
Return the zone index of the given IPv6 address; possibly "no zone".
- -#define IP6_NO_ZONE 0 | -
Identifier for "no zone".
- -#define IPADDR6_ZONE_INIT , IP6_NO_ZONE | -
Zone initializer for static IPv6 address initialization, including comma.
- -#define IPV6_CUSTOM_SCOPES 0 | -
IPV6_CUSTOM_SCOPES: together, the following three macro definitions, ip6_addr_has_scope, ip6_addr_assign_zone, and ip6_addr_test_zone, completely define the lwIP scoping policy. The definitions below implement the default policy from RFC 4007 Sec. 6. Should an implementation desire to implement a different policy, it can define IPV6_CUSTOM_SCOPES to 1 and supply its own definitions for the three macros instead.
- -enum lwip_ipv6_scope_type | -
Symbolic constants for the 'type' parameters in some of the macros. These exist for efficiency only, allowing the macros to avoid certain tests when the address is known not to be of a certain type. Dead code elimination will do the rest. IP6_MULTICAST is supported but currently not optimized.
-Enumerator | |
---|---|
IP6_UNKNOWN | Unknown - |
IP6_UNICAST | Unicast - |
IP6_MULTICAST | Multicast - |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | IPADDR6_INIT(a, b, c, d) { { { { a, b, c, d } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 } |
#define | IPADDR6_INIT_HOST(a, b, c, d) { { { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 } |
#define | IP_IS_V6_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V6) |
#define | IP_IS_V6(ipaddr) (((ipaddr) != NULL) && IP_IS_V6_VAL(*(ipaddr))) |
#define | ip_2_ip6(ipaddr) (&((ipaddr)->u_addr.ip6)) |
#define | IP_ADDR6(ipaddr, i0, i1, i2, i3) |
#define | IP_ADDR6_HOST(ipaddr, i0, i1, i2, i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3)) |
#define | ip_addr_copy_from_ip6(dest, src) |
#define | ip_addr_copy_from_ip6_packed(dest, src) |
#define | ip_addr_set_zero_ip6(ipaddr) |
#define | IP6_ADDR_ANY (&ip6_addr_any) |
#define | IP6_ADDR_ANY6 (ip_2_ip6(&ip6_addr_any)) |
#define IP6_ADDR_ANY (&ip6_addr_any) | -
IP6_ADDR_ANY can be used as a fixed ip_addr_t for the IPv6 wildcard address
- -#define IP6_ADDR_ANY6 (ip_2_ip6(&ip6_addr_any)) | -
IP6_ADDR_ANY6 can be used as a fixed ip6_addr_t for the IPv6 wildcard address
- -#define ip_2_ip6 | -( | -- | ipaddr | ) | -(&((ipaddr)->u_addr.ip6)) | -
Convert generic ip address to specific protocol version
- -#define IP_ADDR6 | -( | -- | ipaddr, | -
- | - | - | i0, | -
- | - | - | i1, | -
- | - | - | i2, | -
- | - | - | i3 | -
- | ) | -- |
#define IP_ADDR6_HOST | -( | -- | ipaddr, | -
- | - | - | i0, | -
- | - | - | i1, | -
- | - | - | i2, | -
- | - | - | i3 | -
- | ) | -IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3)) | -
#define ip_addr_copy_from_ip6 | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
#define ip_addr_copy_from_ip6_packed | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
#define ip_addr_set_zero_ip6 | -( | -- | ipaddr | ) | -- |
#define IP_IS_V6 | -( | -- | ipaddr | ) | -(((ipaddr) != NULL) && IP_IS_V6_VAL(*(ipaddr))) | -
#define IP_IS_V6_VAL | -( | -- | ipaddr | ) | -(IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V6) | -
#define IPADDR6_INIT | -( | -- | a, | -
- | - | - | b, | -
- | - | - | c, | -
- | - | - | d | -
- | ) | -{ { { { a, b, c, d } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 } | -
#define IPADDR6_INIT_HOST | -( | -- | a, | -
- | - | - | b, | -
- | - | - | c, | -
- | - | - | d | -
- | ) | -{ { { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 } | -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
IPv4 only | |
IPv6 only | |
-Data Structures | |
struct | ip_addr |
-Macros | |
#define | IP_IS_ANY_TYPE_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_ANY) |
#define | IPADDR_ANY_TYPE_INIT { { { { 0ul, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_ANY } |
#define | ip_addr_copy(dest, src) |
#define | ip_addr_set(dest, src) |
#define | ip_addr_set_ipaddr(dest, src) ip_addr_set(dest, src) |
#define | ip_addr_set_zero(ipaddr) |
#define | ip_addr_set_any(is_ipv6, ipaddr) |
#define | ip_addr_set_any_val(is_ipv6, ipaddr) |
#define | ip_addr_set_loopback(is_ipv6, ipaddr) |
#define | ip_addr_set_loopback_val(is_ipv6, ipaddr) |
#define | ip_addr_set_hton(dest, src) |
#define | ip_addr_get_network(target, host, netmask) |
#define | ip_addr_netcmp(addr1, addr2, mask) |
#define | ip_addr_cmp(addr1, addr2) |
#define | ip_addr_cmp_zoneless(addr1, addr2) |
#define | ip_addr_isany(ipaddr) |
#define | ip_addr_isany_val(ipaddr) |
#define | ip_addr_isbroadcast(ipaddr, netif) |
#define | ip_addr_ismulticast(ipaddr) |
#define | ip_addr_isloopback(ipaddr) |
#define | ip_addr_islinklocal(ipaddr) |
#define | IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX |
#define | ip4_2_ipv4_mapped_ipv6(ip6addr, ip4addr) |
#define | unmap_ipv4_mapped_ipv6(ip4addr, ip6addr) (ip4addr)->addr = (ip6addr)->addr[3]; |
#define | IP_ANY_TYPE (&ip_addr_any_type) |
-Typedefs | |
typedef struct ip_addr | ip_addr_t |
-Enumerations | |
enum | lwip_ip_addr_type { IPADDR_TYPE_V4 = 0U, -IPADDR_TYPE_V6 = 6U, -IPADDR_TYPE_ANY = 46U - } |
-Functions | |
char * | ipaddr_ntoa (const ip_addr_t *addr) |
char * | ipaddr_ntoa_r (const ip_addr_t *addr, char *buf, int buflen) |
int | ipaddr_aton (const char *cp, ip_addr_t *addr) |
#define ip4_2_ipv4_mapped_ipv6 | -( | -- | ip6addr, | -
- | - | - | ip4addr | -
- | ) | -- |
#define ip_addr_cmp | -( | -- | addr1, | -
- | - | - | addr2 | -
- | ) | -- |
#define ip_addr_cmp_zoneless | -( | -- | addr1, | -
- | - | - | addr2 | -
- | ) | -- |
#define ip_addr_copy | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
#define ip_addr_get_network | -( | -- | target, | -
- | - | - | host, | -
- | - | - | netmask | -
- | ) | -- |
#define ip_addr_isany | -( | -- | ipaddr | ) | -- |
#define ip_addr_isany_val | -( | -- | ipaddr | ) | -- |
#define ip_addr_isbroadcast | -( | -- | ipaddr, | -
- | - | - | netif | -
- | ) | -- |
#define ip_addr_islinklocal | -( | -- | ipaddr | ) | -- |
#define ip_addr_isloopback | -( | -- | ipaddr | ) | -- |
#define ip_addr_ismulticast | -( | -- | ipaddr | ) | -- |
#define ip_addr_netcmp | -( | -- | addr1, | -
- | - | - | addr2, | -
- | - | - | mask | -
- | ) | -- |
#define ip_addr_set | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
#define ip_addr_set_any | -( | -- | is_ipv6, | -
- | - | - | ipaddr | -
- | ) | -- |
#define ip_addr_set_any_val | -( | -- | is_ipv6, | -
- | - | - | ipaddr | -
- | ) | -- |
#define ip_addr_set_hton | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
#define ip_addr_set_ipaddr | -( | -- | dest, | -
- | - | - | src | -
- | ) | -ip_addr_set(dest, src) | -
#define ip_addr_set_loopback | -( | -- | is_ipv6, | -
- | - | - | ipaddr | -
- | ) | -- |
#define ip_addr_set_loopback_val | -( | -- | is_ipv6, | -
- | - | - | ipaddr | -
- | ) | -- |
#define ip_addr_set_zero | -( | -- | ipaddr | ) | -- |
#define IP_ANY_TYPE (&ip_addr_any_type) | -
#define IP_IS_ANY_TYPE_VAL | -( | -- | ipaddr | ) | -(IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_ANY) | -
#define IPADDR_ANY_TYPE_INIT { { { { 0ul, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_ANY } | -
#define IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX | -
#define unmap_ipv4_mapped_ipv6 | -( | -- | ip4addr, | -
- | - | - | ip6addr | -
- | ) | -(ip4addr)->addr = (ip6addr)->addr[3]; | -
A union struct for both IP version's addresses. ATTENTION: watch out for its size when adding IPv6 address scope!
- -enum lwip_ip_addr_type | -
IP address types for use in ip_addr_t.type member.
Enumerator | |
---|---|
IPADDR_TYPE_V4 | IPv4 - |
IPADDR_TYPE_V6 | IPv6 - |
IPADDR_TYPE_ANY | IPv4+IPv6 ("dual-stack") - |
int ipaddr_aton | -( | -const char * | -cp, | -
- | - | ip_addr_t * | -addr | -
- | ) | -- |
Convert IP address string (both versions) to numeric. The version is auto-detected from the string.
-cp | IP address string to convert |
addr | conversion result is stored here |
char* ipaddr_ntoa | -( | -const ip_addr_t * | -addr | ) | -- |
Convert numeric IP address (both versions) into ASCII representation. returns ptr to static buffer; not reentrant!
-addr | ip address in network order to convert |
char* ipaddr_ntoa_r | -( | -const ip_addr_t * | -addr, | -
- | - | char * | -buf, | -
- | - | int | -buflen | -
- | ) | -- |
Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used.
-addr | ip address in network order to convert |
buf | target buffer where the string is stored |
buflen | length of buf |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void * | lwiperf_start_tcp_server_default (lwiperf_report_fn report_fn, void *report_arg) |
void * | lwiperf_start_tcp_server (const ip_addr_t *local_addr, u16_t local_port, lwiperf_report_fn report_fn, void *report_arg) |
void * | lwiperf_start_tcp_client_default (const ip_addr_t *remote_addr, lwiperf_report_fn report_fn, void *report_arg) |
void * | lwiperf_start_tcp_client (const ip_addr_t *remote_addr, u16_t remote_port, enum lwiperf_client_type type, lwiperf_report_fn report_fn, void *report_arg) |
void | lwiperf_abort (void *lwiperf_session) |
This is a simple performance measuring client/server to check your bandwith using iPerf2 on a PC as server/client. It is currently a minimal implementation providing a TCP client/server only.
-void lwiperf_abort | -( | -void * | -lwiperf_session | ) | -- |
Abort an iperf session (handle returned by lwiperf_start_tcp_server*())
- -void* lwiperf_start_tcp_client | -( | -const ip_addr_t * | -remote_addr, | -
- | - | u16_t | -remote_port, | -
- | - | enum lwiperf_client_type | -type, | -
- | - | lwiperf_report_fn | -report_fn, | -
- | - | void * | -report_arg | -
- | ) | -- |
Start a TCP iperf client to a specific IP address and port.
-void* lwiperf_start_tcp_client_default | -( | -const ip_addr_t * | -remote_addr, | -
- | - | lwiperf_report_fn | -report_fn, | -
- | - | void * | -report_arg | -
- | ) | -- |
Start a TCP iperf client to the default TCP port (5001).
-void* lwiperf_start_tcp_server | -( | -const ip_addr_t * | -local_addr, | -
- | - | u16_t | -local_port, | -
- | - | lwiperf_report_fn | -report_fn, | -
- | - | void * | -report_arg | -
- | ) | -- |
Start a TCP iperf server on a specific IP address and port and listen for incoming connections from iperf clients.
-void* lwiperf_start_tcp_server_default | -( | -lwiperf_report_fn | -report_fn, | -
- | - | void * | -report_arg | -
- | ) | -- |
Start a TCP iperf server on the default TCP port (5001) and listen for incoming connections from iperf clients.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Mainloop mode ("NO_SYS") | |
OS mode (TCPIP thread) | |
Porting (system abstraction layer) | |
Version | |
Options (lwipopts.h) | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_NOASSERT |
#define LWIP_NOASSERT | -
LWIP_NOASSERT: Disable LWIP_ASSERT checks: To disable assertions define LWIP_NOASSERT in arch/cc.h.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | lwip_init (void) |
err_t | ip_input (struct pbuf *p, struct netif *inp) |
err_t | netif_input (struct pbuf *p, struct netif *inp) |
void | sys_check_timeouts (void) |
err_t | ethernet_input (struct pbuf *p, struct netif *netif) |
Use this mode if you do not run an OS on your system. #define NO_SYS to 1. Feed incoming packets to netif->input(pbuf, netif) function from mainloop, not from interrupt context. You can allocate a Packet buffers (PBUF) in interrupt context and put them into a queue which is processed from mainloop.
-Call sys_check_timeouts() periodically in the mainloop.
-Porting: implement all functions in Time, Critical sections and Compiler/platform abstraction.
-You can only use "raw" APIs in this mode.
-Sample code:
-
err_t ethernet_input | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Process received ethernet frames. Using this function instead of directly calling ip_input and passing ARP frames through etharp in ethernetif_input, the ARP cache is protected from concurrent access.
-Don't call directly, pass to netif_add() and call netif->input().
p | the received packet, p->payload pointing to the ethernet header |
netif | the network interface on which the packet was received |
If both IP versions are enabled, this function can dispatch packets to the correct one. Don't call directly, pass to netif_add() and call netif->input().
- -void lwip_init | -( | -void | -) | -- |
Initialize all modules. Use this in NO_SYS mode. Use tcpip_init() otherwise.
- -Forwards a received packet for input processing with ethernet_input() or ip_input() depending on netif flags. Don't call directly, pass to netif_add() and call netif->input(). Only works if the netif driver correctly sets NETIF_FLAG_ETHARP and/or NETIF_FLAG_ETHERNET flag!
- -void sys_check_timeouts | -( | -void | -) | -- |
Handle timeouts for NO_SYS==1 (i.e. without using tcpip_thread/sys_timeouts_mbox_fetch(). Uses sys_now() to call timeout handler functions when timeouts expire.
-Must be called periodically from your main loop.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Debugging | |
Infrastructure | |
Callback-style APIs | |
Thread-safe APIs | |
IPv4 | |
PBUF | |
NETIF | |
IPv6 | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_ARP 1 |
#define | ARP_TABLE_SIZE 10 |
#define | ARP_MAXAGE 300 |
#define | ARP_QUEUEING 0 |
#define | ARP_QUEUE_LEN 3 |
#define | ETHARP_SUPPORT_VLAN 0 |
#define | LWIP_ETHERNET LWIP_ARP |
#define | ETH_PAD_SIZE 0 |
#define | ETHARP_SUPPORT_STATIC_ENTRIES 0 |
#define | ETHARP_TABLE_MATCH_NETIF !LWIP_SINGLE_NETIF |
#define ARP_MAXAGE 300 | -
the time an ARP entry stays valid after its last update, for ARP_TMR_INTERVAL = 1000, this is (60 * 5) seconds = 5 minutes.
- -#define ARP_QUEUE_LEN 3 | -
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.
- -#define ARP_QUEUEING 0 | -
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.
- -#define ARP_TABLE_SIZE 10 | -
ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
- -#define ETH_PAD_SIZE 0 | -
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.
- -#define ETHARP_SUPPORT_STATIC_ENTRIES 0 | -
ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table entries (using etharp_add_static_entry/etharp_remove_static_entry).
- -#define ETHARP_SUPPORT_VLAN 0 | -
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.
- -#define ETHARP_TABLE_MATCH_NETIF !LWIP_SINGLE_NETIF | -
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).
- -#define LWIP_ARP 1 | -
LWIP_ARP==1: Enable ARP functionality.
- -#define LWIP_ETHERNET LWIP_ARP | -
LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_AUTOIP 0 |
#define | LWIP_DHCP_AUTOIP_COOP 0 |
#define | LWIP_DHCP_AUTOIP_COOP_TRIES 9 |
#define LWIP_AUTOIP 0 | -
LWIP_AUTOIP==1: Enable AUTOIP module.
- -#define LWIP_DHCP_AUTOIP_COOP 0 | -
LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on the same interface at the same time.
- -#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 | -
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.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_CHECKSUM_CTRL_PER_NETIF 0 |
#define | CHECKSUM_GEN_IP 1 |
#define | CHECKSUM_GEN_UDP 1 |
#define | CHECKSUM_GEN_TCP 1 |
#define | CHECKSUM_GEN_ICMP 1 |
#define | CHECKSUM_GEN_ICMP6 1 |
#define | CHECKSUM_CHECK_IP 1 |
#define | CHECKSUM_CHECK_UDP 1 |
#define | CHECKSUM_CHECK_TCP 1 |
#define | CHECKSUM_CHECK_ICMP 1 |
#define | CHECKSUM_CHECK_ICMP6 1 |
#define | LWIP_CHECKSUM_ON_COPY 0 |
#define CHECKSUM_CHECK_ICMP 1 | -
CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets.
- -#define CHECKSUM_CHECK_ICMP6 1 | -
CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets
- -#define CHECKSUM_CHECK_IP 1 | -
CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
- -#define CHECKSUM_CHECK_TCP 1 | -
CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
- -#define CHECKSUM_CHECK_UDP 1 | -
CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
- -#define CHECKSUM_GEN_ICMP 1 | -
CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.
- -#define CHECKSUM_GEN_ICMP6 1 | -
CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets.
- -#define CHECKSUM_GEN_IP 1 | -
CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
- -#define CHECKSUM_GEN_TCP 1 | -
CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
- -#define CHECKSUM_GEN_UDP 1 | -
CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
- -#define LWIP_CHECKSUM_CTRL_PER_NETIF 0 | -
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!
- -#define LWIP_CHECKSUM_ON_COPY 0 | -
LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from application buffers to pbufs.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Assertion handling | |
Statistics | |
Debug messages | |
Performance | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
LWIP_DBG_MIN_LEVEL and LWIP_DBG_TYPES_ON values | |
-Macros | |
#define | LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL |
#define | LWIP_DBG_TYPES_ON LWIP_DBG_ON |
#define | ETHARP_DEBUG LWIP_DBG_OFF |
#define | NETIF_DEBUG LWIP_DBG_OFF |
#define | PBUF_DEBUG LWIP_DBG_OFF |
#define | API_LIB_DEBUG LWIP_DBG_OFF |
#define | API_MSG_DEBUG LWIP_DBG_OFF |
#define | SOCKETS_DEBUG LWIP_DBG_OFF |
#define | ICMP_DEBUG LWIP_DBG_OFF |
#define | IGMP_DEBUG LWIP_DBG_OFF |
#define | INET_DEBUG LWIP_DBG_OFF |
#define | IP_DEBUG LWIP_DBG_OFF |
#define | IP_REASS_DEBUG LWIP_DBG_OFF |
#define | RAW_DEBUG LWIP_DBG_OFF |
#define | MEM_DEBUG LWIP_DBG_OFF |
#define | MEMP_DEBUG LWIP_DBG_OFF |
#define | SYS_DEBUG LWIP_DBG_OFF |
#define | TIMERS_DEBUG LWIP_DBG_OFF |
#define | TCP_DEBUG LWIP_DBG_OFF |
#define | TCP_INPUT_DEBUG LWIP_DBG_OFF |
#define | TCP_FR_DEBUG LWIP_DBG_OFF |
#define | TCP_RTO_DEBUG LWIP_DBG_OFF |
#define | TCP_CWND_DEBUG LWIP_DBG_OFF |
#define | TCP_WND_DEBUG LWIP_DBG_OFF |
#define | TCP_OUTPUT_DEBUG LWIP_DBG_OFF |
#define | TCP_RST_DEBUG LWIP_DBG_OFF |
#define | TCP_QLEN_DEBUG LWIP_DBG_OFF |
#define | UDP_DEBUG LWIP_DBG_OFF |
#define | TCPIP_DEBUG LWIP_DBG_OFF |
#define | SLIP_DEBUG LWIP_DBG_OFF |
#define | DHCP_DEBUG LWIP_DBG_OFF |
#define | AUTOIP_DEBUG LWIP_DBG_OFF |
#define | DNS_DEBUG LWIP_DBG_OFF |
#define | IP6_DEBUG LWIP_DBG_OFF |
#define | DHCP6_DEBUG LWIP_DBG_OFF |
#define API_LIB_DEBUG LWIP_DBG_OFF | -
API_LIB_DEBUG: Enable debugging in api_lib.c.
- -#define API_MSG_DEBUG LWIP_DBG_OFF | -
API_MSG_DEBUG: Enable debugging in api_msg.c.
- -#define AUTOIP_DEBUG LWIP_DBG_OFF | -
AUTOIP_DEBUG: Enable debugging in autoip.c.
- -#define DHCP6_DEBUG LWIP_DBG_OFF | -
DHCP6_DEBUG: Enable debugging in dhcp6.c.
- -#define DHCP_DEBUG LWIP_DBG_OFF | -
DHCP_DEBUG: Enable debugging in dhcp.c.
- -#define DNS_DEBUG LWIP_DBG_OFF | -
DNS_DEBUG: Enable debugging for DNS.
- -#define ETHARP_DEBUG LWIP_DBG_OFF | -
ETHARP_DEBUG: Enable debugging in etharp.c.
- -#define ICMP_DEBUG LWIP_DBG_OFF | -
ICMP_DEBUG: Enable debugging in icmp.c.
- -#define IGMP_DEBUG LWIP_DBG_OFF | -
IGMP_DEBUG: Enable debugging in igmp.c.
- -#define INET_DEBUG LWIP_DBG_OFF | -
INET_DEBUG: Enable debugging in inet.c.
- -#define IP6_DEBUG LWIP_DBG_OFF | -
IP6_DEBUG: Enable debugging for IPv6.
- -#define IP_DEBUG LWIP_DBG_OFF | -
IP_DEBUG: Enable debugging for IP.
- -#define IP_REASS_DEBUG LWIP_DBG_OFF | -
IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
- -#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL | -
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.
- -#define LWIP_DBG_TYPES_ON LWIP_DBG_ON | -
LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable debug messages of certain types.
- -#define MEM_DEBUG LWIP_DBG_OFF | -
MEM_DEBUG: Enable debugging in mem.c.
- -#define MEMP_DEBUG LWIP_DBG_OFF | -
MEMP_DEBUG: Enable debugging in memp.c.
- -#define NETIF_DEBUG LWIP_DBG_OFF | -
NETIF_DEBUG: Enable debugging in netif.c.
- -#define PBUF_DEBUG LWIP_DBG_OFF | -
PBUF_DEBUG: Enable debugging in pbuf.c.
- -#define RAW_DEBUG LWIP_DBG_OFF | -
RAW_DEBUG: Enable debugging in raw.c.
- -#define SLIP_DEBUG LWIP_DBG_OFF | -
SLIP_DEBUG: Enable debugging in slipif.c.
- -#define SOCKETS_DEBUG LWIP_DBG_OFF | -
SOCKETS_DEBUG: Enable debugging in sockets.c.
- -#define SYS_DEBUG LWIP_DBG_OFF | -
SYS_DEBUG: Enable debugging in sys.c.
- -#define TCP_CWND_DEBUG LWIP_DBG_OFF | -
TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
- -#define TCP_DEBUG LWIP_DBG_OFF | -
TCP_DEBUG: Enable debugging for TCP.
- -#define TCP_FR_DEBUG LWIP_DBG_OFF | -
TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
- -#define TCP_INPUT_DEBUG LWIP_DBG_OFF | -
TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
- -#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF | -
TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
- -#define TCP_QLEN_DEBUG LWIP_DBG_OFF | -
TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
- -#define TCP_RST_DEBUG LWIP_DBG_OFF | -
TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
- -#define TCP_RTO_DEBUG LWIP_DBG_OFF | -
TCP_RTO_DEBUG: Enable debugging in TCP for retransmit timeout.
- -#define TCP_WND_DEBUG LWIP_DBG_OFF | -
TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
- -#define TCPIP_DEBUG LWIP_DBG_OFF | -
TCPIP_DEBUG: Enable debugging in tcpip.c.
- -#define TIMERS_DEBUG LWIP_DBG_OFF | -
TIMERS_DEBUG: Enable debugging in timers.c.
- -#define UDP_DEBUG LWIP_DBG_OFF | -
UDP_DEBUG: Enable debugging in UDP.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_DHCP 0 |
#define | DHCP_DOES_ARP_CHECK (LWIP_DHCP && LWIP_ARP) |
#define | LWIP_DHCP_BOOTP_FILE 0 |
#define | LWIP_DHCP_GET_NTP_SRV 0 |
#define | LWIP_DHCP_MAX_NTP_SERVERS 1 |
#define | LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS |
DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
- -#define LWIP_DHCP 0 | -
LWIP_DHCP==1: Enable DHCP module.
- -#define LWIP_DHCP_BOOTP_FILE 0 | -
LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name.
- -#define LWIP_DHCP_GET_NTP_SRV 0 | -
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);
- -#define LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS | -
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).
- -#define LWIP_DHCP_MAX_NTP_SERVERS 1 | -
The maximum of NTP servers requested
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_IPV6_DHCP6 0 |
#define | LWIP_IPV6_DHCP6_STATEFUL 0 |
#define | LWIP_IPV6_DHCP6_STATELESS LWIP_IPV6_DHCP6 |
#define | LWIP_DHCP6_GET_NTP_SRV 0 |
#define | LWIP_DHCP6_MAX_NTP_SERVERS 1 |
#define | LWIP_DHCP6_MAX_DNS_SERVERS DNS_MAX_SERVERS |
#define LWIP_DHCP6_GET_NTP_SRV 0 | -
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);
- -#define LWIP_DHCP6_MAX_DNS_SERVERS DNS_MAX_SERVERS | -
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).
- -#define LWIP_DHCP6_MAX_NTP_SERVERS 1 | -
The maximum of NTP servers requested
- -#define LWIP_IPV6_DHCP6 0 | -
LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful/stateless address autoconfiguration.
- -#define LWIP_IPV6_DHCP6_STATEFUL 0 | -
LWIP_IPV6_DHCP6_STATEFUL==1: enable DHCPv6 stateful address autoconfiguration. (not supported, yet!)
- -#define LWIP_IPV6_DHCP6_STATELESS LWIP_IPV6_DHCP6 | -
LWIP_IPV6_DHCP6_STATELESS==1: enable DHCPv6 stateless address autoconfiguration.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_DNS 0 |
#define | DNS_TABLE_SIZE 4 |
#define | DNS_MAX_NAME_LENGTH 256 |
#define | DNS_MAX_SERVERS 2 |
#define | DNS_MAX_RETRIES 4 |
#define | DNS_DOES_NAME_CHECK 1 |
#define | LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) |
#define | DNS_LOCAL_HOSTLIST 0 |
#define | DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 |
#define | LWIP_DNS_SUPPORT_MDNS_QUERIES 0 |
#define DNS_DOES_NAME_CHECK 1 | -
DNS do a name checking between the query and the response.
- -#define DNS_LOCAL_HOSTLIST 0 | -
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).
- -#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 | -
If this is turned on, the local host-list can be dynamically changed at runtime.
- -#define DNS_MAX_NAME_LENGTH 256 | -
DNS maximum host name length supported in the name table.
- -#define DNS_MAX_RETRIES 4 | -
DNS maximum number of retries when asking for a name, before "timeout".
- -#define DNS_MAX_SERVERS 2 | -
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*'
- -#define DNS_TABLE_SIZE 4 | -
DNS maximum number of entries to maintain locally.
- -#define LWIP_DNS 0 | -
LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS transport.
- -#define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) | -
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.
- -#define LWIP_DNS_SUPPORT_MDNS_QUERIES 0 | -
Set this to 1 to enable querying ".local" names via mDNS using a One-Shot Multicast DNS Query
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h" |
#define | LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port) |
#define | LWIP_HOOK_TCP_INPACKET_PCB(pcb, hdr, optlen, opt1len, opt2, p) |
#define | LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH(pcb, internal_len) |
#define | LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(p, hdr, pcb, opts) |
#define | LWIP_HOOK_IP4_INPUT(pbuf, input_netif) |
#define | LWIP_HOOK_IP4_ROUTE() |
#define | LWIP_HOOK_IP4_ROUTE_SRC(src, dest) |
#define | LWIP_HOOK_IP4_CANFORWARD(src, dest) |
#define | LWIP_HOOK_ETHARP_GET_GW(netif, dest) |
#define | LWIP_HOOK_IP6_INPUT(pbuf, input_netif) |
#define | LWIP_HOOK_IP6_ROUTE(src, dest) |
#define | LWIP_HOOK_ND6_GET_GW(netif, dest) |
#define | LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr) |
#define | LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) |
#define | LWIP_HOOK_MEMP_AVAILABLE(memp_t_type) |
#define | LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif) |
#define | LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr) |
#define | LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) |
#define | LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len) |
#define | LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err) |
#define | LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err) |
#define | LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err) |
Hooks are undefined by default, define them to a function if you need them.
-#define LWIP_HOOK_DHCP6_APPEND_OPTIONS | -( | -- | netif, | -
- | - | - | dhcp6, | -
- | - | - | state, | -
- | - | - | msg, | -
- | - | - | msg_type, | -
- | - | - | options_len_ptr, | -
- | - | - | max_len | -
- | ) | -- |
LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len): Called from various dhcp6 functions when sending a DHCP6 message. This hook is called just before the DHCP6 message is sent, so the options are at the end of a DHCP6 message. Signature:
Arguments:
Options need to appended like this: u8_t *options = (u8_t *)(msg + 1); LWIP_ASSERT("dhcp option overflow", sizeof(struct dhcp6_msg) + *options_len_ptr + newoptlen <= max_len); options[(*options_len_ptr)++] = <option_data>; [...]
- -#define LWIP_HOOK_DHCP_APPEND_OPTIONS | -( | -- | netif, | -
- | - | - | dhcp, | -
- | - | - | state, | -
- | - | - | msg, | -
- | - | - | msg_type, | -
- | - | - | options_len_ptr | -
- | ) | -- |
LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr): Called from various dhcp functions when sending a DHCP message. This hook is called just before the DHCP message trailer is added, so the options are at the end of a DHCP message. Signature:
Arguments:
Options need to appended like this: LWIP_ASSERT("dhcp option overflow", *options_len_ptr + option_len + 2 <= DHCP_OPTIONS_LEN); msg->options[(*options_len_ptr)++] = <option_number>; msg->options[(*options_len_ptr)++] = <option_len>; msg->options[(*options_len_ptr)++] = <option_bytes>; [...]
- -#define LWIP_HOOK_DHCP_PARSE_OPTION | -( | -- | netif, | -
- | - | - | dhcp, | -
- | - | - | state, | -
- | - | - | msg, | -
- | - | - | msg_type, | -
- | - | - | option, | -
- | - | - | len, | -
- | - | - | pbuf, | -
- | - | - | offset | -
- | ) | -- |
LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, option_value_offset): Called from dhcp_parse_reply when receiving a DHCP message. This hook is called for every option in the received message that is not handled internally. Signature:
Arguments:
A nice way to get the option contents is pbuf_get_contiguous(): u8_t buf[32]; u8_t ptr = (u8_t)pbuf_get_contiguous(p, buf, sizeof(buf), LWIP_MIN(option_len, sizeof(buf)), offset);
- -#define LWIP_HOOK_ETHARP_GET_GW | -( | -- | netif, | -
- | - | - | dest | -
- | ) | -- |
LWIP_HOOK_ETHARP_GET_GW(netif, dest): Called from etharp_output() (IPv4) Signature:
Arguments:
The returned address MUST be directly reachable on the specified netif! This function is meant to implement advanced IPv4 routing together with LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is not part of lwIP but can e.g. be hidden in the netif's state argument.
- -#define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h" | -
LWIP_HOOK_FILENAME: Custom filename to #include in files that provide hooks. Declare your hook function prototypes in there, you may also #include all headers providing data types that are need in this file.
- -#define LWIP_HOOK_IP4_CANFORWARD | -( | -- | src, | -
- | - | - | dest | -
- | ) | -- |
LWIP_HOOK_IP4_CANFORWARD(src, dest): Check if an IPv4 can be forwarded - called from: ip4_input() -> ip4_forward() -> ip4_canforward() (IPv4)
#define LWIP_HOOK_IP4_INPUT | -( | -- | pbuf, | -
- | - | - | input_netif | -
- | ) | -- |
LWIP_HOOK_IP4_INPUT(pbuf, input_netif): Called from ip_input() (IPv4) Signature:
Arguments:
#define LWIP_HOOK_IP4_ROUTE | -( | -) | -- |
LWIP_HOOK_IP4_ROUTE(dest): Called from ip_route() (IPv4) Signature:
Arguments:
#define LWIP_HOOK_IP4_ROUTE_SRC | -( | -- | src, | -
- | - | - | dest | -
- | ) | -- |
LWIP_HOOK_IP4_ROUTE_SRC(src, dest): Source-based routing for IPv4 - called from ip_route() (IPv4) Signature:
Arguments:
#define LWIP_HOOK_IP6_INPUT | -( | -- | pbuf, | -
- | - | - | input_netif | -
- | ) | -- |
LWIP_HOOK_IP6_INPUT(pbuf, input_netif): Called from ip6_input() (IPv6) Signature:
Arguments:
#define LWIP_HOOK_IP6_ROUTE | -( | -- | src, | -
- | - | - | dest | -
- | ) | -- |
LWIP_HOOK_IP6_ROUTE(src, dest): Called from ip_route() (IPv6) Signature:
Arguments:
#define LWIP_HOOK_MEMP_AVAILABLE | -( | -- | memp_t_type | ) | -- |
LWIP_HOOK_MEMP_AVAILABLE(memp_t_type): Called from memp_free() when a memp pool was empty and an item is now available Signature:
#define LWIP_HOOK_ND6_GET_GW | -( | -- | netif, | -
- | - | - | dest | -
- | ) | -- |
LWIP_HOOK_ND6_GET_GW(netif, dest): Called from nd6_get_next_hop_entry() (IPv6) Signature:
Arguments:
The returned address MUST be directly reachable on the specified netif! This function is meant to implement advanced IPv6 routing together with LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is not part of lwIP but can e.g. be hidden in the netif's state argument.
- -#define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE | -( | -- | name, | -
- | - | - | addr, | -
- | - | - | addrtype, | -
- | - | - | err | -
- | ) | -- |
LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err) Called from netconn APIs (not usable with callback apps) allowing an external DNS resolver (which uses sequential API) to handle the query. Signature:
Arguments:
err must also be checked to determine if the hook consumed the query, but the query failed
- -#define LWIP_HOOK_SOCKETS_GETSOCKOPT | -( | -- | s, | -
- | - | - | sock, | -
- | - | - | level, | -
- | - | - | optname, | -
- | - | - | optval, | -
- | - | - | optlen, | -
- | - | - | err | -
- | ) | -- |
LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err) Called from socket API to implement getsockopt() for options not provided by lwIP. Core lock is held when this hook is called. Signature:
Arguments:
#define LWIP_HOOK_SOCKETS_SETSOCKOPT | -( | -- | s, | -
- | - | - | sock, | -
- | - | - | level, | -
- | - | - | optname, | -
- | - | - | optval, | -
- | - | - | optlen, | -
- | - | - | err | -
- | ) | -- |
LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err) Called from socket API to implement setsockopt() for options not provided by lwIP. Core lock is held when this hook is called. Signature:
Arguments:
#define LWIP_HOOK_TCP_INPACKET_PCB | -( | -- | pcb, | -
- | - | - | hdr, | -
- | - | - | optlen, | -
- | - | - | opt1len, | -
- | - | - | opt2, | -
- | - | - | p | -
- | ) | -- |
LWIP_HOOK_TCP_INPACKET_PCB: Hook for intercepting incoming packets before they are passed to a pcb. This allows updating some state or even dropping a packet. Signature:
Arguments:
ATTENTION: don't call any tcp api functions that might change tcp state (pcb state or any pcb lists) from this callback!
- -#define LWIP_HOOK_TCP_ISN | -( | -- | local_ip, | -
- | - | - | local_port, | -
- | - | - | remote_ip, | -
- | - | - | remote_port | -
- | ) | -- |
LWIP_HOOK_TCP_ISN: Hook for generation of the Initial Sequence Number (ISN) for a new TCP connection. The default lwIP ISN generation algorithm is very basic and may allow for TCP spoofing attacks. This hook provides the means to implement the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn), or any other desired algorithm as a replacement. Called from tcp_connect() and tcp_listen_input() when an ISN is needed for a new TCP connection, if TCP support (LWIP_TCP) is enabled.
-Signature:
#define LWIP_HOOK_TCP_OUT_ADD_TCPOPTS | -( | -- | p, | -
- | - | - | hdr, | -
- | - | - | pcb, | -
- | - | - | opts | -
- | ) | -- |
LWIP_HOOK_TCP_OUT_ADD_TCPOPTS: Hook for adding custom options to outgoing tcp segments. Space for these custom options has to be reserved via LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH. Signature:
Arguments:
ATTENTION: don't call any tcp api functions that might change tcp state (pcb state or any pcb lists) from this callback!
- -#define LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH | -( | -- | pcb, | -
- | - | - | internal_len | -
- | ) | -- |
LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH: Hook for increasing the size of the options allocated with a tcp header. Together with LWIP_HOOK_TCP_OUT_ADD_TCPOPTS, this can be used to add custom options to outgoing tcp segments. Signature:
Arguments:
ATTENTION: don't call any tcp api functions that might change tcp state (pcb state or any pcb lists) from this callback!
- -LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif): Called from ethernet_input() when an unknown eth type is encountered. Signature:
Arguments:
Payload points to ethernet header!
- -#define LWIP_HOOK_VLAN_CHECK | -( | -- | netif, | -
- | - | - | eth_hdr, | -
- | - | - | vlan_hdr | -
- | ) | -- |
LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr): Called from ethernet_input() if VLAN support is enabled Signature:
Arguments:
#define LWIP_HOOK_VLAN_SET | -( | -- | netif, | -
- | - | - | p, | -
- | - | - | src, | -
- | - | - | dst, | -
- | - | - | eth_type | -
- | ) | -- |
LWIP_HOOK_VLAN_SET: Hook can be used to set prio_vid field of vlan_hdr. If you need to store data on per-netif basis to implement this callback, see Client data handling. Called from ethernet_output() if VLAN support (ETHARP_SUPPORT_VLAN) is enabled.
-Signature:
Arguments:
Return values:
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_ICMP 1 |
#define | ICMP_TTL IP_DEFAULT_TTL |
#define | LWIP_BROADCAST_PING 0 |
#define | LWIP_MULTICAST_PING 0 |
#define ICMP_TTL IP_DEFAULT_TTL | -
ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
- -#define LWIP_BROADCAST_PING 0 | -
LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
- -#define LWIP_ICMP 1 | -
LWIP_ICMP==1: Enable ICMP module inside the IP stack. Be careful, disable that make your product non-compliant to RFC1122
- -#define LWIP_MULTICAST_PING 0 | -
LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_ICMP6 LWIP_IPV6 |
#define | LWIP_ICMP6_DATASIZE 8 |
#define | LWIP_ICMP6_HL 255 |
#define LWIP_ICMP6 LWIP_IPV6 | -
LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC)
- -#define LWIP_ICMP6_DATASIZE 8 | -
LWIP_ICMP6_DATASIZE: bytes from original packet to send back in ICMPv6 error messages.
- -#define LWIP_ICMP6_HL 255 | -
LWIP_ICMP6_HL: default hop limit for ICMPv6 messages
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
NO_SYS | |
Timers | |
memcpy | |
Core locking and MPU | |
Heap and memory pools | |
Internal memory pools | |
SNMP MIB2 callbacks | |
Multicast | |
Threading | |
Checksum | |
Hooks | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
ARP | |
ICMP | |
DHCP | |
AUTOIP | |
IGMP | |
-Macros | |
#define | LWIP_IPV4 1 |
#define | IP_FORWARD 0 |
#define | IP_REASSEMBLY 1 |
#define | IP_FRAG 1 |
#define | IP_OPTIONS_ALLOWED 1 |
#define | IP_REASS_MAXAGE 15 |
#define | IP_REASS_MAX_PBUFS 10 |
#define | IP_DEFAULT_TTL 255 |
#define | IP_SOF_BROADCAST 0 |
#define | IP_SOF_BROADCAST_RECV 0 |
#define | IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 |
#define IP_DEFAULT_TTL 255 | -
IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
- -#define IP_FORWARD 0 | -
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.
- -#define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 | -
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!
- -#define IP_FRAG 1 | -
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.
- -#define IP_OPTIONS_ALLOWED 1 | -
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).
- -#define IP_REASS_MAX_PBUFS 10 | -
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)!
- -#define IP_REASS_MAXAGE 15 | -
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.
- -#define IP_REASSEMBLY 1 | -
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.
- -#define IP_SOF_BROADCAST 0 | -
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.
- -#define IP_SOF_BROADCAST_RECV 0 | -
IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast filter on recv operations.
- -#define LWIP_IPV4 1 | -
LWIP_IPV4==1: Enable IPv4
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
ICMP6 | |
Multicast listener discovery | |
Neighbor discovery | |
DHCPv6 | |
-Macros | |
#define | LWIP_IPV6 0 |
#define | IPV6_REASS_MAXAGE 60 |
#define | LWIP_IPV6_SCOPES (LWIP_IPV6 && !LWIP_SINGLE_NETIF) |
#define | LWIP_IPV6_SCOPES_DEBUG 0 |
#define | LWIP_IPV6_NUM_ADDRESSES 3 |
#define | LWIP_IPV6_FORWARD 0 |
#define | LWIP_IPV6_FRAG 1 |
#define | LWIP_IPV6_REASS LWIP_IPV6 |
#define | LWIP_IPV6_SEND_ROUTER_SOLICIT 1 |
#define | LWIP_IPV6_AUTOCONFIG LWIP_IPV6 |
#define | LWIP_IPV6_ADDRESS_LIFETIMES LWIP_IPV6_AUTOCONFIG |
#define | LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 |
#define IPV6_REASS_MAXAGE 60 | -
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.
- -#define LWIP_IPV6 0 | -
LWIP_IPV6==1: Enable IPv6
- -#define LWIP_IPV6_ADDRESS_LIFETIMES LWIP_IPV6_AUTOCONFIG | -
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.
- -#define LWIP_IPV6_AUTOCONFIG LWIP_IPV6 | -
LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862.
- -#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 | -
LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts.
- -#define LWIP_IPV6_FORWARD 0 | -
LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs
- -#define LWIP_IPV6_FRAG 1 | -
LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big.
- -#define LWIP_IPV6_NUM_ADDRESSES 3 | -
LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif.
- -#define LWIP_IPV6_REASS LWIP_IPV6 | -
LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented
- -#define LWIP_IPV6_SCOPES (LWIP_IPV6 && !LWIP_SINGLE_NETIF) | -
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.
- -#define LWIP_IPV6_SCOPES_DEBUG 0 | -
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.
- -#define LWIP_IPV6_SEND_ROUTER_SOLICIT 1 | -
LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during network startup.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_MPU_COMPATIBLE 0 |
#define | LWIP_TCPIP_CORE_LOCKING 1 |
#define | LWIP_TCPIP_CORE_LOCKING_INPUT 0 |
#define | SYS_LIGHTWEIGHT_PROT 1 |
#define | LWIP_ASSERT_CORE_LOCKED() |
#define | LWIP_MARK_TCPIP_THREAD() |
#define LWIP_ASSERT_CORE_LOCKED | -( | -) | -- |
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:
#define LWIP_MARK_TCPIP_THREAD | -( | -) | -- |
Called as first thing in the lwIP TCPIP thread. Can be used in conjunction with LWIP_ASSERT_CORE_LOCKED to check core locking.
#define LWIP_MPU_COMPATIBLE 0 | -
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)
- -#define LWIP_TCPIP_CORE_LOCKING 1 | -
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.
- -#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 | -
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!
- -#define SYS_LIGHTWEIGHT_PROT 1 | -
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!
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_HAVE_LOOPIF (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF) |
#define | LWIP_LOOPIF_MULTICAST 0 |
#define | LWIP_NETIF_LOOPBACK 0 |
#define | LWIP_LOOPBACK_MAX_PBUFS 0 |
#define | LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) |
#define LWIP_HAVE_LOOPIF (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF) | -
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.
- -#define LWIP_LOOPBACK_MAX_PBUFS 0 | -
LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback sending for each netif (0 = disabled)
- -#define LWIP_LOOPIF_MULTICAST 0 | -
LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1).
- -#define LWIP_NETIF_LOOPBACK 0 | -
LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP address equal to the netif IP address, looping them back up the stack.
- -#define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) | -
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.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | MEM_LIBC_MALLOC 0 |
#define | MEMP_MEM_MALLOC 0 |
#define | MEMP_MEM_INIT 0 |
#define | MEM_ALIGNMENT 1 |
#define | MEM_SIZE 1600 |
#define | MEMP_OVERFLOW_CHECK 0 |
#define | MEMP_SANITY_CHECK 0 |
#define | MEM_OVERFLOW_CHECK 0 |
#define | MEM_SANITY_CHECK 0 |
#define | MEM_USE_POOLS 0 |
#define | MEM_USE_POOLS_TRY_BIGGER_POOL 0 |
#define | MEMP_USE_CUSTOM_POOLS 0 |
#define | LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 |
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 | -
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:
#define MEM_ALIGNMENT 1 | -
MEM_ALIGNMENT: should be set to the alignment of the CPU 4 byte alignment -> #define MEM_ALIGNMENT 4 2 byte alignment -> #define MEM_ALIGNMENT 2
- -#define MEM_LIBC_MALLOC 0 | -
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.
- -#define MEM_OVERFLOW_CHECK 0 | -
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!)
- -#define MEM_SANITY_CHECK 0 | -
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.
- -#define MEM_SIZE 1600 | -
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.
- -#define MEM_USE_POOLS 0 | -
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.
- -#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 | -
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.
- -#define MEMP_MEM_INIT 0 | -
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.
- -#define MEMP_MEM_MALLOC 0 | -
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)!
- -#define MEMP_OVERFLOW_CHECK 0 | -
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!)
- -#define MEMP_SANITY_CHECK 0 | -
MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make sure that there are no cycles in the linked lists.
- -#define MEMP_USE_CUSTOM_POOLS 0 | -
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.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | MEMCPY(dst, src, len) memcpy(dst,src,len) |
#define | SMEMCPY(dst, src, len) memcpy(dst,src,len) |
#define | MEMMOVE(dst, src, len) memmove(dst,src,len) |
#define MEMCPY | -( | -- | dst, | -
- | - | - | src, | -
- | - | - | len | -
- | ) | -memcpy(dst,src,len) | -
MEMCPY: override this if you have a faster implementation at hand than the one included in your C library
- -#define MEMMOVE | -( | -- | dst, | -
- | - | - | src, | -
- | - | - | len | -
- | ) | -memmove(dst,src,len) | -
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.
- -#define SMEMCPY | -( | -- | dst, | -
- | - | - | src, | -
- | - | - | len | -
- | ) | -memcpy(dst,src,len) | -
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.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | MEMP_NUM_PBUF 16 |
#define | MEMP_NUM_RAW_PCB 4 |
#define | MEMP_NUM_UDP_PCB 4 |
#define | MEMP_NUM_TCP_PCB 5 |
#define | MEMP_NUM_TCP_PCB_LISTEN 8 |
#define | MEMP_NUM_TCP_SEG 16 |
#define | MEMP_NUM_ALTCP_PCB MEMP_NUM_TCP_PCB |
#define | MEMP_NUM_REASSDATA 5 |
#define | MEMP_NUM_FRAG_PBUF 15 |
#define | MEMP_NUM_ARP_QUEUE 30 |
#define | MEMP_NUM_IGMP_GROUP 8 |
#define | LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD))) |
#define | MEMP_NUM_SYS_TIMEOUT LWIP_NUM_SYS_TIMEOUT_INTERNAL |
#define | MEMP_NUM_NETBUF 2 |
#define | MEMP_NUM_NETCONN 4 |
#define | MEMP_NUM_SELECT_CB 4 |
#define | MEMP_NUM_TCPIP_MSG_API 8 |
#define | MEMP_NUM_TCPIP_MSG_INPKT 8 |
#define | MEMP_NUM_NETDB 1 |
#define | MEMP_NUM_LOCALHOSTLIST 1 |
#define | PBUF_POOL_SIZE 16 |
#define | MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API |
#define | MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API |
#define | MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API |
#define | MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API |
#define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD))) | -
The number of sys timeouts used by the core stack (not apps) The default number of timeouts is calculated here for all enabled modules.
- -#define MEMP_NUM_ALTCP_PCB MEMP_NUM_TCP_PCB | -
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).
- -#define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API | -
MEMP_NUM_API_MSG: the number of concurrently active calls to various socket, netconn, and tcpip functions
- -#define MEMP_NUM_ARP_QUEUE 30 | -
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)
- -#define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API | -
MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname
- -#define MEMP_NUM_FRAG_PBUF 15 | -
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.
- -#define MEMP_NUM_IGMP_GROUP 8 | -
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)
- -#define MEMP_NUM_LOCALHOSTLIST 1 | -
MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
- -#define MEMP_NUM_NETBUF 2 | -
MEMP_NUM_NETBUF: the number of struct netbufs. (only needed if you use the sequential API, like api_lib.c)
- -#define MEMP_NUM_NETCONN 4 | -
MEMP_NUM_NETCONN: the number of struct netconns. (only needed if you use the sequential API, like api_lib.c)
- -#define MEMP_NUM_NETDB 1 | -
MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls (before freeing the corresponding memory using lwip_freeaddrinfo()).
- -#define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API | -
MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the netifapi functions
- -#define MEMP_NUM_PBUF 16 | -
MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). If the application sends a lot of data out of ROM (or other static memory), this should be set high.
- -#define MEMP_NUM_RAW_PCB 4 | -
MEMP_NUM_RAW_PCB: Number of raw connection PCBs (requires the LWIP_RAW option)
- -#define MEMP_NUM_REASSDATA 5 | -
MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for reassembly (whole packets, not fragments!)
- -#define MEMP_NUM_SELECT_CB 4 | -
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.)
- -#define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API | -
MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls to getsockopt/setsockopt
- -#define MEMP_NUM_SYS_TIMEOUT LWIP_NUM_SYS_TIMEOUT_INTERNAL | -
MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. The default number of timeouts is calculated here for all enabled modules. The formula expects settings to be either '0' or '1'.
- -#define MEMP_NUM_TCP_PCB 5 | -
MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. (requires the LWIP_TCP option)
- -#define MEMP_NUM_TCP_PCB_LISTEN 8 | -
MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. (requires the LWIP_TCP option)
- -#define MEMP_NUM_TCP_SEG 16 | -
MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. (requires the LWIP_TCP option)
- -#define MEMP_NUM_TCPIP_MSG_API 8 | -
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)
- -#define MEMP_NUM_TCPIP_MSG_INPKT 8 | -
MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used for incoming packets. (only needed if you use tcpip.c)
- -#define MEMP_NUM_UDP_PCB 4 | -
MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One per active UDP "connection". (requires the LWIP_UDP option)
- -#define PBUF_POOL_SIZE 16 | -
PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_MIB2_CALLBACKS 0 |
#define LWIP_MIB2_CALLBACKS 0 | -
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
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_IPV6_MLD LWIP_IPV6 |
#define | MEMP_NUM_MLD6_GROUP 4 |
#define LWIP_IPV6_MLD LWIP_IPV6 | -
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.
- -#define MEMP_NUM_MLD6_GROUP 4 | -
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.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_MULTICAST_TX_OPTIONS ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW)) |
#define LWIP_MULTICAST_TX_OPTIONS ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW)) | -
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
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_ND6_QUEUEING LWIP_IPV6 |
#define | MEMP_NUM_ND6_QUEUE 20 |
#define | LWIP_ND6_NUM_NEIGHBORS 10 |
#define | LWIP_ND6_NUM_DESTINATIONS 10 |
#define | LWIP_ND6_NUM_PREFIXES 5 |
#define | LWIP_ND6_NUM_ROUTERS 3 |
#define | LWIP_ND6_MAX_MULTICAST_SOLICIT 3 |
#define | LWIP_ND6_MAX_UNICAST_SOLICIT 3 |
#define | LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 |
#define | LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 |
#define | LWIP_ND6_REACHABLE_TIME 30000 |
#define | LWIP_ND6_RETRANS_TIMER 1000 |
#define | LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 |
#define | LWIP_ND6_ALLOW_RA_UPDATES 1 |
#define | LWIP_ND6_TCP_REACHABILITY_HINTS 1 |
#define | LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 |
#define LWIP_ND6_ALLOW_RA_UPDATES 1 | -
LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update Reachable time and retransmission timers, and netif MTU.
- -#define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 | -
LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation message is sent, during neighbor reachability detection.
- -#define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 | -
Unused: See ND RFC (time in milliseconds).
- -#define LWIP_ND6_MAX_MULTICAST_SOLICIT 3 | -
LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send (neighbor solicit and router solicit)
- -#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 | -
Unused: See ND RFC
- -#define LWIP_ND6_MAX_UNICAST_SOLICIT 3 | -
LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages to send during neighbor reachability detection.
- -#define LWIP_ND6_NUM_DESTINATIONS 10 | -
LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache
- -#define LWIP_ND6_NUM_NEIGHBORS 10 | -
LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache
- -#define LWIP_ND6_NUM_PREFIXES 5 | -
LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache
- -#define LWIP_ND6_NUM_ROUTERS 3 | -
LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache
- -#define LWIP_ND6_QUEUEING LWIP_IPV6 | -
LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address is being resolved.
- -#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 | -
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.
- -#define LWIP_ND6_REACHABLE_TIME 30000 | -
LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). May be updated by router advertisement messages.
- -#define LWIP_ND6_RETRANS_TIMER 1000 | -
LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages
- -#define LWIP_ND6_TCP_REACHABILITY_HINTS 1 | -
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.
- -#define MEMP_NUM_ND6_QUEUE 20 | -
MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_NETCONN 1 |
#define | LWIP_TCPIP_TIMEOUT 0 |
#define | LWIP_NETCONN_SEM_PER_THREAD 0 |
#define | LWIP_NETCONN_FULLDUPLEX 0 |
#define LWIP_NETCONN 1 | -
LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
- -#define LWIP_NETCONN_FULLDUPLEX 0 | -
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:
#define LWIP_NETCONN_SEM_PER_THREAD 0 | -
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:
#define LWIP_TCPIP_TIMEOUT 0 | -
LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create timers running in tcpip_thread from another thread.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Loopback interface | |
-Macros | |
#define | LWIP_SINGLE_NETIF 0 |
#define | LWIP_NETIF_HOSTNAME 0 |
#define | LWIP_NETIF_API 0 |
#define | LWIP_NETIF_STATUS_CALLBACK 0 |
#define | LWIP_NETIF_EXT_STATUS_CALLBACK 0 |
#define | LWIP_NETIF_LINK_CALLBACK 0 |
#define | LWIP_NETIF_REMOVE_CALLBACK 0 |
#define | LWIP_NETIF_HWADDRHINT 0 |
#define | LWIP_NETIF_TX_SINGLE_PBUF 0 |
#define | LWIP_NUM_NETIF_CLIENT_DATA 0 |
#define LWIP_NETIF_API 0 | -
LWIP_NETIF_API==1: Support netif api (in netifapi.c)
- -#define LWIP_NETIF_EXT_STATUS_CALLBACK 0 | -
LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function for several netif related event that supports multiple subscribers.
#define LWIP_NETIF_HOSTNAME 0 | -
LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname field.
- -#define LWIP_NETIF_HWADDRHINT 0 | -
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.
- -#define LWIP_NETIF_LINK_CALLBACK 0 | -
LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface whenever the link changes (i.e., link down)
- -#define LWIP_NETIF_REMOVE_CALLBACK 0 | -
LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called when a netif has been removed
- -#define LWIP_NETIF_STATUS_CALLBACK 0 | -
LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface changes its up/down status (i.e., due to DHCP IP acquisition)
- -#define LWIP_NETIF_TX_SINGLE_PBUF 0 | -
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! }
- -#define LWIP_NUM_NETIF_CLIENT_DATA 0 | -
LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store data in client_data member array of struct netif (max. 256).
- -#define LWIP_SINGLE_NETIF 0 | -
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
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | NO_SYS 0 |
#define NO_SYS 0 | -
NO_SYS==1: Use lwIP without OS-awareness (no thread, semaphores, mutexes or mboxes). This means threaded APIs cannot be used (socket, netconn, i.e. everything in the 'api' folder), only the callback-style raw API is available (and you have to watch out for yourself that you don't access lwIP functions/structures from more than one context at a time!)
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) |
#define | PBUF_LINK_ENCAPSULATION_HLEN 0 |
#define | PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) |
#define | LWIP_PBUF_REF_T u8_t |
#define LWIP_PBUF_REF_T u8_t | -
LWIP_PBUF_REF_T: Refcount type in pbuf. Default width of u8_t can be increased if 255 refs are not enough for you.
- -#define PBUF_LINK_ENCAPSULATION_HLEN 0 | -
PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated for an additional encapsulation header before ethernet headers (e.g. 802.11)
- -#define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) | -
PBUF_LINK_HLEN: the number of bytes that should be allocated for a link level header. The default is 14, the standard value for Ethernet.
- -#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) | -
PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is designed to accommodate single full size TCP frame in one pbuf, including TCP_MSS, IP header, and link header.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_RAW 0 |
#define | RAW_TTL IP_DEFAULT_TTL |
#define LWIP_RAW 0 | -
LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
- -#define RAW_TTL IP_DEFAULT_TTL | -
LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_SOCKET 1 |
#define | LWIP_COMPAT_SOCKETS 1 |
#define | LWIP_POSIX_SOCKETS_IO_NAMES 1 |
#define | LWIP_SOCKET_OFFSET 0 |
#define | LWIP_TCP_KEEPALIVE 0 |
#define | LWIP_SO_SNDTIMEO 0 |
#define | LWIP_SO_RCVTIMEO 0 |
#define | LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 |
#define | LWIP_SO_RCVBUF 0 |
#define | LWIP_SO_LINGER 0 |
#define | RECV_BUFSIZE_DEFAULT INT_MAX |
#define | LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 |
#define | SO_REUSE 0 |
#define | SO_REUSE_RXTOALL 0 |
#define | LWIP_FIONREAD_LINUXMODE 0 |
#define | LWIP_SOCKET_SELECT 1 |
#define | LWIP_SOCKET_POLL 1 |
#define LWIP_COMPAT_SOCKETS 1 | -
LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. While this helps code completion, it might conflict with existing libraries. (only used if you use sockets.c)
- -#define LWIP_FIONREAD_LINUXMODE 0 | -
LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of pending data in the network buffer. This is the way windows does it. It's the default for lwIP since it is smaller. LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next pending datagram in bytes. This is the way linux does it. This code is only here for compatibility.
- -#define LWIP_POSIX_SOCKETS_IO_NAMES 1 | -
LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. Disable this option if you use a POSIX operating system that uses the same names (read, write & close). (only used if you use sockets.c)
- -#define LWIP_SO_LINGER 0 | -
LWIP_SO_LINGER==1: Enable SO_LINGER processing.
- -#define LWIP_SO_RCVBUF 0 | -
LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
- -#define LWIP_SO_RCVTIMEO 0 | -
LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and SO_RCVTIMEO processing.
- -#define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 | -
LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int (milliseconds, much like winsock does) instead of a struct timeval (default).
- -#define LWIP_SO_SNDTIMEO 0 | -
LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and SO_SNDTIMEO processing.
- -#define LWIP_SOCKET 1 | -
LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
- -#define LWIP_SOCKET_OFFSET 0 | -
LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. This can be useful when there are multiple APIs which create file descriptors. When they all start with a different offset and you won't make them overlap you can re implement read/write/close/ioctl/fnctl to send the requested action to the right library (sharing select will need more work though).
- -#define LWIP_SOCKET_POLL 1 | -
LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including struct pollfd, nfds_t, and constants)
- -#define LWIP_SOCKET_SELECT 1 | -
LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn callback to keep track of events). This saves RAM (counters per socket) and code (netconn event callback), which should improve performance a bit).
- -#define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 | -
By default, TCP socket/netconn close waits 20 seconds max to send the FIN
- -#define LWIP_TCP_KEEPALIVE 0 | -
#define RECV_BUFSIZE_DEFAULT INT_MAX | -
If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
- -#define SO_REUSE 0 | -
SO_REUSE==1: Enable SO_REUSEADDR option.
- -#define SO_REUSE_RXTOALL 0 | -
SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets to all local matches if SO_REUSEADDR is turned on. WARNING: Adds a memcpy for every packet if passing to more than one pcb!
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_STATS 1 |
#define | LWIP_STATS_DISPLAY 0 |
#define | LINK_STATS 1 |
#define | ETHARP_STATS (LWIP_ARP) |
#define | IP_STATS 1 |
#define | IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) |
#define | ICMP_STATS 1 |
#define | IGMP_STATS (LWIP_IGMP) |
#define | UDP_STATS (LWIP_UDP) |
#define | TCP_STATS (LWIP_TCP) |
#define | MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) |
#define | MEMP_STATS (MEMP_MEM_MALLOC == 0) |
#define | SYS_STATS (NO_SYS == 0) |
#define | IP6_STATS (LWIP_IPV6) |
#define | ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) |
#define | IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) |
#define | MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) |
#define | ND6_STATS (LWIP_IPV6) |
#define | MIB2_STATS 0 |
#define ETHARP_STATS (LWIP_ARP) | -
ETHARP_STATS==1: Enable etharp stats.
- -#define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) | -
ICMP6_STATS==1: Enable ICMP for IPv6 stats.
- -#define ICMP_STATS 1 | -
ICMP_STATS==1: Enable ICMP stats.
- -#define IGMP_STATS (LWIP_IGMP) | -
IGMP_STATS==1: Enable IGMP stats.
- -#define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) | -
IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats.
- -#define IP6_STATS (LWIP_IPV6) | -
IP6_STATS==1: Enable IPv6 stats.
- -#define IP_STATS 1 | -
IP_STATS==1: Enable IP stats.
- -#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) | -
IPFRAG_STATS==1: Enable IP fragmentation stats. Default is on if using either frag or reass.
- -#define LINK_STATS 1 | -
LINK_STATS==1: Enable link stats.
- -#define LWIP_STATS 1 | -
LWIP_STATS==1: Enable statistics collection in lwip_stats.
- -#define LWIP_STATS_DISPLAY 0 | -
LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
- -#define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) | -
MEM_STATS==1: Enable mem.c stats.
- -#define MEMP_STATS (MEMP_MEM_MALLOC == 0) | -
MEMP_STATS==1: Enable memp.c pool stats.
- -#define MIB2_STATS 0 | -
MIB2_STATS==1: Stats for SNMP MIB2.
- -#define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) | -
MLD6_STATS==1: Enable MLD for IPv6 stats.
- -#define ND6_STATS (LWIP_IPV6) | -
ND6_STATS==1: Enable Neighbor discovery for IPv6 stats.
- -#define SYS_STATS (NO_SYS == 0) | -
SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
- -#define TCP_STATS (LWIP_TCP) | -
TCP_STATS==1: Enable TCP stats. Default is on if TCP enabled, otherwise off.
- -#define UDP_STATS (LWIP_UDP) | -
UDP_STATS==1: Enable UDP stats. Default is on if UDP enabled, otherwise off.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_TCP 1 |
#define | TCP_TTL IP_DEFAULT_TTL |
#define | TCP_WND (4 * TCP_MSS) |
#define | TCP_MAXRTX 12 |
#define | TCP_SYNMAXRTX 6 |
#define | TCP_QUEUE_OOSEQ LWIP_TCP |
#define | LWIP_TCP_SACK_OUT 0 |
#define | LWIP_TCP_MAX_SACK_NUM 4 |
#define | TCP_MSS 536 |
#define | TCP_CALCULATE_EFF_SEND_MSS 1 |
#define | TCP_SND_BUF (2 * TCP_MSS) |
#define | TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) |
#define | TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) |
#define | TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) |
#define | TCP_OOSEQ_MAX_BYTES 0 |
#define | TCP_OOSEQ_MAX_PBUFS 0 |
#define | TCP_LISTEN_BACKLOG 0 |
#define | TCP_DEFAULT_LISTEN_BACKLOG 0xff |
#define | TCP_OVERSIZE TCP_MSS |
#define | LWIP_TCP_TIMESTAMPS 0 |
#define | TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4)) |
#define | LWIP_EVENT_API 0 |
#define | LWIP_WND_SCALE 0 |
#define | LWIP_TCP_PCB_NUM_EXT_ARGS 0 |
#define | LWIP_ALTCP 0 |
#define | LWIP_ALTCP_TLS 0 |
#define LWIP_ALTCP 0 | -
LWIP_ALTCP==1: enable the altcp API. altcp is an abstraction layer that prevents applications linking against the tcp.h functions but provides the same functionality. It is used to e.g. add SSL/TLS or proxy-connect support to an application written for the tcp callback API without that application knowing the protocol details.
-With LWIP_ALTCP==0, applications written against the altcp API can still be compiled but are directly linked against the tcp.h callback API and then cannot use layered protocols.
- - -#define LWIP_ALTCP_TLS 0 | -
LWIP_ALTCP_TLS==1: enable TLS support for altcp API. This needs a port of the functions in altcp_tls.h to a TLS library. A port to ARM mbedtls is provided with lwIP, see apps/altcp_tls/ directory and LWIP_ALTCP_TLS_MBEDTLS option.
- -#define LWIP_EVENT_API 0 | -
LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all events (accept, sent, etc) that happen in the system. LWIP_CALLBACK_API==1: The PCB callback function is called directly for the event. This is the default.
- -#define LWIP_TCP 1 | -
LWIP_TCP==1: Turn on TCP.
- -#define LWIP_TCP_MAX_SACK_NUM 4 | -
LWIP_TCP_MAX_SACK_NUM: The maximum number of SACK values to include in TCP segments. Must be at least 1, but is only used if LWIP_TCP_SACK_OUT is enabled. NOTE: Even though we never send more than 3 or 4 SACK ranges in a single segment (depending on other options), setting this option to values greater than 4 is not pointless. This is basically the max number of SACK ranges we want to keep track of. As new data is delivered, some of the SACK ranges may be removed or merged. In that case some of those older SACK ranges may be used again. The amount of memory used to store SACK ranges is LWIP_TCP_MAX_SACK_NUM * 8 bytes for each TCP PCB.
- -#define LWIP_TCP_PCB_NUM_EXT_ARGS 0 | -
LWIP_TCP_PCB_NUM_EXT_ARGS: When this is > 0, every tcp pcb (including listen pcb) includes a number of additional argument entries in an array (see tcp_ext_arg_alloc_id)
- -#define LWIP_TCP_SACK_OUT 0 | -
LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs).
- -#define LWIP_TCP_TIMESTAMPS 0 | -
LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. The timestamp option is currently only used to help remote hosts, it is not really used locally. Therefore, it is only enabled when a TS option is received in the initial SYN packet from a remote host.
- -#define LWIP_WND_SCALE 0 | -
LWIP_WND_SCALE and TCP_RCV_SCALE: Set LWIP_WND_SCALE to 1 to enable window scaling. Set TCP_RCV_SCALE to the desired scaling factor (shift count in the range of [0..14]). When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large send window while having a small receive window only.
- -#define TCP_CALCULATE_EFF_SEND_MSS 1 | -
TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which reflects the available reassembly buffer size at the remote host) and the largest size permitted by the IP layer" (RFC 1122) Setting this to 1 enables code that checks TCP_MSS against the MTU of the netif used for a connection and limits the MSS if it would be too big otherwise.
- -#define TCP_DEFAULT_LISTEN_BACKLOG 0xff | -
The maximum allowed backlog for TCP listen netconns. This backlog is used unless another is explicitly specified. 0xff is the maximum (u8_t).
- -#define TCP_LISTEN_BACKLOG 0 | -
TCP_OOSEQ_PBUFS_LIMIT(pcb): Return the maximum number of pbufs to be queued on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 && TCP_OOSEQ_MAX_PBUFS==1. Use this to override TCP_OOSEQ_MAX_PBUFS to a dynamic value per pcb. TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
- -#define TCP_MAXRTX 12 | -
TCP_MAXRTX: Maximum number of retransmissions of data segments.
- -#define TCP_MSS 536 | -
TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, you might want to increase this.) For the receive side, this MSS is advertised to the remote side when opening a connection. For the transmit size, this MSS sets an upper limit on the MSS advertised by the remote host.
- -#define TCP_OOSEQ_MAX_BYTES 0 | -
TCP_OOSEQ_MAX_BYTES: The default maximum number of bytes queued on ooseq per pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1.
- -#define TCP_OOSEQ_MAX_PBUFS 0 | -
TCP_OOSEQ_BYTES_LIMIT(pcb): Return the maximum number of bytes to be queued on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 && TCP_OOSEQ_MAX_BYTES==1. Use this to override TCP_OOSEQ_MAX_BYTES to a dynamic value per pcb. TCP_OOSEQ_MAX_PBUFS: The default maximum number of pbufs queued on ooseq per pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1.
- -#define TCP_OVERSIZE TCP_MSS | -
TCP_OVERSIZE: The maximum number of bytes that tcp_write may allocate ahead of time in an attempt to create shorter pbuf chains for transmission. The meaningful range is 0 to TCP_MSS. Some suggested values are:
-0: Disable oversized allocation. Each tcp_write() allocates a new pbuf (old behaviour). 1: Allocate size-aligned pbufs with minimal excess. Use this if your scatter-gather DMA requires aligned fragments. 128: Limit the pbuf/memory overhead to 20%. TCP_MSS: Try to create unfragmented TCP packets. TCP_MSS/4: Try to create 4 fragments or less per TCP packet.
- -#define TCP_QUEUE_OOSEQ LWIP_TCP | -
TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. Define to 0 if your device is low on memory.
- -#define TCP_SND_BUF (2 * TCP_MSS) | -
TCP_SND_BUF: TCP sender buffer space (bytes). To achieve good performance, this should be at least 2 * TCP_MSS.
- -#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) | -
TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
- -#define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) | -
TCP_SNDLOWAT: TCP writable space (bytes). This must be less than TCP_SND_BUF. It is the amount of space which must be available in the TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
- -#define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) | -
TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below this number, select returns writable (combined with TCP_SNDLOWAT).
- -#define TCP_SYNMAXRTX 6 | -
TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
- -#define TCP_TTL IP_DEFAULT_TTL | -
TCP_TTL: Default Time-To-Live value.
- -#define TCP_WND (4 * TCP_MSS) | -
TCP_WND: The size of a TCP window. This must be at least (2 * TCP_MSS) for things to work well. ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size with scaling applied. Maximum window value in the TCP header will be TCP_WND >> TCP_RCV_SCALE
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | TCPIP_THREAD_NAME "tcpip_thread" |
#define | TCPIP_THREAD_STACKSIZE 0 |
#define | TCPIP_THREAD_PRIO 1 |
#define | TCPIP_MBOX_SIZE 0 |
#define | LWIP_TCPIP_THREAD_ALIVE() |
#define | SLIPIF_THREAD_NAME "slipif_loop" |
#define | SLIPIF_THREAD_STACKSIZE 0 |
#define | SLIPIF_THREAD_PRIO 1 |
#define | DEFAULT_THREAD_NAME "lwIP" |
#define | DEFAULT_THREAD_STACKSIZE 0 |
#define | DEFAULT_THREAD_PRIO 1 |
#define | DEFAULT_RAW_RECVMBOX_SIZE 0 |
#define | DEFAULT_UDP_RECVMBOX_SIZE 0 |
#define | DEFAULT_TCP_RECVMBOX_SIZE 0 |
#define | DEFAULT_ACCEPTMBOX_SIZE 0 |
#define DEFAULT_ACCEPTMBOX_SIZE 0 | -
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.
- -#define DEFAULT_RAW_RECVMBOX_SIZE 0 | -
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.
- -#define DEFAULT_TCP_RECVMBOX_SIZE 0 | -
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.
- -#define DEFAULT_THREAD_NAME "lwIP" | -
DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
- -#define DEFAULT_THREAD_PRIO 1 | -
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.
- -#define DEFAULT_THREAD_STACKSIZE 0 | -
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.
- -#define DEFAULT_UDP_RECVMBOX_SIZE 0 | -
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.
- -#define LWIP_TCPIP_THREAD_ALIVE | -( | -) | -- |
Define this to something that triggers a watchdog. This is called from tcpip_thread after processing a message.
- -#define SLIPIF_THREAD_NAME "slipif_loop" | -
SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
- -#define SLIPIF_THREAD_PRIO 1 | -
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.
- -#define SLIPIF_THREAD_STACKSIZE 0 | -
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.
- -#define TCPIP_MBOX_SIZE 0 | -
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.
- -#define TCPIP_THREAD_NAME "tcpip_thread" | -
TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
- -#define TCPIP_THREAD_PRIO 1 | -
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.
- -#define TCPIP_THREAD_STACKSIZE 0 | -
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.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_TIMERS 1 |
#define | LWIP_TIMERS_CUSTOM 0 |
#define LWIP_TIMERS 1 | -
LWIP_TIMERS==0: Drop support for sys_timeout and lwip-internal cyclic timers. (the array of lwip-internal cyclic timers is still provided) (check NO_SYS_NO_TIMERS for compatibility to old versions)
- -#define LWIP_TIMERS_CUSTOM 0 | -
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()
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_UDP 1 |
#define | LWIP_UDPLITE 0 |
#define | UDP_TTL IP_DEFAULT_TTL |
#define | LWIP_NETBUF_RECVINFO 0 |
#define LWIP_NETBUF_RECVINFO 0 | -
LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
- -#define LWIP_UDP 1 | -
LWIP_UDP==1: Turn on UDP.
- -#define LWIP_UDPLITE 0 | -
LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
- -#define UDP_TTL IP_DEFAULT_TTL | -
UDP_TTL: Default Time-To-Live value.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | tcpip_callback_with_block(function, ctx, block) ((block != 0)? tcpip_callback(function, ctx) : tcpip_try_callback(function, ctx)) |
-Functions | |
err_t | tcpip_input (struct pbuf *p, struct netif *inp) |
err_t | tcpip_callback (tcpip_callback_fn function, void *ctx) |
err_t | tcpip_try_callback (tcpip_callback_fn function, void *ctx) |
struct tcpip_callback_msg * | tcpip_callbackmsg_new (tcpip_callback_fn function, void *ctx) |
void | tcpip_callbackmsg_delete (struct tcpip_callback_msg *msg) |
err_t | tcpip_callbackmsg_trycallback (struct tcpip_callback_msg *msg) |
err_t | tcpip_callbackmsg_trycallback_fromisr (struct tcpip_callback_msg *msg) |
void | tcpip_init (tcpip_init_done_fn initfunc, void *arg) |
Use this mode if you run an OS on your system. It is recommended to use an RTOS that correctly handles priority inversion and to use LWIP_TCPIP_CORE_LOCKING.
-Porting: implement all functions in Porting (system abstraction layer).
-You can use "raw" APIs together with tcpip_callback, and all Sequential-style APIs.
#define tcpip_callback_with_block | -( | -- | function, | -
- | - | - | ctx, | -
- | - | - | block | -
- | ) | -((block != 0)? tcpip_callback(function, ctx) : tcpip_try_callback(function, ctx)) | -
err_t tcpip_callback | -( | -tcpip_callback_fn | -function, | -
- | - | void * | -ctx | -
- | ) | -- |
Call a specific function in the thread context of tcpip_thread for easy access synchronization. A function called in that way may access lwIP core code without fearing concurrent access. Blocks until the request is posted. Must not be called from interrupt context!
-function | the function to call |
ctx | parameter passed to f |
void tcpip_callbackmsg_delete | -( | -struct tcpip_callback_msg * | -msg | ) | -- |
Free a callback message allocated by tcpip_callbackmsg_new().
-msg | the message to free |
struct tcpip_callback_msg* tcpip_callbackmsg_new | -( | -tcpip_callback_fn | -function, | -
- | - | void * | -ctx | -
- | ) | -- |
Allocate a structure for a static callback message and initialize it. The message has a special type such that lwIP never frees it. This is intended to be used to send "static" messages from interrupt context, e.g. the message is allocated once and posted several times from an IRQ using tcpip_callbackmsg_trycallback(). Example usage: Trigger execution of an ethernet IRQ DPC routine in lwIP thread context.
-function | the function to call |
ctx | parameter passed to function |
err_t tcpip_callbackmsg_trycallback | -( | -struct tcpip_callback_msg * | -msg | ) | -- |
Try to post a callback-message to the tcpip_thread tcpip_mbox.
-msg | pointer to the message to post |
err_t tcpip_callbackmsg_trycallback_fromisr | -( | -struct tcpip_callback_msg * | -msg | ) | -- |
Try to post a callback-message to the tcpip_thread mbox. Same as tcpip_callbackmsg_trycallback but calls sys_mbox_trypost_fromisr(), mainly to help FreeRTOS, where calls differ between task level and ISR level.
-msg | pointer to the message to post |
void tcpip_init | -( | -tcpip_init_done_fn | -initfunc, | -
- | - | void * | -arg | -
- | ) | -- |
Initialize this module:
initfunc | a function to call when tcpip_thread is running and finished initializing |
arg | argument to pass to initfunc |
Pass a received packet to tcpip_thread for input processing with ethernet_input or ip_input. Don't call directly, pass to netif_add() and call netif->input().
-p | the received packet, p->payload pointing to the Ethernet header or to an IP header (if inp doesn't have NETIF_FLAG_ETHARP or NETIF_FLAG_ETHERNET flags) |
inp | the network interface on which the packet was received |
err_t tcpip_try_callback | -( | -tcpip_callback_fn | -function, | -
- | - | void * | -ctx | -
- | ) | -- |
Call a specific function in the thread context of tcpip_thread for easy access synchronization. A function called in that way may access lwIP core code without fearing concurrent access. Does NOT block when the request cannot be posted because the tcpip_mbox is full, but returns ERR_MEM instead. Can be called from interrupt context.
-function | the function to call |
ctx | parameter passed to f |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_VERSION_MAJOR 2 |
#define | LWIP_VERSION_MINOR 1 |
#define | LWIP_VERSION_REVISION 2 |
#define | LWIP_VERSION_RC LWIP_RC_RELEASE |
#define | LWIP_RC_RELEASE 255 |
#define | LWIP_RC_DEVELOPMENT 0 |
#define | LWIP_VERSION |
#define | LWIP_VERSION_STRING LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX |
#define LWIP_RC_DEVELOPMENT 0 | -
LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions
- -#define LWIP_RC_RELEASE 255 | -
LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases
- -#define LWIP_VERSION | -
Provides the version of the stack
- -#define LWIP_VERSION_MAJOR 2 | -
X.x.x: Major version of the stack
- -#define LWIP_VERSION_MINOR 1 | -
x.X.x: Minor version of the stack
- -#define LWIP_VERSION_RC LWIP_RC_RELEASE | -
For release candidates, this is set to 1..254 For official releases, this is set to 255 (LWIP_RC_RELEASE) For development versions (Git), this is set to 0 (LWIP_RC_DEVELOPMENT)
- -#define LWIP_VERSION_REVISION 2 | -
x.x.X: Revision of the stack
- -#define LWIP_VERSION_STRING LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX | -
Provides the version of the stack as string
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
-Macros | |
#define | mdns_resp_netif_settings_changed(netif) mdns_resp_announce(netif) |
-Functions | |
err_t | mdns_resp_add_netif (struct netif *netif, const char *hostname, u32_t dns_ttl) |
err_t | mdns_resp_remove_netif (struct netif *netif) |
err_t | mdns_resp_rename_netif (struct netif *netif, const char *hostname) |
s8_t | mdns_resp_add_service (struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_data) |
err_t | mdns_resp_del_service (struct netif *netif, s8_t slot) |
err_t | mdns_resp_rename_service (struct netif *netif, s8_t slot, const char *name) |
err_t | mdns_resp_add_service_txtitem (struct mdns_service *service, const char *txt, u8_t txt_len) |
void | mdns_resp_announce (struct netif *netif) |
void | mdns_resp_restart (struct netif *netif) |
void | mdns_resp_init (void) |
RFC 6762 - Multicast DNS
-RFC 6763 - DNS-Based Service Discovery
-
Multicast DNS for lwIP - -Author: Erik Ekman - - -Note! The MDNS responder does not have all features required by the standards. -See notes in src/apps/mdns/mdns.c for what is left. It is however usable in normal -cases - but watch out if many devices on the same network try to use the same -host/service instance names. - - -How to enable: -============== - -MDNS support does not depend on DNS. -MDNS supports using IPv4 only, v6 only, or v4+v6. - -To enable MDNS responder, set - LWIP_MDNS_RESPONDER = 1 -in lwipopts.h and add src/apps/mdns/mdns.c to your list of files to build. - -The max number of services supported per netif is defined by MDNS_MAX_SERVICES, -default is 1. - -Increase MEMP_NUM_UDP_PCB by 1. MDNS needs one PCB. -Increase LWIP_NUM_NETIF_CLIENT_DATA by 1 (MDNS needs one entry on netif). - -MDNS with IPv4 requires LWIP_IGMP = 1, and preferably LWIP_AUTOIP = 1. -MDNS with IPv6 requires LWIP_IPV6_MLD = 1, and that a link-local address is -generated. - -The MDNS code puts its structs on the stack where suitable to reduce dynamic -memory allocation. It may use up to 1kB of stack. - -MDNS (like other apps) needs a strncasecmp() implementation. If you have one, define -'lwip_strnicmp' to it. Otherwise the code will provide an implementation -for you. - - -How to use: -=========== - -Call mdns_resp_init() during system initialization. -This opens UDP sockets on port 5353 for IPv4 and IPv6. - - -To start responding on a netif, run - mdns_resp_add_netif(struct netif *netif, char *hostname, u32_t dns_ttl) - -The hostname will be copied. If this returns successfully, the netif will join -the multicast groups and any MDNS/legacy DNS requests sent unicast or multicast -to port 5353 will be handled: -- <hostname>.local type A, AAAA or ANY returns relevant IP addresses -- Reverse lookups (PTR in-addr.arpa, ip6.arpa) of netif addresses - returns <hostname>.local -Answers will use the supplied TTL (in seconds) -MDNS allows UTF-8 names, but it is recommended to stay within ASCII, -since the default case-insensitive comparison assumes this. - -Call mdns_resp_announce() every time the IP address on the netif has changed. - -Call mdns_resp_restart() every time the network interface comes up after being -down, for example cable connected after being disconnected, administrative -interface comes up after being down, or the device wakes up from sleep. - -To stop responding on a netif, run - mdns_resp_remove_netif(struct netif *netif) - - -Adding services: -================ - -The netif first needs to be registered. Then run - mdns_resp_add_service(struct netif *netif, char *name, char *service, - u16_t proto, u16_t port, u32_t dns_ttl, - service_get_txt_fn_t txt_fn, void *txt_userdata); - -The name and service pointers will be copied. Name refers to the name of the -service instance, and service is the type of service, like _http -proto can be DNSSD_PROTO_UDP or DNSSD_PROTO_TCP which represent _udp and _tcp. -If this call returns successfully, the following queries will be answered: -- _services._dns-sd._udp.local type PTR returns <service>.<proto>.local -- <service>.<proto>.local type PTR returns <name>.<service>.<proto>.local -- <name>.<service>.<proto>.local type SRV returns hostname and port of service -- <name>.<service>.<proto>.local type TXT builds text strings by calling txt_fn - with the supplied userdata. The callback adds strings to the reply by calling - mdns_resp_add_service_txtitem(struct mdns_service *service, char *txt, - int txt_len). Example callback method: - - static void srv_txt(struct mdns_service *service, void *txt_userdata) - { - res = mdns_resp_add_service_txtitem(service, "path=/", 6); - LWIP_ERROR("mdns add service txt failed\n", (res == ERR_OK), return); - } - - Since a hostname struct is used for TXT storage each single item can be max - 63 bytes long, and the total max length (including length bytes for each - item) is 255 bytes. - -If your device runs a webserver on port 80, an example call might be: - - mdns_resp_add_service(netif, "myweb", "_http" - DNSSD_PROTO_TCP, 80, 3600, srv_txt, NULL); - -which will publish myweb._http._tcp.local for any hosts looking for web servers, -and point them to <hostname>.local:80 - -Relevant information will be sent as additional records to reduce number of -requests required from a client. - -To remove a service from a netif, run - mdns_resp_del_service(struct netif *netif, s8_t slot)
#define mdns_resp_netif_settings_changed | -( | -- | netif | ) | -mdns_resp_announce(netif) | -
Announce IP settings have changed on netif. Call this in your callback registered by netif_set_status_callback(). No need to call this function when LWIP_NETIF_EXT_STATUS_CALLBACK==1, this handled automatically for you.
netif | The network interface where settings have changed. |
err_t mdns_resp_add_netif | -( | -struct netif * | -netif, | -
- | - | const char * | -hostname, | -
- | - | u32_t | -dns_ttl | -
- | ) | -- |
Activate MDNS responder for a network interface.
netif | The network interface to activate. |
hostname | Name to use. Queries for <hostname>.local will be answered with the IP addresses of the netif. The hostname will be copied, the given pointer can be on the stack. |
dns_ttl | Validity time in seconds to send out for IP address data in DNS replies |
s8_t mdns_resp_add_service | -( | -struct netif * | -netif, | -
- | - | const char * | -name, | -
- | - | const char * | -service, | -
- | - | enum mdns_sd_proto | -proto, | -
- | - | u16_t | -port, | -
- | - | u32_t | -dns_ttl, | -
- | - | service_get_txt_fn_t | -txt_fn, | -
- | - | void * | -txt_data | -
- | ) | -- |
Add a service to the selected network interface.
netif | The network interface to publish this service on |
name | The name of the service |
service | The service type, like "_http" |
proto | The service protocol, DNSSD_PROTO_TCP for TCP ("_tcp") and DNSSD_PROTO_UDP for others ("_udp") |
port | The port the service listens to |
dns_ttl | Validity time in seconds to send out for service data in DNS replies |
txt_fn | Callback to get TXT data. Will be called each time a TXT reply is created to allow dynamic replies. |
txt_data | Userdata pointer for txt_fn |
err_t mdns_resp_add_service_txtitem | -( | -struct mdns_service * | -service, | -
- | - | const char * | -txt, | -
- | - | u8_t | -txt_len | -
- | ) | -- |
Call this function from inside the service_get_txt_fn_t callback to add text data. Buffer for TXT data is 256 bytes, and each field is prefixed with a length byte.
service | The service provided to the get_txt callback |
txt | String to add to the TXT field. |
txt_len | Length of string |
void mdns_resp_announce | -( | -struct netif * | -netif | ) | -- |
Send unsolicited answer containing all our known data
netif | The network interface to send on |
err_t mdns_resp_del_service | -( | -struct netif * | -netif, | -
- | - | s8_t | -slot | -
- | ) | -- |
Delete a service on the selected network interface.
netif | The network interface on which service should be removed |
slot | The service slot number returned by mdns_resp_add_service |
void mdns_resp_init | -( | -void | -) | -- |
Initiate MDNS responder. Will open UDP sockets on port 5353
- -Stop responding to MDNS queries on this interface, leave multicast groups, and free the helper structure and any of its services.
netif | The network interface to remove. |
err_t mdns_resp_rename_netif | -( | -struct netif * | -netif, | -
- | - | const char * | -hostname | -
- | ) | -- |
Update MDNS hostname for a network interface.
netif | The network interface to activate. |
hostname | Name to use. Queries for <hostname>.local will be answered with the IP addresses of the netif. The hostname will be copied, the given pointer can be on the stack. |
err_t mdns_resp_rename_service | -( | -struct netif * | -netif, | -
- | - | s8_t | -slot, | -
- | - | const char * | -name | -
- | ) | -- |
Update name for an MDNS service.
netif | The network interface to activate. |
slot | The service slot number returned by mdns_resp_add_service |
name | The new name for the service |
void mdns_resp_restart | -( | -struct netif * | -netif | ) | -- |
Restart mdns responder. Call this when cable is connected after being disconnected or administrative interface is set up after being down
netif | The network interface to send on |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | MDNS_MAX_SERVICES 1 |
#define | MDNS_RESP_USENETIF_EXTCALLBACK LWIP_NETIF_EXT_STATUS_CALLBACK |
#define | MDNS_DEBUG LWIP_DBG_OFF |
#define MDNS_DEBUG LWIP_DBG_OFF | -
MDNS_DEBUG: Enable debugging for multicast DNS.
- -#define MDNS_MAX_SERVICES 1 | -
LWIP_MDNS_RESPONDER==1: Turn on multicast DNS module. UDP must be available for MDNS transport. IGMP is needed for IPv4 multicast.The maximum number of services per netif
- -#define MDNS_RESP_USENETIF_EXTCALLBACK LWIP_NETIF_EXT_STATUS_CALLBACK | -
MDNS_RESP_USENETIF_EXTCALLBACK==1: register an ext_callback on the netif to automatically restart probing/announcing on status or address change.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name |
#define | LWIP_MEMPOOL_DECLARE(name, num, size, desc) |
#define | LWIP_MEMPOOL_INIT(name) memp_init_pool(&memp_ ## name) |
#define | LWIP_MEMPOOL_ALLOC(name) memp_malloc_pool(&memp_ ## name) |
#define | LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x)) |
Custom memory pools
-#define LWIP_MEMPOOL_ALLOC | -( | -- | name | ) | -memp_malloc_pool(&memp_ ## name) | -
Allocate from a private memory pool
- -#define LWIP_MEMPOOL_DECLARE | -( | -- | name, | -
- | - | - | num, | -
- | - | - | size, | -
- | - | - | desc | -
- | ) | -- |
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:
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[];
- -#define LWIP_MEMPOOL_FREE | -( | -- | name, | -
- | - | - | x | -
- | ) | -memp_free_pool(&memp_ ## name, (x)) | -
Free element from a private memory pool
- -#define LWIP_MEMPOOL_INIT | -( | -- | name | ) | -memp_init_pool(&memp_ ## name) | -
Initialize a private memory pool
- -#define LWIP_MEMPOOL_PROTOTYPE | -( | -- | name | ) | -extern const struct memp_desc memp_ ## name | -
Declare prototype for private memory pool if it is used in multiple files
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netif_mld6_data(netif) ((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6)) |
-Functions | |
err_t | mld6_joingroup (const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr) |
err_t | mld6_joingroup_netif (struct netif *netif, const ip6_addr_t *groupaddr) |
err_t | mld6_leavegroup (const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr) |
err_t | mld6_leavegroup_netif (struct netif *netif, const ip6_addr_t *groupaddr) |
Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. No support for MLDv2.
-Note: The allnodes (ff01::1, ff02::1) group is assumed be received by your netif since it must always be received for correct IPv6 operation (e.g. SLAAC). Ensure the netif filters are configured accordingly!
-The netif flags also need NETIF_FLAG_MLD6 flag set to enable MLD6 on a netif ("netif->flags |= NETIF_FLAG_MLD6;").
-To be called from TCPIP thread.
#define netif_mld6_data | -( | -- | netif | ) | -((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6)) | -
Get list head of MLD6 groups for netif. Note: The allnodes group IP is NOT in the list, since it must always be received for correct IPv6 operation.
err_t mld6_joingroup | -( | -const ip6_addr_t * | -srcaddr, | -
- | - | const ip6_addr_t * | -groupaddr | -
- | ) | -- |
Join a group on one or all network interfaces.
-If the group is to be joined on all interfaces, the given group address must not have a zone set (i.e., it must have its zone index set to IP6_NO_ZONE). If the group is to be joined on one particular interface, the given group address may or may not have a zone set.
-srcaddr | ipv6 address (zoned) of the network interface which should join a new group. If IP6_ADDR_ANY6, join on all netifs |
groupaddr | the ipv6 address of the group to join (possibly but not necessarily zoned) |
err_t mld6_joingroup_netif | -( | -struct netif * | -netif, | -
- | - | const ip6_addr_t * | -groupaddr | -
- | ) | -- |
Join a group on a network interface.
-netif | the network interface which should join a new group. |
groupaddr | the ipv6 address of the group to join (possibly but not necessarily zoned) |
err_t mld6_leavegroup | -( | -const ip6_addr_t * | -srcaddr, | -
- | - | const ip6_addr_t * | -groupaddr | -
- | ) | -- |
Leave a group on a network interface.
-Zoning of address follows the same rules as mld6_joingroup.
-srcaddr | ipv6 address (zoned) of the network interface which should leave the group. If IP6_ADDR_ANY6, leave on all netifs |
groupaddr | the ipv6 address of the group to leave (possibly, but not necessarily zoned) |
err_t mld6_leavegroup_netif | -( | -struct netif * | -netif, | -
- | - | const ip6_addr_t * | -groupaddr | -
- | ) | -- |
Leave a group on a network interface.
-netif | the network interface which should leave the group. |
groupaddr | the ipv6 address of the group to leave (possibly, but not necessarily zoned) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
-Data Structures | |
struct | mqtt_connect_client_info_t |
-Macros | |
#define | MQTT_PORT LWIP_IANA_PORT_MQTT |
#define | MQTT_TLS_PORT LWIP_IANA_PORT_SECURE_MQTT |
#define | mqtt_subscribe(client, topic, qos, cb, arg) mqtt_sub_unsub(client, topic, qos, cb, arg, 1) |
#define | mqtt_unsubscribe(client, topic, cb, arg) mqtt_sub_unsub(client, topic, 0, cb, arg, 0) |
-Typedefs | |
typedef void(* | mqtt_connection_cb_t) (mqtt_client_t *client, void *arg, mqtt_connection_status_t status) |
typedef void(* | mqtt_incoming_data_cb_t) (void *arg, const u8_t *data, u16_t len, u8_t flags) |
typedef void(* | mqtt_incoming_publish_cb_t) (void *arg, const char *topic, u32_t tot_len) |
typedef void(* | mqtt_request_cb_t) (void *arg, err_t err) |
-Enumerations | |
enum | mqtt_connection_status_t { - MQTT_CONNECT_ACCEPTED = 0, -MQTT_CONNECT_REFUSED_PROTOCOL_VERSION = 1, -MQTT_CONNECT_REFUSED_IDENTIFIER = 2, -MQTT_CONNECT_REFUSED_SERVER = 3, - - MQTT_CONNECT_REFUSED_USERNAME_PASS = 4, -MQTT_CONNECT_REFUSED_NOT_AUTHORIZED_ = 5, -MQTT_CONNECT_DISCONNECTED = 256, -MQTT_CONNECT_TIMEOUT = 257 - - } |
enum | { MQTT_DATA_FLAG_LAST = 1 - } |
-Functions | |
err_t | mqtt_publish (mqtt_client_t *client, const char *topic, const void *payload, u16_t payload_length, u8_t qos, u8_t retain, mqtt_request_cb_t cb, void *arg) |
err_t | mqtt_sub_unsub (mqtt_client_t *client, const char *topic, u8_t qos, mqtt_request_cb_t cb, void *arg, u8_t sub) |
void | mqtt_set_inpub_callback (mqtt_client_t *client, mqtt_incoming_publish_cb_t pub_cb, mqtt_incoming_data_cb_t data_cb, void *arg) |
mqtt_client_t * | mqtt_client_new (void) |
void | mqtt_client_free (mqtt_client_t *client) |
err_t | mqtt_client_connect (mqtt_client_t *client, const ip_addr_t *ip_addr, u16_t port, mqtt_connection_cb_t cb, void *arg, const struct mqtt_connect_client_info_t *client_info) |
void | mqtt_disconnect (mqtt_client_t *client) |
u8_t | mqtt_client_is_connected (mqtt_client_t *client) |
MQTT client for lwIP - -Author: Erik Andersson - -Details of the MQTT protocol can be found at: -http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html - ------------------------------------------------------------------ -1. Initial steps, reserve memory and make connection to server: - -1.1: Provide storage - -Static allocation: - mqtt_client_t static_client; - example_do_connect(&static_client); - -Dynamic allocation: - mqtt_client_t *client = mqtt_client_new(); - if(client != NULL) { - example_do_connect(&client); - } - -1.2: Establish Connection with server - -void example_do_connect(mqtt_client_t *client) -{ - struct mqtt_connect_client_info_t ci; - err_t err; - - /* Setup an empty client info structure */ - memset(&ci, 0, sizeof(ci)); - - /* Minimal amount of information required is client identifier, so set it here */ - ci.client_id = "lwip_test"; - - /* Initiate client and connect to server, if this fails immediately an error code is returned - otherwise mqtt_connection_cb will be called with connection result after attempting - to establish a connection with the server. - For now MQTT version 3.1.1 is always used */ - - err = mqtt_client_connect(client, ip_addr, MQTT_PORT, mqtt_connection_cb, 0, &ci); - - /* For now just print the result code if something goes wrong */ - if(err != ERR_OK) { - printf("mqtt_connect return %d\n", err); - } -} - -Connection to server can also be probed by calling mqtt_client_is_connected(client) - ------------------------------------------------------------------ -2. Implementing the connection status callback - - -static void mqtt_connection_cb(mqtt_client_t *client, void *arg, mqtt_connection_status_t status) -{ - err_t err; - if(status == MQTT_CONNECT_ACCEPTED) { - printf("mqtt_connection_cb: Successfully connected\n"); - - /* Setup callback for incoming publish requests */ - mqtt_set_inpub_callback(client, mqtt_incoming_publish_cb, mqtt_incoming_data_cb, arg); - - /* Subscribe to a topic named "subtopic" with QoS level 1, call mqtt_sub_request_cb with result */ - err = mqtt_subscribe(client, "subtopic", 1, mqtt_sub_request_cb, arg); - - if(err != ERR_OK) { - printf("mqtt_subscribe return: %d\n", err); - } - } else { - printf("mqtt_connection_cb: Disconnected, reason: %d\n", status); - - /* Its more nice to be connected, so try to reconnect */ - example_do_connect(client); - } -} - -static void mqtt_sub_request_cb(void *arg, err_t result) -{ - /* Just print the result code here for simplicity, - normal behaviour would be to take some action if subscribe fails like - notifying user, retry subscribe or disconnect from server */ - printf("Subscribe result: %d\n", result); -} - ------------------------------------------------------------------ -3. Implementing callbacks for incoming publish and data - -/* The idea is to demultiplex topic and create some reference to be used in data callbacks - Example here uses a global variable, better would be to use a member in arg - If RAM and CPU budget allows it, the easiest implementation might be to just take a copy of - the topic string and use it in mqtt_incoming_data_cb -*/ -static int inpub_id; -static void mqtt_incoming_publish_cb(void *arg, const char *topic, u32_t tot_len) -{ - printf("Incoming publish at topic %s with total length %u\n", topic, (unsigned int)tot_len); - - /* Decode topic string into a user defined reference */ - if(strcmp(topic, "print_payload") == 0) { - inpub_id = 0; - } else if(topic[0] == 'A') { - /* All topics starting with 'A' might be handled at the same way */ - inpub_id = 1; - } else { - /* For all other topics */ - inpub_id = 2; - } -} - -static void mqtt_incoming_data_cb(void *arg, const u8_t *data, u16_t len, u8_t flags) -{ - printf("Incoming publish payload with length %d, flags %u\n", len, (unsigned int)flags); - - if(flags & MQTT_DATA_FLAG_LAST) { - /* Last fragment of payload received (or whole part if payload fits receive buffer - See MQTT_VAR_HEADER_BUFFER_LEN) */ - - /* Call function or do action depending on reference, in this case inpub_id */ - if(inpub_id == 0) { - /* Don't trust the publisher, check zero termination */ - if(data[len-1] == 0) { - printf("mqtt_incoming_data_cb: %s\n", (const char *)data); - } - } else if(inpub_id == 1) { - /* Call an 'A' function... */ - } else { - printf("mqtt_incoming_data_cb: Ignoring payload...\n"); - } - } else { - /* Handle fragmented payload, store in buffer, write to file or whatever */ - } -} - ------------------------------------------------------------------ -4. Using outgoing publish - - -void example_publish(mqtt_client_t *client, void *arg) -{ - const char *pub_payload= "PubSubHubLubJub"; - err_t err; - u8_t qos = 2; /* 0 1 or 2, see MQTT specification */ - u8_t retain = 0; /* No don't retain such crappy payload... */ - err = mqtt_publish(client, "pub_topic", pub_payload, strlen(pub_payload), qos, retain, mqtt_pub_request_cb, arg); - if(err != ERR_OK) { - printf("Publish err: %d\n", err); - } -} - -/* Called when publish is complete either with sucess or failure */ -static void mqtt_pub_request_cb(void *arg, err_t result) -{ - if(result != ERR_OK) { - printf("Publish result: %d\n", result); - } -} - ------------------------------------------------------------------ -5. Disconnecting - -Simply call mqtt_disconnect(client) -
#define MQTT_PORT LWIP_IANA_PORT_MQTT | -
Default MQTT port (non-TLS)
- -#define mqtt_subscribe | -( | -- | client, | -
- | - | - | topic, | -
- | - | - | qos, | -
- | - | - | cb, | -
- | - | - | arg | -
- | ) | -mqtt_sub_unsub(client, topic, qos, cb, arg, 1) | -
Subscribe to topic
- -#define MQTT_TLS_PORT LWIP_IANA_PORT_SECURE_MQTT | -
Default MQTT TLS port
- -#define mqtt_unsubscribe | -( | -- | client, | -
- | - | - | topic, | -
- | - | - | cb, | -
- | - | - | arg | -
- | ) | -mqtt_sub_unsub(client, topic, 0, cb, arg, 0) | -
Unsubscribe to topic
- -typedef void(* mqtt_connection_cb_t) (mqtt_client_t *client, void *arg, mqtt_connection_status_t status) | -
Function prototype for mqtt connection status callback. Called when client has connected to the server after initiating a mqtt connection attempt by calling mqtt_client_connect() or when connection is closed by server or an error
-client | MQTT client itself |
arg | Additional argument to pass to the callback function |
status | Connect result code or disconnection notification |
typedef void(* mqtt_incoming_data_cb_t) (void *arg, const u8_t *data, u16_t len, u8_t flags) | -
Function prototype for MQTT incoming publish data callback function. Called when data arrives to a subscribed topic
arg | Additional argument to pass to the callback function |
data | User data, pointed object, data may not be referenced after callback return, NULL is passed when all publish data are delivered |
len | Length of publish data fragment |
flags | MQTT_DATA_FLAG_LAST set when this call contains the last part of data from publish message |
typedef void(* mqtt_incoming_publish_cb_t) (void *arg, const char *topic, u32_t tot_len) | -
Function prototype for MQTT incoming publish function. Called when an incoming publish arrives to a subscribed topic
arg | Additional argument to pass to the callback function |
topic | Zero terminated Topic text string, topic may not be referenced after callback return |
tot_len | Total length of publish data, if set to 0 (no publish payload) data callback will not be invoked |
typedef void(* mqtt_request_cb_t) (void *arg, err_t err) | -
Function prototype for mqtt request callback. Called when a subscribe, unsubscribe or publish request has completed
arg | Pointer to user data supplied when invoking request |
err | ERR_OK on success ERR_TIMEOUT if no response was received within timeout, ERR_ABRT if (un)subscribe was denied |
anonymous enum | -
enum mqtt_connection_status_t | -
Connection status codes
-Enumerator | |
---|---|
MQTT_CONNECT_ACCEPTED | Accepted - |
MQTT_CONNECT_REFUSED_PROTOCOL_VERSION | Refused protocol version - |
MQTT_CONNECT_REFUSED_IDENTIFIER | Refused identifier - |
MQTT_CONNECT_REFUSED_SERVER | Refused server - |
MQTT_CONNECT_REFUSED_USERNAME_PASS | Refused user credentials - |
MQTT_CONNECT_REFUSED_NOT_AUTHORIZED_ | Refused not authorized - |
MQTT_CONNECT_DISCONNECTED | Disconnected - |
MQTT_CONNECT_TIMEOUT | Timeout - |
err_t mqtt_client_connect | -( | -mqtt_client_t * | -client, | -
- | - | const ip_addr_t * | -ip_addr, | -
- | - | u16_t | -port, | -
- | - | mqtt_connection_cb_t | -cb, | -
- | - | void * | -arg, | -
- | - | const struct mqtt_connect_client_info_t * | -client_info | -
- | ) | -- |
Connect to MQTT server
client | MQTT client |
ip_addr | Server IP |
port | Server port |
cb | Connection state change callback |
arg | User supplied argument to connection callback |
client_info | Client identification and connection options |
void mqtt_client_free | -( | -mqtt_client_t * | -client | ) | -- |
Free MQTT client instance
client | Pointer to instance to be freed |
u8_t mqtt_client_is_connected | -( | -mqtt_client_t * | -client | ) | -- |
Check connection with server
client | MQTT client |
mqtt_client_t* mqtt_client_new | -( | -void | -) | -- |
Create a new MQTT client instance
void mqtt_disconnect | -( | -mqtt_client_t * | -client | ) | -- |
Disconnect from MQTT server
client | MQTT client |
err_t mqtt_publish | -( | -mqtt_client_t * | -client, | -
- | - | const char * | -topic, | -
- | - | const void * | -payload, | -
- | - | u16_t | -payload_length, | -
- | - | u8_t | -qos, | -
- | - | u8_t | -retain, | -
- | - | mqtt_request_cb_t | -cb, | -
- | - | void * | -arg | -
- | ) | -- |
MQTT publish function.
client | MQTT client |
topic | Publish topic string |
payload | Data to publish (NULL is allowed) |
payload_length | Length of payload (0 is allowed) |
qos | Quality of service, 0 1 or 2 |
retain | MQTT retain flag |
cb | Callback to call when publish is complete or has timed out |
arg | User supplied argument to publish callback |
void mqtt_set_inpub_callback | -( | -mqtt_client_t * | -client, | -
- | - | mqtt_incoming_publish_cb_t | -pub_cb, | -
- | - | mqtt_incoming_data_cb_t | -data_cb, | -
- | - | void * | -arg | -
- | ) | -- |
Set callback to handle incoming publish requests from server
client | MQTT client |
pub_cb | Callback invoked when publish starts, contain topic and total length of payload |
data_cb | Callback for each fragment of payload that arrives |
arg | User supplied argument to both callbacks |
err_t mqtt_sub_unsub | -( | -mqtt_client_t * | -client, | -
- | - | const char * | -topic, | -
- | - | u8_t | -qos, | -
- | - | mqtt_request_cb_t | -cb, | -
- | - | void * | -arg, | -
- | - | u8_t | -sub | -
- | ) | -- |
MQTT subscribe/unsubscribe function.
client | MQTT client |
topic | topic to subscribe to |
qos | Quality of service, 0 1 or 2 (only used for subscribe) |
cb | Callback to call when subscribe/unsubscribe reponse is received |
arg | User supplied argument to publish callback |
sub | 1 for subscribe, 0 for unsubscribe |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | MQTT_OUTPUT_RINGBUF_SIZE 256 |
#define | MQTT_VAR_HEADER_BUFFER_LEN 128 |
#define | MQTT_REQ_MAX_IN_FLIGHT 4 |
#define | MQTT_CYCLIC_TIMER_INTERVAL 5 |
#define | MQTT_REQ_TIMEOUT 30 |
#define | MQTT_CONNECT_TIMOUT 100 |
#define MQTT_CONNECT_TIMOUT 100 | -
Seconds for MQTT connect response timeout after sending connect request
- -#define MQTT_CYCLIC_TIMER_INTERVAL 5 | -
Seconds between each cyclic timer call.
- -#define MQTT_OUTPUT_RINGBUF_SIZE 256 | -
Output ring-buffer size, must be able to fit largest outgoing publish message topic+payloads
- -#define MQTT_REQ_MAX_IN_FLIGHT 4 | -
Maximum number of pending subscribe, unsubscribe and publish requests to server .
- -#define MQTT_REQ_TIMEOUT 30 | -
Publish, subscribe and unsubscribe request timeout in seconds.
- -#define MQTT_VAR_HEADER_BUFFER_LEN 128 | -
Number of bytes in receive buffer, must be at least the size of the longest incoming topic + 8 If one wants to avoid fragmented incoming publish, set length to max incoming topic length + max payload length + 8
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
-Functions | |
void | netbiosns_init (void) |
void | netbiosns_stop (void) |
This is an example implementation of a NetBIOS name server. It responds to name queries for a configurable name. Name resolving is not supported.
-Note that the device doesn't broadcast it's own name so can't detect duplicate names!
-void netbiosns_init | -( | -void | -) | -- |
Init netbios responder
- -void netbiosns_stop | -( | -void | -) | -- |
Stop netbios responder
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | NETBIOS_LWIP_NAME "NETBIOSLWIPDEV" |
#define | LWIP_NETBIOS_RESPOND_NAME_QUERY 0 |
#define LWIP_NETBIOS_RESPOND_NAME_QUERY 0 | -
Respond to NetBIOS name queries Default is disabled
- -#define NETBIOS_LWIP_NAME "NETBIOSLWIPDEV" | -
NetBIOS name of lwip device This must be uppercase until NETBIOS_STRCMP() is defined to a string comparision function that is case insensitive. If you want to use the netif's hostname, use this (with LWIP_NETIF_HOSTNAME): (ip_current_netif() != NULL ? ip_current_netif()->hostname != NULL ? ip_current_netif()->hostname : "" : "")
-If this is not defined, netbiosns_set_name() can be called at runtime to change the name.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
struct netbuf * | netbuf_new (void) |
void | netbuf_delete (struct netbuf *buf) |
void * | netbuf_alloc (struct netbuf *buf, u16_t size) |
void | netbuf_free (struct netbuf *buf) |
err_t | netbuf_ref (struct netbuf *buf, const void *dataptr, u16_t size) |
void | netbuf_chain (struct netbuf *head, struct netbuf *tail) |
err_t | netbuf_data (struct netbuf *buf, void **dataptr, u16_t *len) |
s8_t | netbuf_next (struct netbuf *buf) |
void | netbuf_first (struct netbuf *buf) |
Network buffer descriptor for Netconn API. Based on Packet buffers (PBUF) internally to avoid copying data around.
-Buffers must not be shared accross multiple threads, all functions except netbuf_new() and netbuf_delete() are not thread-safe.
void* netbuf_alloc | -( | -struct netbuf * | -buf, | -
- | - | u16_t | -size | -
- | ) | -- |
Allocate memory for a packet buffer for a given netbuf.
-buf | the netbuf for which to allocate a packet buffer |
size | the size of the packet buffer to allocate |
void netbuf_chain | -( | -struct netbuf * | -head, | -
- | - | struct netbuf * | -tail | -
- | ) | -- |
Chain one netbuf to another (
head | the first netbuf |
tail | netbuf to chain after head, freed by this function, may not be reference after returning |
err_t netbuf_data | -( | -struct netbuf * | -buf, | -
- | - | void ** | -dataptr, | -
- | - | u16_t * | -len | -
- | ) | -- |
Get the data pointer and length of the data inside a netbuf.
-buf | netbuf to get the data from |
dataptr | pointer to a void pointer where to store the data pointer |
len | pointer to an u16_t where the length of the data is stored |
void netbuf_delete | -( | -struct netbuf * | -buf | ) | -- |
Deallocate a netbuf allocated by netbuf_new().
-buf | pointer to a netbuf allocated by netbuf_new() |
void netbuf_first | -( | -struct netbuf * | -buf | ) | -- |
Move the current data pointer of a packet buffer contained in a netbuf to the beginning of the packet. The packet buffer itself is not modified.
-buf | the netbuf to modify |
void netbuf_free | -( | -struct netbuf * | -buf | ) | -- |
Free the packet buffer included in a netbuf
-buf | pointer to the netbuf which contains the packet buffer to free |
struct netbuf* netbuf_new | -( | -void | -) | -- |
Create (allocate) and initialize a new netbuf. The netbuf doesn't yet contain a packet buffer!
-s8_t netbuf_next | -( | -struct netbuf * | -buf | ) | -- |
Move the current data pointer of a packet buffer contained in a netbuf to the next part. The packet buffer itself is not modified.
-buf | the netbuf to modify |
err_t netbuf_ref | -( | -struct netbuf * | -buf, | -
- | - | const void * | -dataptr, | -
- | - | u16_t | -size | -
- | ) | -- |
Let a netbuf reference existing (non-volatile) data.
-buf | netbuf which should reference the data |
dataptr | pointer to the data to reference |
size | size of the data |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Common functions | |
TCP only | |
UDP only | |
Network buffers | |
Thread-safe, to be called from non-TCPIP threads only. TX/RX handling based on Network buffers (containing Packet buffers (PBUF)) to avoid copying data around.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL) |
#define | netconn_peer(c, i, p) netconn_getaddr(c,i,p,0) |
#define | netconn_addr(c, i, p) netconn_getaddr(c,i,p,1) |
#define | netconn_set_ipv6only(conn, val) |
#define | netconn_get_ipv6only(conn) (((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0) |
-Enumerations | |
enum | netconn_type { , - NETCONN_TCP = 0x10, -NETCONN_TCP_IPV6 = NETCONN_TCP | 0x08, -NETCONN_UDP = 0x20, -NETCONN_UDPLITE = 0x21, - - NETCONN_UDPNOCHKSUM = 0x22, -NETCONN_UDP_IPV6 = NETCONN_UDP | 0x08, -NETCONN_UDPLITE_IPV6 = NETCONN_UDPLITE | 0x08, -NETCONN_UDPNOCHKSUM_IPV6 = NETCONN_UDPNOCHKSUM | 0x08, - - NETCONN_RAW = 0x40 - - } |
-Functions | |
err_t | netconn_prepare_delete (struct netconn *conn) |
err_t | netconn_delete (struct netconn *conn) |
err_t | netconn_bind (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_bind_if (struct netconn *conn, u8_t if_idx) |
err_t | netconn_connect (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_recv (struct netconn *conn, struct netbuf **new_buf) |
err_t | netconn_err (struct netconn *conn) |
err_t | netconn_gethostbyname_addrtype (const char *name, ip_addr_t *addr, u8_t dns_addrtype) |
For use with TCP and UDP
-#define netconn_addr | -( | -- | c, | -
- | - | - | i, | -
- | - | - | p | -
- | ) | -netconn_getaddr(c,i,p,1) | -
#define netconn_get_ipv6only | -( | -- | conn | ) | -(((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0) | -
TCP: Get the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
- -#define netconn_new | -( | -- | t | ) | -netconn_new_with_proto_and_callback(t, 0, NULL) | -
Create new netconn connection
t | netconn_type |
#define netconn_peer | -( | -- | c, | -
- | - | - | i, | -
- | - | - | p | -
- | ) | -netconn_getaddr(c,i,p,0) | -
#define netconn_set_ipv6only | -( | -- | conn, | -
- | - | - | val | -
- | ) | -- |
TCP: Set the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
- -enum netconn_type | -
Protocol family and type of the netconn
-Enumerator | |
---|---|
NETCONN_TCP | TCP IPv4 - |
NETCONN_TCP_IPV6 | TCP IPv6 - |
NETCONN_UDP | UDP IPv4 - |
NETCONN_UDPLITE | UDP IPv4 lite - |
NETCONN_UDPNOCHKSUM | UDP IPv4 no checksum - |
NETCONN_UDP_IPV6 | UDP IPv6 (dual-stack by default, unless you call netconn_set_ipv6only) - |
NETCONN_UDPLITE_IPV6 | UDP IPv6 lite (dual-stack by default, unless you call netconn_set_ipv6only) - |
NETCONN_UDPNOCHKSUM_IPV6 | UDP IPv6 no checksum (dual-stack by default, unless you call netconn_set_ipv6only) - |
NETCONN_RAW | Raw connection IPv4 - |
err_t netconn_bind | -( | -struct netconn * | -conn, | -
- | - | const ip_addr_t * | -addr, | -
- | - | u16_t | -port | -
- | ) | -- |
Bind a netconn to a specific local IP address and port. Binding one netconn twice might not always be checked correctly!
-conn | the netconn to bind |
addr | the local IP address to bind the netconn to (use IP4_ADDR_ANY/IP6_ADDR_ANY to bind to all addresses) |
port | the local port to bind the netconn to (not used for RAW) |
err_t netconn_bind_if | -( | -struct netconn * | -conn, | -
- | - | u8_t | -if_idx | -
- | ) | -- |
Bind a netconn to a specific interface and port. Binding one netconn twice might not always be checked correctly!
-conn | the netconn to bind |
if_idx | the local interface index to bind the netconn to |
err_t netconn_connect | -( | -struct netconn * | -conn, | -
- | - | const ip_addr_t * | -addr, | -
- | - | u16_t | -port | -
- | ) | -- |
Connect a netconn to a specific remote IP address and port.
-conn | the netconn to connect |
addr | the remote IP address to connect to |
port | the remote port to connect to (no used for RAW) |
Close a netconn 'connection' and free its resources. UDP and RAW connection are completely closed, TCP pcbs might still be in a waitstate after this returns.
-conn | the netconn to delete |
Get and reset pending error on a netconn
-conn | the netconn to get the error from |
err_t netconn_gethostbyname_addrtype | -( | -const char * | -name, | -
- | - | ip_addr_t * | -addr, | -
- | - | u8_t | -dns_addrtype | -
- | ) | -- |
Execute a DNS query, only one IP address is returned
-name | a string representation of the DNS host name to query |
addr | a preallocated ip_addr_t where to store the resolved IP address |
dns_addrtype | IP address type (IPv4 / IPv6) |
Close a netconn 'connection' and free all its resources but not the netconn itself. UDP and RAW connection are completely closed, TCP pcbs might still be in a waitstate after this returns.
-conn | the netconn to delete |
err_t netconn_recv | -( | -struct netconn * | -conn, | -
- | - | struct netbuf ** | -new_buf | -
- | ) | -- |
Receive data (in form of a netbuf containing a packet buffer) from a netconn
-conn | the netconn from which to receive data |
new_buf | pointer where a new netbuf is stored when received data |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG) |
#define | netconn_write(conn, dataptr, size, apiflags) netconn_write_partly(conn, dataptr, size, apiflags, NULL) |
-Functions | |
err_t | netconn_listen_with_backlog (struct netconn *conn, u8_t backlog) |
err_t | netconn_accept (struct netconn *conn, struct netconn **new_conn) |
err_t | netconn_recv_tcp_pbuf (struct netconn *conn, struct pbuf **new_buf) |
err_t | netconn_recv_tcp_pbuf_flags (struct netconn *conn, struct pbuf **new_buf, u8_t apiflags) |
err_t | netconn_write_partly (struct netconn *conn, const void *dataptr, size_t size, u8_t apiflags, size_t *bytes_written) |
err_t | netconn_close (struct netconn *conn) |
err_t | netconn_shutdown (struct netconn *conn, u8_t shut_rx, u8_t shut_tx) |
TCP only functions
-#define netconn_listen | -( | -- | conn | ) | -netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG) | -
#define netconn_write | -( | -- | conn, | -
- | - | - | dataptr, | -
- | - | - | size, | -
- | - | - | apiflags | -
- | ) | -netconn_write_partly(conn, dataptr, size, apiflags, NULL) | -
err_t netconn_accept | -( | -struct netconn * | -conn, | -
- | - | struct netconn ** | -new_conn | -
- | ) | -- |
Accept a new connection on a TCP listening netconn.
-conn | the TCP listen netconn |
new_conn | pointer where the new connection is stored |
Close a TCP netconn (doesn't delete it).
-conn | the TCP netconn to close |
err_t netconn_listen_with_backlog | -( | -struct netconn * | -conn, | -
- | - | u8_t | -backlog | -
- | ) | -- |
Set a TCP netconn into listen mode
-conn | the tcp netconn to set to listen mode |
backlog | the listen backlog, only used if TCP_LISTEN_BACKLOG==1 |
err_t netconn_recv_tcp_pbuf | -( | -struct netconn * | -conn, | -
- | - | struct pbuf ** | -new_buf | -
- | ) | -- |
Receive data (in form of a pbuf) from a TCP netconn
-conn | the netconn from which to receive data |
new_buf | pointer where a new pbuf is stored when received data |
err_t netconn_recv_tcp_pbuf_flags | -( | -struct netconn * | -conn, | -
- | - | struct pbuf ** | -new_buf, | -
- | - | u8_t | -apiflags | -
- | ) | -- |
Receive data (in form of a pbuf) from a TCP netconn
-conn | the netconn from which to receive data |
new_buf | pointer where a new pbuf is stored when received data |
apiflags | flags that control function behaviour. For now only:
|
err_t netconn_shutdown | -( | -struct netconn * | -conn, | -
- | - | u8_t | -shut_rx, | -
- | - | u8_t | -shut_tx | -
- | ) | -- |
Shut down one or both sides of a TCP netconn (doesn't delete it).
-conn | the TCP netconn to shut down |
shut_rx | shut down the RX side (no more read possible after this) |
shut_tx | shut down the TX side (no more write possible after this) |
err_t netconn_write_partly | -( | -struct netconn * | -conn, | -
- | - | const void * | -dataptr, | -
- | - | size_t | -size, | -
- | - | u8_t | -apiflags, | -
- | - | size_t * | -bytes_written | -
- | ) | -- |
Send data over a TCP netconn.
-conn | the TCP netconn over which to send data |
dataptr | pointer to the application buffer that contains the data to send |
size | size of the application data to send |
apiflags | combination of following flags :
|
bytes_written | pointer to a location that receives the number of written bytes |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | netconn_disconnect (struct netconn *conn) |
err_t | netconn_sendto (struct netconn *conn, struct netbuf *buf, const ip_addr_t *addr, u16_t port) |
err_t | netconn_send (struct netconn *conn, struct netbuf *buf) |
err_t | netconn_join_leave_group (struct netconn *conn, const ip_addr_t *multiaddr, const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave) |
err_t | netconn_join_leave_group_netif (struct netconn *conn, const ip_addr_t *multiaddr, u8_t if_idx, enum netconn_igmp join_or_leave) |
UDP only functions
-Disconnect a netconn from its current peer (only valid for UDP netconns).
-conn | the netconn to disconnect |
err_t netconn_join_leave_group | -( | -struct netconn * | -conn, | -
- | - | const ip_addr_t * | -multiaddr, | -
- | - | const ip_addr_t * | -netif_addr, | -
- | - | enum netconn_igmp | -join_or_leave | -
- | ) | -- |
Join multicast groups for UDP netconns.
-conn | the UDP netconn for which to change multicast addresses |
multiaddr | IP address of the multicast group to join or leave |
netif_addr | the IP address of the network interface on which to send the igmp message |
join_or_leave | flag whether to send a join- or leave-message |
err_t netconn_join_leave_group_netif | -( | -struct netconn * | -conn, | -
- | - | const ip_addr_t * | -multiaddr, | -
- | - | u8_t | -if_idx, | -
- | - | enum netconn_igmp | -join_or_leave | -
- | ) | -- |
Join multicast groups for UDP netconns.
-conn | the UDP netconn for which to change multicast addresses |
multiaddr | IP address of the multicast group to join or leave |
if_idx | the index of the netif |
join_or_leave | flag whether to send a join- or leave-message |
err_t netconn_send | -( | -struct netconn * | -conn, | -
- | - | struct netbuf * | -buf | -
- | ) | -- |
Send data over a UDP or RAW netconn (that is already connected).
-conn | the UDP or RAW netconn over which to send data |
buf | a netbuf containing the data to send |
err_t netconn_sendto | -( | -struct netconn * | -conn, | -
- | - | struct netbuf * | -buf, | -
- | - | const ip_addr_t * | -addr, | -
- | - | u16_t | -port | -
- | ) | -- |
Send data (in form of a netbuf) to a specific remote IP address and port. Only to be used for UDP and RAW netconns (not TCP).
-conn | the netconn over which to send data |
buf | a netbuf containing the data to send |
addr | the remote IP address to which to send the data |
port | the remote port to which to send the data |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | gethostbyname(name) lwip_gethostbyname(name) |
#define | gethostbyname_r(name, ret, buf, buflen, result, h_errnop) lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) |
#define | freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) |
#define | getaddrinfo(nodname, servname, hints, res) lwip_getaddrinfo(nodname, servname, hints, res) |
#define freeaddrinfo | -( | -- | addrinfo | ) | -lwip_freeaddrinfo(addrinfo) | -
#define getaddrinfo | -( | -- | nodname, | -
- | - | - | servname, | -
- | - | - | hints, | -
- | - | - | res | -
- | ) | -lwip_getaddrinfo(nodname, servname, hints, res) | -
#define gethostbyname | -( | -- | name | ) | -lwip_gethostbyname(name) | -
#define gethostbyname_r | -( | -- | name, | -
- | - | - | ret, | -
- | - | - | buf, | -
- | - | - | buflen, | -
- | - | - | result, | -
- | - | - | h_errnop | -
- | ) | -lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) | -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
IPv4 address handling | |
IPv6 address handling | |
Client data handling | |
Flags | |
MIB2 statistics | |
-Data Structures | |
union | netif_ext_callback_args_t |
-Macros | |
#define | netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) |
#define | netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0) |
#define | netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL) |
#define | netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0) |
#define | netif_set_mld_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0) |
-Typedefs | |
typedef u16_t | netif_nsc_reason_t |
typedef void(* | netif_ext_callback_fn) (struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) |
-Functions | |
struct netif * | netif_add_noaddr (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input) |
struct netif * | netif_add (struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input) |
void | netif_remove (struct netif *netif) |
void | netif_set_default (struct netif *netif) |
void | netif_set_up (struct netif *netif) |
void | netif_set_down (struct netif *netif) |
void | netif_set_status_callback (struct netif *netif, netif_status_callback_fn status_callback) |
void | netif_set_remove_callback (struct netif *netif, netif_status_callback_fn remove_callback) |
void | netif_set_link_up (struct netif *netif) |
void | netif_set_link_down (struct netif *netif) |
void | netif_set_link_callback (struct netif *netif, netif_status_callback_fn link_callback) |
err_t | netif_loop_output (struct netif *netif, struct pbuf *p) |
u8_t | netif_name_to_index (const char *name) |
char * | netif_index_to_name (u8_t idx, char *name) |
struct netif * | netif_get_by_index (u8_t idx) |
struct netif * | netif_find (const char *name) |
void | netif_add_ext_callback (netif_ext_callback_t *callback, netif_ext_callback_fn fn) |
void | netif_remove_ext_callback (netif_ext_callback_t *callback) |
#define netif_get_hostname | -( | -- | netif | ) | -(((netif) != NULL) ? ((netif)->hostname) : NULL) | -
#define netif_is_up | -( | -- | netif | ) | -(((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) | -
Ask if an interface is up
- -#define netif_set_hostname | -( | -- | netif, | -
- | - | - | name | -
- | ) | -do { if((netif) != NULL) { (netif)->hostname = name; }}while(0) | -
#define netif_set_igmp_mac_filter | -( | -- | netif, | -
- | - | - | function | -
- | ) | -do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0) | -
#define netif_set_mld_mac_filter | -( | -- | netif, | -
- | - | - | function | -
- | ) | -do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0) | -
typedef void(* netif_ext_callback_fn) (struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) | -
Function used for extended netif status callbacks Note: When parsing reason argument, keep in mind that more reasons may be added in the future!
netif | netif that is affected by change |
reason | change reason |
args | depends on reason, see reason description |
typedef u16_t netif_nsc_reason_t | -
Extended netif status callback (NSC) reasons flags. May be extended in the future!
- -struct netif* netif_add | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr, | -
- | - | const ip4_addr_t * | -netmask, | -
- | - | const ip4_addr_t * | -gw, | -
- | - | void * | -state, | -
- | - | netif_init_fn | -init, | -
- | - | netif_input_fn | -input | -
- | ) | -- |
Add a network interface to the list of lwIP netifs.
-netif | a pre-allocated netif structure |
ipaddr | IP address for the new netif |
netmask | network mask for the new netif |
gw | default gateway IP address for the new netif |
state | opaque data passed to the new netif |
init | callback function that initializes the interface |
input | callback function that is called to pass ingress packets up in the protocol layer stack. -It is recommended to use a function that passes the input directly to the stack (netif_input(), NO_SYS=1 mode) or via sending a message to TCPIP thread (tcpip_input(), NO_SYS=0 mode). -These functions use netif flags NETIF_FLAG_ETHARP and NETIF_FLAG_ETHERNET to decide whether to forward to ethernet_input() or ip_input(). In other words, the functions only work when the netif driver is implemented correctly! -Most members of struct netif should be be initialized by the netif init function = netif driver (init parameter of this function). -IPv6: Don't forget to call netif_create_ip6_linklocal_address() after setting the MAC address in struct netif.hwaddr (IPv6 requires a link-local address). |
void netif_add_ext_callback | -( | -netif_ext_callback_t * | -callback, | -
- | - | netif_ext_callback_fn | -fn | -
- | ) | -- |
Add extended netif events listener
callback | pointer to listener structure |
fn | callback function |
struct netif* netif_add_noaddr | -( | -struct netif * | -netif, | -
- | - | void * | -state, | -
- | - | netif_init_fn | -init, | -
- | - | netif_input_fn | -input | -
- | ) | -- |
Add a network interface to the list of lwIP netifs.
-Same as netif_add but without IPv4 addresses
- -struct netif* netif_find | -( | -const char * | -name | ) | -- |
Find a network interface by searching for its name
-name | the name of the netif (like netif->name) plus concatenated number in ascii representation (e.g. 'en0') |
struct netif* netif_get_by_index | -( | -u8_t | -idx | ) | -- |
Return the interface for the netif index
-idx | index of netif to find |
char* netif_index_to_name | -( | -u8_t | -idx, | -
- | - | char * | -name | -
- | ) | -- |
Return the interface name for the netif matching index or NULL if not found/on error
-idx | the interface index of the netif |
name | char buffer of at least NETIF_NAMESIZE bytes |
err_t netif_loop_output | -( | -struct netif * | -netif, | -
- | - | struct pbuf * | -p | -
- | ) | -- |
Send an IP packet to be received on the same netif (loopif-like). The pbuf is simply copied and handed back to netif->input. In multithreaded mode, this is done directly since netif->input must put the packet on a queue. In callback mode, the packet is put on an internal queue and is fed to netif->input by netif_poll().
-netif | the lwip network interface structure |
p | the (IP) packet to 'send' |
u8_t netif_name_to_index | -( | -const char * | -name | ) | -- |
Return the interface index for the netif with name or NETIF_NO_INDEX if not found/on error
-name | the name of the netif |
void netif_remove | -( | -struct netif * | -netif | ) | -- |
Remove a network interface from the list of lwIP netifs.
-netif | the network interface to remove |
void netif_remove_ext_callback | -( | -netif_ext_callback_t * | -callback | ) | -- |
Remove extended netif events listener
callback | pointer to listener structure |
void netif_set_default | -( | -struct netif * | -netif | ) | -- |
Set a network interface as the default network interface (used to output all packets for which no specific route is found)
-netif | the default network interface |
void netif_set_down | -( | -struct netif * | -netif | ) | -- |
Bring an interface down, disabling any traffic processing.
- -void netif_set_link_callback | -( | -struct netif * | -netif, | -
- | - | netif_status_callback_fn | -link_callback | -
- | ) | -- |
Set callback to be called when link is brought up/down
- -void netif_set_link_down | -( | -struct netif * | -netif | ) | -- |
Called by a driver when its link goes down
- -void netif_set_link_up | -( | -struct netif * | -netif | ) | -- |
Called by a driver when its link goes up
- -void netif_set_remove_callback | -( | -struct netif * | -netif, | -
- | - | netif_status_callback_fn | -remove_callback | -
- | ) | -- |
Set callback to be called when the interface has been removed
- -void netif_set_status_callback | -( | -struct netif * | -netif, | -
- | - | netif_status_callback_fn | -status_callback | -
- | ) | -- |
Set callback to be called when interface is brought up/down or address is changed while up
- -void netif_set_up | -( | -struct netif * | -netif | ) | -- |
Bring an interface up, available for processing traffic.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netif_set_client_data(netif, id, data) netif_get_client_data(netif, id) = (data) |
#define | netif_get_client_data(netif, id) (netif)->client_data[(id)] |
-Functions | |
u8_t | netif_alloc_client_data_id (void) |
Store data (void*) on a netif for application usage.
#define netif_get_client_data | -( | -- | netif, | -
- | - | - | id | -
- | ) | -(netif)->client_data[(id)] | -
Get client data. Obtain ID from netif_alloc_client_data_id().
- -#define netif_set_client_data | -( | -- | netif, | -
- | - | - | id, | -
- | - | - | data | -
- | ) | -netif_get_client_data(netif, id) = (data) | -
Set client data. Obtain ID from netif_alloc_client_data_id().
- -u8_t netif_alloc_client_data_id | -( | -void | -) | -- |
Allocate an index to store data in client_data member of struct netif. Returned value is an index in mentioned array.
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | NETIF_FLAG_UP 0x01U |
#define | NETIF_FLAG_BROADCAST 0x02U |
#define | NETIF_FLAG_LINK_UP 0x04U |
#define | NETIF_FLAG_ETHARP 0x08U |
#define | NETIF_FLAG_ETHERNET 0x10U |
#define | NETIF_FLAG_IGMP 0x20U |
#define | NETIF_FLAG_MLD6 0x40U |
#define NETIF_FLAG_BROADCAST 0x02U | -
If set, the netif has broadcast capability. Set by the netif driver in its init function.
- -#define NETIF_FLAG_ETHARP 0x08U | -
If set, the netif is an ethernet device using ARP. Set by the netif driver in its init function. Used to check input packet types and use of DHCP.
- -#define NETIF_FLAG_ETHERNET 0x10U | -
If set, the netif is an ethernet device. It might not use ARP or TCP/IP if it is used for PPPoE only.
- -#define NETIF_FLAG_IGMP 0x20U | -
If set, the netif has IGMP capability. Set by the netif driver in its init function.
- -#define NETIF_FLAG_LINK_UP 0x04U | -
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 (if link detection is supported by the hardware).
- -#define NETIF_FLAG_MLD6 0x40U | -
If set, the netif has MLD6 capability. Set by the netif driver in its init function.
- -#define NETIF_FLAG_UP 0x01U | -
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).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netif_ip4_addr(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr))) |
#define | netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask))) |
#define | netif_ip4_gw(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->gw))) |
#define | netif_ip_addr4(netif) ((const ip_addr_t*)&((netif)->ip_addr)) |
#define | netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask)) |
#define | netif_ip_gw4(netif) ((const ip_addr_t*)&((netif)->gw)) |
-Functions | |
void | netif_set_ipaddr (struct netif *netif, const ip4_addr_t *ipaddr) |
void | netif_set_netmask (struct netif *netif, const ip4_addr_t *netmask) |
void | netif_set_gw (struct netif *netif, const ip4_addr_t *gw) |
void | netif_set_addr (struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw) |
#define netif_ip4_addr | -( | -- | netif | ) | -((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr))) | -
#define netif_ip4_gw | -( | -- | netif | ) | -((const ip4_addr_t*)ip_2_ip4(&((netif)->gw))) | -
#define netif_ip4_netmask | -( | -- | netif | ) | -((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask))) | -
void netif_set_addr | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr, | -
- | - | const ip4_addr_t * | -netmask, | -
- | - | const ip4_addr_t * | -gw | -
- | ) | -- |
Change IP address configuration for a network interface (including netmask and default gateway).
-netif | the network interface to change |
ipaddr | the new IP address |
netmask | the new netmask |
gw | the new default gateway |
void netif_set_gw | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -gw | -
- | ) | -- |
Change the default gateway for a network interface
-netif | the network interface to change |
gw | the new default gateway |
void netif_set_ipaddr | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr | -
- | ) | -- |
Change the IP address of a network interface
-netif | the network interface to change |
ipaddr | the new IP address |
void netif_set_netmask | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -netmask | -
- | ) | -- |
Change the netmask of a network interface
-netif | the network interface to change |
netmask | the new netmask |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netif_ip_addr6(netif, i) ((const ip_addr_t*)(&((netif)->ip6_addr[i]))) |
#define | netif_ip6_addr(netif, i) ((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i]))) |
-Functions | |
void | netif_ip6_addr_set (struct netif *netif, s8_t addr_idx, const ip6_addr_t *addr6) |
void | netif_ip6_addr_set_state (struct netif *netif, s8_t addr_idx, u8_t state) |
void | netif_create_ip6_linklocal_address (struct netif *netif, u8_t from_mac_48bit) |
err_t | netif_add_ip6_address (struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx) |
#define netif_ip6_addr | -( | -- | netif, | -
- | - | - | i | -
- | ) | -((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i]))) | -
#define netif_ip_addr6 | -( | -- | netif, | -
- | - | - | i | -
- | ) | -((const ip_addr_t*)(&((netif)->ip6_addr[i]))) | -
err_t netif_add_ip6_address | -( | -struct netif * | -netif, | -
- | - | const ip6_addr_t * | -ip6addr, | -
- | - | s8_t * | -chosen_idx | -
- | ) | -- |
This function allows for the easy addition of a new IPv6 address to an interface. It takes care of finding an empty slot and then sets the address tentative (to make sure that all the subsequent processing happens).
-netif | netif to add the address on |
ip6addr | address to add |
chosen_idx | if != NULL, the chosen IPv6 address index will be stored here |
void netif_create_ip6_linklocal_address | -( | -struct netif * | -netif, | -
- | - | u8_t | -from_mac_48bit | -
- | ) | -- |
Create a link-local IPv6 address on a netif (stored in slot 0)
-netif | the netif to create the address on |
from_mac_48bit | if != 0, assume hwadr is a 48-bit MAC address (std conversion) if == 0, use hwaddr directly as interface ID |
void netif_ip6_addr_set | -( | -struct netif * | -netif, | -
- | - | s8_t | -addr_idx, | -
- | - | const ip6_addr_t * | -addr6 | -
- | ) | -- |
Change an IPv6 address of a network interface
-netif | the network interface to change |
addr_idx | index of the IPv6 address |
addr6 | the new IPv6 address |
void netif_ip6_addr_set_state | -( | -struct netif * | -netif, | -
- | - | s8_t | -addr_idx, | -
- | - | u8_t | -state | -
- | ) | -- |
Change the state of an IPv6 address of a network interface (INVALID, TEMPTATIVE, PREFERRED, DEPRECATED, where TEMPTATIVE includes the number of checks done, see ip6_addr.h)
-netif | the network interface to change |
addr_idx | index of the IPv6 address |
state | the new IPv6 address state |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | stats_mib2_netif_ctrs |
-Macros | |
#define | MIB2_STATS_NETIF_INC(n, x) do { ++(n)->mib2_counters.x; } while(0) |
#define | MIB2_STATS_NETIF_ADD(n, x, val) do { (n)->mib2_counters.x += (val); } while(0) |
#define | MIB2_INIT_NETIF(netif, type, speed) |
-Enumerations | |
enum | snmp_ifType |
#define MIB2_INIT_NETIF | -( | -- | netif, | -
- | - | - | type, | -
- | - | - | speed | -
- | ) | -- |
Init MIB2 statistic counters in netif
netif | Netif to init |
type | one of enum snmp_ifType |
speed | your link speed here (units: bits per second) |
#define MIB2_STATS_NETIF_ADD | -( | -- | n, | -
- | - | - | x, | -
- | - | - | val | -
- | ) | -do { (n)->mib2_counters.x += (val); } while(0) | -
Add value to stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs)
- -#define MIB2_STATS_NETIF_INC | -( | -- | n, | -
- | - | - | x | -
- | ) | -do { ++(n)->mib2_counters.x; } while(0) | -
Increment stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs)
- -enum snmp_ifType | -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
NETIF related | |
DHCPv4 | |
AUTOIP | |
Thread-safe functions to be called from non-TCPIP threads
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start) |
#define | netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop) |
To be called from non-TCPIP threads
-#define netifapi_autoip_start | -( | -- | n | ) | -netifapi_netif_common(n, NULL, autoip_start) | -
#define netifapi_autoip_stop | -( | -- | n | ) | -netifapi_netif_common(n, NULL, autoip_stop) | -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start) |
#define | netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL) |
#define | netifapi_dhcp_inform(n) netifapi_netif_common(n, dhcp_inform, NULL) |
#define | netifapi_dhcp_renew(n) netifapi_netif_common(n, NULL, dhcp_renew) |
#define | netifapi_dhcp_release(n) netifapi_netif_common(n, NULL, dhcp_release) |
#define | netifapi_dhcp_release_and_stop(n) netifapi_netif_common(n, dhcp_release_and_stop, NULL) |
To be called from non-TCPIP threads
-#define netifapi_dhcp_inform | -( | -- | n | ) | -netifapi_netif_common(n, dhcp_inform, NULL) | -
#define netifapi_dhcp_release | -( | -- | n | ) | -netifapi_netif_common(n, NULL, dhcp_release) | -
#define netifapi_dhcp_release_and_stop | -( | -- | n | ) | -netifapi_netif_common(n, dhcp_release_and_stop, NULL) | -
#define netifapi_dhcp_renew | -( | -- | n | ) | -netifapi_netif_common(n, NULL, dhcp_renew) | -
#define netifapi_dhcp_start | -( | -- | n | ) | -netifapi_netif_common(n, NULL, dhcp_start) | -
#define netifapi_dhcp_stop | -( | -- | n | ) | -netifapi_netif_common(n, dhcp_stop, NULL) | -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL) |
#define | netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL) |
#define | netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL) |
#define | netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL) |
#define | netifapi_netif_set_link_up(n) netifapi_netif_common(n, netif_set_link_up, NULL) |
#define | netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL) |
-Functions | |
err_t | netifapi_netif_add (struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input) |
err_t | netifapi_netif_set_addr (struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw) |
err_t | netifapi_netif_name_to_index (const char *name, u8_t *idx) |
err_t | netifapi_netif_index_to_name (u8_t idx, char *name) |
To be called from non-TCPIP threads
-#define netifapi_netif_remove | -( | -- | n | ) | -netifapi_netif_common(n, netif_remove, NULL) | -
#define netifapi_netif_set_default | -( | -- | n | ) | -netifapi_netif_common(n, netif_set_default, NULL) | -
#define netifapi_netif_set_down | -( | -- | n | ) | -netifapi_netif_common(n, netif_set_down, NULL) | -
#define netifapi_netif_set_link_down | -( | -- | n | ) | -netifapi_netif_common(n, netif_set_link_down, NULL) | -
#define netifapi_netif_set_link_up | -( | -- | n | ) | -netifapi_netif_common(n, netif_set_link_up, NULL) | -
#define netifapi_netif_set_up | -( | -- | n | ) | -netifapi_netif_common(n, netif_set_up, NULL) | -
err_t netifapi_netif_add | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr, | -
- | - | const ip4_addr_t * | -netmask, | -
- | - | const ip4_addr_t * | -gw, | -
- | - | void * | -state, | -
- | - | netif_init_fn | -init, | -
- | - | netif_input_fn | -input | -
- | ) | -- |
Call netif_add() in a thread-safe way by running that function inside the tcpip_thread context.
-err_t netifapi_netif_index_to_name | -( | -u8_t | -idx, | -
- | - | char * | -name | -
- | ) | -- |
Call netif_index_to_name() in a thread-safe way by running that function inside the tcpip_thread context.
-idx | the interface index of the netif |
name | output name of the found netif, empty '\0' string if netif not found. name should be of at least NETIF_NAMESIZE bytes |
err_t netifapi_netif_name_to_index | -( | -const char * | -name, | -
- | - | u8_t * | -idx | -
- | ) | -- |
Call netif_name_to_index() in a thread-safe way by running that function inside the tcpip_thread context.
-name | the interface name of the netif |
idx | output index of the found netif |
err_t netifapi_netif_set_addr | -( | -struct netif * | -netif, | -
- | - | const ip4_addr_t * | -ipaddr, | -
- | - | const ip4_addr_t * | -netmask, | -
- | - | const ip4_addr_t * | -gw | -
- | ) | -- |
Call netif_set_addr() in a thread-safe way by running that function inside the tcpip_thread context.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
IEEE 802.1D bridge | |
6LoWPAN (RFC4944) | |
6LoWPAN over BLE (RFC7668) | |
PPP | |
SLIP | |
ZEP - ZigBee Encapsulation Protocol | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | PBUF_NEEDS_COPY(p) ((p)->type_internal & PBUF_TYPE_FLAG_DATA_VOLATILE) |
-Enumerations | |
enum | pbuf_layer { - PBUF_TRANSPORT = 0 + (14 + 0 ) + 40 + 20, -PBUF_IP = 0 + (14 + 0 ) + 40, -PBUF_LINK = 0 + (14 + 0 ), -PBUF_RAW_TX = 0, - - PBUF_RAW = 0 - - } |
enum | pbuf_type { PBUF_RAM = ( 0x0200 | 0x80 | 0x00 ), -PBUF_ROM = 0x01, -PBUF_REF = ( 0x40 | 0x01 ), -PBUF_POOL = ( 0x0100 | 0x80 | 0x02 ) - } |
-Functions | |
struct pbuf * | pbuf_alloc (pbuf_layer layer, u16_t length, pbuf_type type) |
struct pbuf * | pbuf_alloc_reference (void *payload, u16_t length, pbuf_type type) |
struct pbuf * | pbuf_alloced_custom (pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p, void *payload_mem, u16_t payload_mem_len) |
void | pbuf_realloc (struct pbuf *p, u16_t new_len) |
u8_t | pbuf_free (struct pbuf *p) |
void | pbuf_ref (struct pbuf *p) |
void | pbuf_cat (struct pbuf *h, struct pbuf *t) |
void | pbuf_chain (struct pbuf *h, struct pbuf *t) |
err_t | pbuf_copy (struct pbuf *p_to, const struct pbuf *p_from) |
u16_t | pbuf_copy_partial (const struct pbuf *buf, void *dataptr, u16_t len, u16_t offset) |
void * | pbuf_get_contiguous (const struct pbuf *p, void *buffer, size_t bufsize, u16_t len, u16_t offset) |
struct pbuf * | pbuf_skip (struct pbuf *in, u16_t in_offset, u16_t *out_offset) |
err_t | pbuf_take (struct pbuf *buf, const void *dataptr, u16_t len) |
err_t | pbuf_take_at (struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset) |
struct pbuf * | pbuf_coalesce (struct pbuf *p, pbuf_layer layer) |
struct pbuf * | pbuf_clone (pbuf_layer layer, pbuf_type type, struct pbuf *p) |
u8_t | pbuf_get_at (const struct pbuf *p, u16_t offset) |
int | pbuf_try_get_at (const struct pbuf *p, u16_t offset) |
void | pbuf_put_at (struct pbuf *p, u16_t offset, u8_t data) |
u16_t | pbuf_memcmp (const struct pbuf *p, u16_t offset, const void *s2, u16_t n) |
u16_t | pbuf_memfind (const struct pbuf *p, const void *mem, u16_t mem_len, u16_t start_offset) |
Packets are built from the pbuf data structure. It supports dynamic memory allocation for packet contents or can reference externally managed packet contents both in RAM and ROM. Quick allocation for incoming packets is provided through pools with fixed sized pbufs.
-A packet may span over multiple pbufs, chained as a singly linked list. This is called a "pbuf chain".
-Multiple packets may be queued, also using this singly linked list. This is called a "packet queue".
-So, a packet queue consists of one or more pbuf chains, each of which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE NOT SUPPORTED!!! Use helper structs to queue multiple packets.
-The differences between a pbuf chain and a packet queue are very precise but subtle.
-The last pbuf of a packet has a ->tot_len field that equals the ->len field. It can be found by traversing the list. If the last pbuf of a packet has a ->next field other than NULL, more packets are on the queue.
-Therefore, looping through a pbuf of a single packet, has an loop end condition (tot_len == p->len), NOT (next == NULL).
-Example of custom pbuf usage: Zero-copy RX
-#define PBUF_NEEDS_COPY | -( | -- | p | ) | -((p)->type_internal & PBUF_TYPE_FLAG_DATA_VOLATILE) | -
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.
- -enum pbuf_layer | -
Enumeration of pbuf layers
-Enumerator | |
---|---|
PBUF_TRANSPORT | 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(). - |
PBUF_IP | Includes spare room for IP header. Use this if you intend to pass the pbuf to functions like raw_send(). - |
PBUF_LINK | Includes spare room for link layer header (ethernet header). Use this if you intend to pass the pbuf to functions like ethernet_output().
|
PBUF_RAW_TX | 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().
|
PBUF_RAW | Use this for input packets in a netif driver when calling netif->input() in the most common case - ethernet-layer netif driver. - |
enum pbuf_type | -
Enumeration of pbuf types
-Enumerator | |
---|---|
PBUF_RAM | 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). - |
PBUF_ROM | 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. - |
PBUF_REF | 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. - |
PBUF_POOL | 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! - |
struct pbuf* pbuf_alloc | -( | -pbuf_layer | -layer, | -
- | - | u16_t | -length, | -
- | - | pbuf_type | -type | -
- | ) | -- |
Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type).
-The actual memory allocated for the pbuf is determined by the layer at which the pbuf is allocated and the requested size (from the size parameter).
-layer | header size |
length | size of the pbuf's payload |
type | this parameter decides how and where the pbuf should be allocated as follows: |
struct pbuf* pbuf_alloc_reference | -( | -void * | -payload, | -
- | - | u16_t | -length, | -
- | - | pbuf_type | -type | -
- | ) | -- |
Allocates a pbuf for referenced data. Referenced data can be volatile (PBUF_REF) or long-lived (PBUF_ROM).
-The actual memory allocated for the pbuf is determined by the layer at which the pbuf is allocated and the requested size (from the size parameter).
-payload | referenced payload |
length | size of the pbuf's payload |
type | this parameter decides how and where the pbuf should be allocated as follows: |
struct pbuf* pbuf_alloced_custom | -( | -pbuf_layer | -l, | -
- | - | u16_t | -length, | -
- | - | pbuf_type | -type, | -
- | - | struct pbuf_custom * | -p, | -
- | - | void * | -payload_mem, | -
- | - | u16_t | -payload_mem_len | -
- | ) | -- |
Initialize a custom pbuf (already allocated). Example of custom pbuf usage: Zero-copy RX
-l | header size |
length | size of the pbuf's payload |
type | type of the pbuf (only used to treat the pbuf accordingly, as this function allocates no memory) |
p | pointer to the custom pbuf to initialize (already allocated) |
payload_mem | pointer to the buffer that is used for payload and headers, must be at least big enough to hold 'length' plus the header size, may be NULL if set later. ATTENTION: The caller is responsible for correct alignment of this buffer!! |
payload_mem_len | the size of the 'payload_mem' buffer, must be at least big enough to hold 'length' plus the header size |
Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbuf.
-This function explicitly does not check for tot_len overflow to prevent failing to queue too long pbufs. This can produce invalid pbufs, so handle with care!
-Chain two pbufs (or pbuf chains) together.
-The caller MUST call pbuf_free(t) once it has stopped using it. Use pbuf_cat() instead if you no longer use t.
-h | head pbuf (chain) |
t | tail pbuf (chain) |
The ->tot_len fields of all pbufs of the head chain are adjusted. The ->next field of the last pbuf of the head chain is adjusted. The ->ref field of the first pbuf of the tail chain is adjusted.
- -struct pbuf* pbuf_clone | -( | -pbuf_layer | -layer, | -
- | - | pbuf_type | -type, | -
- | - | struct pbuf * | -p | -
- | ) | -- |
Allocates a new pbuf of same length (via pbuf_alloc()) and copies the source pbuf into this new pbuf (using pbuf_copy()).
-layer | pbuf_layer of the new pbuf |
type | this parameter decides how and where the pbuf should be allocated ( |
p | the source pbuf |
struct pbuf* pbuf_coalesce | -( | -struct pbuf * | -p, | -
- | - | pbuf_layer | -layer | -
- | ) | -- |
Creates a single pbuf out of a queue of pbufs.
-p | the source pbuf |
layer | pbuf_layer of the new pbuf |
err_t pbuf_copy | -( | -struct pbuf * | -p_to, | -
- | - | const struct pbuf * | -p_from | -
- | ) | -- |
Create PBUF_RAM copies of pbufs.
-Used to queue packets on behalf of the lwIP stack, such as ARP based queueing.
-p_to | pbuf destination of the copy |
p_from | pbuf source of the copy |
u16_t pbuf_copy_partial | -( | -const struct pbuf * | -buf, | -
- | - | void * | -dataptr, | -
- | - | u16_t | -len, | -
- | - | u16_t | -offset | -
- | ) | -- |
Copy (part of) the contents of a packet buffer to an application supplied buffer.
-buf | the pbuf from which to copy data |
dataptr | the application supplied buffer |
len | length of data to copy (dataptr must be big enough). No more than buf->tot_len will be copied, irrespective of len |
offset | offset into the packet buffer from where to begin copying len bytes |
u8_t pbuf_free | -( | -struct pbuf * | -p | ) | -- |
Dereference a pbuf chain or queue and deallocate any no-longer-used pbufs at the head of this chain or queue.
-Decrements the pbuf reference count. If it reaches zero, the pbuf is deallocated.
-For a pbuf chain, this is repeated for each pbuf in the chain, up to the first pbuf which has a non-zero reference count after decrementing. So, when all reference counts are one, the whole chain is free'd.
-p | The pbuf (chain) to be dereferenced. |
u8_t pbuf_get_at | -( | -const struct pbuf * | -p, | -
- | - | u16_t | -offset | -
- | ) | -- |
Get one byte from the specified position in a pbuf WARNING: returns zero for offset >= p->tot_len
-p | pbuf to parse |
offset | offset into p of the byte to return |
void* pbuf_get_contiguous | -( | -const struct pbuf * | -p, | -
- | - | void * | -buffer, | -
- | - | size_t | -bufsize, | -
- | - | u16_t | -len, | -
- | - | u16_t | -offset | -
- | ) | -- |
Get part of a pbuf's payload as contiguous memory. The returned memory is either a pointer into the pbuf's payload or, if split over multiple pbufs, a copy into the user-supplied buffer.
-p | the pbuf from which to copy data |
buffer | the application supplied buffer |
bufsize | size of the application supplied buffer |
len | length of data to copy (dataptr must be big enough). No more than buf->tot_len will be copied, irrespective of len |
offset | offset into the packet buffer from where to begin copying len bytes |
u16_t pbuf_memcmp | -( | -const struct pbuf * | -p, | -
- | - | u16_t | -offset, | -
- | - | const void * | -s2, | -
- | - | u16_t | -n | -
- | ) | -- |
Compare pbuf contents at specified offset with memory s2, both of length n
-p | pbuf to compare |
offset | offset into p at which to start comparing |
s2 | buffer to compare |
n | length of buffer to compare |
u16_t pbuf_memfind | -( | -const struct pbuf * | -p, | -
- | - | const void * | -mem, | -
- | - | u16_t | -mem_len, | -
- | - | u16_t | -start_offset | -
- | ) | -- |
Find occurrence of mem (with length mem_len) in pbuf p, starting at offset start_offset.
-p | pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as return value 'not found' |
mem | search for the contents of this buffer |
mem_len | length of 'mem' |
start_offset | offset into p at which to start searching |
void pbuf_put_at | -( | -struct pbuf * | -p, | -
- | - | u16_t | -offset, | -
- | - | u8_t | -data | -
- | ) | -- |
Put one byte to the specified position in a pbuf WARNING: silently ignores offset >= p->tot_len
-p | pbuf to fill |
offset | offset into p of the byte to write |
data | byte to write at an offset into p |
void pbuf_realloc | -( | -struct pbuf * | -p, | -
- | - | u16_t | -new_len | -
- | ) | -- |
Shrink a pbuf chain to a desired length.
-p | pbuf to shrink. |
new_len | desired new length of pbuf chain |
Depending on the desired length, the first few pbufs in a chain might be skipped and left unchanged. The new last pbuf in the chain will be resized, and any remaining pbufs will be freed.
-void pbuf_ref | -( | -struct pbuf * | -p | ) | -- |
Increment the reference count of the pbuf.
-p | pbuf to increase reference counter of |
struct pbuf* pbuf_skip | -( | -struct pbuf * | -in, | -
- | - | u16_t | -in_offset, | -
- | - | u16_t * | -out_offset | -
- | ) | -- |
Skip a number of bytes at the start of a pbuf
-in | input pbuf |
in_offset | offset to skip |
out_offset | resulting offset in the returned pbuf |
err_t pbuf_take | -( | -struct pbuf * | -buf, | -
- | - | const void * | -dataptr, | -
- | - | u16_t | -len | -
- | ) | -- |
Copy application supplied data into a pbuf. This function can only be used to copy the equivalent of buf->tot_len data.
-buf | pbuf to fill with data |
dataptr | application supplied data buffer |
len | length of the application supplied data buffer |
err_t pbuf_take_at | -( | -struct pbuf * | -buf, | -
- | - | const void * | -dataptr, | -
- | - | u16_t | -len, | -
- | - | u16_t | -offset | -
- | ) | -- |
Same as pbuf_take() but puts data at an offset
-buf | pbuf to fill with data |
dataptr | application supplied data buffer |
len | length of the application supplied data buffer |
offset | offset in pbuf where to copy dataptr to |
int pbuf_try_get_at | -( | -const struct pbuf * | -p, | -
- | - | u16_t | -offset | -
- | ) | -- |
Get one byte from the specified position in a pbuf
-p | pbuf to parse |
offset | offset into p of the byte to return |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
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.
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
PPP interface for lwIP - -Author: Sylvain Rochet - -Table of Contents: - -1 - Supported PPP protocols and features -2 - Raw API PPP example for all protocols -3 - PPPoS input path (raw API, IRQ safe API, TCPIP API) -4 - Thread safe PPP API (PPPAPI) -5 - Notify phase callback (PPP_NOTIFY_PHASE) -6 - Upgrading from lwIP <= 1.4.x to lwIP >= 2.0.x - - - -1 Supported PPP protocols and features -====================================== - -Supported Low level protocols: -* PPP over serial using HDLC-like framing, such as wired dialup modems - or mobile telecommunications GPRS/EDGE/UMTS/HSPA+/LTE modems -* PPP over Ethernet, such as xDSL modems -* PPP over L2TP (Layer 2 Tunneling Protocol) LAC (L2TP Access Concentrator), - IP tunnel over UDP, such as VPN access - -Supported auth protocols: -* PAP, Password Authentication Protocol -* CHAP, Challenge-Handshake Authentication Protocol, also known as CHAP-MD5 -* MSCHAPv1, Microsoft version of CHAP, version 1 -* MSCHAPv2, Microsoft version of CHAP, version 2 -* EAP, Extensible Authentication Protocol - -Supported address protocols: -* IPCP, IP Control Protocol, IPv4 addresses negotiation -* IP6CP, IPv6 Control Protocol, IPv6 link-local addresses negotiation - -Supported encryption protocols: -* MPPE, Microsoft Point-to-Point Encryption - -Supported compression or miscellaneous protocols, for serial links only: -* PFC, Protocol Field Compression -* ACFC, Address-and-Control-Field-Compression -* ACCM, Asynchronous-Control-Character-Map -* VJ, Van Jacobson TCP/IP Header Compression - - - -2 Raw API PPP example for all protocols -======================================= - -As usual, raw API for lwIP means the lightweight API which *MUST* only be used -for NO_SYS=1 systems or called inside lwIP core thread for NO_SYS=0 systems. - -/* - * Globals - * ======= - */ - -/* The PPP control block */ -ppp_pcb *ppp; - -/* The PPP IP interface */ -struct netif ppp_netif; - - -/* - * PPP status callback - * =================== - * - * PPP status callback is called on PPP status change (up, down, …) from lwIP - * core thread - */ - -/* PPP status callback example */ -static void status_cb(ppp_pcb *pcb, int err_code, void *ctx) { - struct netif *pppif = ppp_netif(pcb); - LWIP_UNUSED_ARG(ctx); - - switch(err_code) { - case PPPERR_NONE: { -#if LWIP_DNS - const ip_addr_t *ns; -#endif /* LWIP_DNS */ - printf("status_cb: Connected\n"); -#if PPP_IPV4_SUPPORT - printf(" our_ipaddr = %s\n", ipaddr_ntoa(&pppif->ip_addr)); - printf(" his_ipaddr = %s\n", ipaddr_ntoa(&pppif->gw)); - printf(" netmask = %s\n", ipaddr_ntoa(&pppif->netmask)); -#if LWIP_DNS - ns = dns_getserver(0); - printf(" dns1 = %s\n", ipaddr_ntoa(ns)); - ns = dns_getserver(1); - printf(" dns2 = %s\n", ipaddr_ntoa(ns)); -#endif /* LWIP_DNS */ -#endif /* PPP_IPV4_SUPPORT */ -#if PPP_IPV6_SUPPORT - printf(" our6_ipaddr = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); -#endif /* PPP_IPV6_SUPPORT */ - break; - } - case PPPERR_PARAM: { - printf("status_cb: Invalid parameter\n"); - break; - } - case PPPERR_OPEN: { - printf("status_cb: Unable to open PPP session\n"); - break; - } - case PPPERR_DEVICE: { - printf("status_cb: Invalid I/O device for PPP\n"); - break; - } - case PPPERR_ALLOC: { - printf("status_cb: Unable to allocate resources\n"); - break; - } - case PPPERR_USER: { - printf("status_cb: User interrupt\n"); - break; - } - case PPPERR_CONNECT: { - printf("status_cb: Connection lost\n"); - break; - } - case PPPERR_AUTHFAIL: { - printf("status_cb: Failed authentication challenge\n"); - break; - } - case PPPERR_PROTOCOL: { - printf("status_cb: Failed to meet protocol\n"); - break; - } - case PPPERR_PEERDEAD: { - printf("status_cb: Connection timeout\n"); - break; - } - case PPPERR_IDLETIMEOUT: { - printf("status_cb: Idle Timeout\n"); - break; - } - case PPPERR_CONNECTTIME: { - printf("status_cb: Max connect time reached\n"); - break; - } - case PPPERR_LOOPBACK: { - printf("status_cb: Loopback detected\n"); - break; - } - default: { - printf("status_cb: Unknown error code %d\n", err_code); - break; - } - } - -/* - * This should be in the switch case, this is put outside of the switch - * case for example readability. - */ - - if (err_code == PPPERR_NONE) { - return; - } - - /* ppp_close() was previously called, don't reconnect */ - if (err_code == PPPERR_USER) { - /* ppp_free(); -- can be called here */ - return; - } - - /* - * Try to reconnect in 30 seconds, if you need a modem chatscript you have - * to do a much better signaling here ;-) - */ - ppp_connect(pcb, 30); - /* OR ppp_listen(pcb); */ -} - - -/* - * Creating a new PPPoS session - * ============================ - * - * In lwIP, PPPoS is not PPPoSONET, in lwIP PPPoS is PPPoSerial. - */ - -#include "netif/ppp/pppos.h" - -/* - * PPPoS serial output callback - * - * ppp_pcb, PPP control block - * data, buffer to write to serial port - * len, length of the data buffer - * ctx, optional user-provided callback context pointer - * - * Return value: len if write succeed - */ -static u32_t output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) { - return uart_write(UART, data, len); -} - -/* - * Create a new PPPoS interface - * - * ppp_netif, netif to use for this PPP link, i.e. PPP IP interface - * output_cb, PPPoS serial output callback - * status_cb, PPP status callback, called on PPP status change (up, down, …) - * ctx_cb, optional user-provided callback context pointer - */ -ppp = pppos_create(&ppp_netif, - output_cb, status_cb, ctx_cb); - - -/* - * Creating a new PPPoE session - * ============================ - */ - -#include "netif/ppp/pppoe.h" - -/* - * Create a new PPPoE interface - * - * ppp_netif, netif to use for this PPP link, i.e. PPP IP interface - * ethif, already existing and setup Ethernet interface to use - * service_name, PPPoE service name discriminator (not supported yet) - * concentrator_name, PPPoE concentrator name discriminator (not supported yet) - * status_cb, PPP status callback, called on PPP status change (up, down, …) - * ctx_cb, optional user-provided callback context pointer - */ -ppp = pppoe_create(&ppp_netif, - ðif, - service_name, concentrator_name, - status_cb, ctx_cb); - - -/* - * Creating a new PPPoL2TP session - * =============================== - */ - -#include "netif/ppp/pppol2tp.h" - -/* - * Create a new PPPoL2TP interface - * - * ppp_netif, netif to use for this PPP link, i.e. PPP IP interface - * netif, optional already existing and setup output netif, necessary if you - * want to set this interface as default route to settle the chicken - * and egg problem with VPN links - * ipaddr, IP to connect to - * port, UDP port to connect to (usually 1701) - * secret, L2TP secret to use - * secret_len, size in bytes of the L2TP secret - * status_cb, PPP status callback, called on PPP status change (up, down, …) - * ctx_cb, optional user-provided callback context pointer - */ -ppp = pppol2tp_create(&ppp_netif, - struct netif *netif, ip_addr_t *ipaddr, u16_t port, - u8_t *secret, u8_t secret_len, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb); - - -/* - * Initiate PPP client connection - * ============================== - */ - -/* Set this interface as default route */ -ppp_set_default(ppp); - -/* - * Basic PPP client configuration. Can only be set if PPP session is in the - * dead state (i.e. disconnected). We don't need to provide thread-safe - * equivalents through PPPAPI because those helpers are only changing - * structure members while session is inactive for lwIP core. Configuration - * only need to be done once. - */ - -/* Ask the peer for up to 2 DNS server addresses. */ -ppp_set_usepeerdns(ppp, 1); - -/* Auth configuration, this is pretty self-explanatory */ -ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password"); - -/* - * Initiate PPP negotiation, without waiting (holdoff=0), can only be called - * if PPP session is in the dead state (i.e. disconnected). - */ -u16_t holdoff = 0; -ppp_connect(ppp, holdoff); - - -/* - * Initiate PPP server listener - * ============================ - */ - -/* - * Basic PPP server configuration. Can only be set if PPP session is in the - * dead state (i.e. disconnected). We don't need to provide thread-safe - * equivalents through PPPAPI because those helpers are only changing - * structure members while session is inactive for lwIP core. Configuration - * only need to be done once. - */ -ip4_addr_t addr; - -/* Set our address */ -IP4_ADDR(&addr, 192,168,0,1); -ppp_set_ipcp_ouraddr(ppp, &addr); - -/* Set peer(his) address */ -IP4_ADDR(&addr, 192,168,0,2); -ppp_set_ipcp_hisaddr(ppp, &addr); - -/* Set primary DNS server */ -IP4_ADDR(&addr, 192,168,10,20); -ppp_set_ipcp_dnsaddr(ppp, 0, &addr); - -/* Set secondary DNS server */ -IP4_ADDR(&addr, 192,168,10,21); -ppp_set_ipcp_dnsaddr(ppp, 1, &addr); - -/* Auth configuration, this is pretty self-explanatory */ -ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password"); - -/* Require peer to authenticate */ -ppp_set_auth_required(ppp, 1); - -/* - * Only for PPPoS, the PPP session should be up and waiting for input. - * - * Note: for PPPoS, ppp_connect() and ppp_listen() are actually the same thing. - * The listen call is meant for future support of PPPoE and PPPoL2TP server - * mode, where we will need to negotiate the incoming PPPoE session or L2TP - * session before initiating PPP itself. We need this call because there is - * two passive modes for PPPoS, ppp_set_passive and ppp_set_silent. - */ -ppp_set_silent(pppos, 1); - -/* - * Initiate PPP listener (i.e. wait for an incoming connection), can only - * be called if PPP session is in the dead state (i.e. disconnected). - */ -ppp_listen(ppp); - - -/* - * Closing PPP connection - * ====================== - */ - -/* - * Initiate the end of the PPP session, without carrier lost signal - * (nocarrier=0), meaning a clean shutdown of PPP protocols. - * You can call this function at anytime. - */ -u8_t nocarrier = 0; -ppp_close(ppp, nocarrier); -/* - * Then you must wait your status_cb() to be called, it may takes from a few - * seconds to several tens of seconds depending on the current PPP state. - */ - -/* - * Freeing a PPP connection - * ======================== - */ - -/* - * Free the PPP control block, can only be called if PPP session is in the - * dead state (i.e. disconnected). You need to call ppp_close() before. - */ -ppp_free(ppp); - - - -3 PPPoS input path (raw API, IRQ safe API, TCPIP API) -===================================================== - -Received data on serial port should be sent to lwIP using the pppos_input() -function or the pppos_input_tcpip() function. - -If NO_SYS is 1 and if PPP_INPROC_IRQ_SAFE is 0 (the default), pppos_input() -is not IRQ safe and then *MUST* only be called inside your main loop. - -Whatever the NO_SYS value, if PPP_INPROC_IRQ_SAFE is 1, pppos_input() is IRQ -safe and can be safely called from an interrupt context, using that is going -to reduce your need of buffer if pppos_input() is called byte after byte in -your rx serial interrupt. - -if NO_SYS is 0, the thread safe way outside an interrupt context is to use -the pppos_input_tcpip() function to pass input data to the lwIP core thread -using the TCPIP API. This is thread safe in all cases but you should avoid -passing data byte after byte because it uses heavy locking (mailbox) and it -allocates pbuf, better fill them ! - -if NO_SYS is 0 and if PPP_INPROC_IRQ_SAFE is 1, you may also use pppos_input() -from an RX thread, however pppos_input() is not thread safe by itself. You can -do that *BUT* you should NEVER call pppos_connect(), pppos_listen() and -ppp_free() if pppos_input() can still be running, doing this is NOT thread safe -at all. Using PPP_INPROC_IRQ_SAFE from an RX thread is discouraged unless you -really know what you are doing, your move ;-) - - -/* - * Fonction to call for received data - * - * ppp, PPP control block - * buffer, input buffer - * buffer_len, buffer length in bytes - */ -void pppos_input(ppp, buffer, buffer_len); - -or - -void pppos_input_tcpip(ppp, buffer, buffer_len); - - - -4 Thread safe PPP API (PPPAPI) -============================== - -There is a thread safe API for all corresponding ppp_* functions, you have to -enable LWIP_PPP_API in your lwipopts.h file, then see -include/netif/ppp/pppapi.h, this is actually pretty obvious. - - - -5 Notify phase callback (PPP_NOTIFY_PHASE) -========================================== - -Notify phase callback, enabled using the PPP_NOTIFY_PHASE config option, let -you configure a callback that is called on each PPP internal state change. -This is different from the status callback which only warns you about -up(running) and down(dead) events. - -Notify phase callback can be used, for example, to set a LED pattern depending -on the current phase of the PPP session. Here is a callback example which -tries to mimic what we usually see on xDSL modems while they are negotiating -the link, which should be self-explanatory: - -static void ppp_notify_phase_cb(ppp_pcb *pcb, u8_t phase, void *ctx) { - switch (phase) { - - /* Session is down (either permanently or briefly) */ - case PPP_PHASE_DEAD: - led_set(PPP_LED, LED_OFF); - break; - - /* We are between two sessions */ - case PPP_PHASE_HOLDOFF: - led_set(PPP_LED, LED_SLOW_BLINK); - break; - - /* Session just started */ - case PPP_PHASE_INITIALIZE: - led_set(PPP_LED, LED_FAST_BLINK); - break; - - /* Session is running */ - case PPP_PHASE_RUNNING: - led_set(PPP_LED, LED_ON); - break; - - default: - break; - } -} - - - -6 Upgrading from lwIP <= 1.4.x to lwIP >= 2.0.x -=============================================== - -PPP API was fully reworked between 1.4.x and 2.0.x releases. However porting -from previous lwIP version is pretty easy: - -* Previous PPP API used an integer to identify PPP sessions, we are now - using ppp_pcb* control block, therefore all functions changed from "int ppp" - to "ppp_pcb *ppp" - -* struct netif was moved outside the PPP structure, you have to provide a netif - for PPP interface in pppoX_create() functions - -* PPP session are not started automatically after you created them anymore, - you have to call ppp_connect(), this way you can configure the session before - starting it. - -* Previous PPP API used CamelCase, we are now using snake_case. - -* Previous PPP API mixed PPPoS and PPPoE calls, this isn't the case anymore, - PPPoS functions are now prefixed pppos_ and PPPoE functions are now prefixed - pppoe_, common functions are now prefixed ppp_. - -* New PPPERR_ error codes added, check you have all of them in your status - callback function - -* Only the following include files should now be used in user application: - #include "netif/ppp/pppapi.h" - #include "netif/ppp/pppos.h" - #include "netif/ppp/pppoe.h" - #include "netif/ppp/pppol2tp.h" - - Functions from ppp.h can be used, but you don't need to include this header - file as it is already included by above header files. - -* PPP_INPROC_OWNTHREAD was broken by design and was removed, you have to create - your own serial rx thread - -* PPP_INPROC_MULTITHREADED option was misnamed and confusing and was renamed - PPP_INPROC_IRQ_SAFE, please read the "PPPoS input path" documentation above - because you might have been fooled by that - -* If you used tcpip_callback_with_block() on ppp_ functions you may wish to use - the PPPAPI API instead. - -* ppp_sighup and ppp_close functions were merged using an optional argument - "nocarrier" on ppp_close. - -* DNS servers are now only remotely asked if LWIP_DNS is set and if - ppp_set_usepeerdns() is set to true, they are now automatically registered - using the dns_setserver() function so you don't need to do that in the PPP - callback anymore. - -* PPPoS does not use the SIO API anymore, as such it now requires a serial - output callback in place of sio_write - -* PPP_MAXIDLEFLAG is now in ms instead of jiffies -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | raw_bind (struct raw_pcb *pcb, const ip_addr_t *ipaddr) |
void | raw_bind_netif (struct raw_pcb *pcb, const struct netif *netif) |
err_t | raw_connect (struct raw_pcb *pcb, const ip_addr_t *ipaddr) |
void | raw_disconnect (struct raw_pcb *pcb) |
void | raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg) |
err_t | raw_sendto (struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr) |
err_t | raw_sendto_if_src (struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, struct netif *netif, const ip_addr_t *src_ip) |
err_t | raw_send (struct raw_pcb *pcb, struct pbuf *p) |
void | raw_remove (struct raw_pcb *pcb) |
struct raw_pcb * | raw_new (u8_t proto) |
struct raw_pcb * | raw_new_ip_type (u8_t type, u8_t proto) |
Implementation of raw protocol PCBs for low-level handling of different types of protocols besides (or overriding) those already available in lwIP.
-
err_t raw_bind | -( | -struct raw_pcb * | -pcb, | -
- | - | const ip_addr_t * | -ipaddr | -
- | ) | -- |
Bind a RAW PCB.
-pcb | RAW PCB to be bound with a local address ipaddr. |
ipaddr | local IP address to bind with. Use IP4_ADDR_ANY to bind to all local interfaces. |
void raw_bind_netif | -( | -struct raw_pcb * | -pcb, | -
- | - | const struct netif * | -netif | -
- | ) | -- |
Bind an RAW PCB to a specific netif. After calling this function, all packets received via this PCB are guaranteed to have come in via the specified netif, and all outgoing packets will go out via the specified netif.
-pcb | RAW PCB to be bound with netif. |
netif | netif to bind to. Can be NULL. |
err_t raw_connect | -( | -struct raw_pcb * | -pcb, | -
- | - | const ip_addr_t * | -ipaddr | -
- | ) | -- |
Connect an RAW PCB. This function is required by upper layers of lwip. Using the raw api you could use raw_sendto() instead
-This will associate the RAW PCB with the remote address.
-pcb | RAW PCB to be connected with remote address ipaddr and port. |
ipaddr | remote IP address to connect with. |
void raw_disconnect | -( | -struct raw_pcb * | -pcb | ) | -- |
Disconnect a RAW PCB.
-pcb | the raw pcb to disconnect. |
struct raw_pcb* raw_new | -( | -u8_t | -proto | ) | -- |
Create a RAW PCB.
-proto | the protocol number of the IPs payload (e.g. IP_PROTO_ICMP) |
struct raw_pcb* raw_new_ip_type | -( | -u8_t | -type, | -
- | - | u8_t | -proto | -
- | ) | -- |
Create a RAW PCB for specific IP type.
-type | IP address type, see lwip_ip_addr_type definitions. If you want to listen to IPv4 and IPv6 (dual-stack) packets, supply IPADDR_TYPE_ANY as argument and bind to IP_ANY_TYPE. |
proto | the protocol number (next header) of the IPv6 packet payload (e.g. IP6_NEXTH_ICMP6) |
void raw_recv | -( | -struct raw_pcb * | -pcb, | -
- | - | raw_recv_fn | -recv, | -
- | - | void * | -recv_arg | -
- | ) | -- |
Set the callback function for received packets that match the raw PCB's protocol and binding.
-The callback function MUST either
void raw_remove | -( | -struct raw_pcb * | -pcb | ) | -- |
Remove an RAW PCB.
-pcb | RAW PCB to be removed. The PCB is removed from the list of RAW PCB's and the data structure is freed from memory. |
Send the raw IP packet to the address given by raw_connect()
-pcb | the raw pcb which to send |
p | the IP payload to send |
err_t raw_sendto | -( | -struct raw_pcb * | -pcb, | -
- | - | struct pbuf * | -p, | -
- | - | const ip_addr_t * | -ipaddr | -
- | ) | -- |
Send the raw IP packet to the given address. An IP header will be prepended to the packet, unless the RAW_FLAGS_HDRINCL flag is set on the PCB. In that case, the packet must include an IP header, which will then be sent as is.
-pcb | the raw pcb which to send |
p | the IP payload to send |
ipaddr | the destination address of the IP packet |
err_t raw_sendto_if_src | -( | -struct raw_pcb * | -pcb, | -
- | - | struct pbuf * | -p, | -
- | - | const ip_addr_t * | -dst_ip, | -
- | - | struct netif * | -netif, | -
- | - | const ip_addr_t * | -src_ip | -
- | ) | -- |
Send the raw IP packet to the given address, using a particular outgoing netif and source IP address. An IP header will be prepended to the packet, unless the RAW_FLAGS_HDRINCL flag is set on the PCB. In that case, the packet must include an IP header, which will then be sent as is.
-pcb | RAW PCB used to send the data |
p | chain of pbufs to be sent |
dst_ip | destination IP address |
netif | the netif used for sending |
src_ip | source IP address |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | ble_addr_to_eui64 (uint8_t *dst, const uint8_t *src, int public_addr) |
void | eui64_to_ble_addr (uint8_t *dst, const uint8_t *src) |
err_t | rfc7668_set_context (u8_t idx, const ip6_addr_t *context) |
err_t | rfc7668_output (struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) |
err_t | rfc7668_input (struct pbuf *p, struct netif *netif) |
err_t | rfc7668_if_init (struct netif *netif) |
This file implements a RFC7668 implementation for 6LoWPAN over Bluetooth Low Energy. The specification is very similar to 6LoWPAN, so most of the code is re-used. Compared to 6LoWPAN, much functionality is already implemented in lower BLE layers (fragmenting, session management,...).
-Usage:
void ble_addr_to_eui64 | -( | -uint8_t * | -dst, | -
- | - | const uint8_t * | -src, | -
- | - | int | -public_addr | -
- | ) | -- |
convert BT address to EUI64 addr
-This method converts a Bluetooth MAC address to an EUI64 address, which is used within IPv6 communication
-dst | IPv6 destination space |
src | BLE MAC address source |
public_addr | If the LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS option is set, bit 0x02 will be set if param=0 (no public addr); cleared otherwise |
void eui64_to_ble_addr | -( | -uint8_t * | -dst, | -
- | - | const uint8_t * | -src | -
- | ) | -- |
convert EUI64 address to Bluetooth MAC addr
-This method converts an EUI64 address to a Bluetooth MAC address,
-dst | BLE MAC address destination |
src | IPv6 source |
Initialize the netif
-No flags are used (broadcast not possible, not ethernet, ...) The shortname for this netif is "BT"
-netif | the network interface to be initialized as RFC7668 netif |
err_t rfc7668_input | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Process a received raw payload from an L2CAP channel
-p | the received packet, p->payload pointing to the IPv6 header (maybe compressed) |
netif | the network interface on which the packet was received |
err_t rfc7668_output | -( | -struct netif * | -netif, | -
- | - | struct pbuf * | -q, | -
- | - | const ip6_addr_t * | -ip6addr | -
- | ) | -- |
Compress outgoing IPv6 packet and pass it on to netif->linkoutput
-netif | The lwIP network interface which the IP packet will be sent on. |
q | The pbuf(s) containing the IP packet to be sent. |
ip6addr | The IP address of the packet destination. |
err_t rfc7668_set_context | -( | -u8_t | -idx, | -
- | - | const ip6_addr_t * | -context | -
- | ) | -- |
Set context id IPv6 address
-Store one IPv6 address to a given context id.
-idx | Context id |
context | IPv6 addr for this context |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Netconn API | |
NETIF API | |
Sequential-style APIs, blocking functions. More overhead, but can be called from any thread except TCPIP thread. The sequential API provides a way for ordinary, sequential, programs to use the lwIP stack. It is quite similar to the BSD socket API. The model of execution is based on the blocking open-read-write-close paradigm. Since the TCP/IP stack is event based by nature, the TCP/IP code and the application program must reside in different execution contexts (threads).
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | lowpan6_set_context (u8_t idx, const ip6_addr_t *context) |
err_t | lowpan6_set_short_addr (u8_t addr_high, u8_t addr_low) |
err_t | lowpan6_output (struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) |
err_t | lowpan6_input (struct pbuf *p, struct netif *netif) |
err_t | lowpan6_set_pan_id (u16_t pan_id) |
err_t | tcpip_6lowpan_input (struct pbuf *p, struct netif *inp) |
6LowPAN netif implementation
-err_t lowpan6_input | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -netif | -
- | ) | -- |
NETIF input function: don't free the input pbuf when returning != ERR_OK!
- -err_t lowpan6_output | -( | -struct netif * | -netif, | -
- | - | struct pbuf * | -q, | -
- | - | const ip6_addr_t * | -ip6addr | -
- | ) | -- |
Resolve and fill-in IEEE 802.15.4 address header for outgoing IPv6 packet.
-Perform Header Compression and fragment if necessary.
-netif | The lwIP network interface which the IP packet will be sent on. |
q | The pbuf(s) containing the IP packet to be sent. |
ip6addr | The IP address of the packet destination. |
err_t lowpan6_set_context | -( | -u8_t | -idx, | -
- | - | const ip6_addr_t * | -context | -
- | ) | -- |
Set context
- -err_t lowpan6_set_pan_id | -( | -u16_t | -pan_id | ) | -- |
Set PAN ID
- -err_t lowpan6_set_short_addr | -( | -u8_t | -addr_high, | -
- | - | u8_t | -addr_low | -
- | ) | -- |
Set short address
- -err_t tcpip_6lowpan_input | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -inp | -
- | ) | -- |
Pass a received packet to tcpip_thread for input processing
-p | the received packet, p->payload pointing to the IEEE 802.15.4 header. |
inp | the network interface on which the packet was received |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | slipif_init (struct netif *netif) |
void | slipif_poll (struct netif *netif) |
void | slipif_process_rxqueue (struct netif *netif) |
void | slipif_received_byte (struct netif *netif, u8_t data) |
void | slipif_received_bytes (struct netif *netif, u8_t *data, u8_t len) |
This is an arch independent SLIP netif. The specific serial hooks must be provided by another file. They are sio_open, sio_read/sio_tryread and sio_send
-Usage: This netif can be used in three ways:
- 1) For NO_SYS==0, an RX thread can be used which blocks on sio_read() until data is received.
- 2) In your main loop, call slipif_poll() to check for new RX bytes, completed packets are fed into netif->input().
- 3) Call slipif_received_byte[s]() from your serial RX ISR and slipif_process_rxqueue() from your main loop. ISR level decodes packets and puts completed packets on a queue which is fed into the stack from the main loop (needs SYS_LIGHTWEIGHT_PROT for pbuf_alloc to work on ISR level!).
SLIP netif initialization
-Call the arch specific sio_open and remember the opened device in the state field of the netif.
-netif | the lwip network interface structure for this slipif |
void slipif_poll | -( | -struct netif * | -netif | ) | -- |
Polls the serial device and feeds the IP layer with incoming packets.
-netif | The lwip network interface structure for this slipif |
void slipif_process_rxqueue | -( | -struct netif * | -netif | ) | -- |
Feeds the IP layer with incoming packets that were receive
-netif | The lwip network interface structure for this slipif |
void slipif_received_byte | -( | -struct netif * | -netif, | -
- | - | u8_t | -data | -
- | ) | -- |
Process a received byte, completed packets are put on a queue that is fed into IP through slipif_process_rxqueue().
-This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled.
-netif | The lwip network interface structure for this slipif |
data | received character |
void slipif_received_bytes | -( | -struct netif * | -netif, | -
- | - | u8_t * | -data, | -
- | - | u8_t | -len | -
- | ) | -- |
Process multiple received byte, completed packets are put on a queue that is fed into IP through slipif_process_rxqueue().
-This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled.
-netif | The lwip network interface structure for this slipif |
data | received character |
len | Number of received characters |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
-Functions | |
err_t | smtp_set_server_addr (const char *server) |
void | smtp_set_server_port (u16_t port) |
void | smtp_set_tls_config (struct altcp_tls_config *tls_config) |
err_t | smtp_set_auth (const char *username, const char *pass) |
err_t | smtp_send_mail (const char *from, const char *to, const char *subject, const char *body, smtp_result_fn callback_fn, void *callback_arg) |
err_t | smtp_send_mail_static (const char *from, const char *to, const char *subject, const char *body, smtp_result_fn callback_fn, void *callback_arg) |
void | smtp_send_mail_int (void *arg) |
This is simple SMTP client for raw API. It is a minimal implementation of SMTP as specified in RFC 5321.
-Example usage:
When using from any other thread than the tcpip_thread (for NO_SYS==0), use smtp_send_mail_int()!
-SMTP_BODYDH usage:
err_t smtp_send_mail | -( | -const char * | -from, | -
- | - | const char * | -to, | -
- | - | const char * | -subject, | -
- | - | const char * | -body, | -
- | - | smtp_result_fn | -callback_fn, | -
- | - | void * | -callback_arg | -
- | ) | -- |
Send an email via the currently selected server, username and password.
-from | source email address (must be NULL-terminated) |
to | target email address (must be NULL-terminated) |
subject | email subject (must be NULL-terminated) |
body | email body (must be NULL-terminated) |
callback_fn | callback function |
callback_arg | user argument to callback_fn |
void smtp_send_mail_int | -( | -void * | -arg | ) | -- |
Same as smtp_send_mail but takes a struct smtp_send_request as single parameter which contains all the other parameters. To be used with tcpip_callback to send mail from interrupt context or from another thread.
-WARNING: server and authentication must stay untouched until this function has run!
-Usage example:
err_t smtp_send_mail_static | -( | -const char * | -from, | -
- | - | const char * | -to, | -
- | - | const char * | -subject, | -
- | - | const char * | -body, | -
- | - | smtp_result_fn | -callback_fn, | -
- | - | void * | -callback_arg | -
- | ) | -- |
Same as smtp_send_mail, but doesn't copy from, to, subject and body into an internal buffer to save memory. WARNING: the above data must stay untouched until the callback function is called (unless the function returns != ERR_OK)
- -err_t smtp_set_auth | -( | -const char * | -username, | -
- | - | const char * | -pass | -
- | ) | -- |
Set authentication parameters for next SMTP connection
-username | login name as passed to the server |
pass | password passed to the server together with username |
err_t smtp_set_server_addr | -( | -const char * | -server | ) | -- |
Set IP address or DNS name for next SMTP connection
-server | IP address (in ASCII representation) or DNS name of the server |
void smtp_set_server_port | -( | -u16_t | -port | ) | -- |
Set TCP port for next SMTP connection
-port | TCP port |
void smtp_set_tls_config | -( | -struct altcp_tls_config * | -tls_config | ) | -- |
Set TLS configuration for next SMTP connection
-tls_config | TLS configuration |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | SMTP_BODYDH 0 |
#define | SMTP_DEBUG LWIP_DBG_OFF |
#define | SMTP_MAX_SERVERNAME_LEN 256 |
#define | SMTP_MAX_USERNAME_LEN 32 |
#define | SMTP_MAX_PASS_LEN 32 |
#define | SMTP_COPY_AUTHDATA 1 |
#define | SMTP_CHECK_DATA 1 |
#define | SMTP_SUPPORT_AUTH_PLAIN 1 |
#define | SMTP_SUPPORT_AUTH_LOGIN 1 |
#define SMTP_BODYDH 0 | -
Set this to 1 to enable data handler callback on BODY
- -#define SMTP_CHECK_DATA 1 | -
Set this to 0 to save some code space if you know for sure that all data passed to this module conforms to the requirements in the SMTP RFC. WARNING: use this with care!
- -#define SMTP_COPY_AUTHDATA 1 | -
Set this to 0 if you know the authentication data will not change during the smtp session, which saves some heap space.
- -#define SMTP_DEBUG LWIP_DBG_OFF | -
SMTP_DEBUG: Enable debugging for SNTP.
- -#define SMTP_MAX_PASS_LEN 32 | -
Maximum length reserved for password
- -#define SMTP_MAX_SERVERNAME_LEN 256 | -
Maximum length reserved for server name including terminating 0 byte
- -#define SMTP_MAX_USERNAME_LEN 32 | -
Maximum length reserved for username
- -#define SMTP_SUPPORT_AUTH_LOGIN 1 | -
Set this to 1 to enable AUTH LOGIN support
- -#define SMTP_SUPPORT_AUTH_PLAIN 1 | -
Set this to 1 to enable AUTH PLAIN support
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Core | |
Traps | |
MIB2 | |
Options | |
SNMPv2c and SNMPv3 compatible agent
-There is also a MIB compiler and a MIB viewer in lwIP contrib repository (lwip-contrib/apps/LwipMibCompiler).
-The agent implements the most important MIB2 MIBs including IPv6 support (interfaces, UDP, TCP, SNMP, ICMP, SYSTEM). IP MIB is an older version without IPv6 statistics (TODO).
-Rewritten by Martin Hentschel info@ and Dirk Ziegelmeier cl-s oft.d edzieg el@g mx.de
-
Note the S in SNMP stands for "Simple". Note that "Simple" is relative. SNMP is simple compared to the complex ISO network management protocols CMIP (Common Management Information Protocol) and CMOT (CMip Over Tcp).
-When SNMPv3 is used, several functions from snmpv3.h must be implemented by the user. This is mainly user management and persistence handling. The sample provided in lwip-contrib is insecure, don't use it in production systems, especially the missing persistence for engine boots variable simplifies replay attacks.
-The standard lwIP stack management information base. This is a required MIB, so this is always enabled. The groups EGP, CMOT and transmission are disabled by default.
-Most mib-2 objects are not writable except: sysName, sysLocation, sysContact, snmpEnableAuthenTraps. Writing to or changing the ARP and IP address and route tables is not possible.
-Note lwIP has a very limited notion of IP routing. It currently doen't have a route table and doesn't have a notion of the U,G,H flags. Instead lwIP uses the interface list with only one default interface acting as a single gateway interface (G) for the default route.
-The agent returns a "virtual table" with the default route 0.0.0.0 for the default interface and network routes (no H) for each network interface in the netif_list. All routes are considered to be up (U).
-MIBs can only be added in compile-time, not in run-time.
-First of all you'll need to add the following define to your local lwipopts.h: #define LWIP_SNMP 1
-and add the source files your makefile.
-Note you'll might need to adapt you network driver to update the mib2 variables for your interface.
-The following function calls must be made in your program to actually get the SNMP agent running.
-Before starting the agent you should supply pointers for sysContact, sysLocation, and snmpEnableAuthenTraps. You can do this by calling
- -You can register a callback which is called on successful write access: snmp_set_write_callback().
-Additionally you may want to set
- -Also before starting the agent you need to setup one or more trap destinations using these calls:
- -If you need more than MIB2, set the MIBs you want to use by snmp_set_mibs().
-Finally, enable the agent by calling snmp_init()
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | snmp_set_mibs (const struct snmp_mib **mibs, u8_t num_mibs) |
void | snmp_set_device_enterprise_oid (const struct snmp_obj_id *device_enterprise_oid) |
const struct snmp_obj_id * | snmp_get_device_enterprise_oid (void) |
const char * | snmp_get_community (void) |
void | snmp_set_community (const char *const community) |
const char * | snmp_get_community_write (void) |
void | snmp_set_community_write (const char *const community) |
void | snmp_set_write_callback (snmp_write_callback_fct write_callback, void *callback_arg) |
void | snmp_init (void) |
const char* snmp_get_community | -( | -void | -) | -- |
Returns current SNMP community string.
const char* snmp_get_community_write | -( | -void | -) | -- |
Returns current SNMP write-access community string.
const struct snmp_obj_id* snmp_get_device_enterprise_oid | -( | -void | -) | -- |
Get 'device enterprise oid'
- -void snmp_init | -( | -void | -) | -- |
Starts SNMP Agent. Allocates UDP pcb and binds it to IP_ANY_TYPE port 161.
-Agent setup, start listening to port 161.
- -void snmp_set_community | -( | -const char *const | -community | ) | -- |
Sets SNMP community string. The string itself (its storage) must be valid throughout the whole life of program (or until it is changed to sth else).
-community | is a pointer to new community string |
void snmp_set_community_write | -( | -const char *const | -community | ) | -- |
Sets SNMP community string for write-access. The string itself (its storage) must be valid throughout the whole life of program (or until it is changed to sth else).
-community | is a pointer to new write-access community string |
void snmp_set_device_enterprise_oid | -( | -const struct snmp_obj_id * | -device_enterprise_oid | ) | -- |
'device enterprise oid' is used for 'device OID' field in trap PDU's (for identification of generating device) as well as for value returned by MIB-2 'sysObjectID' field (if internal MIB2 implementation is used). The 'device enterprise oid' shall point to an OID located under 'private-enterprises' branch (1.3.6.1.4.1.XXX). If a vendor wants to provide a custom object there, he has to get its own enterprise oid from IANA (http://www.iana.org). It is not allowed to use LWIP enterprise ID! In order to identify a specific device it is recommended to create a dedicated OID for each device type under its own enterprise oid. e.g. device a > 1.3.6.1.4.1.XXX(ent-oid).1(devices).1(device a) device b > 1.3.6.1.4.1.XXX(ent-oid).1(devices).2(device b) for more details see description of 'sysObjectID' field in RFC1213-MIB
- -void snmp_set_mibs | -( | -const struct snmp_mib ** | -mibs, | -
- | - | u8_t | -num_mibs | -
- | ) | -- |
Sets the MIBs to use. Example: call snmp_set_mibs() as follows: static const struct snmp_mib *my_snmp_mibs[] = { &mib2, &private_mib }; snmp_set_mibs(my_snmp_mibs, LWIP_ARRAYSIZE(my_snmp_mibs));
- -void snmp_set_write_callback | -( | -snmp_write_callback_fct | -write_callback, | -
- | - | void * | -callback_arg | -
- | ) | -- |
Callback fired on every successful write access
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | snmp_mib2_set_sysdescr (const u8_t *str, const u16_t *len) |
void | snmp_mib2_set_syscontact (u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize) |
void | snmp_mib2_set_syscontact_readonly (const u8_t *ocstr, const u16_t *ocstrlen) |
void | snmp_mib2_set_sysname (u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize) |
void | snmp_mib2_set_sysname_readonly (const u8_t *ocstr, const u16_t *ocstrlen) |
void | snmp_mib2_set_syslocation (u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize) |
void | snmp_mib2_set_syslocation_readonly (const u8_t *ocstr, const u16_t *ocstrlen) |
void snmp_mib2_set_syscontact | -( | -u8_t * | -ocstr, | -
- | - | u16_t * | -ocstrlen, | -
- | - | u16_t | -bufsize | -
- | ) | -- |
Initializes sysContact pointers
-ocstr | if non-NULL then copy str pointer |
ocstrlen | points to string length, excluding zero terminator. if set to NULL it is assumed that ocstr is NULL-terminated. |
bufsize | size of the buffer in bytes. (this is required because the buffer can be overwritten by snmp-set) if ocstrlen is NULL buffer needs space for terminating 0 byte. otherwise complete buffer is used for string. if bufsize is set to 0, the value is regarded as read-only. |
void snmp_mib2_set_syscontact_readonly | -( | -const u8_t * | -ocstr, | -
- | - | const u16_t * | -ocstrlen | -
- | ) | -- |
see snmp_mib2_set_syscontact but set pointer to readonly memory
- -void snmp_mib2_set_sysdescr | -( | -const u8_t * | -str, | -
- | - | const u16_t * | -len | -
- | ) | -- |
Initializes sysDescr pointers.
-str | if non-NULL then copy str pointer |
len | points to string length, excluding zero terminator |
void snmp_mib2_set_syslocation | -( | -u8_t * | -ocstr, | -
- | - | u16_t * | -ocstrlen, | -
- | - | u16_t | -bufsize | -
- | ) | -- |
Initializes sysLocation pointers
-ocstr | if non-NULL then copy str pointer |
ocstrlen | points to string length, excluding zero terminator. if set to NULL it is assumed that ocstr is NULL-terminated. |
bufsize | size of the buffer in bytes. (this is required because the buffer can be overwritten by snmp-set) if ocstrlen is NULL buffer needs space for terminating 0 byte. otherwise complete buffer is used for string. if bufsize is set to 0, the value is regarded as read-only. |
void snmp_mib2_set_syslocation_readonly | -( | -const u8_t * | -ocstr, | -
- | - | const u16_t * | -ocstrlen | -
- | ) | -- |
see snmp_mib2_set_syslocation but set pointer to readonly memory
- -void snmp_mib2_set_sysname | -( | -u8_t * | -ocstr, | -
- | - | u16_t * | -ocstrlen, | -
- | - | u16_t | -bufsize | -
- | ) | -- |
Initializes sysName pointers
-ocstr | if non-NULL then copy str pointer |
ocstrlen | points to string length, excluding zero terminator. if set to NULL it is assumed that ocstr is NULL-terminated. |
bufsize | size of the buffer in bytes. (this is required because the buffer can be overwritten by snmp-set) if ocstrlen is NULL buffer needs space for terminating 0 byte. otherwise complete buffer is used for string. if bufsize is set to 0, the value is regarded as read-only. |
void snmp_mib2_set_sysname_readonly | -( | -const u8_t * | -ocstr, | -
- | - | const u16_t * | -ocstrlen | -
- | ) | -- |
see snmp_mib2_set_sysname but set pointer to readonly memory
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_SNMP 0 |
#define | SNMP_USE_NETCONN 0 |
#define | SNMP_USE_RAW 1 |
#define | SNMP_STACK_SIZE DEFAULT_THREAD_STACKSIZE |
#define | SNMP_THREAD_PRIO DEFAULT_THREAD_PRIO |
#define | SNMP_TRAP_DESTINATIONS 1 |
#define | SNMP_SAFE_REQUESTS 1 |
#define | SNMP_MAX_OCTET_STRING_LEN 127 |
#define | SNMP_MAX_OBJ_ID_LEN 50 |
#define | SNMP_MIN_VALUE_SIZE (2 * sizeof(u32_t*)) /* size required to store the basic types (8 bytes for counter64) */ |
#define | SNMP_MAX_VALUE_SIZE LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE) |
#define | SNMP_COMMUNITY "public" |
#define | SNMP_COMMUNITY_WRITE "private" |
#define | SNMP_COMMUNITY_TRAP "public" |
#define | SNMP_MAX_COMMUNITY_STR_LEN LWIP_MAX(LWIP_MAX(sizeof(SNMP_COMMUNITY), sizeof(SNMP_COMMUNITY_WRITE)), sizeof(SNMP_COMMUNITY_TRAP)) |
#define | SNMP_LWIP_ENTERPRISE_OID 26381 |
#define | SNMP_DEVICE_ENTERPRISE_OID {1, 3, 6, 1, 4, 1, SNMP_LWIP_ENTERPRISE_OID} |
#define | SNMP_DEVICE_ENTERPRISE_OID_LEN 7 |
#define | SNMP_DEBUG LWIP_DBG_OFF |
#define | SNMP_MIB_DEBUG LWIP_DBG_OFF |
#define | SNMP_LWIP_MIB2 LWIP_SNMP |
#define | SNMP_LWIP_MIB2_SYSDESC "lwIP" |
#define | SNMP_LWIP_MIB2_SYSNAME "FQDN-unk" |
#define | SNMP_LWIP_MIB2_SYSCONTACT "" |
#define | SNMP_LWIP_MIB2_SYSLOCATION "" |
#define | SNMP_LWIP_GETBULK_MAX_REPETITIONS 0 |
#define LWIP_SNMP 0 | -
LWIP_SNMP==1: This enables the lwIP SNMP agent. UDP must be available for SNMP transport. If you want to use your own SNMP agent, leave this disabled. To integrate MIB2 of an external agent, you need to enable LWIP_MIB2_CALLBACKS and MIB2_STATS. This will give you the callbacks and statistics counters you need to get MIB2 working.
- -#define SNMP_COMMUNITY "public" | -
The snmp read-access community. Used for write-access and traps, too unless SNMP_COMMUNITY_WRITE or SNMP_COMMUNITY_TRAP are enabled, respectively.
- -#define SNMP_COMMUNITY_TRAP "public" | -
The snmp community used for sending traps.
- -#define SNMP_COMMUNITY_WRITE "private" | -
The snmp write-access community. Set this community to "" in order to disallow any write access.
- -#define SNMP_DEBUG LWIP_DBG_OFF | -
SNMP_DEBUG: Enable debugging for SNMP messages.
- -#define SNMP_DEVICE_ENTERPRISE_OID {1, 3, 6, 1, 4, 1, SNMP_LWIP_ENTERPRISE_OID} | -
IANA assigned enterprise ID for lwIP is 26381
-If you need to create your own private MIB you'll need to apply for your own enterprise ID with IANA: http://www.iana.org/numbers.html
- -#define SNMP_DEVICE_ENTERPRISE_OID_LEN 7 | -
Length of SNMP_DEVICE_ENTERPRISE_OID
- -#define SNMP_LWIP_ENTERPRISE_OID 26381 | -
The OID identifiying the device. This may be the enterprise OID itself or any OID located below it in tree.
- -#define SNMP_LWIP_GETBULK_MAX_REPETITIONS 0 | -
This value is used to limit the repetitions processed in GetBulk requests (value == 0 means no limitation). This may be useful to limit the load for a single request. According to SNMP RFC 1905 it is allowed to not return all requested variables from a GetBulk request if system load would be too high. so the effect is that the client will do more requests to gather all data. For the stack this could be useful in case that SNMP processing is done in TCP/IP thread. In this situation a request with many repetitions could block the thread for a longer time. Setting limit here will keep the stack more responsive.
- -#define SNMP_LWIP_MIB2 LWIP_SNMP | -
Indicates if the MIB2 implementation of LWIP SNMP stack is used.
- -#define SNMP_LWIP_MIB2_SYSCONTACT "" | -
Value return for sysContact field of MIB2. To make sysContact field settable, call snmp_mib2_set_syscontact() to provide the necessary buffers.
- -#define SNMP_LWIP_MIB2_SYSDESC "lwIP" | -
Value return for sysDesc field of MIB2.
- -#define SNMP_LWIP_MIB2_SYSLOCATION "" | -
Value return for sysLocation field of MIB2. To make sysLocation field settable, call snmp_mib2_set_syslocation() to provide the necessary buffers.
- -#define SNMP_LWIP_MIB2_SYSNAME "FQDN-unk" | -
Value return for sysName field of MIB2. To make sysName field settable, call snmp_mib2_set_sysname() to provide the necessary buffers.
- -#define SNMP_MAX_COMMUNITY_STR_LEN LWIP_MAX(LWIP_MAX(sizeof(SNMP_COMMUNITY), sizeof(SNMP_COMMUNITY_WRITE)), sizeof(SNMP_COMMUNITY_TRAP)) | -
The maximum length of community string. If community names shall be adjusted at runtime via snmp_set_community() calls, enter here the possible maximum length (+1 for terminating null character).
- -#define SNMP_MAX_OBJ_ID_LEN 50 | -
The maximum number of Sub ID's inside an object identifier. Indirectly this also limits the maximum depth of SNMP tree.
- -#define SNMP_MAX_OCTET_STRING_LEN 127 | -
The maximum length of strings used.
- -#define SNMP_MAX_VALUE_SIZE LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE) | -
The maximum size of a value.
- -#define SNMP_MIB_DEBUG LWIP_DBG_OFF | -
SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
- -#define SNMP_MIN_VALUE_SIZE (2 * sizeof(u32_t*)) /* size required to store the basic types (8 bytes for counter64) */ | -
The minimum size of a value.
- -#define SNMP_SAFE_REQUESTS 1 | -
Only allow SNMP write actions that are 'safe' (e.g. disabling netifs is not a safe action and disabled when SNMP_SAFE_REQUESTS = 1). Unsafe requests are disabled by default!
- -#define SNMP_STACK_SIZE DEFAULT_THREAD_STACKSIZE | -
SNMP_STACK_SIZE: Stack size of SNMP netconn worker thread
- -#define SNMP_THREAD_PRIO DEFAULT_THREAD_PRIO | -
SNMP_THREAD_PRIO: SNMP netconn worker thread priority
- -#define SNMP_TRAP_DESTINATIONS 1 | -
SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap destination is required
- -#define SNMP_USE_NETCONN 0 | -
SNMP_USE_NETCONN: Use netconn API instead of raw API. Makes SNMP agent run in a worker thread, so blocking operations can be done in MIB calls.
- -#define SNMP_USE_RAW 1 | -
SNMP_USE_RAW: Use raw API. SNMP agent does not run in a worker thread, so blocking operations should not be done in MIB calls.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
const char * | snmp_get_community_trap (void) |
void | snmp_set_community_trap (const char *const community) |
void | snmp_trap_dst_enable (u8_t dst_idx, u8_t enable) |
void | snmp_trap_dst_ip_set (u8_t dst_idx, const ip_addr_t *dst) |
void | snmp_set_auth_traps_enabled (u8_t enable) |
u8_t | snmp_get_auth_traps_enabled (void) |
err_t | snmp_send_trap (const struct snmp_obj_id *eoid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds) |
err_t | snmp_send_trap_generic (s32_t generic_trap) |
err_t | snmp_send_trap_specific (s32_t specific_trap, struct snmp_varbind *varbinds) |
void | snmp_coldstart_trap (void) |
void | snmp_authfail_trap (void) |
void snmp_authfail_trap | -( | -void | -) | -- |
Send authentication failure trap (used internally by agent)
- -void snmp_coldstart_trap | -( | -void | -) | -- |
Send coldstart trap
- -u8_t snmp_get_auth_traps_enabled | -( | -void | -) | -- |
Get authentication traps enabled state
- -const char* snmp_get_community_trap | -( | -void | -) | -- |
Returns current SNMP community string used for sending traps.
err_t snmp_send_trap | -( | -const struct snmp_obj_id * | -eoid, | -
- | - | s32_t | -generic_trap, | -
- | - | s32_t | -specific_trap, | -
- | - | struct snmp_varbind * | -varbinds | -
- | ) | -- |
Sends a generic or enterprise specific trap message.
-eoid | points to enterprise object identifier |
generic_trap | is the trap code |
specific_trap | used for enterprise traps when generic_trap == 6 |
varbinds | linked list of varbinds to be sent |
send to the TRAP destination
- -err_t snmp_send_trap_generic | -( | -s32_t | -generic_trap | ) | -- |
Send generic SNMP trap
- -err_t snmp_send_trap_specific | -( | -s32_t | -specific_trap, | -
- | - | struct snmp_varbind * | -varbinds | -
- | ) | -- |
Send specific SNMP trap with variable bindings
- -void snmp_set_auth_traps_enabled | -( | -u8_t | -enable | ) | -- |
Enable/disable authentication traps
- -void snmp_set_community_trap | -( | -const char *const | -community | ) | -- |
Sets SNMP community string used for sending traps. The string itself (its storage) must be valid throughout the whole life of program (or until it is changed to sth else).
-community | is a pointer to new trap community string |
void snmp_trap_dst_enable | -( | -u8_t | -dst_idx, | -
- | - | u8_t | -enable | -
- | ) | -- |
Sets enable switch for this trap destination.
dst_idx | index in 0 .. SNMP_TRAP_DESTINATIONS-1 |
enable | switch if 0 destination is disabled >0 enabled. |
void snmp_trap_dst_ip_set | -( | -u8_t | -dst_idx, | -
- | - | const ip_addr_t * | -dst | -
- | ) | -- |
Sets IPv4 address for this trap destination.
dst_idx | index in 0 .. SNMP_TRAP_DESTINATIONS-1 |
dst | IPv4 address in host order. |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
-Functions | |
void | sntp_init (void) |
void | sntp_stop (void) |
u8_t | sntp_enabled (void) |
void | sntp_setoperatingmode (u8_t operating_mode) |
u8_t | sntp_getoperatingmode (void) |
u8_t | sntp_getreachability (u8_t idx) |
void | sntp_setserver (u8_t idx, const ip_addr_t *server) |
const ip_addr_t * | sntp_getserver (u8_t idx) |
This is simple "SNTP" client for the lwIP raw API. It is a minimal implementation of SNTPv4 as specified in RFC 4330.
-For a list of some public NTP servers, see this link: http://support.ntp.org/bin/view/Servers/NTPPoolServers
-u8_t sntp_enabled | -( | -void | -) | -- |
Get enabled state.
- -u8_t sntp_getoperatingmode | -( | -void | -) | -- |
Gets the operating mode.
- -u8_t sntp_getreachability | -( | -u8_t | -idx | ) | -- |
Gets the server reachability shift register as described in RFC 5905.
-idx | the index of the NTP server |
const ip_addr_t* sntp_getserver | -( | -u8_t | -idx | ) | -- |
Obtain one of the currently configured by IP address (or DHCP) NTP servers
-idx | the index of the NTP server |
void sntp_init | -( | -void | -) | -- |
Initialize this module. Send out request instantly or after SNTP_STARTUP_DELAY(_FUNC).
- -void sntp_setoperatingmode | -( | -u8_t | -operating_mode | ) | -- |
Sets the operating mode.
operating_mode | one of the available operating modes |
void sntp_setserver | -( | -u8_t | -idx, | -
- | - | const ip_addr_t * | -server | -
- | ) | -- |
Initialize one of the NTP servers by IP address
-idx | the index of the NTP server to set must be < SNTP_MAX_SERVERS |
server | IP address of the NTP server to set |
void sntp_stop | -( | -void | -) | -- |
Stop this module.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | SNTP_SET_SYSTEM_TIME(sec) LWIP_UNUSED_ARG(sec) |
#define | SNTP_MAX_SERVERS LWIP_DHCP_MAX_NTP_SERVERS |
#define | SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV |
#define | SNTP_SERVER_DNS 0 |
#define | SNTP_DEBUG LWIP_DBG_OFF |
#define | SNTP_PORT LWIP_IANA_PORT_SNTP |
#define | SNTP_CHECK_RESPONSE 0 |
#define | SNTP_COMP_ROUNDTRIP 0 |
#define | SNTP_STARTUP_DELAY 1 |
#define | SNTP_STARTUP_DELAY_FUNC (LWIP_RAND() % 5000) |
#define | SNTP_RECV_TIMEOUT 15000 |
#define | SNTP_UPDATE_DELAY 3600000 |
#define | SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0) |
#define | SNTP_RETRY_TIMEOUT SNTP_RECV_TIMEOUT |
#define | SNTP_RETRY_TIMEOUT_MAX (SNTP_RETRY_TIMEOUT * 10) |
#define | SNTP_RETRY_TIMEOUT_EXP 1 |
#define | SNTP_MONITOR_SERVER_REACHABILITY 1 |
#define SNTP_CHECK_RESPONSE 0 | -
Sanity check: Define this to
#define SNTP_COMP_ROUNDTRIP 0 | -
Enable round-trip delay compensation. Compensate for the round-trip delay by calculating the clock offset from the originate, receive, transmit and destination timestamps, as per RFC.
-The calculation requires compiler support for 64-bit integers. Also, either SNTP_SET_SYSTEM_TIME_US or SNTP_SET_SYSTEM_TIME_NTP has to be implemented for setting the system clock with sub-second precision. Likewise, either SNTP_GET_SYSTEM_TIME or SNTP_GET_SYSTEM_TIME_NTP needs to be implemented with sub-second precision.
-Although not strictly required, it makes sense to combine this option with SNTP_CHECK_RESPONSE >= 2 for sanity-checking of the received timestamps. Also, in order for the round-trip calculation to work, the difference between the local clock and the NTP server clock must not be larger than about 34 years. If that limit is exceeded, the implementation will fall back to setting the clock without compensation. In order to ensure that the local clock is always within the permitted range for compensation, even at first try, it may be necessary to store at least the current year in non-volatile memory.
- -#define SNTP_DEBUG LWIP_DBG_OFF | -
SNTP_DEBUG: Enable debugging for SNTP.
- -#define SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV | -
Set this to 1 to implement the callback function called by dhcp when NTP servers are received.
- -#define SNTP_GET_SYSTEM_TIME | -( | -- | sec, | -
- | - | - | us | -
- | ) | -do { (sec) = 0; (us) = 0; } while(0) | -
SNTP macro to get system time, used with SNTP_CHECK_RESPONSE >= 2 to send in request and compare in response. Also used for round-trip delay compensation if SNTP_COMP_ROUNDTRIP != 0. Alternatively, define SNTP_GET_SYSTEM_TIME_NTP(sec, frac) in order to work with native NTP timestamps instead.
- -#define SNTP_MAX_SERVERS LWIP_DHCP_MAX_NTP_SERVERS | -
The maximum number of SNTP servers that can be set
- -#define SNTP_MONITOR_SERVER_REACHABILITY 1 | -
Keep a reachability shift register per server Default is on to conform to RFC.
- -#define SNTP_PORT LWIP_IANA_PORT_SNTP | -
SNTP server port
- -#define SNTP_RECV_TIMEOUT 15000 | -
SNTP receive timeout - in milliseconds Also used as retry timeout - this shouldn't be too low. Default is 15 seconds. Must not be beolw 15 seconds by specification (i.e. 15000)
- -#define SNTP_RETRY_TIMEOUT SNTP_RECV_TIMEOUT | -
Default retry timeout (in milliseconds) if the response received is invalid. This is doubled with each retry until SNTP_RETRY_TIMEOUT_MAX is reached.
- -#define SNTP_RETRY_TIMEOUT_EXP 1 | -
Increase retry timeout with every retry sent Default is on to conform to RFC.
- -#define SNTP_RETRY_TIMEOUT_MAX (SNTP_RETRY_TIMEOUT * 10) | -
Maximum retry timeout (in milliseconds).
- -#define SNTP_SERVER_DNS 0 | -
Set this to 1 to support DNS names (or IP address strings) to set sntp servers One server address/name can be defined as default if SNTP_SERVER_DNS == 1: #define SNTP_SERVER_ADDRESS "pool.ntp.org"
- -#define SNTP_SET_SYSTEM_TIME | -( | -- | sec | ) | -LWIP_UNUSED_ARG(sec) | -
SNTP macro to change system time in seconds Define SNTP_SET_SYSTEM_TIME_US(sec, us) to set the time in microseconds instead of this one if you need the additional precision. Alternatively, define SNTP_SET_SYSTEM_TIME_NTP(sec, frac) in order to work with native NTP timestamps instead.
- -#define SNTP_STARTUP_DELAY 1 | -
According to the RFC, this shall be a random delay between 1 and 5 minutes (in milliseconds) to prevent load peaks. This can be defined to a random generation function, which must return the delay in milliseconds as u32_t. Turned off by default.
- -#define SNTP_STARTUP_DELAY_FUNC (LWIP_RAND() % 5000) | -
If you want the startup delay to be a function, define this to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1.
- -#define SNTP_UPDATE_DELAY 3600000 | -
SNTP update delay - in milliseconds Default is 1 hour. Must not be beolw 60 seconds by specification (i.e. 60000)
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Interface Identification API | |
NETDB API | |
-Macros | |
#define | accept(s, addr, addrlen) lwip_accept(s,addr,addrlen) |
#define | bind(s, name, namelen) lwip_bind(s,name,namelen) |
#define | shutdown(s, how) lwip_shutdown(s,how) |
#define | getpeername(s, name, namelen) lwip_getpeername(s,name,namelen) |
#define | getsockname(s, name, namelen) lwip_getsockname(s,name,namelen) |
#define | setsockopt(s, level, optname, opval, optlen) lwip_setsockopt(s,level,optname,opval,optlen) |
#define | getsockopt(s, level, optname, opval, optlen) lwip_getsockopt(s,level,optname,opval,optlen) |
#define | closesocket(s) lwip_close(s) |
#define | connect(s, name, namelen) lwip_connect(s,name,namelen) |
#define | listen(s, backlog) lwip_listen(s,backlog) |
#define | recv(s, mem, len, flags) lwip_recv(s,mem,len,flags) |
#define | recvmsg(s, message, flags) lwip_recvmsg(s,message,flags) |
#define | recvfrom(s, mem, len, flags, from, fromlen) lwip_recvfrom(s,mem,len,flags,from,fromlen) |
#define | send(s, dataptr, size, flags) lwip_send(s,dataptr,size,flags) |
#define | sendmsg(s, message, flags) lwip_sendmsg(s,message,flags) |
#define | sendto(s, dataptr, size, flags, to, tolen) lwip_sendto(s,dataptr,size,flags,to,tolen) |
#define | socket(domain, type, protocol) lwip_socket(domain,type,protocol) |
#define | select(maxfdp1, readset, writeset, exceptset, timeout) lwip_select(maxfdp1,readset,writeset,exceptset,timeout) |
#define | poll(fds, nfds, timeout) lwip_poll(fds,nfds,timeout) |
#define | ioctlsocket(s, cmd, argp) lwip_ioctl(s,cmd,argp) |
#define | inet_ntop(af, src, dst, size) lwip_inet_ntop(af,src,dst,size) |
#define | inet_pton(af, src, dst) lwip_inet_pton(af,src,dst) |
#define | read(s, mem, len) lwip_read(s,mem,len) |
#define | readv(s, iov, iovcnt) lwip_readv(s,iov,iovcnt) |
#define | write(s, dataptr, len) lwip_write(s,dataptr,len) |
#define | writev(s, iov, iovcnt) lwip_writev(s,iov,iovcnt) |
#define | close(s) lwip_close(s) |
#define | fcntl(s, cmd, val) lwip_fcntl(s,cmd,val) |
#define | ioctl(s, cmd, argp) lwip_ioctl(s,cmd,argp) |
BSD-style socket API.
-Thread-safe, to be called from non-TCPIP threads only.
-Can be activated by defining LWIP_SOCKET to 1.
-Header is in posix/sys/socket.h
-The socket API is a compatibility API for existing applications, currently it is built on top of the sequential API. It is meant to provide all functions needed to run socket API applications running on other platforms (e.g. unix / windows etc.). However, due to limitations in the specification of this API, there might be incompatibilities that require small modifications of existing programs.
#define accept | -( | -- | s, | -
- | - | - | addr, | -
- | - | - | addrlen | -
- | ) | -lwip_accept(s,addr,addrlen) | -
#define bind | -( | -- | s, | -
- | - | - | name, | -
- | - | - | namelen | -
- | ) | -lwip_bind(s,name,namelen) | -
#define close | -( | -- | s | ) | -lwip_close(s) | -
#define closesocket | -( | -- | s | ) | -lwip_close(s) | -
#define connect | -( | -- | s, | -
- | - | - | name, | -
- | - | - | namelen | -
- | ) | -lwip_connect(s,name,namelen) | -
#define fcntl | -( | -- | s, | -
- | - | - | cmd, | -
- | - | - | val | -
- | ) | -lwip_fcntl(s,cmd,val) | -
#define getpeername | -( | -- | s, | -
- | - | - | name, | -
- | - | - | namelen | -
- | ) | -lwip_getpeername(s,name,namelen) | -
#define getsockname | -( | -- | s, | -
- | - | - | name, | -
- | - | - | namelen | -
- | ) | -lwip_getsockname(s,name,namelen) | -
#define getsockopt | -( | -- | s, | -
- | - | - | level, | -
- | - | - | optname, | -
- | - | - | opval, | -
- | - | - | optlen | -
- | ) | -lwip_getsockopt(s,level,optname,opval,optlen) | -
#define inet_ntop | -( | -- | af, | -
- | - | - | src, | -
- | - | - | dst, | -
- | - | - | size | -
- | ) | -lwip_inet_ntop(af,src,dst,size) | -
#define inet_pton | -( | -- | af, | -
- | - | - | src, | -
- | - | - | dst | -
- | ) | -lwip_inet_pton(af,src,dst) | -
#define ioctl | -( | -- | s, | -
- | - | - | cmd, | -
- | - | - | argp | -
- | ) | -lwip_ioctl(s,cmd,argp) | -
#define ioctlsocket | -( | -- | s, | -
- | - | - | cmd, | -
- | - | - | argp | -
- | ) | -lwip_ioctl(s,cmd,argp) | -
#define listen | -( | -- | s, | -
- | - | - | backlog | -
- | ) | -lwip_listen(s,backlog) | -
#define poll | -( | -- | fds, | -
- | - | - | nfds, | -
- | - | - | timeout | -
- | ) | -lwip_poll(fds,nfds,timeout) | -
#define read | -( | -- | s, | -
- | - | - | mem, | -
- | - | - | len | -
- | ) | -lwip_read(s,mem,len) | -
#define readv | -( | -- | s, | -
- | - | - | iov, | -
- | - | - | iovcnt | -
- | ) | -lwip_readv(s,iov,iovcnt) | -
#define recv | -( | -- | s, | -
- | - | - | mem, | -
- | - | - | len, | -
- | - | - | flags | -
- | ) | -lwip_recv(s,mem,len,flags) | -
#define recvfrom | -( | -- | s, | -
- | - | - | mem, | -
- | - | - | len, | -
- | - | - | flags, | -
- | - | - | from, | -
- | - | - | fromlen | -
- | ) | -lwip_recvfrom(s,mem,len,flags,from,fromlen) | -
#define recvmsg | -( | -- | s, | -
- | - | - | message, | -
- | - | - | flags | -
- | ) | -lwip_recvmsg(s,message,flags) | -
#define select | -( | -- | maxfdp1, | -
- | - | - | readset, | -
- | - | - | writeset, | -
- | - | - | exceptset, | -
- | - | - | timeout | -
- | ) | -lwip_select(maxfdp1,readset,writeset,exceptset,timeout) | -
#define send | -( | -- | s, | -
- | - | - | dataptr, | -
- | - | - | size, | -
- | - | - | flags | -
- | ) | -lwip_send(s,dataptr,size,flags) | -
#define sendmsg | -( | -- | s, | -
- | - | - | message, | -
- | - | - | flags | -
- | ) | -lwip_sendmsg(s,message,flags) | -
#define sendto | -( | -- | s, | -
- | - | - | dataptr, | -
- | - | - | size, | -
- | - | - | flags, | -
- | - | - | to, | -
- | - | - | tolen | -
- | ) | -lwip_sendto(s,dataptr,size,flags,to,tolen) | -
#define setsockopt | -( | -- | s, | -
- | - | - | level, | -
- | - | - | optname, | -
- | - | - | opval, | -
- | - | - | optlen | -
- | ) | -lwip_setsockopt(s,level,optname,opval,optlen) | -
#define shutdown | -( | -- | s, | -
- | - | - | how | -
- | ) | -lwip_shutdown(s,how) | -
#define socket | -( | -- | domain, | -
- | - | - | type, | -
- | - | - | protocol | -
- | ) | -lwip_socket(domain,type,protocol) | -
#define write | -( | -- | s, | -
- | - | - | dataptr, | -
- | - | - | len | -
- | ) | -lwip_write(s,dataptr,len) | -
#define writev | -( | -- | s, | -
- | - | - | iov, | -
- | - | - | iovcnt | -
- | ) | -lwip_writev(s,iov,iovcnt) | -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Non-standard functions | |
OS abstraction layer | |
Time | |
Critical sections | |
Compiler/platform abstraction | |
Performance measurement | |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | sys_mbox_new (sys_mbox_t *mbox, int size) |
void | sys_mbox_post (sys_mbox_t *mbox, void *msg) |
err_t | sys_mbox_trypost (sys_mbox_t *mbox, void *msg) |
err_t | sys_mbox_trypost_fromisr (sys_mbox_t *mbox, void *msg) |
u32_t | sys_arch_mbox_fetch (sys_mbox_t *mbox, void **msg, u32_t timeout) |
u32_t | sys_arch_mbox_tryfetch (sys_mbox_t *mbox, void **msg) |
void | sys_mbox_free (sys_mbox_t *mbox) |
int | sys_mbox_valid (sys_mbox_t *mbox) |
void | sys_mbox_set_invalid (sys_mbox_t *mbox) |
Mailboxes should be implemented as a queue which allows multiple messages to be posted (implementing as a rendez-vous point where only one message can be posted at a time can have a highly negative impact on performance). A message in a mailbox is just a pointer, nothing more.
-u32_t sys_arch_mbox_fetch | -( | -sys_mbox_t * | -mbox, | -
- | - | void ** | -msg, | -
- | - | u32_t | -timeout | -
- | ) | -- |
Blocks the thread until a message arrives in the mailbox, but does not block the thread longer than "timeout" milliseconds (similar to the sys_arch_sem_wait() function). If "timeout" is 0, the thread should be blocked until a message arrives. The "msg" argument is a result parameter that is set by the function (i.e., by doing "*msg = -ptr"). The "msg" parameter maybe NULL to indicate that the message should be dropped. The return values are the same as for the sys_arch_sem_wait() function: SYS_ARCH_TIMEOUT if there was a timeout, any other value if a messages is received.
-Note that a function with a similar name, sys_mbox_fetch(), is implemented by lwIP.
-mbox | mbox to get a message from |
msg | pointer where the message is stored |
timeout | maximum time (in milliseconds) to wait for a message (0 = wait forever) |
u32_t sys_arch_mbox_tryfetch | -( | -sys_mbox_t * | -mbox, | -
- | - | void ** | -msg | -
- | ) | -- |
This is similar to sys_arch_mbox_fetch, however if a message is not present in the mailbox, it immediately returns with the code SYS_MBOX_EMPTY. On success 0 is returned. To allow for efficient implementations, this can be defined as a function-like macro in sys_arch.h instead of a normal function. For example, a naive implementation could be: #define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1) although this would introduce unnecessary delays.
-mbox | mbox to get a message from |
msg | pointer where the message is stored |
void sys_mbox_free | -( | -sys_mbox_t * | -mbox | ) | -- |
Deallocates a mailbox. If there are messages still present in the mailbox when the mailbox is deallocated, it is an indication of a programming error in lwIP and the developer should be notified.
-mbox | mbox to delete |
err_t sys_mbox_new | -( | -sys_mbox_t * | -mbox, | -
- | - | int | -size | -
- | ) | -- |
Creates an empty mailbox for maximum "size" elements. Elements stored in mailboxes are pointers. You have to define macros "_MBOX_SIZE" in your lwipopts.h, or ignore this parameter in your implementation and use a default size. If the mailbox has been created, ERR_OK should be returned. Returning any other error will provide a hint what went wrong, but except for assertions, no real error handling is implemented.
-mbox | pointer to the mbox to create |
size | (minimum) number of messages in this mbox |
void sys_mbox_post | -( | -sys_mbox_t * | -mbox, | -
- | - | void * | -msg | -
- | ) | -- |
Post a message to an mbox - may not fail -> blocks if full, only to be used from tasks NOT from ISR!
-mbox | mbox to posts the message |
msg | message to post (ATTENTION: can be NULL) |
void sys_mbox_set_invalid | -( | -sys_mbox_t * | -mbox | ) | -- |
Invalidate a mailbox so that sys_mbox_valid() returns 0. ATTENTION: This does NOT mean that the mailbox shall be deallocated: sys_mbox_free() is always called before calling this function! This may also be a define, in which case the function is not prototyped.
- -err_t sys_mbox_trypost | -( | -sys_mbox_t * | -mbox, | -
- | - | void * | -msg | -
- | ) | -- |
Try to post a message to an mbox - may fail if full. Can be used from ISR (if the sys arch layer allows this). Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
-mbox | mbox to posts the message |
msg | message to post (ATTENTION: can be NULL) |
err_t sys_mbox_trypost_fromisr | -( | -sys_mbox_t * | -mbox, | -
- | - | void * | -msg | -
- | ) | -- |
Try to post a message to an mbox - may fail if full. To be be used from ISR. Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
-mbox | mbox to posts the message |
msg | message to post (ATTENTION: can be NULL) |
int sys_mbox_valid | -( | -sys_mbox_t * | -mbox | ) | -- |
Returns 1 if the mailbox is valid, 0 if it is not valid. When using pointers, a simple way is to check the pointer for != NULL. When directly using OS structures, implementing this may be more complex. This may also be a define, in which case the function is not prototyped.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
void | sys_msleep (u32_t ms) |
sys_thread_t | sys_thread_new (const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio) |
void | sys_init (void) |
void sys_init | -( | -void | -) | -- |
sys_init() must be called before anything else. Initialize the sys_arch layer.
- -void sys_msleep | -( | -u32_t | -ms | ) | -- |
Sleep for specified number of ms
-Sleep for some ms. Timeouts are NOT processed while sleeping.
-ms | number of milliseconds to sleep |
sys_thread_t sys_thread_new | -( | -const char * | -name, | -
- | - | lwip_thread_fn | -thread, | -
- | - | void * | -arg, | -
- | - | int | -stacksize, | -
- | - | int | -prio | -
- | ) | -- |
The only thread function: Starts a new thread named "name" with priority "prio" that will begin its execution in the function "thread()". The "arg" argument will be passed as an argument to the thread() function. The stack size to used for this thread is the "stacksize" parameter. The id of the new thread is returned. Both the id and the priority are system dependent. ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!)
-name | human-readable name for the thread (used for debugging purposes) |
thread | thread-function |
arg | parameter passed to 'thread' |
stacksize | stack size in bytes for the new thread (may be ignored by ports) |
prio | priority of the new thread (may be ignored by ports) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | sys_mutex_new (sys_mutex_t *mutex) |
void | sys_mutex_lock (sys_mutex_t *mutex) |
void | sys_mutex_unlock (sys_mutex_t *mutex) |
void | sys_mutex_free (sys_mutex_t *mutex) |
int | sys_mutex_valid (sys_mutex_t *mutex) |
void | sys_mutex_set_invalid (sys_mutex_t *mutex) |
Mutexes are recommended to correctly handle priority inversion, especially if you use LWIP_CORE_LOCKING .
-void sys_mutex_free | -( | -sys_mutex_t * | -mutex | ) | -- |
Deallocates a mutex.
mutex | the mutex to delete |
void sys_mutex_lock | -( | -sys_mutex_t * | -mutex | ) | -- |
Blocks the thread until the mutex can be grabbed.
mutex | the mutex to lock |
err_t sys_mutex_new | -( | -sys_mutex_t * | -mutex | ) | -- |
Create a new mutex. Note that mutexes are expected to not be taken recursively by the lwIP code, so both implementation types (recursive or non-recursive) should work. The mutex is allocated to the memory that 'mutex' points to (which can be both a pointer or the actual OS structure). If the mutex has been created, ERR_OK should be returned. Returning any other error will provide a hint what went wrong, but except for assertions, no real error handling is implemented.
-mutex | pointer to the mutex to create |
void sys_mutex_set_invalid | -( | -sys_mutex_t * | -mutex | ) | -- |
Invalidate a mutex so that sys_mutex_valid() returns 0. ATTENTION: This does NOT mean that the mutex shall be deallocated: sys_mutex_free() is always called before calling this function! This may also be a define, in which case the function is not prototyped.
- -void sys_mutex_unlock | -( | -sys_mutex_t * | -mutex | ) | -- |
Releases the mutex previously locked through 'sys_mutex_lock()'.
mutex | the mutex to unlock |
int sys_mutex_valid | -( | -sys_mutex_t * | -mutex | ) | -- |
Returns 1 if the mutes is valid, 0 if it is not valid. When using pointers, a simple way is to check the pointer for != NULL. When directly using OS structures, implementing this may be more complex. This may also be a define, in which case the function is not prototyped.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
char * | lwip_strnstr (const char *buffer, const char *token, size_t n) |
int | lwip_stricmp (const char *str1, const char *str2) |
int | lwip_strnicmp (const char *str1, const char *str2, size_t len) |
void | lwip_itoa (char *result, size_t bufsize, int number) |
lwIP provides default implementations for non-standard functions. These can be mapped to OS functions to reduce code footprint if desired. All defines related to this section must not be placed in lwipopts.h, but in arch/cc.h! These options cannot be #defined in lwipopts.h since they are not options of lwIP itself, but options of the lwIP port to your system.
-void lwip_itoa | -( | -char * | -result, | -
- | - | size_t | -bufsize, | -
- | - | int | -number | -
- | ) | -- |
lwIP default implementation for itoa() non-standard function. This can be #defined to itoa() or snprintf(result, bufsize, "%d", number) depending on your platform port.
- -int lwip_stricmp | -( | -const char * | -str1, | -
- | - | const char * | -str2 | -
- | ) | -- |
lwIP default implementation for stricmp() non-standard function. This can be #defined to stricmp() depending on your platform port.
- -int lwip_strnicmp | -( | -const char * | -str1, | -
- | - | const char * | -str2, | -
- | - | size_t | -len | -
- | ) | -- |
lwIP default implementation for strnicmp() non-standard function. This can be #defined to strnicmp() depending on your platform port.
- -char* lwip_strnstr | -( | -const char * | -buffer, | -
- | - | const char * | -token, | -
- | - | size_t | -n | -
- | ) | -- |
lwIP default implementation for strnstr() non-standard function. This can be #defined to strnstr() depending on your platform port.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Semaphores | |
Mutexes | |
Mailboxes | |
Misc | |
No need to implement functions in this section in NO_SYS mode. The OS-specific code should be implemented in arch/sys_arch.h and sys_arch.c of your port.
-The operating system emulation layer provides a common interface between the lwIP code and the underlying operating system kernel. The general idea is that porting lwIP to new architectures requires only small changes to a few header files and a new sys_arch implementation. It is also possible to do a sys_arch implementation that does not rely on any underlying operating system.
-The sys_arch provides semaphores, mailboxes and mutexes to lwIP. For the full lwIP functionality, multiple threads support can be implemented in the sys_arch, but this is not required for the basic lwIP functionality. Timer scheduling is implemented in lwIP, but can be implemented by the sys_arch port (LWIP_TIMERS_CUSTOM==1).
-In addition to the source file providing the functionality of sys_arch, the OS emulation layer must provide several header files defining macros used throughout lwip. The files required and the macros they must define are listed below the sys_arch description.
-Since lwIP 1.4.0, semaphore, mutexes and mailbox functions are prototyped in a way that allows both using pointers or actual OS structures to be used. This way, memory required for such types can be either allocated in place (globally or on the stack) or on the heap (allocated internally in the "*_new()" functions).
-Be careful with using mem_malloc() in sys_arch. When malloc() refers to mem_malloc() you can run into a circular function call problem. In mem.c mem_init() tries to allocate a semaphore using mem_malloc, which of course can't be performed when sys_arch uses mem_malloc.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev |
#define | SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() |
#define | SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) |
Used to protect short regions of code against concurrent access.
#define SYS_ARCH_DECL_PROTECT | -( | -- | lev | ) | -sys_prot_t lev | -
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.
- -#define SYS_ARCH_PROTECT | -( | -- | lev | ) | -lev = sys_arch_protect() | -
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
- -#define SYS_ARCH_UNPROTECT | -( | -- | lev | ) | -sys_arch_unprotect(lev) | -
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
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | sys_sem_new (sys_sem_t *sem, u8_t count) |
void | sys_sem_signal (sys_sem_t *sem) |
u32_t | sys_arch_sem_wait (sys_sem_t *sem, u32_t timeout) |
void | sys_sem_free (sys_sem_t *sem) |
int | sys_sem_valid (sys_sem_t *sem) |
void | sys_sem_set_invalid (sys_sem_t *sem) |
Semaphores can be either counting or binary - lwIP works with both kinds. Semaphores are represented by the type "sys_sem_t" which is typedef'd in the sys_arch.h file. Mailboxes are equivalently represented by the type "sys_mbox_t". Mutexes are represented by the type "sys_mutex_t". lwIP does not place any restrictions on how these types are represented internally.
-u32_t sys_arch_sem_wait | -( | -sys_sem_t * | -sem, | -
- | - | u32_t | -timeout | -
- | ) | -- |
Blocks the thread while waiting for the semaphore to be signaled. If the "timeout" argument is non-zero, the thread should only be blocked for the specified time (measured in milliseconds). If the "timeout" argument is zero, the thread should be blocked until the semaphore is signalled.
-The return value is SYS_ARCH_TIMEOUT if the semaphore wasn't signaled within the specified time or any other value if it was signaled (with or without waiting). Notice that lwIP implements a function with a similar name, sys_sem_wait(), that uses the sys_arch_sem_wait() function.
-sem | the semaphore to wait for |
timeout | timeout in milliseconds to wait (0 = wait forever) |
void sys_sem_free | -( | -sys_sem_t * | -sem | ) | -- |
Deallocates a semaphore.
sem | semaphore to delete |
err_t sys_sem_new | -( | -sys_sem_t * | -sem, | -
- | - | u8_t | -count | -
- | ) | -- |
Create a new semaphore Creates a new semaphore. The semaphore is allocated to the memory that 'sem' points to (which can be both a pointer or the actual OS structure). The "count" argument specifies the initial state of the semaphore (which is either 0 or 1). If the semaphore has been created, ERR_OK should be returned. Returning any other error will provide a hint what went wrong, but except for assertions, no real error handling is implemented.
-sem | pointer to the semaphore to create |
count | initial count of the semaphore |
void sys_sem_set_invalid | -( | -sys_sem_t * | -sem | ) | -- |
Invalidate a semaphore so that sys_sem_valid() returns 0. ATTENTION: This does NOT mean that the semaphore shall be deallocated: sys_sem_free() is always called before calling this function! This may also be a define, in which case the function is not prototyped.
- -void sys_sem_signal | -( | -sys_sem_t * | -sem | ) | -- |
Signals a semaphore
sem | the semaphore to signal |
int sys_sem_valid | -( | -sys_sem_t * | -sem | ) | -- |
Returns 1 if the semaphore is valid, 0 if it is not valid. When using pointers, a simple way is to check the pointer for != NULL. When directly using OS structures, implementing this may be more complex. This may also be a define, in which case the function is not prototyped.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
u32_t | sys_now (void) |
u32_t sys_now | -( | -void | -) | -- |
Returns the current time in milliseconds, may be the same as sys_jiffies or at least based on it. Don't care for wraparound, this is only used for time diffs. Not implementing this function means you cannot use some modules (e.g. TCP timestamps, internal timeouts for NO_SYS==1).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
ext arguments | |
-Macros | |
#define | tcp_mss(pcb) ((pcb)->mss) |
#define | tcp_sndbuf(pcb) (TCPWND16((pcb)->snd_buf)) |
#define | tcp_sndqueuelen(pcb) ((pcb)->snd_queuelen) |
#define | tcp_nagle_disable(pcb) tcp_set_flags(pcb, TF_NODELAY) |
#define | tcp_nagle_enable(pcb) tcp_clear_flags(pcb, TF_NODELAY) |
#define | tcp_nagle_disabled(pcb) tcp_is_flag_set(pcb, TF_NODELAY) |
#define | tcp_listen(pcb) tcp_listen_with_backlog(pcb, TCP_DEFAULT_LISTEN_BACKLOG) |
-Functions | |
void | tcp_backlog_delayed (struct tcp_pcb *pcb) |
void | tcp_backlog_accepted (struct tcp_pcb *pcb) |
err_t | tcp_close (struct tcp_pcb *pcb) |
err_t | tcp_shutdown (struct tcp_pcb *pcb, int shut_rx, int shut_tx) |
void | tcp_abort (struct tcp_pcb *pcb) |
err_t | tcp_bind (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) |
void | tcp_bind_netif (struct tcp_pcb *pcb, const struct netif *netif) |
struct tcp_pcb * | tcp_listen_with_backlog (struct tcp_pcb *pcb, u8_t backlog) |
struct tcp_pcb * | tcp_listen_with_backlog_and_err (struct tcp_pcb *pcb, u8_t backlog, err_t *err) |
void | tcp_recved (struct tcp_pcb *pcb, u16_t len) |
err_t | tcp_connect (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port, tcp_connected_fn connected) |
struct tcp_pcb * | tcp_new (void) |
struct tcp_pcb * | tcp_new_ip_type (u8_t type) |
void | tcp_arg (struct tcp_pcb *pcb, void *arg) |
void | tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv) |
void | tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent) |
void | tcp_err (struct tcp_pcb *pcb, tcp_err_fn err) |
void | tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept) |
void | tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval) |
err_t | tcp_write (struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags) |
err_t | tcp_output (struct tcp_pcb *pcb) |
Transmission Control Protocol for IP
-
Common functions for the TCP implementation, such as functions for manipulating the data structures and the TCP timer functions. TCP functions related to input and output is found in tcp_in.c and tcp_out.c respectively.
-
The functions used for setting up connections is similar to that of the sequential API and of the BSD socket API. A new TCP connection identifier (i.e., a protocol control block - PCB) is created with the tcp_new() function. This PCB can then be either set to listen for new incoming connections or be explicitly connected to another host.
-TCP data is sent by enqueueing the data with a call to tcp_write() and triggering to send by calling tcp_output(). When the data is successfully transmitted to the remote host, the application will be notified with a call to a specified callback function.
-TCP data reception is callback based - an application specified callback function is called when new data arrives. When the application has taken the data, it has to call the tcp_recved() function to indicate that TCP can advertise increase the receive window.
-When a connection is idle (i.e., no data is either transmitted or received), lwIP will repeatedly poll the application by calling a specified callback function. This can be used either as a watchdog timer for killing connections that have stayed idle for too long, or as a method of waiting for memory to become available. For instance, if a call to tcp_write() has failed because memory wasn't available, the application may use the polling functionality to call tcp_write() again when the connection has been idle for a while.
#define tcp_listen | -( | -- | pcb | ) | -tcp_listen_with_backlog(pcb, TCP_DEFAULT_LISTEN_BACKLOG) | -
#define tcp_mss | -( | -- | pcb | ) | -((pcb)->mss) | -
#define tcp_nagle_disable | -( | -- | pcb | ) | -tcp_set_flags(pcb, TF_NODELAY) | -
#define tcp_nagle_disabled | -( | -- | pcb | ) | -tcp_is_flag_set(pcb, TF_NODELAY) | -
#define tcp_nagle_enable | -( | -- | pcb | ) | -tcp_clear_flags(pcb, TF_NODELAY) | -
#define tcp_sndbuf | -( | -- | pcb | ) | -(TCPWND16((pcb)->snd_buf)) | -
#define tcp_sndqueuelen | -( | -- | pcb | ) | -((pcb)->snd_queuelen) | -
void tcp_abort | -( | -struct tcp_pcb * | -pcb | ) | -- |
Aborts the connection by sending a RST (reset) segment to the remote host. The pcb is deallocated. This function never fails.
-ATTENTION: When calling this from one of the TCP callbacks, make sure you always return ERR_ABRT (and never return ERR_ABRT otherwise or you will risk accessing deallocated memory or memory leaks!
-pcb | the tcp pcb to abort |
void tcp_accept | -( | -struct tcp_pcb * | -pcb, | -
- | - | tcp_accept_fn | -accept | -
- | ) | -- |
Used for specifying the function that should be called when a LISTENing connection has been connected to another host.
-pcb | tcp_pcb to set the accept callback |
accept | callback function to call for this pcb when LISTENing connection has been connected to another host |
void tcp_arg | -( | -struct tcp_pcb * | -pcb, | -
- | - | void * | -arg | -
- | ) | -- |
Specifies the program specific state that should be passed to all other callback functions. The "pcb" argument is the current TCP connection control block, and the "arg" argument is the argument that will be passed to the callbacks.
-pcb | tcp_pcb to set the callback argument |
arg | void pointer argument to pass to callback functions |
void tcp_backlog_accepted | -( | -struct tcp_pcb * | -pcb | ) | -- |
A delayed-accept a connection is accepted (or closed/aborted): decreases the number of outstanding connections after calling tcp_backlog_delayed().
-ATTENTION: the caller is responsible for calling tcp_backlog_accepted() or else the backlog feature will get out of sync!
-pcb | the connection pcb which is now fully accepted (or closed/aborted) |
void tcp_backlog_delayed | -( | -struct tcp_pcb * | -pcb | ) | -- |
Delay accepting a connection in respect to the listen backlog: the number of outstanding connections is increased until tcp_backlog_accepted() is called.
-ATTENTION: the caller is responsible for calling tcp_backlog_accepted() or else the backlog feature will get out of sync!
-pcb | the connection pcb which is not fully accepted yet |
err_t tcp_bind | -( | -struct tcp_pcb * | -pcb, | -
- | - | const ip_addr_t * | -ipaddr, | -
- | - | u16_t | -port | -
- | ) | -- |
Binds the connection to a local port number and IP address. If the IP address is not given (i.e., ipaddr == IP_ANY_TYPE), the connection is bound to all local IP addresses. If another connection is bound to the same port, the function will return ERR_USE, otherwise ERR_OK is returned.
-pcb | the tcp_pcb to bind (no check is done whether this pcb is already bound!) |
ipaddr | the local ip address to bind to (use IPx_ADDR_ANY to bind to any local address |
port | the local port to bind to |
void tcp_bind_netif | -( | -struct tcp_pcb * | -pcb, | -
- | - | const struct netif * | -netif | -
- | ) | -- |
Binds the connection to a netif and IP address. After calling this function, all packets received via this PCB are guaranteed to have come in via the specified netif, and all outgoing packets will go out via the specified netif.
-pcb | the tcp_pcb to bind. |
netif | the netif to bind to. Can be NULL. |
Closes the connection held by the PCB.
-Listening pcbs are freed and may not be referenced any more. Connection pcbs are freed if not yet connected and may not be referenced any more. If a connection is established (at least SYN received or in a closing state), the connection is closed, and put in a closing state. The pcb is then automatically freed in tcp_slowtmr(). It is therefore unsafe to reference it (unless an error is returned).
-The function may return ERR_MEM if no memory was available for closing the connection. If so, the application should wait and try again either by using the acknowledgment callback or the polling functionality. If the close succeeds, the function returns ERR_OK.
-pcb | the tcp_pcb to close |
err_t tcp_connect | -( | -struct tcp_pcb * | -pcb, | -
- | - | const ip_addr_t * | -ipaddr, | -
- | - | u16_t | -port, | -
- | - | tcp_connected_fn | -connected | -
- | ) | -- |
Connects to another host. The function given as the "connected" argument will be called when the connection has been established. Sets up the pcb to connect to the remote host and sends the initial SYN segment which opens the connection.
-The tcp_connect() function returns immediately; it does not wait for the connection to be properly setup. Instead, it will call the function specified as the fourth argument (the "connected" argument) when the connection is established. If the connection could not be properly established, either because the other host refused the connection or because the other host didn't answer, the "err" callback function of this pcb (registered with tcp_err, see below) will be called.
-The tcp_connect() function can return ERR_MEM if no memory is available for enqueueing the SYN segment. If the SYN indeed was enqueued successfully, the tcp_connect() function returns ERR_OK.
-pcb | the tcp_pcb used to establish the connection |
ipaddr | the remote ip address to connect to |
port | the remote tcp port to connect to |
connected | callback function to call when connected (on error, the err calback will be called) |
void tcp_err | -( | -struct tcp_pcb * | -pcb, | -
- | - | tcp_err_fn | -err | -
- | ) | -- |
Used to specify the function that should be called when a fatal error has occurred on the connection.
-If a connection is aborted because of an error, the application is alerted of this event by the err callback. Errors that might abort a connection are when there is a shortage of memory. The callback function to be called is set using the tcp_err() function.
-pcb | tcp_pcb to set the err callback |
err | callback function to call for this pcb when a fatal error has occurred on the connection |
struct tcp_pcb* tcp_listen_with_backlog | -( | -struct tcp_pcb * | -pcb, | -
- | - | u8_t | -backlog | -
- | ) | -- |
Set the state of the connection to be LISTEN, which means that it is able to accept incoming connections. The protocol control block is reallocated in order to consume less memory. Setting the connection to LISTEN is an irreversible process. When an incoming connection is accepted, the function specified with the tcp_accept() function will be called. The pcb has to be bound to a local port with the tcp_bind() function.
-The tcp_listen() function returns a new connection identifier, and the one passed as an argument to the function will be deallocated. The reason for this behavior is that less memory is needed for a connection that is listening, so tcp_listen() will reclaim the memory needed for the original connection and allocate a new smaller memory block for the listening connection.
-tcp_listen() may return NULL if no memory was available for the listening connection. If so, the memory associated with the pcb passed as an argument to tcp_listen() will not be deallocated.
-The backlog limits the number of outstanding connections in the listen queue to the value specified by the backlog argument. To use it, your need to set TCP_LISTEN_BACKLOG=1 in your lwipopts.h.
-pcb | the original tcp_pcb |
backlog | the incoming connections queue limit |
struct tcp_pcb* tcp_listen_with_backlog_and_err | -( | -struct tcp_pcb * | -pcb, | -
- | - | u8_t | -backlog, | -
- | - | err_t * | -err | -
- | ) | -- |
Set the state of the connection to be LISTEN, which means that it is able to accept incoming connections. The protocol control block is reallocated in order to consume less memory. Setting the connection to LISTEN is an irreversible process.
-pcb | the original tcp_pcb |
backlog | the incoming connections queue limit |
err | when NULL is returned, this contains the error reason |
struct tcp_pcb* tcp_new | -( | -void | -) | -- |
Creates a new TCP protocol control block but doesn't place it on any of the TCP PCB lists. The pcb is not put on any list until binding using tcp_bind(). If memory is not available for creating the new pcb, NULL is returned.
- -struct tcp_pcb* tcp_new_ip_type | -( | -u8_t | -type | ) | -- |
Creates a new TCP protocol control block but doesn't place it on any of the TCP PCB lists. The pcb is not put on any list until binding using tcp_bind().
-type | IP address type, see lwip_ip_addr_type definitions. If you want to listen to IPv4 and IPv6 (dual-stack) connections, supply IPADDR_TYPE_ANY as argument and bind to IP_ANY_TYPE. |
Find out what we can send and send it
-pcb | Protocol control block for the TCP connection to send data |
void tcp_poll | -( | -struct tcp_pcb * | -pcb, | -
- | - | tcp_poll_fn | -poll, | -
- | - | u8_t | -interval | -
- | ) | -- |
Specifies the polling interval and the callback function that should be called to poll the application. The interval is specified in number of TCP coarse grained timer shots, which typically occurs twice a second. An interval of 10 means that the application would be polled every 5 seconds.
-When a connection is idle (i.e., no data is either transmitted or received), lwIP will repeatedly poll the application by calling a specified callback function. This can be used either as a watchdog timer for killing connections that have stayed idle for too long, or as a method of waiting for memory to become available. For instance, if a call to tcp_write() has failed because memory wasn't available, the application may use the polling functionality to call tcp_write() again when the connection has been idle for a while.
- -void tcp_recv | -( | -struct tcp_pcb * | -pcb, | -
- | - | tcp_recv_fn | -recv | -
- | ) | -- |
Sets the callback function that will be called when new data arrives. The callback function will be passed a NULL pbuf to indicate that the remote host has closed the connection. If the callback function returns ERR_OK or ERR_ABRT it must have freed the pbuf, otherwise it must not have freed it.
-pcb | tcp_pcb to set the recv callback |
recv | callback function to call for this pcb when data is received |
void tcp_recved | -( | -struct tcp_pcb * | -pcb, | -
- | - | u16_t | -len | -
- | ) | -- |
This function should be called by the application when it has processed the data. The purpose is to advertise a larger window when the data has been processed.
-pcb | the tcp_pcb for which data is read |
len | the amount of bytes that have been read by the application |
void tcp_sent | -( | -struct tcp_pcb * | -pcb, | -
- | - | tcp_sent_fn | -sent | -
- | ) | -- |
Specifies the callback function that should be called when data has successfully been received (i.e., acknowledged) by the remote host. The len argument passed to the callback function gives the amount bytes that was acknowledged by the last acknowledgment.
-pcb | tcp_pcb to set the sent callback |
sent | callback function to call for this pcb when data is successfully sent |
err_t tcp_shutdown | -( | -struct tcp_pcb * | -pcb, | -
- | - | int | -shut_rx, | -
- | - | int | -shut_tx | -
- | ) | -- |
Causes all or part of a full-duplex connection of this PCB to be shut down. This doesn't deallocate the PCB unless shutting down both sides! Shutting down both sides is the same as calling tcp_close, so if it succeds (i.e. returns ER_OK), the PCB must not be referenced any more!
-pcb | PCB to shutdown |
shut_rx | shut down receive side if this is != 0 |
shut_tx | shut down send side if this is != 0 |
err_t tcp_write | -( | -struct tcp_pcb * | -pcb, | -
- | - | const void * | -arg, | -
- | - | u16_t | -len, | -
- | - | u8_t | -apiflags | -
- | ) | -- |
Write data for sending (but does not send it immediately).
-It waits in the expectation of more data being sent soon (as it can send them more efficiently by combining them together). To prompt the system to send data now, call tcp_output() after calling tcp_write().
-This function enqueues the data pointed to by the argument dataptr. The length of the data is passed as the len parameter. The apiflags can be one or more of:
The tcp_write() function will fail and return ERR_MEM if the length of the data exceeds the current send buffer size or if the length of the queue of outgoing segment is larger than the upper limit defined in lwipopts.h. The number of bytes available in the output queue can be retrieved with the tcp_sndbuf() function.
-The proper way to use this function is to call the function with at most tcp_sndbuf() bytes of data. If the function returns ERR_MEM, the application should wait until some of the currently enqueued data has been successfully received by the other host and try again.
-pcb | Protocol control block for the TCP connection to enqueue data for. |
arg | Pointer to the data to be enqueued for sending. |
len | Data length in bytes |
apiflags | combination of following flags :
|
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
u8_t | tcp_ext_arg_alloc_id (void) |
void | tcp_ext_arg_set_callbacks (struct tcp_pcb *pcb, uint8_t id, const struct tcp_ext_arg_callbacks *const callbacks) |
void | tcp_ext_arg_set (struct tcp_pcb *pcb, uint8_t id, void *arg) |
void * | tcp_ext_arg_get (const struct tcp_pcb *pcb, uint8_t id) |
Additional data storage per tcp pcb
-
When LWIP_TCP_PCB_NUM_EXT_ARGS is > 0, every tcp pcb (including listen pcb) includes a number of additional argument entries in an array.
-To support memory management, in addition to a 'void *', callbacks can be provided to manage transition from listening pcbs to connections and to deallocate memory when a pcb is deallocated (see struct tcp_ext_arg_callbacks).
-After allocating this index, use tcp_ext_arg_set and tcp_ext_arg_get to store and load arguments from this index for a given pcb.
-u8_t tcp_ext_arg_alloc_id | -( | -void | -) | -- |
Allocate an index to store data in ext_args member of struct tcp_pcb. Returned value is an index in mentioned array. The index is global over all pcbs!
-When LWIP_TCP_PCB_NUM_EXT_ARGS is > 0, every tcp pcb (including listen pcb) includes a number of additional argument entries in an array.
-To support memory management, in addition to a 'void *', callbacks can be provided to manage transition from listening pcbs to connections and to deallocate memory when a pcb is deallocated (see struct tcp_ext_arg_callbacks).
-After allocating this index, use tcp_ext_arg_set and tcp_ext_arg_get to store and load arguments from this index for a given pcb.
-void* tcp_ext_arg_get | -( | -const struct tcp_pcb * | -pcb, | -
- | - | uint8_t | -id | -
- | ) | -- |
Set data for a given index of ext_args on the specified pcb.
-pcb | tcp_pcb for which to set the data |
id | ext_args index to set (allocated via tcp_ext_arg_alloc_id) |
void tcp_ext_arg_set | -( | -struct tcp_pcb * | -pcb, | -
- | - | uint8_t | -id, | -
- | - | void * | -arg | -
- | ) | -- |
Set data for a given index of ext_args on the specified pcb.
-pcb | tcp_pcb for which to set the data |
id | ext_args index to set (allocated via tcp_ext_arg_alloc_id) |
arg | data pointer to set |
void tcp_ext_arg_set_callbacks | -( | -struct tcp_pcb * | -pcb, | -
- | - | uint8_t | -id, | -
- | - | const struct tcp_ext_arg_callbacks *const | -callbacks | -
- | ) | -- |
Set callbacks for a given index of ext_args on the specified pcb.
-pcb | tcp_pcb for which to set the callback |
id | ext_args index to set (allocated via tcp_ext_arg_alloc_id) |
callbacks | callback table (const since it is referenced, not copied!) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Modules | |
Options | |
-Data Structures | |
struct | tftp_context |
-Functions | |
err_t | tftp_init (const struct tftp_context *ctx) |
void | tftp_cleanup (void) |
This is simple TFTP server for the lwIP raw API.
-void tftp_cleanup | -( | -void | -) | -- |
Deinitialize ("turn off") TFTP server.
- -err_t tftp_init | -( | -const struct tftp_context * | -ctx | ) | -- |
Initialize TFTP server.
ctx | TFTP callback struct |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | TFTP_DEBUG LWIP_DBG_OFF |
#define | TFTP_PORT LWIP_IANA_PORT_TFTP |
#define | TFTP_TIMEOUT_MSECS 10000 |
#define | TFTP_MAX_RETRIES 5 |
#define | TFTP_TIMER_MSECS (TFTP_TIMEOUT_MSECS / 10) |
#define | TFTP_MAX_FILENAME_LEN 20 |
#define | TFTP_MAX_MODE_LEN 7 |
#define TFTP_DEBUG LWIP_DBG_OFF | -
Enable TFTP debug messages
- -#define TFTP_MAX_FILENAME_LEN 20 | -
Max. length of TFTP filename
- -#define TFTP_MAX_MODE_LEN 7 | -
Max. length of TFTP mode
- -#define TFTP_MAX_RETRIES 5 | -
Max. number of retries when a file is read from server
- -#define TFTP_PORT LWIP_IANA_PORT_TFTP | -
TFTP server port
- -#define TFTP_TIMEOUT_MSECS 10000 | -
TFTP timeout
- -#define TFTP_TIMER_MSECS (TFTP_TIMEOUT_MSECS / 10) | -
TFTP timer cyclic interval
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | udp_send (struct udp_pcb *pcb, struct pbuf *p) |
err_t | udp_sendto (struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, u16_t dst_port) |
err_t | udp_sendto_if (struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif) |
err_t | udp_sendto_if_src (struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif, const ip_addr_t *src_ip) |
err_t | udp_bind (struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) |
void | udp_bind_netif (struct udp_pcb *pcb, const struct netif *netif) |
err_t | udp_connect (struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) |
void | udp_disconnect (struct udp_pcb *pcb) |
void | udp_recv (struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg) |
void | udp_remove (struct udp_pcb *pcb) |
struct udp_pcb * | udp_new (void) |
struct udp_pcb * | udp_new_ip_type (u8_t type) |
User Datagram Protocol module
-
err_t udp_bind | -( | -struct udp_pcb * | -pcb, | -
- | - | const ip_addr_t * | -ipaddr, | -
- | - | u16_t | -port | -
- | ) | -- |
Bind an UDP PCB.
-pcb | UDP PCB to be bound with a local address ipaddr and port. |
ipaddr | local IP address to bind with. Use IP_ANY_TYPE to bind to all local interfaces. |
port | local UDP port to bind with. Use 0 to automatically bind to a random port between UDP_LOCAL_PORT_RANGE_START and UDP_LOCAL_PORT_RANGE_END. |
ipaddr & port are expected to be in the same byte order as in the pcb.
-void udp_bind_netif | -( | -struct udp_pcb * | -pcb, | -
- | - | const struct netif * | -netif | -
- | ) | -- |
Bind an UDP PCB to a specific netif. After calling this function, all packets received via this PCB are guaranteed to have come in via the specified netif, and all outgoing packets will go out via the specified netif.
-pcb | UDP PCB to be bound. |
netif | netif to bind udp pcb to. Can be NULL. |
err_t udp_connect | -( | -struct udp_pcb * | -pcb, | -
- | - | const ip_addr_t * | -ipaddr, | -
- | - | u16_t | -port | -
- | ) | -- |
Sets the remote end of the pcb. This function does not generate any network traffic, but only sets the remote address of the pcb.
-pcb | UDP PCB to be connected with remote address ipaddr and port. |
ipaddr | remote IP address to connect with. |
port | remote UDP port to connect with. |
ipaddr & port are expected to be in the same byte order as in the pcb.
-The udp pcb is bound to a random local port if not already bound.
-void udp_disconnect | -( | -struct udp_pcb * | -pcb | ) | -- |
Remove the remote end of the pcb. This function does not generate any network traffic, but only removes the remote address of the pcb.
-pcb | the udp pcb to disconnect. |
struct udp_pcb* udp_new | -( | -void | -) | -- |
Creates a new UDP pcb which can be used for UDP communication. The pcb is not active until it has either been bound to a local address or connected to a remote address.
-struct udp_pcb* udp_new_ip_type | -( | -u8_t | -type | ) | -- |
Create a UDP PCB for specific IP type. The pcb is not active until it has either been bound to a local address or connected to a remote address.
-type | IP address type, see lwip_ip_addr_type definitions. If you want to listen to IPv4 and IPv6 (dual-stack) packets, supply IPADDR_TYPE_ANY as argument and bind to IP_ANY_TYPE. |
void udp_recv | -( | -struct udp_pcb * | -pcb, | -
- | - | udp_recv_fn | -recv, | -
- | - | void * | -recv_arg | -
- | ) | -- |
Set a receive callback for a UDP PCB. This callback will be called when receiving a datagram for the pcb.
-pcb | the pcb for which to set the recv callback |
recv | function pointer of the callback function |
recv_arg | additional argument to pass to the callback function |
void udp_remove | -( | -struct udp_pcb * | -pcb | ) | -- |
Removes and deallocates the pcb.
-pcb | UDP PCB to be removed. The PCB is removed from the list of UDP PCB's and the data structure is freed from memory. |
Sends the pbuf p using UDP. The pbuf is not deallocated.
-pcb | UDP PCB used to send the data. |
p | chain of pbuf's to be sent. |
The datagram will be sent to the current remote_ip & remote_port stored in pcb. If the pcb is not bound to a port, it will automatically be bound to a random port.
-err_t udp_sendto | -( | -struct udp_pcb * | -pcb, | -
- | - | struct pbuf * | -p, | -
- | - | const ip_addr_t * | -dst_ip, | -
- | - | u16_t | -dst_port | -
- | ) | -- |
Send data to a specified address using UDP.
-pcb | UDP PCB used to send the data. |
p | chain of pbuf's to be sent. |
dst_ip | Destination IP address. |
dst_port | Destination UDP port. |
dst_ip & dst_port are expected to be in the same byte order as in the pcb.
-If the PCB already has a remote address association, it will be restored after the data is sent.
-err_t udp_sendto_if | -( | -struct udp_pcb * | -pcb, | -
- | - | struct pbuf * | -p, | -
- | - | const ip_addr_t * | -dst_ip, | -
- | - | u16_t | -dst_port, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Send data to a specified address using UDP. The netif used for sending can be specified.
-This function exists mainly for DHCP, to be able to send UDP packets on a netif that is still down.
-pcb | UDP PCB used to send the data. |
p | chain of pbuf's to be sent. |
dst_ip | Destination IP address. |
dst_port | Destination UDP port. |
netif | the netif used for sending. |
dst_ip & dst_port are expected to be in the same byte order as in the pcb.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
err_t | zepif_init (struct netif *netif) |
A netif implementing the ZigBee Encapsulation Protocol (ZEP). This is used to tunnel 6LowPAN over UDP.
-Usage (there must be a default netif before!):
err_t zepif_init | -( | -struct netif * | -netif | ) | -- |
Set up a raw 6LowPAN netif and surround it with input- and output functions for ZEP
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/apps/http_client.h"
#include "lwip/altcp_tcp.h"
#include "lwip/dns.h"
#include "lwip/debug.h"
#include "lwip/mem.h"
#include "lwip/altcp_tls.h"
#include "lwip/init.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-Macros | |
#define | HTTPC_DEBUG LWIP_DBG_OFF |
#define | HTTPC_DEBUG_REQUEST 0 |
#define | HTTPC_CLIENT_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" |
-Functions | |
err_t | httpc_get_file (const ip_addr_t *server_addr, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection) |
err_t | httpc_get_file_dns (const char *server_name, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection) |
HTTP client
-#define HTTPC_CLIENT_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" | -
This string is passed in the HTTP header as "User-Agent: "
- -#define HTTPC_DEBUG LWIP_DBG_OFF | -
HTTPC_DEBUG: Enable debugging for HTTP client.
- -#define HTTPC_DEBUG_REQUEST 0 | -
Set this to 1 to keep server name and uri in request state
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/ip_addr.h"
#include "lwip/err.h"
#include "lwip/altcp.h"
#include "lwip/prot/iana.h"
#include "lwip/pbuf.h"
-Macros | |
#define | LWIP_HTTPC_HAVE_FILE_IO 0 |
#define | HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP |
-Typedefs | |
typedef enum ehttpc_result | httpc_result_t |
typedef void(* | httpc_result_fn) (void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err) |
typedef err_t(* | httpc_headers_done_fn) (httpc_state_t *connection, void *arg, struct pbuf *hdr, u16_t hdr_len, u32_t content_len) |
-Enumerations | |
enum | ehttpc_result { - HTTPC_RESULT_OK = 0, -HTTPC_RESULT_ERR_UNKNOWN = 1, -HTTPC_RESULT_ERR_CONNECT = 2, -HTTPC_RESULT_ERR_HOSTNAME = 3, - - HTTPC_RESULT_ERR_CLOSED = 4, -HTTPC_RESULT_ERR_TIMEOUT = 5, -HTTPC_RESULT_ERR_SVR_RESP = 6, -HTTPC_RESULT_ERR_MEM = 7, - - HTTPC_RESULT_LOCAL_ABORT = 8, -HTTPC_RESULT_ERR_CONTENT_LEN = 9 - - } |
-Functions | |
err_t | httpc_get_file (const ip_addr_t *server_addr, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection) |
err_t | httpc_get_file_dns (const char *server_name, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection) |
HTTP client
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/init.h"
#include "lwip/apps/httpd.h"
#include "lwip/debug.h"
#include "lwip/stats.h"
#include "lwip/apps/fs.h"
#include "httpd_structs.h"
#include "lwip/def.h"
#include "lwip/altcp.h"
#include "lwip/altcp_tcp.h"
#include "lwip/altcp_tls.h"
#include "path/to/my/lwip_hooks.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-Macros | |
#define | MIN_REQ_LEN 7 |
#define | HTTP_IS_DATA_VOLATILE(hs) (HTTP_IS_DYNAMIC_FILE(hs) ? TCP_WRITE_FLAG_COPY : 0) |
#define | HTTP_IS_HDR_VOLATILE(hs, ptr) 0 |
-Functions | |
void | httpd_post_data_recved (void *connection, u16_t recved_len) |
void | httpd_init (void) |
void | httpd_inits (struct altcp_tls_config *conf) |
void | http_set_ssi_handler (tSSIHandler ssi_handler, const char **tags, int num_tags) |
void | http_set_cgi_handlers (const tCGI *cgis, int num_handlers) |
LWIP HTTP server implementation
-#define HTTP_IS_DATA_VOLATILE | -( | -- | hs | ) | -(HTTP_IS_DYNAMIC_FILE(hs) ? TCP_WRITE_FLAG_COPY : 0) | -
tcp_write does not have to copy data when sent from rom-file-system directly
- -#define HTTP_IS_HDR_VOLATILE | -( | -- | hs, | -
- | - | - | ptr | -
- | ) | -0 | -
Default: dynamic headers are sent from ROM (non-dynamic headers are handled like file data)
- -#define MIN_REQ_LEN 7 | -
Minimum length for a valid HTTP/0.9 request: "GET /\r\n" -> 7 bytes
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | tCGI |
-Macros | |
#define | HTTPD_SSI_TAG_UNKNOWN 0xFFFF |
-Typedefs | |
typedef const char *(* | tCGIHandler) (int iIndex, int iNumParams, char *pcParam[], char *pcValue[]) |
typedef u16_t(* | tSSIHandler) (const char *ssi_tag_name, char *pcInsert, int iInsertLen) |
-Functions | |
void | http_set_cgi_handlers (const tCGI *pCGIs, int iNumHandlers) |
void | http_set_ssi_handler (tSSIHandler pfnSSIHandler, const char **ppcTags, int iNumTags) |
err_t | httpd_post_begin (void *connection, const char *uri, const char *http_request, u16_t http_request_len, int content_len, char *response_uri, u16_t response_uri_len, u8_t *post_auto_wnd) |
err_t | httpd_post_receive_data (void *connection, struct pbuf *p) |
void | httpd_post_finished (void *connection, char *response_uri, u16_t response_uri_len) |
void | httpd_post_data_recved (void *connection, u16_t recved_len) |
void | httpd_init (void) |
void | httpd_inits (struct altcp_tls_config *conf) |
HTTP server
-#define HTTPD_SSI_TAG_UNKNOWN 0xFFFF | -
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.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | LWIP_HTTPD_CGI 0 |
#define | LWIP_HTTPD_CGI_SSI 0 |
#define | LWIP_HTTPD_SSI 0 |
#define | LWIP_HTTPD_SSI_RAW 0 |
#define | LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1 |
#define | LWIP_HTTPD_SUPPORT_POST 0 |
#define | LWIP_HTTPD_SSI_MULTIPART 0 |
#define | HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" |
#define | LWIP_HTTPD_DYNAMIC_HEADERS 0 |
#define | HTTPD_USE_MEM_POOL 0 |
#define | HTTPD_SERVER_PORT LWIP_IANA_PORT_HTTP |
#define | HTTPD_SERVER_PORT_HTTPS LWIP_IANA_PORT_HTTPS |
#define | HTTPD_ENABLE_HTTPS 0 |
#define | HTTPD_MAX_RETRIES 4 |
#define | HTTPD_POLL_INTERVAL 4 |
#define | HTTPD_TCP_PRIO TCP_PRIO_MIN |
#define | LWIP_HTTPD_TIMING 0 |
#define | HTTPD_DEBUG_TIMING LWIP_DBG_OFF |
#define | LWIP_HTTPD_SUPPORT_EXTSTATUS 0 |
#define | LWIP_HTTPD_SUPPORT_V09 1 |
#define | LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0 |
#define | LWIP_HTTPD_SUPPORT_REQUESTLIST 1 |
#define | LWIP_HTTPD_REQ_QUEUELEN 5 |
#define | LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH |
#define | LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE)) |
#define | LWIP_HTTPD_MAX_REQUEST_URI_LEN 63 |
#define | LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63 |
#define | LWIP_HTTPD_SSI_INCLUDE_TAG 1 |
#define | LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0 |
#define | LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0 |
#define | LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0 |
#define | HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY |
#define | LWIP_HTTPD_CUSTOM_FILES 0 |
#define | LWIP_HTTPD_DYNAMIC_FILE_READ 0 |
#define | LWIP_HTTPD_FILE_STATE 0 |
#define | HTTPD_PRECALCULATED_CHECKSUM 0 |
#define | LWIP_HTTPD_FS_ASYNC_READ 0 |
#define | HTTPD_FSDATA_FILE "fsdata.c" |
HTTP server options list
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Enumerations | |
enum | lwip_iana_hwtype { LWIP_IANA_HWTYPE_ETHERNET = 1 - } |
enum | lwip_iana_port_number { - LWIP_IANA_PORT_SMTP = 25, -LWIP_IANA_PORT_DHCP_SERVER = 67, -LWIP_IANA_PORT_DHCP_CLIENT = 68, -LWIP_IANA_PORT_TFTP = 69, - - LWIP_IANA_PORT_HTTP = 80, -LWIP_IANA_PORT_SNTP = 123, -LWIP_IANA_PORT_NETBIOS = 137, -LWIP_IANA_PORT_SNMP = 161, - - LWIP_IANA_PORT_SNMP_TRAP = 162, -LWIP_IANA_PORT_HTTPS = 443, -LWIP_IANA_PORT_SMTPS = 465, -LWIP_IANA_PORT_MQTT = 1883, - - LWIP_IANA_PORT_MDNS = 5353, -LWIP_IANA_PORT_SECURE_MQTT = 8883 - - } |
IANA assigned numbers (RFC 1700 and successors)
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/icmp6.h"
#include "lwip/prot/icmp6.h"
#include "lwip/ip6.h"
#include "lwip/ip6_addr.h"
#include "lwip/inet_chksum.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#include "lwip/nd6.h"
#include "lwip/mld6.h"
#include "lwip/ip.h"
#include "lwip/stats.h"
#include <string.h>
-Functions | |
void | icmp6_input (struct pbuf *p, struct netif *inp) |
void | icmp6_dest_unreach (struct pbuf *p, enum icmp6_dur_code c) |
void | icmp6_packet_too_big (struct pbuf *p, u32_t mtu) |
void | icmp6_time_exceeded (struct pbuf *p, enum icmp6_te_code c) |
void | icmp6_time_exceeded_with_addrs (struct pbuf *p, enum icmp6_te_code c, const ip6_addr_t *src_addr, const ip6_addr_t *dest_addr) |
void | icmp6_param_problem (struct pbuf *p, enum icmp6_pp_code c, const void *pointer) |
IPv6 version of ICMP, as per RFC 4443.
-void icmp6_dest_unreach | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_dur_code | -c | -
- | ) | -- |
Send an icmpv6 'destination unreachable' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.
-p | the input packet for which the 'unreachable' should be sent, p->payload pointing to the IPv6 header |
c | ICMPv6 code for the unreachable type |
Process an input ICMPv6 message. Called by ip6_input.
-Will generate a reply for echo requests. Other messages are forwarded to nd6_input, or mld6_input.
-p | the mld packet, p->payload pointing to the icmpv6 header |
inp | the netif on which this packet was received |
void icmp6_packet_too_big | -( | -struct pbuf * | -p, | -
- | - | u32_t | -mtu | -
- | ) | -- |
Send an icmpv6 'packet too big' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.
-p | the input packet for which the 'packet too big' should be sent, p->payload pointing to the IPv6 header |
mtu | the maximum mtu that we can accept |
void icmp6_param_problem | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_pp_code | -c, | -
- | - | const void * | -pointer | -
- | ) | -- |
Send an icmpv6 'parameter problem' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost and the calculated offset would be wrong (calculated against ip6_current_header()).
-p | the input packet for which the 'param problem' should be sent, p->payload pointing to the IP header |
c | ICMPv6 code for the param problem type |
pointer | the pointer to the byte where the parameter is found |
void icmp6_time_exceeded | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_te_code | -c | -
- | ) | -- |
Send an icmpv6 'time exceeded' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.
-p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IPv6 header |
c | ICMPv6 code for the time exceeded type |
void icmp6_time_exceeded_with_addrs | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_te_code | -c, | -
- | - | const ip6_addr_t * | -src_addr, | -
- | - | const ip6_addr_t * | -dest_addr | -
- | ) | -- |
Send an icmpv6 'time exceeded' packet, with explicit source and destination addresses.
-This function may be used to send a response sometime after receiving the packet for which this response is meant. The provided source and destination addresses are used primarily to retain their zone information.
-p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IPv6 header |
c | ICMPv6 code for the time exceeded type |
src_addr | source address of the original packet, with zone information |
dest_addr | destination address of the original packet, with zone information |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip6_addr.h"
#include "lwip/netif.h"
#include "lwip/prot/icmp6.h"
-Functions | |
void | icmp6_input (struct pbuf *p, struct netif *inp) |
void | icmp6_dest_unreach (struct pbuf *p, enum icmp6_dur_code c) |
void | icmp6_packet_too_big (struct pbuf *p, u32_t mtu) |
void | icmp6_time_exceeded (struct pbuf *p, enum icmp6_te_code c) |
void | icmp6_time_exceeded_with_addrs (struct pbuf *p, enum icmp6_te_code c, const ip6_addr_t *src_addr, const ip6_addr_t *dest_addr) |
void | icmp6_param_problem (struct pbuf *p, enum icmp6_pp_code c, const void *pointer) |
IPv6 version of ICMP, as per RFC 4443.
-void icmp6_dest_unreach | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_dur_code | -c | -
- | ) | -- |
Send an icmpv6 'destination unreachable' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.
-p | the input packet for which the 'unreachable' should be sent, p->payload pointing to the IPv6 header |
c | ICMPv6 code for the unreachable type |
Process an input ICMPv6 message. Called by ip6_input.
-Will generate a reply for echo requests. Other messages are forwarded to nd6_input, or mld6_input.
-p | the mld packet, p->payload pointing to the icmpv6 header |
inp | the netif on which this packet was received |
void icmp6_packet_too_big | -( | -struct pbuf * | -p, | -
- | - | u32_t | -mtu | -
- | ) | -- |
Send an icmpv6 'packet too big' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.
-p | the input packet for which the 'packet too big' should be sent, p->payload pointing to the IPv6 header |
mtu | the maximum mtu that we can accept |
void icmp6_param_problem | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_pp_code | -c, | -
- | - | const void * | -pointer | -
- | ) | -- |
Send an icmpv6 'parameter problem' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost and the calculated offset would be wrong (calculated against ip6_current_header()).
-p | the input packet for which the 'param problem' should be sent, p->payload pointing to the IP header |
c | ICMPv6 code for the param problem type |
pointer | the pointer to the byte where the parameter is found |
void icmp6_time_exceeded | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_te_code | -c | -
- | ) | -- |
Send an icmpv6 'time exceeded' packet.
-This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.
-p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IPv6 header |
c | ICMPv6 code for the time exceeded type |
void icmp6_time_exceeded_with_addrs | -( | -struct pbuf * | -p, | -
- | - | enum icmp6_te_code | -c, | -
- | - | const ip6_addr_t * | -src_addr, | -
- | - | const ip6_addr_t * | -dest_addr | -
- | ) | -- |
Send an icmpv6 'time exceeded' packet, with explicit source and destination addresses.
-This function may be used to send a response sometime after receiving the packet for which this response is meant. The provided source and destination addresses are used primarily to retain their zone information.
-p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IPv6 header |
c | ICMPv6 code for the time exceeded type |
src_addr | source address of the original packet, with zone information |
dest_addr | destination address of the original packet, with zone information |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/icmp.h"
#include "lwip/inet_chksum.h"
#include "lwip/ip.h"
#include "lwip/def.h"
#include "lwip/stats.h"
#include <string.h>
#include "path/to/my/lwip_hooks.h"
-Macros | |
#define | LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN 1 |
-Functions | |
void | icmp_input (struct pbuf *p, struct netif *inp) |
void | icmp_dest_unreach (struct pbuf *p, enum icmp_dur_type t) |
void | icmp_time_exceeded (struct pbuf *p, enum icmp_te_type t) |
ICMP - Internet Control Message Protocol
-#define LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN 1 | -
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)
- -void icmp_dest_unreach | -( | -struct pbuf * | -p, | -
- | - | enum icmp_dur_type | -t | -
- | ) | -- |
Send an icmp 'destination unreachable' packet, called from ip_input() if the transport layer protocol is unknown and from udp_input() if the local port is not bound.
-p | the input packet for which the 'unreachable' should be sent, p->payload pointing to the IP header |
t | type of the 'unreachable' packet |
Processes ICMP input packets, called from ip_input().
-Currently only processes icmp echo requests and sends out the echo response.
-p | the icmp echo request packet, p->payload pointing to the icmp header |
inp | the netif on which this packet was received |
void icmp_time_exceeded | -( | -struct pbuf * | -p, | -
- | - | enum icmp_te_type | -t | -
- | ) | -- |
Send a 'time exceeded' packet, called from ip_forward() if TTL is 0.
-p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IP header |
t | type of the 'time exceeded' packet |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/prot/icmp.h"
#include "lwip/icmp6.h"
-Enumerations | |
enum | icmp_dur_type { - ICMP_DUR_NET = 0, -ICMP_DUR_HOST = 1, -ICMP_DUR_PROTO = 2, -ICMP_DUR_PORT = 3, - - ICMP_DUR_FRAG = 4, -ICMP_DUR_SR = 5 - - } |
enum | icmp_te_type { ICMP_TE_TTL = 0, -ICMP_TE_FRAG = 1 - } |
-Functions | |
void | icmp_input (struct pbuf *p, struct netif *inp) |
void | icmp_dest_unreach (struct pbuf *p, enum icmp_dur_type t) |
void | icmp_time_exceeded (struct pbuf *p, enum icmp_te_type t) |
ICMP API
-enum icmp_dur_type | -
enum icmp_te_type | -
void icmp_dest_unreach | -( | -struct pbuf * | -p, | -
- | - | enum icmp_dur_type | -t | -
- | ) | -- |
Send an icmp 'destination unreachable' packet, called from ip_input() if the transport layer protocol is unknown and from udp_input() if the local port is not bound.
-p | the input packet for which the 'unreachable' should be sent, p->payload pointing to the IP header |
t | type of the 'unreachable' packet |
Processes ICMP input packets, called from ip_input().
-Currently only processes icmp echo requests and sends out the echo response.
-p | the icmp echo request packet, p->payload pointing to the icmp header |
inp | the netif on which this packet was received |
void icmp_time_exceeded | -( | -struct pbuf * | -p, | -
- | - | enum icmp_te_type | -t | -
- | ) | -- |
Send a 'time exceeded' packet, called from ip_forward() if TTL is 0.
-p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IP header |
t | type of the 'time exceeded' packet |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | ieee_802154_hdr |
Definitions for IEEE 802.15.4 MAC frames
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Enumerations | |
enum | lwip_ieee_eth_type { - ETHTYPE_IP = 0x0800U, -ETHTYPE_ARP = 0x0806U, -ETHTYPE_WOL = 0x0842U, -ETHTYPE_RARP = 0x8035U, - - ETHTYPE_VLAN = 0x8100U, -ETHTYPE_IPV6 = 0x86DDU, -ETHTYPE_PPPOEDISC = 0x8863U, -ETHTYPE_PPPOE = 0x8864U, - - ETHTYPE_JUMBO = 0x8870U, -ETHTYPE_PROFINET = 0x8892U, -ETHTYPE_ETHERCAT = 0x88A4U, -ETHTYPE_LLDP = 0x88CCU, - - ETHTYPE_SERCOS = 0x88CDU, -ETHTYPE_MRP = 0x88E3U, -ETHTYPE_PTP = 0x88F7U, -ETHTYPE_QINQ = 0x9100U - - } |
IEEE assigned numbers
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/errno.h"
#include "lwip/if_api.h"
#include "lwip/netifapi.h"
#include "lwip/priv/sockets_priv.h"
-Functions | |
char * | lwip_if_indextoname (unsigned int ifindex, char *ifname) |
unsigned int | lwip_if_nametoindex (const char *ifname) |
Interface Identification APIs from: RFC 3493: Basic Socket Interface Extensions for IPv6 Section 4: Interface Identification
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
char * | lwip_if_indextoname (unsigned int ifindex, char *ifname) |
unsigned int | lwip_if_nametoindex (const char *ifname) |
Interface Identification APIs from: RFC 3493: Basic Socket Interface Extensions for IPv6 Section 4: Interface Identification
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/igmp.h"
#include "lwip/debug.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/ip.h"
#include "lwip/inet_chksum.h"
#include "lwip/netif.h"
#include "lwip/stats.h"
#include "lwip/prot/igmp.h"
#include <string.h>
-Functions | |
void | igmp_init (void) |
err_t | igmp_start (struct netif *netif) |
err_t | igmp_stop (struct netif *netif) |
void | igmp_report_groups (struct netif *netif) |
struct igmp_group * | igmp_lookfor_group (struct netif *ifp, const ip4_addr_t *addr) |
void | igmp_input (struct pbuf *p, struct netif *inp, const ip4_addr_t *dest) |
err_t | igmp_joingroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) |
err_t | igmp_joingroup_netif (struct netif *netif, const ip4_addr_t *groupaddr) |
err_t | igmp_leavegroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) |
err_t | igmp_leavegroup_netif (struct netif *netif, const ip4_addr_t *groupaddr) |
void | igmp_tmr (void) |
IGMP - Internet Group Management Protocol
-void igmp_init | -( | -void | -) | -- |
Initialize the IGMP module
- -void igmp_input | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -inp, | -
- | - | const ip4_addr_t * | -dest | -
- | ) | -- |
Called from ip_input() if a new IGMP packet is received.
-p | received igmp packet, p->payload pointing to the igmp header |
inp | network interface on which the packet was received |
dest | destination ip address of the igmp packet |
struct igmp_group* igmp_lookfor_group | -( | -struct netif * | -ifp, | -
- | - | const ip4_addr_t * | -addr | -
- | ) | -- |
Search for a group in the netif's igmp group list
-ifp | the network interface for which to look |
addr | the group ip address to search for |
void igmp_report_groups | -( | -struct netif * | -netif | ) | -- |
Report IGMP memberships for this interface
-netif | network interface on which report IGMP memberships |
Start IGMP processing on interface
-netif | network interface on which start IGMP processing |
Stop IGMP processing on interface
-netif | network interface on which stop IGMP processing |
void igmp_tmr | -( | -void | -) | -- |
The igmp timer function (both for NO_SYS=1 and =0) Should be called every IGMP_TMR_INTERVAL milliseconds (100 ms is default).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | igmp_group |
-Macros | |
#define | netif_igmp_data(netif) ((struct igmp_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP)) |
-Functions | |
void | igmp_init (void) |
err_t | igmp_start (struct netif *netif) |
err_t | igmp_stop (struct netif *netif) |
void | igmp_report_groups (struct netif *netif) |
struct igmp_group * | igmp_lookfor_group (struct netif *ifp, const ip4_addr_t *addr) |
void | igmp_input (struct pbuf *p, struct netif *inp, const ip4_addr_t *dest) |
err_t | igmp_joingroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) |
err_t | igmp_joingroup_netif (struct netif *netif, const ip4_addr_t *groupaddr) |
err_t | igmp_leavegroup (const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) |
err_t | igmp_leavegroup_netif (struct netif *netif, const ip4_addr_t *groupaddr) |
void | igmp_tmr (void) |
IGMP API
-void igmp_init | -( | -void | -) | -- |
Initialize the IGMP module
- -void igmp_input | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -inp, | -
- | - | const ip4_addr_t * | -dest | -
- | ) | -- |
Called from ip_input() if a new IGMP packet is received.
-p | received igmp packet, p->payload pointing to the igmp header |
inp | network interface on which the packet was received |
dest | destination ip address of the igmp packet |
struct igmp_group* igmp_lookfor_group | -( | -struct netif * | -ifp, | -
- | - | const ip4_addr_t * | -addr | -
- | ) | -- |
Search for a group in the netif's igmp group list
-ifp | the network interface for which to look |
addr | the group ip address to search for |
void igmp_report_groups | -( | -struct netif * | -netif | ) | -- |
Report IGMP memberships for this interface
-netif | network interface on which report IGMP memberships |
Start IGMP processing on interface
-netif | network interface on which start IGMP processing |
Stop IGMP processing on interface
-netif | network interface on which stop IGMP processing |
void igmp_tmr | -( | -void | -) | -- |
The igmp timer function (both for NO_SYS=1 and =0) Should be called every IGMP_TMR_INTERVAL milliseconds (100 ms is default).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
INTRODUCTION - -lwIP is a small independent implementation of the TCP/IP protocol suite. - -The focus of the lwIP TCP/IP implementation is to reduce the RAM usage -while still having a full scale TCP. This making lwIP suitable for use -in embedded systems with tens of kilobytes of free RAM and room for -around 40 kilobytes of code ROM. - -lwIP was originally developed by Adam Dunkels at the Computer and Networks -Architectures (CNA) lab at the Swedish Institute of Computer Science (SICS) -and is now developed and maintained by a worldwide network of developers. - -FEATURES - - * IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over - multiple network interfaces - * ICMP (Internet Control Message Protocol) for network maintenance and debugging - * IGMP (Internet Group Management Protocol) for multicast traffic management - * MLD (Multicast listener discovery for IPv6). Aims to be compliant with - RFC 2710. No support for MLDv2 - * ND (Neighbor discovery and stateless address autoconfiguration for IPv6). - Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 - (Address autoconfiguration) - * DHCP, AutoIP/APIPA (Zeroconf) and (stateless) DHCPv6 - * UDP (User Datagram Protocol) including experimental UDP-lite extensions - * TCP (Transmission Control Protocol) with congestion control, RTT estimation - fast recovery/fast retransmit and sending SACKs - * raw/native API for enhanced performance - * Optional Berkeley-like socket API - * TLS: optional layered TCP ("altcp") for nearly transparent TLS for any - TCP-based protocol (ported to mbedTLS) (see changelog for more info) - * PPPoS and PPPoE (Point-to-point protocol over Serial/Ethernet) - * DNS (Domain name resolver incl. mDNS) - * 6LoWPAN (via IEEE 802.15.4, BLE or ZEP) - - -APPLICATIONS - - * HTTP server with SSI and CGI (HTTPS via altcp) - * SNMPv2c agent with MIB compiler (Simple Network Management Protocol), v3 via altcp - * SNTP (Simple network time protocol) - * NetBIOS name service responder - * MDNS (Multicast DNS) responder - * iPerf server implementation - * MQTT client (TLS support via altcp) - - -LICENSE - -lwIP is freely available under a BSD license. - - -DEVELOPMENT - -lwIP has grown into an excellent TCP/IP stack for embedded devices, -and developers using the stack often submit bug fixes, improvements, -and additions to the stack to further increase its usefulness. - -Development of lwIP is hosted on Savannah, a central point for -software development, maintenance and distribution. Everyone can -help improve lwIP by use of Savannah's interface, Git and the -mailing list. A core team of developers will commit changes to the -Git source tree. - -The lwIP TCP/IP stack is maintained in the 'lwip' Git module and -contributions (such as platform ports) are in the 'contrib' Git module. - -See doc/savannah.txt for details on Git server access for users and -developers. - -The current Git trees are web-browsable: - http://git.savannah.gnu.org/cgit/lwip.git - http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git - -Submit patches and bugs via the lwIP project page: - http://savannah.nongnu.org/projects/lwip/ - -Continuous integration builds (GCC, clang): - https://travis-ci.org/yarrick/lwip-merged - - -DOCUMENTATION - -Self documentation of the source code is regularly extracted from the current -Git sources and is available from this web page: - http://www.nongnu.org/lwip/ - -There is now a constantly growing wiki about lwIP at - http://lwip.wikia.com/wiki/LwIP_Wiki - -Also, there are mailing lists you can subscribe at - http://savannah.nongnu.org/mail/?group=lwip -plus searchable archives: - http://lists.nongnu.org/archive/html/lwip-users/ - http://lists.nongnu.org/archive/html/lwip-devel/ - -lwIP was originally written by Adam Dunkels: - http://dunkels.com/adam/ - -Reading Adam's papers, the files in docs/, browsing the source code -documentation and browsing the mailing list archives is a good way to -become familiar with the design of lwIP. - -Adam Dunkels <adam@sics.se> -Leon Woestenberg <leon.woestenberg@gmx.net> -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Variables | |
const struct in6_addr | in6addr_any = {{{0,0,0,0}}} |
INET v6 addresses.
-const struct in6_addr in6addr_any = {{{0,0,0,0}}} | -
This variable is initialized by the system to contain the wildcard IPv6 address.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/inet_chksum.h"
#include "lwip/def.h"
#include "lwip/ip_addr.h"
#include <string.h>
-Functions | |
u16_t | ip6_chksum_pseudo (struct pbuf *p, u8_t proto, u16_t proto_len, const ip6_addr_t *src, const ip6_addr_t *dest) |
u16_t | ip6_chksum_pseudo_partial (struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest) |
u16_t | inet_chksum_pbuf (struct pbuf *p) |
Internet checksum functions.
- These are some reference implementations of the checksum algorithm, with the aim of being simple, correct and fully portable. Checksumming is the first thing you would want to optimize for your platform. If you create your own version, link it in and in your cc.h put:
#define LWIP_CHKSUM your_checksum_routine
-Or you can select from the implementations below by defining LWIP_CHKSUM_ALGORITHM to 1, 2 or 3.
-u16_t inet_chksum_pbuf | -( | -struct pbuf * | -p | ) | -- |
Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).
-p | pbuf chain over that the checksum should be calculated |
u16_t ip6_chksum_pseudo | -( | -struct pbuf * | -p, | -
- | - | u8_t | -proto, | -
- | - | u16_t | -proto_len, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. IPv6 addresses are expected to be in network byte order.
-p | chain of pbufs over that a checksum should be calculated (ip data part) |
proto | ipv6 protocol/next header (used for checksum of pseudo header) |
proto_len | length of the ipv6 payload (used for checksum of pseudo header) |
src | source ipv6 address (used for checksum of pseudo header) |
dest | destination ipv6 address (used for checksum of pseudo header) |
u16_t ip6_chksum_pseudo_partial | -( | -struct pbuf * | -p, | -
- | - | u8_t | -proto, | -
- | - | u16_t | -proto_len, | -
- | - | u16_t | -chksum_len, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. IPv6 addresses are expected to be in network byte order. Will only compute for a portion of the payload.
-p | chain of pbufs over that a checksum should be calculated (ip data part) |
proto | ipv6 protocol/next header (used for checksum of pseudo header) |
proto_len | length of the ipv6 payload (used for checksum of pseudo header) |
chksum_len | number of payload bytes used to compute chksum |
src | source ipv6 address (used for checksum of pseudo header) |
dest | destination ipv6 address (used for checksum of pseudo header) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) |
#define | FOLD_U32T(u) ((u32_t)(((u) >> 16) + ((u) & 0x0000ffffUL))) |
-Functions | |
u16_t | inet_chksum_pbuf (struct pbuf *p) |
u16_t | ip6_chksum_pseudo (struct pbuf *p, u8_t proto, u16_t proto_len, const ip6_addr_t *src, const ip6_addr_t *dest) |
u16_t | ip6_chksum_pseudo_partial (struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest) |
IP checksum calculation functions
-#define FOLD_U32T | -( | -- | u | ) | -((u32_t)(((u) >> 16) + ((u) & 0x0000ffffUL))) | -
Split an u32_t in two u16_ts and add them up
- -#define SWAP_BYTES_IN_WORD | -( | -- | w | ) | -(((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) | -
Swap the bytes in an u16_t: much like lwip_htons() for little-endian
- -u16_t inet_chksum_pbuf | -( | -struct pbuf * | -p | ) | -- |
Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).
-p | pbuf chain over that the checksum should be calculated |
u16_t ip6_chksum_pseudo | -( | -struct pbuf * | -p, | -
- | - | u8_t | -proto, | -
- | - | u16_t | -proto_len, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. IPv6 addresses are expected to be in network byte order.
-p | chain of pbufs over that a checksum should be calculated (ip data part) |
proto | ipv6 protocol/next header (used for checksum of pseudo header) |
proto_len | length of the ipv6 payload (used for checksum of pseudo header) |
src | source ipv6 address (used for checksum of pseudo header) |
dest | destination ipv6 address (used for checksum of pseudo header) |
u16_t ip6_chksum_pseudo_partial | -( | -struct pbuf * | -p, | -
- | - | u8_t | -proto, | -
- | - | u16_t | -proto_len, | -
- | - | u16_t | -chksum_len, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. IPv6 addresses are expected to be in network byte order. Will only compute for a portion of the payload.
-p | chain of pbufs over that a checksum should be calculated (ip data part) |
proto | ipv6 protocol/next header (used for checksum of pseudo header) |
proto_len | length of the ipv6 payload (used for checksum of pseudo header) |
chksum_len | number of payload bytes used to compute chksum |
src | source ipv6 address (used for checksum of pseudo header) |
dest | destination ipv6 address (used for checksum of pseudo header) |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/init.h"
#include "lwip/stats.h"
#include "lwip/sys.h"
#include "lwip/mem.h"
#include "lwip/memp.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#include "lwip/sockets.h"
#include "lwip/ip.h"
#include "lwip/raw.h"
#include "lwip/udp.h"
#include "lwip/priv/tcp_priv.h"
#include "lwip/igmp.h"
#include "lwip/dns.h"
#include "lwip/timeouts.h"
#include "lwip/etharp.h"
#include "lwip/ip6.h"
#include "lwip/nd6.h"
#include "lwip/mld6.h"
#include "lwip/api.h"
#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_impl.h"
#include "arch/bpstruct.h"
#include "arch/epstruct.h"
-Functions | |
void | lwip_init (void) |
Modules initialization
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
-Macros | |
#define | LWIP_VERSION_MAJOR 2 |
#define | LWIP_VERSION_MINOR 1 |
#define | LWIP_VERSION_REVISION 2 |
#define | LWIP_VERSION_RC LWIP_RC_RELEASE |
#define | LWIP_RC_RELEASE 255 |
#define | LWIP_RC_DEVELOPMENT 0 |
#define | LWIP_VERSION |
#define | LWIP_VERSION_STRING LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX |
-Functions | |
void | lwip_init (void) |
lwIP initialization API
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/ip.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/ip4_frag.h"
#include "lwip/inet_chksum.h"
#include "lwip/netif.h"
#include "lwip/icmp.h"
#include "lwip/igmp.h"
#include "lwip/priv/raw_priv.h"
#include "lwip/udp.h"
#include "lwip/priv/tcp_priv.h"
#include "lwip/autoip.h"
#include "lwip/stats.h"
#include "lwip/prot/iana.h"
#include <string.h>
#include "path/to/my/lwip_hooks.h"
-Macros | |
#define | LWIP_INLINE_IP_CHKSUM 1 |
#define | IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(port) ((port) == PP_NTOHS(LWIP_IANA_PORT_DHCP_CLIENT)) |
-Functions | |
void | ip4_set_default_multicast_netif (struct netif *default_multicast_netif) |
struct netif * | ip4_route_src (const ip4_addr_t *src, const ip4_addr_t *dest) |
struct netif * | ip4_route (const ip4_addr_t *dest) |
err_t | ip4_input (struct pbuf *p, struct netif *inp) |
err_t | ip4_output_if (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif) |
err_t | ip4_output_if_opt (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, u16_t optlen) |
err_t | ip4_output_if_src (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif) |
err_t | ip4_output_if_opt_src (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, u16_t optlen) |
err_t | ip4_output (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto) |
This is the IPv4 layer implementation for incoming and outgoing IP traffic.
-#define IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT | -( | -- | port | ) | -((port) == PP_NTOHS(LWIP_IANA_PORT_DHCP_CLIENT)) | -
Some defines for DHCP to let link-layer-addressed packets through while the netif is down. To use this in your own application/protocol, define LWIP_IP_ACCEPT_UDP_PORT(port) to return 1 if the port is accepted and 0 if the port is not accepted.
- -#define LWIP_INLINE_IP_CHKSUM 1 | -
Set this to 0 in the rare case of wanting to call an extra function to generate the IP checksum (in contrast to calculating it on-the-fly).
- -This function is called by the network interface device driver when an IP packet is received. The function does the basic checks of the IP header such as packet size being at least larger than the header size etc. If the packet was not destined for us, the packet is forwarded (using ip_forward). The IP checksum is always checked.
-Finally, the packet is sent to the upper layer protocol input function.
-p | the received IP packet (p->payload points to IP header) |
inp | the netif on which this packet was received |
err_t ip4_output | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto | -
- | ) | -- |
Simple interface to ip_output_if. It finds the outgoing network interface and calls upon ip_output_if to do the actual work.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IP header and p->payload points to that IP header) |
src | the source IP address to send from (if src == IP4_ADDR_ANY, the IP address of the netif used to send is used as source address) |
dest | the destination IP address to send the packet to |
ttl | the TTL value to be set in the IP header |
tos | the TOS value to be set in the IP header |
proto | the PROTOCOL to be set in the IP header |
err_t ip4_output_if | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Sends an IP packet on a network interface. This function constructs the IP header and calculates the IP header checksum. If the source IP address is NULL, the IP address of the outgoing network interface is filled in as source address. If the destination IP address is LWIP_IP_HDRINCL, p is assumed to already include an IP header and p->payload points to it instead of the data.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IP header and p->payload points to that IP header) |
src | the source IP address to send from (if src == IP4_ADDR_ANY, the IP address of the netif used to send is used as source address) |
dest | the destination IP address to send the packet to |
ttl | the TTL value to be set in the IP header |
tos | the TOS value to be set in the IP header |
proto | the PROTOCOL to be set in the IP header |
netif | the netif on which to send this packet |
err_t ip4_output_if_opt | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif, | -
- | - | void * | -ip_options, | -
- | - | u16_t | -optlen | -
- | ) | -- |
Same as ip_output_if() but with the possibility to include IP options:
-@ param ip_options pointer to the IP options, copied into the IP header @ param optlen length of ip_options
- -err_t ip4_output_if_opt_src | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif, | -
- | - | void * | -ip_options, | -
- | - | u16_t | -optlen | -
- | ) | -- |
Same as ip_output_if_opt() but 'src' address is not replaced by netif address when it is 'any'.
- -err_t ip4_output_if_src | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Same as ip_output_if() but 'src' address is not replaced by netif address when it is 'any'.
- -struct netif* ip4_route | -( | -const ip4_addr_t * | -dest | ) | -- |
Finds the appropriate network interface for a given IP address. It searches the list of network interfaces linearly. A match is found if the masked IP address of the network interface equals the masked IP address given to the function.
-dest | the destination IP address for which to find the route |
struct netif* ip4_route_src | -( | -const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest | -
- | ) | -- |
Source based IPv4 routing must be fully implemented in LWIP_HOOK_IP4_ROUTE_SRC(). This function only provides the parameters.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/ip4_addr.h"
#include "lwip/err.h"
#include "lwip/netif.h"
#include "lwip/prot/ip4.h"
-Macros | |
#define | IP_OPTIONS_SEND (LWIP_IPV4 && LWIP_IGMP) |
-Functions | |
struct netif * | ip4_route (const ip4_addr_t *dest) |
struct netif * | ip4_route_src (const ip4_addr_t *src, const ip4_addr_t *dest) |
err_t | ip4_input (struct pbuf *p, struct netif *inp) |
err_t | ip4_output (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto) |
err_t | ip4_output_if (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif) |
err_t | ip4_output_if_src (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif) |
err_t | ip4_output_if_opt (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, u16_t optlen) |
err_t | ip4_output_if_opt_src (struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, u16_t optlen) |
void | ip4_set_default_multicast_netif (struct netif *default_multicast_netif) |
IPv4 API
-Currently, the function ip_output_if_opt() is only used with IGMP
- -This function is called by the network interface device driver when an IP packet is received. The function does the basic checks of the IP header such as packet size being at least larger than the header size etc. If the packet was not destined for us, the packet is forwarded (using ip_forward). The IP checksum is always checked.
-Finally, the packet is sent to the upper layer protocol input function.
-p | the received IP packet (p->payload points to IP header) |
inp | the netif on which this packet was received |
err_t ip4_output | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto | -
- | ) | -- |
Simple interface to ip_output_if. It finds the outgoing network interface and calls upon ip_output_if to do the actual work.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IP header and p->payload points to that IP header) |
src | the source IP address to send from (if src == IP4_ADDR_ANY, the IP address of the netif used to send is used as source address) |
dest | the destination IP address to send the packet to |
ttl | the TTL value to be set in the IP header |
tos | the TOS value to be set in the IP header |
proto | the PROTOCOL to be set in the IP header |
err_t ip4_output_if | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Sends an IP packet on a network interface. This function constructs the IP header and calculates the IP header checksum. If the source IP address is NULL, the IP address of the outgoing network interface is filled in as source address. If the destination IP address is LWIP_IP_HDRINCL, p is assumed to already include an IP header and p->payload points to it instead of the data.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IP header and p->payload points to that IP header) |
src | the source IP address to send from (if src == IP4_ADDR_ANY, the IP address of the netif used to send is used as source address) |
dest | the destination IP address to send the packet to |
ttl | the TTL value to be set in the IP header |
tos | the TOS value to be set in the IP header |
proto | the PROTOCOL to be set in the IP header |
netif | the netif on which to send this packet |
err_t ip4_output_if_opt | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif, | -
- | - | void * | -ip_options, | -
- | - | u16_t | -optlen | -
- | ) | -- |
Same as ip_output_if() but with the possibility to include IP options:
-@ param ip_options pointer to the IP options, copied into the IP header @ param optlen length of ip_options
- -err_t ip4_output_if_opt_src | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif, | -
- | - | void * | -ip_options, | -
- | - | u16_t | -optlen | -
- | ) | -- |
Same as ip_output_if_opt() but 'src' address is not replaced by netif address when it is 'any'.
- -err_t ip4_output_if_src | -( | -struct pbuf * | -p, | -
- | - | const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest, | -
- | - | u8_t | -ttl, | -
- | - | u8_t | -tos, | -
- | - | u8_t | -proto, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Same as ip_output_if() but 'src' address is not replaced by netif address when it is 'any'.
- -struct netif* ip4_route | -( | -const ip4_addr_t * | -dest | ) | -- |
Finds the appropriate network interface for a given IP address. It searches the list of network interfaces linearly. A match is found if the masked IP address of the network interface equals the masked IP address given to the function.
-dest | the destination IP address for which to find the route |
struct netif* ip4_route_src | -( | -const ip4_addr_t * | -src, | -
- | - | const ip4_addr_t * | -dest | -
- | ) | -- |
Source based IPv4 routing must be fully implemented in LWIP_HOOK_IP4_ROUTE_SRC(). This function only provides the parameters.
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
u8_t | ip4_addr_isbroadcast_u32 (u32_t addr, const struct netif *netif) |
u8_t | ip4_addr_netmask_valid (u32_t netmask) |
u32_t | ipaddr_addr (const char *cp) |
int | ip4addr_aton (const char *cp, ip4_addr_t *addr) |
char * | ip4addr_ntoa (const ip4_addr_t *addr) |
char * | ip4addr_ntoa_r (const ip4_addr_t *addr, char *buf, int buflen) |
This is the IPv4 address tools implementation.
-u8_t ip4_addr_isbroadcast_u32 | -( | -u32_t | -addr, | -
- | - | const struct netif * | -netif | -
- | ) | -- |
Determine if an address is a broadcast address on a network interface
-addr | address to be checked |
netif | the network interface against which the address is checked |
u8_t ip4_addr_netmask_valid | -( | -u32_t | -netmask | ) | -- |
Checks if a netmask is valid (starting with ones, then only zeros)
-netmask | the IPv4 netmask to check (in network byte order!) |
int ip4addr_aton | -( | -const char * | -cp, | -
- | - | ip4_addr_t * | -addr | -
- | ) | -- |
Check whether "cp" is a valid ascii representation of an Internet address and convert to a binary address. Returns 1 if the address is valid, 0 if not. This replaces inet_addr, the return value from which cannot distinguish between failure and a local broadcast address.
-cp | IP address in ascii representation (e.g. "127.0.0.1") |
addr | pointer to which to save the ip address in network order |
char* ip4addr_ntoa | -( | -const ip4_addr_t * | -addr | ) | -- |
Convert numeric IP address into decimal dotted ASCII representation. returns ptr to static buffer; not reentrant!
-addr | ip address in network order to convert |
char* ip4addr_ntoa_r | -( | -const ip4_addr_t * | -addr, | -
- | - | char * | -buf, | -
- | - | int | -buflen | -
- | ) | -- |
Same as ip4addr_ntoa, but reentrant since a user-supplied buffer is used.
-addr | ip address in network order to convert |
buf | target buffer where the string is stored |
buflen | length of buf |
u32_t ipaddr_addr | -( | -const char * | -cp | ) | -- |
Ascii internet address interpretation routine. The value returned is in network order.
-cp | IP address in ascii representation (e.g. "127.0.0.1") |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | ip4_addr |
-Macros | |
#define | IPADDR_NONE ((u32_t)0xffffffffUL) |
#define | IPADDR_LOOPBACK ((u32_t)0x7f000001UL) |
#define | IPADDR_ANY ((u32_t)0x00000000UL) |
#define | IPADDR_BROADCAST ((u32_t)0xffffffffUL) |
#define | IP4_ADDR(ipaddr, a, b, c, d) (ipaddr)->addr = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) |
#define | ip4_addr_copy(dest, src) ((dest).addr = (src).addr) |
#define | ip4_addr_set(dest, src) |
#define | ip4_addr_set_zero(ipaddr) ((ipaddr)->addr = 0) |
#define | ip4_addr_set_any(ipaddr) ((ipaddr)->addr = IPADDR_ANY) |
#define | ip4_addr_set_loopback(ipaddr) ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK)) |
#define | ip4_addr_isloopback(ipaddr) (((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32_t)IP_LOOPBACKNET) << 24)) |
#define | ip4_addr_set_hton(dest, src) |
#define | ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32)) |
#define | ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr) |
#define | ip4_addr_get_network(target, host, netmask) do { ((target)->addr = ((host)->addr) & ((netmask)->addr)); } while(0) |
#define | ip4_addr_netcmp(addr1, addr2, mask) |
#define | ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr) |
-Typedefs | |
typedef struct ip4_addr | ip4_addr_t |
-Functions | |
u8_t | ip4_addr_isbroadcast_u32 (u32_t addr, const struct netif *netif) |
u8_t | ip4_addr_netmask_valid (u32_t netmask) |
u32_t | ipaddr_addr (const char *cp) |
int | ip4addr_aton (const char *cp, ip4_addr_t *addr) |
char * | ip4addr_ntoa (const ip4_addr_t *addr) |
char * | ip4addr_ntoa_r (const ip4_addr_t *addr, char *buf, int buflen) |
IPv4 address API
-#define IP4_ADDR | -( | -- | ipaddr, | -
- | - | - | a, | -
- | - | - | b, | -
- | - | - | c, | -
- | - | - | d | -
- | ) | -(ipaddr)->addr = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) | -
Set an IP address given by the four byte-parts
- -#define ip4_addr_copy | -( | -- | dest, | -
- | - | - | src | -
- | ) | -((dest).addr = (src).addr) | -
Copy IP address - faster than ip4_addr_set: no NULL check
- -#define ip4_addr_get_network | -( | -- | target, | -
- | - | - | host, | -
- | - | - | netmask | -
- | ) | -do { ((target)->addr = ((host)->addr) & ((netmask)->addr)); } while(0) | -
Get the network address by combining host address with netmask
- -#define ip4_addr_get_u32 | -( | -- | src_ipaddr | ) | -((src_ipaddr)->addr) | -
IPv4 only: get the IP address as an u32_t
- -#define ip4_addr_isloopback | -( | -- | ipaddr | ) | -(((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32_t)IP_LOOPBACKNET) << 24)) | -
Check if an address is in the loopback region
- -#define ip4_addr_netcmp | -( | -- | addr1, | -
- | - | - | addr2, | -
- | - | - | mask | -
- | ) | -- |
Determine if two address are on the same network.
-#define ip4_addr_set | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Safely copy one IP address to another (src may be NULL)
- -#define ip4_addr_set_any | -( | -- | ipaddr | ) | -((ipaddr)->addr = IPADDR_ANY) | -
Set address to IPADDR_ANY (no need for lwip_htonl())
- -#define ip4_addr_set_hton | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Safely copy one IP address to another and change byte order from host- to network-order.
- -#define ip4_addr_set_loopback | -( | -- | ipaddr | ) | -((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK)) | -
Set address to loopback address
- -#define ip4_addr_set_u32 | -( | -- | dest_ipaddr, | -
- | - | - | src_u32 | -
- | ) | -((dest_ipaddr)->addr = (src_u32)) | -
IPv4 only: set the IP address given as an u32_t
- -#define ip4_addr_set_zero | -( | -- | ipaddr | ) | -((ipaddr)->addr = 0) | -
Set complete address to zero
- -#define ip_ntoa | -( | -- | ipaddr | ) | -ipaddr_ntoa(ipaddr) | -
For backwards compatibility
- -#define IPADDR_ANY ((u32_t)0x00000000UL) | -
0.0.0.0
- -#define IPADDR_BROADCAST ((u32_t)0xffffffffUL) | -
255.255.255.255
- -#define IPADDR_LOOPBACK ((u32_t)0x7f000001UL) | -
127.0.0.1
- -#define IPADDR_NONE ((u32_t)0xffffffffUL) | -
255.255.255.255
- -typedef struct ip4_addr ip4_addr_t | -
ip4_addr_t uses a struct for convenience only, so that the same defines can operate both on ip4_addr_t as well as on ip4_addr_p_t.
- -u8_t ip4_addr_isbroadcast_u32 | -( | -u32_t | -addr, | -
- | - | const struct netif * | -netif | -
- | ) | -- |
Determine if an address is a broadcast address on a network interface
-addr | address to be checked |
netif | the network interface against which the address is checked |
u8_t ip4_addr_netmask_valid | -( | -u32_t | -netmask | ) | -- |
Checks if a netmask is valid (starting with ones, then only zeros)
-netmask | the IPv4 netmask to check (in network byte order!) |
int ip4addr_aton | -( | -const char * | -cp, | -
- | - | ip4_addr_t * | -addr | -
- | ) | -- |
Check whether "cp" is a valid ascii representation of an Internet address and convert to a binary address. Returns 1 if the address is valid, 0 if not. This replaces inet_addr, the return value from which cannot distinguish between failure and a local broadcast address.
-cp | IP address in ascii representation (e.g. "127.0.0.1") |
addr | pointer to which to save the ip address in network order |
char* ip4addr_ntoa | -( | -const ip4_addr_t * | -addr | ) | -- |
returns ptr to static buffer; not reentrant!
-Convert numeric IP address into decimal dotted ASCII representation. returns ptr to static buffer; not reentrant!
-addr | ip address in network order to convert |
char* ip4addr_ntoa_r | -( | -const ip4_addr_t * | -addr, | -
- | - | char * | -buf, | -
- | - | int | -buflen | -
- | ) | -- |
Same as ip4addr_ntoa, but reentrant since a user-supplied buffer is used.
-addr | ip address in network order to convert |
buf | target buffer where the string is stored |
buflen | length of buf |
u32_t ipaddr_addr | -( | -const char * | -cp | ) | -- |
Ascii internet address interpretation routine. The value returned is in network order.
-cp | IP address in ascii representation (e.g. "127.0.0.1") |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/ip4_frag.h"
#include "lwip/def.h"
#include "lwip/inet_chksum.h"
#include "lwip/netif.h"
#include "lwip/stats.h"
#include "lwip/icmp.h"
#include <string.h>
#include "arch/bpstruct.h"
#include "arch/epstruct.h"
-Data Structures | |
struct | ip_reass_helper |
-Macros | |
#define | IP_REASS_CHECK_OVERLAP 1 |
#define | IP_REASS_FREE_OLDEST 1 |
-Functions | |
void | ip_reass_tmr (void) |
struct pbuf * | ip4_reass (struct pbuf *p) |
err_t | ip4_frag (struct pbuf *p, struct netif *netif, const ip4_addr_t *dest) |
This is the IPv4 packet segmentation and reassembly implementation.
-#define IP_REASS_CHECK_OVERLAP 1 | -
The IP reassembly code currently has the following limitations:
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!
- -#define IP_REASS_FREE_OLDEST 1 | -
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.
- -err_t ip4_frag | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -netif, | -
- | - | const ip4_addr_t * | -dest | -
- | ) | -- |
Fragment an IP datagram if too large for the netif.
-Chop the datagram in MTU sized chunks and send them in order by pointing PBUF_REFs into p.
-p | ip packet to send |
netif | the netif on which to send |
dest | destination ip address to which to send |
Reassembles incoming IP fragments into an IP datagram.
-p | points to a pbuf chain of the fragment |
void ip_reass_tmr | -( | -void | -) | -- |
Reassembly timer base function for both NO_SYS == 0 and 1 (!).
-Should be called every 1000 msec (defined by IP_TMR_INTERVAL).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/err.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#include "lwip/ip_addr.h"
#include "lwip/ip.h"
-Data Structures | |
struct | ip_reassdata |
struct | pbuf_custom_ref |
-Functions | |
void | ip_reass_tmr (void) |
struct pbuf * | ip4_reass (struct pbuf *p) |
err_t | ip4_frag (struct pbuf *p, struct netif *netif, const ip4_addr_t *dest) |
IP fragmentation/reassembly
-err_t ip4_frag | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -netif, | -
- | - | const ip4_addr_t * | -dest | -
- | ) | -- |
Fragment an IP datagram if too large for the netif.
-Chop the datagram in MTU sized chunks and send them in order by pointing PBUF_REFs into p.
-p | ip packet to send |
netif | the netif on which to send |
dest | destination ip address to which to send |
Reassembles incoming IP fragments into an IP datagram.
-p | points to a pbuf chain of the fragment |
void ip_reass_tmr | -( | -void | -) | -- |
Reassembly timer base function for both NO_SYS == 0 and 1 (!).
-Should be called every 1000 msec (defined by IP_TMR_INTERVAL).
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/netif.h"
#include "lwip/ip.h"
#include "lwip/ip6.h"
#include "lwip/ip6_addr.h"
#include "lwip/ip6_frag.h"
#include "lwip/icmp6.h"
#include "lwip/priv/raw_priv.h"
#include "lwip/udp.h"
#include "lwip/priv/tcp_priv.h"
#include "lwip/dhcp6.h"
#include "lwip/nd6.h"
#include "lwip/mld6.h"
#include "lwip/debug.h"
#include "lwip/stats.h"
#include "path/to/my/lwip_hooks.h"
-Functions | |
struct netif * | ip6_route (const ip6_addr_t *src, const ip6_addr_t *dest) |
const ip_addr_t * | ip6_select_source_address (struct netif *netif, const ip6_addr_t *dest) |
err_t | ip6_input (struct pbuf *p, struct netif *inp) |
err_t | ip6_output_if (struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, u8_t hl, u8_t tc, u8_t nexth, struct netif *netif) |
err_t | ip6_output_if_src (struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, u8_t hl, u8_t tc, u8_t nexth, struct netif *netif) |
err_t | ip6_output (struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, u8_t hl, u8_t tc, u8_t nexth) |
err_t | ip6_options_add_hbh_ra (struct pbuf *p, u8_t nexth, u8_t value) |
IPv6 layer.
-This function is called by the network interface device driver when an IPv6 packet is received. The function does the basic checks of the IP header such as packet size being at least larger than the header size etc. If the packet was not destined for us, the packet is forwarded (using ip6_forward).
-Finally, the packet is sent to the upper layer protocol input function.
-p | the received IPv6 packet (p->payload points to IPv6 header) |
inp | the netif on which this packet was received |
err_t ip6_options_add_hbh_ra | -( | -struct pbuf * | -p, | -
- | - | u8_t | -nexth, | -
- | - | u8_t | -value | -
- | ) | -- |
Add a hop-by-hop options header with a router alert option and padding.
-Used by MLD when sending a Multicast listener report/done message.
-p | the packet to which we will prepend the options header |
nexth | the next header protocol number (e.g. IP6_NEXTH_ICMP6) |
value | the value of the router alert option data (e.g. IP6_ROUTER_ALERT_VALUE_MLD) |
err_t ip6_output | -( | -struct pbuf * | -p, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest, | -
- | - | u8_t | -hl, | -
- | - | u8_t | -tc, | -
- | - | u8_t | -nexth | -
- | ) | -- |
Simple interface to ip6_output_if. It finds the outgoing network interface and calls upon ip6_output_if to do the actual work.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IPv6 header and p->payload points to that IPv6 header) |
src | the source IPv6 address to send from (if src == IP6_ADDR_ANY, an IP address of the netif is selected and used as source address. if src == NULL, IP6_ADDR_ANY is used as source) |
dest | the destination IPv6 address to send the packet to |
hl | the Hop Limit value to be set in the IPv6 header |
tc | the Traffic Class value to be set in the IPv6 header |
nexth | the Next Header to be set in the IPv6 header |
err_t ip6_output_if | -( | -struct pbuf * | -p, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest, | -
- | - | u8_t | -hl, | -
- | - | u8_t | -tc, | -
- | - | u8_t | -nexth, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Sends an IPv6 packet on a network interface. This function constructs the IPv6 header. If the source IPv6 address is NULL, the IPv6 "ANY" address is used as source (usually during network startup). If the source IPv6 address it IP6_ADDR_ANY, the most appropriate IPv6 address of the outgoing network interface is filled in as source address. If the destination IPv6 address is LWIP_IP_HDRINCL, p is assumed to already include an IPv6 header and p->payload points to it instead of the data.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IPv6 header and p->payload points to that IPv6 header) |
src | the source IPv6 address to send from (if src == IP6_ADDR_ANY, an IP address of the netif is selected and used as source address. if src == NULL, IP6_ADDR_ANY is used as source) (src is possibly not properly zoned) |
dest | the destination IPv6 address to send the packet to (possibly not properly zoned) |
hl | the Hop Limit value to be set in the IPv6 header |
tc | the Traffic Class value to be set in the IPv6 header |
nexth | the Next Header to be set in the IPv6 header |
netif | the netif on which to send this packet |
err_t ip6_output_if_src | -( | -struct pbuf * | -p, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest, | -
- | - | u8_t | -hl, | -
- | - | u8_t | -tc, | -
- | - | u8_t | -nexth, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Same as ip6_output_if() but 'src' address is not replaced by netif address when it is 'any'.
- -struct netif* ip6_route | -( | -const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Finds the appropriate network interface for a given IPv6 address. It tries to select a netif following a sequence of heuristics: 1) if there is only 1 netif, return it 2) if the destination is a zoned address, match its zone to a netif 3) if the either the source or destination address is a scoped address, match the source address's zone (if set) or address (if not) to a netif 4) tries to match the destination subnet to a configured address 5) tries to find a router-announced route 6) tries to match the (unscoped) source address to the netif 7) returns the default netif, if configured
-Note that each of the two given addresses may or may not be properly zoned.
-src | the source IPv6 address, if known |
dest | the destination IPv6 address for which to find the route |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/ip6_addr.h"
#include "lwip/prot/ip6.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#include "lwip/err.h"
-Functions | |
struct netif * | ip6_route (const ip6_addr_t *src, const ip6_addr_t *dest) |
const ip_addr_t * | ip6_select_source_address (struct netif *netif, const ip6_addr_t *dest) |
err_t | ip6_input (struct pbuf *p, struct netif *inp) |
err_t | ip6_output (struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, u8_t hl, u8_t tc, u8_t nexth) |
err_t | ip6_output_if (struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, u8_t hl, u8_t tc, u8_t nexth, struct netif *netif) |
err_t | ip6_output_if_src (struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, u8_t hl, u8_t tc, u8_t nexth, struct netif *netif) |
err_t | ip6_options_add_hbh_ra (struct pbuf *p, u8_t nexth, u8_t value) |
IPv6 layer.
-This function is called by the network interface device driver when an IPv6 packet is received. The function does the basic checks of the IP header such as packet size being at least larger than the header size etc. If the packet was not destined for us, the packet is forwarded (using ip6_forward).
-Finally, the packet is sent to the upper layer protocol input function.
-p | the received IPv6 packet (p->payload points to IPv6 header) |
inp | the netif on which this packet was received |
err_t ip6_options_add_hbh_ra | -( | -struct pbuf * | -p, | -
- | - | u8_t | -nexth, | -
- | - | u8_t | -value | -
- | ) | -- |
Add a hop-by-hop options header with a router alert option and padding.
-Used by MLD when sending a Multicast listener report/done message.
-p | the packet to which we will prepend the options header |
nexth | the next header protocol number (e.g. IP6_NEXTH_ICMP6) |
value | the value of the router alert option data (e.g. IP6_ROUTER_ALERT_VALUE_MLD) |
err_t ip6_output | -( | -struct pbuf * | -p, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest, | -
- | - | u8_t | -hl, | -
- | - | u8_t | -tc, | -
- | - | u8_t | -nexth | -
- | ) | -- |
Simple interface to ip6_output_if. It finds the outgoing network interface and calls upon ip6_output_if to do the actual work.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IPv6 header and p->payload points to that IPv6 header) |
src | the source IPv6 address to send from (if src == IP6_ADDR_ANY, an IP address of the netif is selected and used as source address. if src == NULL, IP6_ADDR_ANY is used as source) |
dest | the destination IPv6 address to send the packet to |
hl | the Hop Limit value to be set in the IPv6 header |
tc | the Traffic Class value to be set in the IPv6 header |
nexth | the Next Header to be set in the IPv6 header |
err_t ip6_output_if | -( | -struct pbuf * | -p, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest, | -
- | - | u8_t | -hl, | -
- | - | u8_t | -tc, | -
- | - | u8_t | -nexth, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Sends an IPv6 packet on a network interface. This function constructs the IPv6 header. If the source IPv6 address is NULL, the IPv6 "ANY" address is used as source (usually during network startup). If the source IPv6 address it IP6_ADDR_ANY, the most appropriate IPv6 address of the outgoing network interface is filled in as source address. If the destination IPv6 address is LWIP_IP_HDRINCL, p is assumed to already include an IPv6 header and p->payload points to it instead of the data.
-p | the packet to send (p->payload points to the data, e.g. next protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IPv6 header and p->payload points to that IPv6 header) |
src | the source IPv6 address to send from (if src == IP6_ADDR_ANY, an IP address of the netif is selected and used as source address. if src == NULL, IP6_ADDR_ANY is used as source) (src is possibly not properly zoned) |
dest | the destination IPv6 address to send the packet to (possibly not properly zoned) |
hl | the Hop Limit value to be set in the IPv6 header |
tc | the Traffic Class value to be set in the IPv6 header |
nexth | the Next Header to be set in the IPv6 header |
netif | the netif on which to send this packet |
err_t ip6_output_if_src | -( | -struct pbuf * | -p, | -
- | - | const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest, | -
- | - | u8_t | -hl, | -
- | - | u8_t | -tc, | -
- | - | u8_t | -nexth, | -
- | - | struct netif * | -netif | -
- | ) | -- |
Same as ip6_output_if() but 'src' address is not replaced by netif address when it is 'any'.
- -struct netif* ip6_route | -( | -const ip6_addr_t * | -src, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Finds the appropriate network interface for a given IPv6 address. It tries to select a netif following a sequence of heuristics: 1) if there is only 1 netif, return it 2) if the destination is a zoned address, match its zone to a netif 3) if the either the source or destination address is a scoped address, match the source address's zone (if set) or address (if not) to a netif 4) tries to match the destination subnet to a configured address 5) tries to find a router-announced route 6) tries to match the (unscoped) source address to the netif 7) returns the default netif, if configured
-Note that each of the two given addresses may or may not be properly zoned.
-src | the source IPv6 address, if known |
dest | the destination IPv6 address for which to find the route |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/ip_addr.h"
#include "lwip/def.h"
#include <string.h>
#include "lwip/ip4_addr.h"
-Functions | |
int | ip6addr_aton (const char *cp, ip6_addr_t *addr) |
char * | ip6addr_ntoa (const ip6_addr_t *addr) |
char * | ip6addr_ntoa_r (const ip6_addr_t *addr, char *buf, int buflen) |
IPv6 addresses.
-int ip6addr_aton | -( | -const char * | -cp, | -
- | - | ip6_addr_t * | -addr | -
- | ) | -- |
Check whether "cp" is a valid ascii representation of an IPv6 address and convert to a binary address. Returns 1 if the address is valid, 0 if not.
-cp | IPv6 address in ascii representation (e.g. "FF01::1") |
addr | pointer to which to save the ip address in network order |
char* ip6addr_ntoa | -( | -const ip6_addr_t * | -addr | ) | -- |
Convert numeric IPv6 address into ASCII representation. returns ptr to static buffer; not reentrant!
-addr | ip6 address in network order to convert |
char* ip6addr_ntoa_r | -( | -const ip6_addr_t * | -addr, | -
- | - | char * | -buf, | -
- | - | int | -buflen | -
- | ) | -- |
Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used.
-addr | ip6 address in network order to convert |
buf | target buffer where the string is stored |
buflen | length of buf |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Data Structures | |
struct | ip6_addr |
-Macros | |
#define | IP6_ADDR_PART(ip6addr, index, a, b, c, d) (ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) |
#define | IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3) |
#define | IP6_ADDR_BLOCK1(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK2(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 0xffff)) |
#define | IP6_ADDR_BLOCK3(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK4(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 0xffff)) |
#define | IP6_ADDR_BLOCK5(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK6(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 0xffff)) |
#define | IP6_ADDR_BLOCK7(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK8(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 0xffff)) |
#define | ip6_addr_copy(dest, src) |
#define | ip6_addr_set(dest, src) |
#define | ip6_addr_copy_from_packed(dest, src) |
#define | ip6_addr_copy_to_packed(dest, src) |
#define | ip6_addr_set_zero(ip6addr) |
#define | ip6_addr_set_any(ip6addr) ip6_addr_set_zero(ip6addr) |
#define | ip6_addr_set_loopback(ip6addr) |
#define | ip6_addr_set_hton(dest, src) |
#define | ip6_addr_netcmp_zoneless(addr1, addr2) |
#define | ip6_addr_netcmp(addr1, addr2) |
#define | ip6_addr_cmp_zoneless(addr1, addr2) |
#define | ip6_addr_cmp(addr1, addr2) |
#define | ip6_addr_cmp_packed(ip6addr, paddr, zone_idx) |
-Typedefs | |
typedef struct ip6_addr | ip6_addr_t |
-Functions | |
int | ip6addr_aton (const char *cp, ip6_addr_t *addr) |
char * | ip6addr_ntoa (const ip6_addr_t *addr) |
char * | ip6addr_ntoa_r (const ip6_addr_t *addr, char *buf, int buflen) |
IPv6 addresses.
-#define IP6_ADDR | -( | -- | ip6addr, | -
- | - | - | idx0, | -
- | - | - | idx1, | -
- | - | - | idx2, | -
- | - | - | idx3 | -
- | ) | -- |
Set a full IPv6 address by passing the 4 u32_t indices in network byte order (use PP_HTONL() for constants)
- -#define IP6_ADDR_BLOCK1 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff)) | -
Access address in 16-bit block
- -#define IP6_ADDR_BLOCK2 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 0xffff)) | -
Access address in 16-bit block
- -#define IP6_ADDR_BLOCK3 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff)) | -
Access address in 16-bit block
- -#define IP6_ADDR_BLOCK4 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 0xffff)) | -
Access address in 16-bit block
- -#define IP6_ADDR_BLOCK5 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff)) | -
Access address in 16-bit block
- -#define IP6_ADDR_BLOCK6 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 0xffff)) | -
Access address in 16-bit block
- -#define IP6_ADDR_BLOCK7 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff)) | -
Access address in 16-bit block
- -#define IP6_ADDR_BLOCK8 | -( | -- | ip6addr | ) | -((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 0xffff)) | -
Access address in 16-bit block
- -#define ip6_addr_cmp | -( | -- | addr1, | -
- | - | - | addr2 | -
- | ) | -- |
Determine if two IPv6 addresses are the same. In particular, the address part of both must be the same, and the zone must be compatible.
-addr1 | IPv6 address 1 |
addr2 | IPv6 address 2 |
#define ip6_addr_cmp_packed | -( | -- | ip6addr, | -
- | - | - | paddr, | -
- | - | - | zone_idx | -
- | ) | -- |
Compare IPv6 address to packed address and zone
- -#define ip6_addr_cmp_zoneless | -( | -- | addr1, | -
- | - | - | addr2 | -
- | ) | -- |
Compare IPv6 addresses, ignoring zone information. To be used sparingly!
- -#define ip6_addr_copy | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Copy IPv6 address - faster than ip6_addr_set: no NULL check
- -#define ip6_addr_copy_from_packed | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Copy packed IPv6 address to unpacked IPv6 address; zone is not set
- -#define ip6_addr_copy_to_packed | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Copy unpacked IPv6 address to packed IPv6 address; zone is lost
- -#define ip6_addr_netcmp | -( | -- | addr1, | -
- | - | - | addr2 | -
- | ) | -- |
Determine if two IPv6 address are on the same network.
-addr1 | IPv6 address 1 |
addr2 | IPv6 address 2 |
#define ip6_addr_netcmp_zoneless | -( | -- | addr1, | -
- | - | - | addr2 | -
- | ) | -- |
Compare IPv6 networks, ignoring zone information. To be used sparingly!
- -#define IP6_ADDR_PART | -( | -- | ip6addr, | -
- | - | - | index, | -
- | - | - | a, | -
- | - | - | b, | -
- | - | - | c, | -
- | - | - | d | -
- | ) | -(ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) | -
Set an IPv6 partial address given by byte-parts
- -#define ip6_addr_set | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Safely copy one IPv6 address to another (src may be NULL)
- -#define ip6_addr_set_any | -( | -- | ip6addr | ) | -ip6_addr_set_zero(ip6addr) | -
Set address to ipv6 'any' (no need for lwip_htonl())
- -#define ip6_addr_set_hton | -( | -- | dest, | -
- | - | - | src | -
- | ) | -- |
Safely copy one IPv6 address to another and change byte order from host- to network-order.
- -#define ip6_addr_set_loopback | -( | -- | ip6addr | ) | -- |
Set address to ipv6 loopback address
- -#define ip6_addr_set_zero | -( | -- | ip6addr | ) | -- |
Set complete address to zero
- -typedef struct ip6_addr ip6_addr_t | -
IPv6 address
- -int ip6addr_aton | -( | -const char * | -cp, | -
- | - | ip6_addr_t * | -addr | -
- | ) | -- |
Check whether "cp" is a valid ascii representation of an IPv6 address and convert to a binary address. Returns 1 if the address is valid, 0 if not.
-cp | IPv6 address in ascii representation (e.g. "FF01::1") |
addr | pointer to which to save the ip address in network order |
char* ip6addr_ntoa | -( | -const ip6_addr_t * | -addr | ) | -- |
returns ptr to static buffer; not reentrant!
-Convert numeric IPv6 address into ASCII representation. returns ptr to static buffer; not reentrant!
-addr | ip6 address in network order to convert |
char* ip6addr_ntoa_r | -( | -const ip6_addr_t * | -addr, | -
- | - | char * | -buf, | -
- | - | int | -buflen | -
- | ) | -- |
Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used.
-addr | ip6 address in network order to convert |
buf | target buffer where the string is stored |
buflen | length of buf |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/ip6_frag.h"
#include "lwip/ip6.h"
#include "lwip/icmp6.h"
#include "lwip/nd6.h"
#include "lwip/ip.h"
#include "lwip/pbuf.h"
#include "lwip/memp.h"
#include "lwip/stats.h"
#include <string.h>
#include "arch/bpstruct.h"
#include "arch/epstruct.h"
-Data Structures | |
struct | ip6_reass_helper |
-Macros | |
#define | IP_REASS_CHECK_OVERLAP 1 |
#define | IP_REASS_FREE_OLDEST 1 |
-Functions | |
struct pbuf * | ip6_reass (struct pbuf *p) |
err_t | ip6_frag (struct pbuf *p, struct netif *netif, const ip6_addr_t *dest) |
IPv6 fragmentation and reassembly.
-#define IP_REASS_CHECK_OVERLAP 1 | -
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!
- -#define IP_REASS_FREE_OLDEST 1 | -
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.
- -err_t ip6_frag | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -netif, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Fragment an IPv6 datagram if too large for the netif or path MTU.
-Chop the datagram in MTU sized chunks and send them in order by pointing PBUF_REFs into p
-p | ipv6 packet to send |
netif | the netif on which to send |
dest | destination ipv6 address to which to send |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip6_addr.h"
#include "lwip/ip6.h"
#include "lwip/netif.h"
-Data Structures | |
struct | ip6_reassdata |
struct | pbuf_custom_ref |
-Macros | |
#define | IP6_REASS_TMR_INTERVAL 1000 |
#define | IPV6_FRAG_COPYHEADER 0 |
-Functions | |
struct pbuf * | ip6_reass (struct pbuf *p) |
err_t | ip6_frag (struct pbuf *p, struct netif *netif, const ip6_addr_t *dest) |
IPv6 fragmentation and reassembly.
-#define IP6_REASS_TMR_INTERVAL 1000 | -
The IPv6 reassembly timer interval in milliseconds.
- -#define IPV6_FRAG_COPYHEADER 0 | -
IP6_FRAG_COPYHEADER==1: for platforms where sizeof(void*) > 4, "struct -ip6_reass_helper" is too large to be stored in the IPv6 fragment header, and will bleed into the header before it, which may be the IPv6 header or an extension header. This means that for each first fragment packet, we need to 1) make a copy of some IPv6 header fields (src+dest) that we need later on, just in case we do overwrite part of the IPv6 header, and 2) make a copy of the header data that we overwrote, so that we can restore it before either completing reassembly or sending an ICMPv6 reply. The last part is true even if this setting is disabled, but if it is enabled, we need to save a bit more data (up to the size of a pointer) because we overwrite more.
- -err_t ip6_frag | -( | -struct pbuf * | -p, | -
- | - | struct netif * | -netif, | -
- | - | const ip6_addr_t * | -dest | -
- | ) | -- |
Fragment an IPv6 datagram if too large for the netif or path MTU.
-Chop the datagram in MTU sized chunks and send them in order by pointing PBUF_REFs into p
-p | ipv6 packet to send |
netif | the netif on which to send |
dest | destination ipv6 address to which to send |
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Macros | |
#define | IP6_NO_ZONE 0 |
#define | IPADDR6_ZONE_INIT , IP6_NO_ZONE |
#define | ip6_addr_zone(ip6addr) ((ip6addr)->zone) |
#define | ip6_addr_has_zone(ip6addr) (ip6_addr_zone(ip6addr) != IP6_NO_ZONE) |
#define | ip6_addr_set_zone(ip6addr, zone_idx) ((ip6addr)->zone = (zone_idx)) |
#define | ip6_addr_clear_zone(ip6addr) ((ip6addr)->zone = IP6_NO_ZONE) |
#define | ip6_addr_copy_zone(ip6addr1, ip6addr2) ((ip6addr1).zone = (ip6addr2).zone) |
#define | ip6_addr_equals_zone(ip6addr, zone_idx) ((ip6addr)->zone == (zone_idx)) |
#define | ip6_addr_cmp_zone(ip6addr1, ip6addr2) ((ip6addr1)->zone == (ip6addr2)->zone) |
#define | IPV6_CUSTOM_SCOPES 0 |
#define | ip6_addr_has_scope(ip6addr, type) |
#define | ip6_addr_assign_zone(ip6addr, type, netif) |
#define | ip6_addr_test_zone(ip6addr, netif) (ip6_addr_equals_zone((ip6addr), netif_get_index(netif))) |
#define | ip6_addr_lacks_zone(ip6addr, type) (!ip6_addr_has_zone(ip6addr) && ip6_addr_has_scope((ip6addr), (type))) |
#define | ip6_addr_select_zone(dest, src) |
-Enumerations | |
enum | lwip_ipv6_scope_type { IP6_UNKNOWN = 0, -IP6_UNICAST = 1, -IP6_MULTICAST = 2 - } |
IPv6 address scopes, zones, and scoping policy.
-This header provides the means to implement support for IPv6 address scopes, as per RFC 4007. An address scope can be either global or more constrained. In lwIP, we say that an address "has a scope" or "is scoped" when its scope is constrained, in which case the address is meaningful only in a specific "zone." For unicast addresses, only link-local addresses have a scope; in that case, the scope is the link. For multicast addresses, there are various scopes defined by RFC 4007 and others. For any constrained scope, a system must establish a (potentially one-to-many) mapping between zones and local interfaces. For example, a link-local address is valid on only one link (its zone). That link may be attached to one or more local interfaces. The decisions on which scopes are constrained and the mapping between zones and interfaces is together what we refer to as the "scoping policy" - more on this in a bit.
-In lwIP, each IPv6 address has an associated zone index. This zone index may be set to "no zone" (IP6_NO_ZONE, 0) or an actual zone. We say that an address "has a zone" or "is zoned" when its zone index is not set to "no -zone." In lwIP, in principle, each address should be "properly zoned," which means that if the address has a zone if and only if has a scope. As such, it is a rule that an unscoped (e.g., global) address must never have a zone. Even though one could argue that there is always one zone even for global scopes, this rule exists for implementation simplicity. Violation of the rule will trigger assertions or otherwise result in undesired behavior.
-Backward compatibility prevents us from requiring that applications always provide properly zoned addresses. We do enforce the rule that the in the lwIP link layer (everything below netif->output_ip6() and in particular ND6) all addresses are properly zoned. Thus, on the output paths down the stack, various places deal with the case of addresses that lack a zone. Some of them are best-effort for efficiency (e.g. the PCB bind and connect API calls' attempts to add missing zones); ultimately the IPv6 output handler (ip6_output_if_src) will set a zone if necessary.
-Aside from dealing with scoped addresses lacking a zone, a proper IPv6 implementation must also ensure that a packet with a scoped source and/or destination address does not leave its zone. This is currently implemented in the input and forward functions. However, for output, these checks are deliberately omitted in order to keep the implementation lightweight. The routing algorithm in ip6_route will take decisions such that it will not cause zone violations unless the application sets bad addresses, though.
-In terms of scoping policy, lwIP implements the default policy from RFC 4007 using macros in this file. This policy considers link-local unicast addresses and (only) interface-local and link-local multicast addresses as having a scope. For all these addresses, the zone is equal to the interface. As shown below in this file, it is possible to implement a custom policy.
-
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
-Functions | |
char * | ipaddr_ntoa (const ip_addr_t *addr) |
char * | ipaddr_ntoa_r (const ip_addr_t *addr, char *buf, int buflen) |
int | ipaddr_aton (const char *cp, ip_addr_t *addr) |
err_t | ip_input (struct pbuf *p, struct netif *inp) |
-Variables | |
struct ip_globals | ip_data |
Common IPv4 and IPv6 code
-struct ip_globals ip_data | -
Global data for both IPv4 and IPv6
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
#include "lwip/err.h"
#include "lwip/netif.h"
#include "lwip/ip4.h"
#include "lwip/ip6.h"
#include "lwip/prot/ip.h"
-Data Structures | |
struct | ip_globals |
-Macros | |
#define | LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p) LWIP_ASSERT("p->ref == 1", (p)->ref == 1) |
#define | IP_PCB |
#define | ip_current_netif() (ip_data.current_netif) |
#define | ip_current_input_netif() (ip_data.current_input_netif) |
#define | ip_current_header_tot_len() (ip_data.current_ip_header_tot_len) |
#define | ip_current_src_addr() (&ip_data.current_iphdr_src) |
#define | ip_current_dest_addr() (&ip_data.current_iphdr_dest) |
#define | ip4_current_header() ip_data.current_ip4_header |
#define | ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header)) |
#define | ip_current_is_v6() (ip6_current_header() != NULL) |
#define | ip6_current_src_addr() (ip_2_ip6(&ip_data.current_iphdr_src)) |
#define | ip6_current_dest_addr() (ip_2_ip6(&ip_data.current_iphdr_dest)) |
#define | ip_current_header_proto() |
#define | ip_next_header_ptr() |
#define | ip4_current_src_addr() (ip_2_ip4(&ip_data.current_iphdr_src)) |
#define | ip4_current_dest_addr() (ip_2_ip4(&ip_data.current_iphdr_dest)) |
#define | ip_current_src_addr() (&ip_data.current_iphdr_src) |
#define | ip_current_dest_addr() (&ip_data.current_iphdr_dest) |
#define | ip_get_option(pcb, opt) ((pcb)->so_options & (opt)) |
#define | ip_set_option(pcb, opt) ((pcb)->so_options = (u8_t)((pcb)->so_options | (opt))) |
#define | ip_reset_option(pcb, opt) ((pcb)->so_options = (u8_t)((pcb)->so_options & ~(opt))) |
#define | ip_output(p, src, dest, ttl, tos, proto) |
#define | ip_output_if(p, src, dest, ttl, tos, proto, netif) |
#define | ip_output_if_src(p, src, dest, ttl, tos, proto, netif) |
#define | ip_output_if_hdrincl(p, src, dest, netif) |
#define | ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint) |
#define | ip_route(src, dest) |
#define | ip_netif_get_local_ip(netif, dest) |
-Functions | |
err_t | ip_input (struct pbuf *p, struct netif *inp) |
-Variables | |
struct ip_globals | ip_data |
IP API
-#define ip4_current_dest_addr | -( | -) | -(ip_2_ip4(&ip_data.current_iphdr_dest)) | -
Destination IP4 address of current_header
- -#define ip4_current_header | -( | -) | -ip_data.current_ip4_header | -
Get the IPv4 header of the current packet. This function must only be called from a receive callback (udp_recv, raw_recv, tcp_accept). It will return NULL otherwise.
- -#define ip4_current_src_addr | -( | -) | -(ip_2_ip4(&ip_data.current_iphdr_src)) | -
Source IP4 address of current_header
- -#define ip6_current_dest_addr | -( | -) | -(ip_2_ip6(&ip_data.current_iphdr_dest)) | -
Destination IPv6 address of current_header
- -#define ip6_current_header | -( | -) | -((const struct ip6_hdr*)(ip_data.current_ip6_header)) | -
Get the IPv6 header of the current packet. This function must only be called from a receive callback (udp_recv, raw_recv, tcp_accept). It will return NULL otherwise.
- -#define ip6_current_src_addr | -( | -) | -(ip_2_ip6(&ip_data.current_iphdr_src)) | -
Source IPv6 address of current_header
- -#define ip_current_dest_addr | -( | -) | -(&ip_data.current_iphdr_dest) | -
Destination IP address of current_header
-Union destination address of current_header
- -#define ip_current_dest_addr | -( | -) | -(&ip_data.current_iphdr_dest) | -
Destination IP address of current_header
-Union destination address of current_header
- -#define ip_current_header_proto | -( | -) | -- |
Get the transport layer protocol
- -#define ip_current_header_tot_len | -( | -) | -(ip_data.current_ip_header_tot_len) | -
Total header length of ip(6)_current_header() (i.e. after this, the UDP/TCP header starts)
- -#define ip_current_input_netif | -( | -) | -(ip_data.current_input_netif) | -
Get the interface that received the current packet. This function must only be called from a receive callback (udp_recv, raw_recv, tcp_accept). It will return NULL otherwise.
- -#define ip_current_is_v6 | -( | -) | -(ip6_current_header() != NULL) | -
Returns TRUE if the current IP input packet is IPv6, FALSE if it is IPv4
- -#define ip_current_netif | -( | -) | -(ip_data.current_netif) | -
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, raw_recv, tcp_accept). It will return NULL otherwise.
- -#define ip_current_src_addr | -( | -) | -(&ip_data.current_iphdr_src) | -
Source IP address of current_header
-Union source address of current_header
- -#define ip_current_src_addr | -( | -) | -(&ip_data.current_iphdr_src) | -
Source IP address of current_header
-Union source address of current_header
- -#define ip_get_option | -( | -- | pcb, | -
- | - | - | opt | -
- | ) | -((pcb)->so_options & (opt)) | -
Gets an IP pcb option (SOF_* flags)
- -#define ip_next_header_ptr | -( | -) | -- |
Get the transport layer header
- -#define ip_output_hinted | -( | -- | p, | -
- | - | - | src, | -
- | - | - | dest, | -
- | - | - | ttl, | -
- | - | - | tos, | -
- | - | - | proto, | -
- | - | - | netif_hint | -
- | ) | -- |
Output IP packet with netif_hint
- -#define ip_output_if_hdrincl | -( | -- | p, | -
- | - | - | src, | -
- | - | - | dest, | -
- | - | - | netif | -
- | ) | -- |
Output IP packet that already includes an IP header.
- -#define IP_PCB | -
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 having to change all PCB structs.
- -#define ip_reset_option | -( | -- | pcb, | -
- | - | - | opt | -
- | ) | -((pcb)->so_options = (u8_t)((pcb)->so_options & ~(opt))) | -
Resets an IP pcb option (SOF_* flags)
- -#define ip_set_option | -( | -- | pcb, | -
- | - | - | opt | -
- | ) | -((pcb)->so_options = (u8_t)((pcb)->so_options | (opt))) | -
Sets an IP pcb option (SOF_* flags)
- -#define LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX | -( | -- | p | ) | -LWIP_ASSERT("p->ref == 1", (p)->ref == 1) | -
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
- -struct ip_globals ip_data | -
Global data for both IPv4 and IPv6
- -
- lwIP
- 2.1.2
-
- Lightweight IP stack
- |
-
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/ip4_addr.h"
#include "lwip/ip6_addr.h"
-Data Structures | |
struct | ip_addr |
-Macros | |
#define | IPADDR4_INIT(u32val) { { { { u32val, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V4 } |
#define | IPADDR4_INIT_BYTES(a, b, c, d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d))) |
#define | IPADDR6_INIT(a, b, c, d) { { { { a, b, c, d } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 } |
#define | IPADDR6_INIT_HOST(a, b, c, d) { { { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 } |
#define | IP_IS_ANY_TYPE_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_ANY) |
#define | IPADDR_ANY_TYPE_INIT { { { { 0ul, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_ANY } |
#define | IP_IS_V4_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4) |
#define | IP_IS_V6_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V6) |
#define | IP_IS_V4(ipaddr) (((ipaddr) == NULL) || IP_IS_V4_VAL(*(ipaddr))) |
#define | IP_IS_V6(ipaddr) (((ipaddr) != NULL) && IP_IS_V6_VAL(*(ipaddr))) |
#define | ip_2_ip6(ipaddr) (&((ipaddr)->u_addr.ip6)) |
#define | ip_2_ip4(ipaddr) (&((ipaddr)->u_addr.ip4)) |
#define | IP_ADDR4(ipaddr, a, b, c, d) |
#define | IP_ADDR6(ipaddr, i0, i1, i2, i3) |
#define | IP_ADDR6_HOST(ipaddr, i0, i1, i2, i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3)) |
#define | ip_addr_copy(dest, src) |
#define | ip_addr_copy_from_ip6(dest, src) |
#define | ip_addr_copy_from_ip6_packed(dest, src) |
#define | ip_addr_copy_from_ip4(dest, src) |
#define | ip_addr_set_ip4_u32(ipaddr, val) |
#define | ip_addr_set_ip4_u32_val(ipaddr, val) |
#define | ip_addr_get_ip4_u32(ipaddr) |
#define | ip_addr_set(dest, src) |
#define | ip_addr_set_ipaddr(dest, src) ip_addr_set(dest, src) |
#define | ip_addr_set_zero(ipaddr) |
#define | ip_addr_set_zero_ip4(ipaddr) |
#define | ip_addr_set_zero_ip6(ipaddr) |
#define | ip_addr_set_any(is_ipv6, ipaddr) |
#define | ip_addr_set_any_val(is_ipv6, ipaddr) |
#define | ip_addr_set_loopback(is_ipv6, ipaddr) |
#define | ip_addr_set_loopback_val(is_ipv6, ipaddr) |
#define | ip_addr_set_hton(dest, src) |
#define | ip_addr_get_network(target, host, netmask) |
#define | ip_addr_netcmp(addr1, addr2, mask) |
#define | ip_addr_cmp(addr1, addr2) |
#define | ip_addr_cmp_zoneless(addr1, addr2) |
#define | ip_addr_isany(ipaddr) |
#define | ip_addr_isany_val(ipaddr) |
#define | ip_addr_isbroadcast(ipaddr, netif) |
#define | ip_addr_ismulticast(ipaddr) |
#define | ip_addr_isloopback(ipaddr) |
#define | ip_addr_islinklocal(ipaddr) |
#define | IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX |
#define | ip4_2_ipv4_mapped_ipv6(ip6addr, ip4addr) |
#define | unmap_ipv4_mapped_ipv6(ip4addr, ip6addr) (ip4addr)->addr = (ip6addr)->addr[3]; |
#define | IP_ADDR_ANY IP4_ADDR_ANY |
#define | IP4_ADDR_ANY (&ip_addr_any) |
#define | IP4_ADDR_ANY4 (ip_2_ip4(&ip_addr_any)) |
#define | IP_ADDR_BROADCAST (&ip_addr_broadcast) |
#define | IP4_ADDR_BROADCAST (ip_2_ip4(&ip_addr_broadcast)) |
#define | IP6_ADDR_ANY (&ip6_addr_any) |
#define | IP6_ADDR_ANY6 (ip_2_ip6(&ip6_addr_any)) |
#define | IP_ANY_TYPE (&ip_addr_any_type) |
-Typedefs | |
typedef struct ip_addr | ip_addr_t |
-Enumerations | |
enum | lwip_ip_addr_type { IPADDR_TYPE_V4 = 0U, -IPADDR_TYPE_V6 = 6U, -IPADDR_TYPE_ANY = 46U - } |
-Functions | |
char * | ipaddr_ntoa (const ip_addr_t *addr) |
char * | ipaddr_ntoa_r (const ip_addr_t *addr, char *buf, int buflen) |
int | ipaddr_aton (const char *cp, ip_addr_t *addr) |
IP address API (common IPv4 and IPv6)
-#define ip_addr_set_zero_ip4 | -( | -- | ipaddr | ) | -- |
t |