Skip to content

Commit ded3211

Browse files
author
Mika Leppänen
committed
Squashed 'features/net/FEATURE_IPV4/lwip-interface/lwip/' content from commit d7a6c6d
git-subtree-dir: features/net/FEATURE_IPV4/lwip-interface/lwip git-subtree-split: d7a6c6d768a300917c489e7b48d3708260926f20
0 parents  commit ded3211

File tree

262 files changed

+114185
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+114185
-0
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These files are text and should be normalized
2+
*.txt text
3+
*.c text
4+
*.h text

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/doc/doxygen/output
2+
/src/apps/snmp/LwipMibCompiler/CCodeGeneration/bin/
3+
/src/apps/snmp/LwipMibCompiler/CCodeGeneration/obj/
4+
/src/apps/snmp/LwipMibCompiler/LwipMibCompiler/bin/
5+
/src/apps/snmp/LwipMibCompiler/LwipMibCompiler/obj/
6+
/src/apps/snmp/LwipMibCompiler/MibViewer/bin/
7+
/src/apps/snmp/LwipMibCompiler/MibViewer/obj/
8+
/src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/bin/
9+
/src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/obj/
10+
/src/apps/snmp/LwipMibCompiler/SharpSnmpLib/bin/
11+
/src/apps/snmp/LwipMibCompiler/SharpSnmpLib/obj/
12+
/src/apps/snmp/LwipMibCompiler/LwipMibCompiler.userprefs
13+
/src/apps/snmp/LwipMibCompiler/*.suo

CHANGELOG

Lines changed: 4126 additions & 0 deletions
Large diffs are not rendered by default.

COPYING

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) 2001, 2002 Swedish Institute of Computer Science.
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
* 2. Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
* 3. The name of the author may not be used to endorse or promote products
14+
* derived from this software without specific prior written permission.
15+
*
16+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17+
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19+
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
21+
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24+
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
25+
* OF SUCH DAMAGE.
26+
*
27+
* This file is part of the lwIP TCP/IP stack.
28+
*
29+
* Author: Adam Dunkels <[email protected]>
30+
*
31+
*/
32+
33+

FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/ - The source code for the lwIP TCP/IP stack.
2+
doc/ - The documentation for lwIP.
3+
4+
See also the FILES file in each subdirectory.

README

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
INTRODUCTION
2+
3+
lwIP is a small independent implementation of the TCP/IP protocol
4+
suite that has been developed by Adam Dunkels at the Computer and
5+
Networks Architectures (CNA) lab at the Swedish Institute of Computer
6+
Science (SICS).
7+
8+
The focus of the lwIP TCP/IP implementation is to reduce the RAM usage
9+
while still having a full scale TCP. This making lwIP suitable for use
10+
in embedded systems with tens of kilobytes of free RAM and room for
11+
around 40 kilobytes of code ROM.
12+
13+
14+
FEATURES
15+
16+
* IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over
17+
multiple network interfaces
18+
* ICMP (Internet Control Message Protocol) for network maintenance and debugging
19+
* IGMP (Internet Group Management Protocol) for multicast traffic management
20+
* MLD (Multicast listener discovery for IPv6). Aims to be compliant with
21+
RFC 2710. No support for MLDv2
22+
* ND (Neighbor discovery and stateless address autoconfiguration for IPv6).
23+
Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862
24+
(Address autoconfiguration)
25+
* UDP (User Datagram Protocol) including experimental UDP-lite extensions
26+
* TCP (Transmission Control Protocol) with congestion control, RTT estimation
27+
and fast recovery/fast retransmit
28+
* raw/native API for enhanced performance
29+
* Optional Berkeley-like socket API
30+
* DNS (Domain names resolver)
31+
32+
33+
APPLICATIONS
34+
35+
* HTTP server with SSI and CGI
36+
* SNMPv2c agent with MIB compiler (Simple Network Management Protocol)
37+
* SNTP (Simple network time protocol)
38+
39+
40+
LICENSE
41+
42+
lwIP is freely available under a BSD license.
43+
44+
45+
DEVELOPMENT
46+
47+
lwIP has grown into an excellent TCP/IP stack for embedded devices,
48+
and developers using the stack often submit bug fixes, improvements,
49+
and additions to the stack to further increase its usefulness.
50+
51+
Development of lwIP is hosted on Savannah, a central point for
52+
software development, maintenance and distribution. Everyone can
53+
help improve lwIP by use of Savannah's interface, Git and the
54+
mailing list. A core team of developers will commit changes to the
55+
Git source tree.
56+
57+
The lwIP TCP/IP stack is maintained in the 'lwip' Git module and
58+
contributions (such as platform ports) are in the 'contrib' Git module.
59+
60+
See doc/savannah.txt for details on Git server access for users and
61+
developers.
62+
63+
The current Git trees are web-browsable:
64+
http://git.savannah.gnu.org/cgit/lwip.git
65+
http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git
66+
67+
Submit patches and bugs via the lwIP project page:
68+
http://savannah.nongnu.org/projects/lwip/
69+
70+
Continuous integration builds (GCC, clang):
71+
https://travis-ci.org/yarrick/lwip-merged
72+
73+
74+
DOCUMENTATION
75+
76+
Self documentation of the source code is regularly extracted from the current
77+
Git sources and is available from this web page:
78+
http://www.nongnu.org/lwip/
79+
80+
There is now a constantly growin wiki about lwIP at
81+
http://lwip.wikia.com/wiki/LwIP_Uncyclo
82+
83+
Also, there are mailing lists you can subscribe at
84+
http://savannah.nongnu.org/mail/?group=lwip
85+
plus searchable archives:
86+
http://lists.nongnu.org/archive/html/lwip-users/
87+
http://lists.nongnu.org/archive/html/lwip-devel/
88+
89+
lwIP was originally written by Adam Dunkels:
90+
http://dunkels.com/adam/
91+
92+
Reading Adam's papers, the files in docs/, browsing the source code
93+
documentation and browsing the mailing list archives is a good way to
94+
become familiar with the design of lwIP.
95+
96+
Adam Dunkels <[email protected]>
97+
Leon Woestenberg <[email protected]>

