Part XLIV. lwIP - the lightweight IP stack for eCosPro

Jonathan Larmour

eCosCentric Limited

Adam Dunkels

LWIP Documentation Notices

Table of Contents

156. lwIP overview
156.1. Introduction
156.2. lwIP sources and ports
156.3. External documentation
156.4. Licensing
157. Basic concepts
157.1. Structure
157.2. Application Programming Interfaces (APIs)
157.3. Protocol implementations
157.4. Packet data buffers
157.5. Configurability
157.6. Limitations
157.7. Quick Start
158. Port
158.1. Port status
158.2. Implementation
158.2.1. System Configuration
158.2.2. System Source
158.2.3. Threads
158.3. Extensions
158.4. eCos API reference
cyg_lwip_init — Initialise lwIP network stack
cyg_lwip_netif_print_info — Output network interface address information
cyg_net_eth_phy_ctx_acquire — Allocate PHY event context
cyg_net_eth_phy_dsr — Notify lwIP stack of PHY event
cyg_lwip_tick_to_msec — Convert eCos kernel clock ticks to millisecond count
cyg_lwip_msec_to_tick — Convert millisecond count to eCos kernel clock ticks
cyg_lwip_statistics — Statistics output
159. Configuration
159.1. Configuration Overview
159.2. Configuring the lwIP stack
159.3. Performance and Footprint Tuning
159.3.1. Performance
159.3.2. Optimizations
159.3.3. Memory Footprint
160. Sequential API
160.1. Overview
160.2. Comparison with BSD sockets
160.2.1. BSD API Restrictions
160.3. Netbufs
160.4. TCP/IP thread
160.5. Usage
160.5.1. API declarations
160.5.2. Types
160.6. API reference
netbuf_new() — Allocate a netbuf structure
netbuf_delete() — Deallocate a netbuf structure
netbuf_alloc() — Allocate space in a netbuf
netbuf_free() — Deallocate buffer memory associated with a netbuf
netbuf_ref() — Associate a data pointer with a netbuf
netbuf_len() — Obtain the total length of a netbuf
netbuf_data() — Obtain a pointer to netbuf data
netbuf_next() — Traverse internal fragments in a netbuf
netbuf_first() — Reset fragment pointer to start of netbuf
netbuf_copy() — Copy all netbuf data to memory pointer
netbuf_copy_partial() — Copy some netbuf data to memory pointer
netbuf_chain() — Chain two netbufs together
netbuf_fromaddr() — Obtain the sender's IPv4 address for a netbuf
netbuf_fromaddr_ip6() — Obtain the sender's IPv6 address for a netbuf
netbuf_fromport() — Obtain the sender's port number for a netbuf
netconn_new() — Create a new connection structure
netconn_new_with_callback() — Create a new connection structure with a callback
netconn_new_with_proto_and_callback() — Create a new connection structure with a callback for a specific protocol
netconn_delete() — Deallocate a netconn
netconn_type() — Obtain the type of netconn
netconn_peer() — Obtain the remote host IP address/port of a netconn
netconn_addr() — Obtain the local host IPv4 address/port of a netconn
netconn_bind() — Set local IP address/port of a netconn
netconn_bind_ip6() — Set local IPv6 address/port of a netconn
netconn_connect() — Connect netconn to remote peer
netconn_connect_ip6() — Connect netconn to remote peer
netconn_disconnect() — Disconnect UDP connection
netconn_listen() — Make a listening TCP netconn
netconn_accept() — Wait for incoming connections
netconn_recv() — Wait for data
netconn_recv_tcp_pbuf() — Wait for data
netconn_recved() — Update receive window
netconn_write() — Send data on TCP connection
netconn_send() — Send data on UDP connection
netconn_close() — Close a connection
netconn_shutdown() — Shutdown a connection
netconn_set_noautorecved() — Set the connection no-auto-recved state
netconn_get_noautorecved() — Get the connection no-auto-recved state
netconn_err() — Obtain connection error status
161. Raw API
161.1. Overview
161.2. Usage
161.3. Callbacks
tcp_arg() — Set the application connection state
161.4. TCP connection setup
tcp_new() — Create a new TCP PCB
tcp_bind() — Bind PCB to local IP address and port
tcp_listen() — Make PCB listen for incoming connections
tcp_accept() — Set callback used for new incoming connections
tcp_connect() — Open connection to remote host
161.5. Sending TCP data
tcp_write() — Enqueue data for transmission
tcp_sent() — Set callback for successful transmission
161.6. Receiving TCP data
tcp_recv() — Set callback for incoming data
tcp_recved() — Indicate receipt of data
161.7. Application polling
tcp_poll() — Set application poll callback
161.8. Closing connections, aborting connections and errors
tcp_close() — Close the connection
tcp_abort() — Abort the connection
tcp_err() — Set callback for errors
161.9. Lower layer TCP interface
161.10. UDP interface
udp_new() — Create a new UDP pcb
udp_remove() — Remove a UDP pcb
udp_bind() — Bind PCB to local IP address and port
udp_connect() — Set remote UDP peer
udp_disconnect() — Set remote UDP peer
udp_send() — Send UDP packet
udp_recv() — Set callback for incoming UDP data
161.11. System initialization
161.11.1. Initialization detail
162. Debug and Test
162.1. Debugging
162.1.1. Asserts
162.1.2. Memory Allocations
162.1.3. Statistics
162.1.4. GDB/RedBoot
162.1.5. Host Tools
162.2. Testing
162.2.1. lwipsnmp
162.2.2. lwipsntp
162.2.3. lwiperf
162.2.4. unitwrap
162.2.5. socket
162.2.6. tcpecho
162.2.7. udpecho
162.2.8. frag
162.2.9. nc_test_slave
162.2.10. httpd
162.2.11. httpd2
162.2.12. lookup
162.2.13. sys_timeout
162.2.14. lwiphttpd