UPGRADING

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
This file lists major changes between release versions that require
2+
ports or applications to be changed. Use it to update a port or an
3+
application written for an older version of lwIP to correctly work
4+
with newer versions.
5+
6+
7+
(git master)
8+
9+
* [Enter new changes just after this line - do not remove this line]
10+
11+
* TODO
12+
13+
(2.0.0)
14+
15+
++ Application changes:
16+
17+
* Changed netif "up" flag handling to be an administrative flag (as opposed to the previous meaning of
18+
"ip4-address-valid", a netif will now not be used for transmission if not up) -> even a DHCP netif
19+
has to be set "up" before starting the DHCP client
20+
* Added IPv6 support (dual-stack or IPv4/IPv6 only)
21+
* Changed ip_addr_t to be a union in dual-stack mode (use ip4_addr_t where referring to IPv4 only).
22+
* Major rewrite of SNMP (added MIB parser that creates code stubs for custom MIBs);
23+
supports SNMP2vc (experimental v3 support)
24+
* Moved some core applications from contrib repository to src/apps (and include/lwip/apps)
25+
26+
+++ Raw API:
27+
* Changed TCP listen backlog: removed tcp_accepted(), added the function pair tcp_backlog_delayed()/
28+
tcp_backlog_accepted() to explicitly delay backlog handling on a connection pcb
29+
30+
+++ Socket API:
31+
* Added an implementation for posix sendmsg()
32+
* Added LWIP_FIONREAD_LINUXMODE that makes ioctl/FIONREAD return the size of the next pending datagram
33+
34+
++ Port changes
35+
36+
+++ new files:
37+
* MANY new and moved files!
38+
* Continued moving stack-internal parts from abc.h to abc_priv.h in sub-folder "priv"
39+
to let abc.h only contain the actual application programmer's API
40+
41+
+++ sys layer:
42+
* Made LWIP_TCPIP_CORE_LOCKING==1 the default as it usually performs better than
43+
the traditional message passing (although with LWIP_COMPAT_MUTEX you are still
44+
open to priority inversion, so this is not recommended any more)
45+
* Added LWIP_NETCONN_SEM_PER_THREAD to use one "op_completed" semaphore per thread
46+
instead of using one per netconn (these semaphores are used even with core locking
47+
enabled as some longer lasting functions like big writes still need to delay)
48+
49+
+++ new options:
50+
* TODO
51+
52+
+++ new pools:
53+
* Added LWIP_MEMPOOL_* (declare/init/alloc/free) to declare private memp pools
54+
that share memp.c code but do not have to be made global via lwippools.h
55+
* Added pools for IPv6, MPU_COMPATIBLE, dns-api, netif-api, etc.
56+
* added hook LWIP_HOOK_MEMP_AVAILABLE() to get informed when a memp pool was empty and an item
57+
is now available
58+
59+
* LWIP_DECLARE_MEMORY_ALIGNED() may be used to declare aligned memory buffers (mem/memp)
60+
or to move buffers to dedicated memory using compiler attributes
61+
62+
* Standard C headers are used to define sized types and printf formatters
63+
(disable by setting LWIP_NO_STDINT_H=1 or LWIP_NO_INTTYPES_H=1 if your compiler
64+
does not support these)
65+
66+
67+
++ Major bugfixes/improvements
68+
69+
* Added IPv6 support (dual-stack or IPv4/IPv6 only)
70+
* Major rewrite of PPP (incl. keep-up with apache pppd)
71+
* Major rewrite of SNMP (incl. MIB parser)
72+
* Fixed timing issues that might have lead to losing a DHCP lease
73+
* Made rx processing path more robust against crafted errors
74+
* TCP window scaling support
75+
* modification of api modules to support FreeRTOS-MPU (don't pass stack-pointers to other threads)
76+
* made DNS client more robust
77+
* support PBUF_REF for RX packets
78+
* LWIP_NETCONN_FULLDUPLEX allows netconn/sockets to be used for reading/writing from separate
79+
threads each (needs LWIP_NETCONN_SEM_PER_THREAD)
80+
* Moved and reorderd stats (mainly memp/mib2)
81+
82+
(1.4.0)
83+
84+
++ Application changes:
85+
86+
* Replaced struct ip_addr by typedef ip_addr_t (struct ip_addr is kept for
87+
compatibility to old applications, but will be removed in the future).
88+
89+
* Renamed mem_realloc() to mem_trim() to prevent confusion with realloc()
90+
91+
+++ Raw API:
92+
* Changed the semantics of tcp_close() (since it was rather a
93+
shutdown before): Now the application does *NOT* get any calls to the recv
94+
callback (aside from NULL/closed) after calling tcp_close()
95+
96+
* When calling tcp_abort() from a raw API TCP callback function,
97+
make sure you return ERR_ABRT to prevent accessing unallocated memory.
98+
(ERR_ABRT now means the applicaiton has called tcp_abort!)
99+
100+
+++ Netconn API:
101+
* Changed netconn_receive() and netconn_accept() to return
102+
err_t, not a pointer to new data/netconn.
103+
104+
+++ Socket API:
105+
* LWIP_SO_RCVTIMEO: when accept() or recv() time out, they
106+
now set errno to EWOULDBLOCK/EAGAIN, not ETIMEDOUT.
107+
108+
* Added a minimal version of posix fctl() to have a
109+
standardised way to set O_NONBLOCK for nonblocking sockets.
110+
111+
+++ all APIs:
112+
* correctly implemented SO(F)_REUSEADDR
113+
114+
++ Port changes
115+
116+
+++ new files:
117+
118+
* Added 4 new files: def.c, timers.c, timers.h, tcp_impl.h:
119+
120+
* Moved stack-internal parts of tcp.h to tcp_impl.h, tcp.h now only contains
121+
the actual application programmer's API
122+
123+
* Separated timer implementation from sys.h/.c, moved to timers.h/.c;
124+
Added timer implementation for NO_SYS==1, set NO_SYS_NO_TIMERS==1 if you
125+
still want to use your own timer implementation for NO_SYS==0 (as before).
126+
127+
+++ sys layer:
128+
129+
* Converted mbox- and semaphore-functions to take pointers to sys_mbox_t/
130+
sys_sem_t;
131+
132+
* Converted sys_mbox_new/sys_sem_new to take pointers and return err_t;
133+
134+
* Added Mutex concept in sys_arch (define LWIP_COMPAT_MUTEX to let sys.h use
135+
binary semaphores instead of mutexes - as before)
136+
137+
+++ new options:
138+
139+
* Don't waste memory when chaining segments, added option TCP_OVERSIZE to
140+
prevent creating many small pbufs when calling tcp_write with many small
141+
blocks of data. Instead, pbufs are allocated larger than needed and the
142+
space is used for later calls to tcp_write.
143+
144+
* Added LWIP_NETIF_TX_SINGLE_PBUF to always copy to try to create single pbufs
145+
in tcp_write/udp_send.
146+
147+
* Added an additional option LWIP_ETHERNET to support ethernet without ARP
148+
(necessary for pure PPPoE)
149+
150+
* Add MEMP_SEPARATE_POOLS to place memory pools in separate arrays. This may
151+
be used to place these pools into user-defined memory by using external
152+
declaration.
153+
154+
* Added TCP_SNDQUEUELOWAT corresponding to TCP_SNDLOWAT
155+
156+
+++ new pools:
157+
158+
* Netdb uses a memp pool for allocating memory when getaddrinfo() is called,
159+
so MEMP_NUM_NETDB has to be set accordingly.
160+
161+
* DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses a memp pool instead of the heap, so
162+
MEMP_NUM_LOCALHOSTLIST has to be set accordingly.
163+
164+
* Snmp-agent uses a memp pools instead of the heap, so MEMP_NUM_SNMP_* have
165+
to be set accordingly.
166+
167+
* PPPoE uses a MEMP pool instead of the heap, so MEMP_NUM_PPPOE_INTERFACES
168+
has to be set accordingly
169+
170+
* Integrated loopif into netif.c - loopif does not have to be created by the
171+
port any more, just define LWIP_HAVE_LOOPIF to 1.
172+
173+
* Added define LWIP_RAND() for lwip-wide randomization (needs to be defined
174+
in cc.h, e.g. used by igmp)
175+
176+
* Added printf-formatter X8_F to printf u8_t as hex
177+
178+
* The heap now may be moved to user-defined memory by defining
179+
LWIP_RAM_HEAP_POINTER as a void pointer to that memory's address
180+
181+
* added autoip_set_struct() and dhcp_set_struct() to let autoip and dhcp work
182+
with user-allocated structs instead of calling mem_malloc
183+
184+
* Added const char* name to mem- and memp-stats for easier debugging.
185+
186+
* Calculate the TCP/UDP checksum while copying to only fetch data once:
187+
Define LWIP_CHKSUM_COPY to a memcpy-like function that returns the checksum
188+
189+
* Added SO_REUSE_RXTOALL to pass received UDP broadcast/multicast packets to
190+
more than one pcb.
191+
192+
* Changed the semantics of ARP_QUEUEING==0: ARP_QUEUEING now cannot be turned
193+
off any more, if this is set to 0, only one packet (the most recent one) is
194+
queued (like demanded by RFC 1122).
195+
196+
197+
++ Major bugfixes/improvements
198+
199+
* Implemented tcp_shutdown() to only shut down one end of a connection
200+
* Implemented shutdown() at socket- and netconn-level
201+
* Added errorset support to select() + improved select speed overhead
202+
* Merged pppd to v2.3.11 (including some backported bugfixes from 2.4.x)
203+
* Added timer implementation for NO_SYS==1 (may be disabled with NO_SYS_NO_TIMERS==1
204+
* Use macros defined in ip_addr.h to work with IP addresses
205+
* Implemented many nonblocking socket/netconn functions
206+
* Fixed ARP input processing: only add a new entry if a request was directed as us
207+
* mem_realloc() to mem_trim() to prevent confusion with realloc()
208+
* Some improvements for AutoIP (don't route/forward link-local addresses, don't break
209+
existing connections when assigning a routable address)
210+
* Correctly handle remote side overrunning our rcv_wnd in ooseq case
211+
* Removed packing from ip_addr_t, the packed version is now only used in protocol headers
212+
* Corrected PBUF_POOL_BUFSIZE for ports where ETH_PAD_SIZE > 0
213+
* Added support for static ARP table entries
214+
215+
(STABLE-1.3.2)
216+
217+
* initial version of this file

doc/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
savannah.txt - How to obtain the current development source code.
2+
contrib.txt - How to contribute to lwIP as a developer.
3+
rawapi.txt - The documentation for the core API of lwIP.
4+
Also provides an overview about the other APIs and multithreading.
5+
snmp_agent.txt - The documentation for the lwIP SNMP agent.
6+
sys_arch.txt - The documentation for a system abstraction layer of lwIP.

0 commit comments

Comments
 (0)