Commit Graph

2703 Commits

Author SHA1 Message Date
likewise
20667e5163 Added debug levels for some serious errors (out of memory). 2003-03-24 10:29:03 +00:00
davidhaas
96f2e162ef Fixed memory leak caused by my last pbuf_ref change. 2003-03-21 23:01:20 +00:00
jani
859f06a91e if LWIP_TCP is 0 do not link in TCP code.putting ugly ifdefs in api and core :(.Also only udp_init if LWIP_UDP is on 2003-03-21 10:48:21 +00:00
davidhaas
32d9f25a6f Fixed up and made work a PBUF_REF type. Most of the code uses this now
instead of PBUF_ROM. This addition allows support of copy-on-demand where the
lower layers can call pbuf_unref() which tests for any PBUF_REF buffers and
replaces them with PBUF_POOL buffers. This is now used
everywhere. pbuf_unref() is called in ARP queueing and in the coldfire
driver, which puts frames on a DMA queue and frees them later.

Along with this change pbuf_free() now goes through the entire chain of
buffers and tests all the ref counters, not just the first one. Generally now
pbuf_ref_chain() should be called and not pbuf_ref(). This change was made
because it is possible for the head of the pbuf chain to have a different
count than the payload pbuf which might have been passed by the application.
2003-03-19 22:14:49 +00:00
jani
2f7e4bd587 patch 1197 form floriZ.When debug is on and port is 0 in udp_bind ERR_USE is always returned due to missing braces.Reindent that part of code while at it 2003-03-19 16:04:54 +00:00
jani
0846206bc0 rename STATS to LWIP_STATS and make it checked by #if not #ifdef.The rest of the _STATS defines should follow 2003-03-19 12:37:46 +00:00
likewise
090b4087fc Using a negated unsigned value as func. arg. fails for Keil C166 compilers. 2003-03-16 22:39:15 +00:00
likewise
7ece19c474 pbuf_unfold_reply() lost memory if already unfold.
dhcp_stop() leaked memory if a unfold reply was still in existance.
2003-03-16 22:36:54 +00:00
likewise
dbdd0f520f Added source comments. 2003-03-13 08:50:04 +00:00
likewise
daeb21b3b9 Include "netif.h" for ntohl and friends. 2003-03-10 16:13:25 +00:00
likewise
7e36c58529 Make sure that BYTE_ORDER is actually defined. Panic with #error if not. 2003-03-10 16:12:41 +00:00
jani
8613f2a48e factor out netif_set_addr so address of netif can be changed 2003-03-07 10:55:58 +00:00
jani
0ba9a45d32 icmp messages need only PBUF_IP layer 2003-02-25 16:00:21 +00:00
jani
d390ca7056 cleaned up opt.h a bit, added more option defaults ad changed SYS_LIGHTWEIGHT_PROT to be a 0/1 define.The same for COMPAT_SOCKET 2003-02-24 10:49:05 +00:00
jani
18df3961e9 byte-order handling functions are in inet.c now and the uperrcase counterparts are gone. opt.h has all the
configurable items debug does not need to be directly included.
2003-02-21 16:43:46 +00:00
jani
8e9aa84070 do not directly include lwipopts.h but lwip/opt.h instead 2003-02-20 16:32:22 +00:00
likewise
d1c03cbd69 Fixed some issues open after merging 'leon-dhcp'. 2003-02-20 14:35:40 +00:00
likewise
37629fc1b6 Fixed some issues open after merging 'leon-dhcp'. Added new debugging. 2003-02-20 13:13:51 +00:00
jani
cc31bb9358 make netif->init return err_t instead of void.Patch from David Le Corfec 2003-02-20 11:51:53 +00:00
likewise
d8d787545e Merged with leon-dhcp branch. Tagged as POST_leon-dhcp afterwards. 2003-02-20 08:41:59 +00:00
likewise
0a51d72098 Removed Id: fields as they give conflicts while merging to leon-dhcp branch. 2003-02-19 22:07:42 +00:00
davidhaas
e13c78820f Fixed SYS_ARCH_PROTECT macros when NO_SYS is not defined.
Added documentation for lightweight protection.

Fixed debug statement in ip.c.

Removed tabs in files I changed.
2003-02-18 21:14:16 +00:00
davidhaas
7f1becc682 Allow minimal unix target to build in cygwin (but not necessarily run).
Applied a patch from Marc Boucher which has the following changes:

1) Fixed sys_arch.txt documentation to have new return type from
   sys_thread_new.

2) Removed unnecessary casts on calling sys_timeout() in certain files.

3) Removed some unnecessary break statements after return statements.

4) Changed sys_timeout_remove() to sys_untimeout().

5) Added some forgotten #ifndef SYS_LIGHTWEIGHT_PROT to memp.c

6) Changed LWIP_DIAG and LWIP_PLATFORM_ASSERT to have do while().
2003-02-18 19:27:48 +00:00
likewise
cb6cec0404 Disabled too restrictive behaviour in _bind() and _connect(). Reimplementation pending. 2003-02-14 15:49:02 +00:00
davidhaas
de29a0818e By request: moved lightweight protection to macros. 2003-02-12 22:00:18 +00:00
davidhaas
353478180d Fix some compile issues with both coldfire and unix builds. 2003-02-12 15:09:04 +00:00
jani
f2d35751ca fix doxygen comment for netif_add 2003-02-11 09:51:22 +00:00
davidhaas
dc49999124 Fixed some build issues regarding snmp.h 2003-02-10 21:58:34 +00:00
likewise
c68ee2b2ed SNMP functions are now unconditionally called and defined empty if LWIP_SNMP == 0
This removes a lot of #if #endif cluttering the source code.
2003-02-10 13:47:47 +00:00
jani
451926e5c3 don't include arch/lib.h 2003-02-07 10:23:15 +00:00
davidhaas
dd2fa15e8a Add the following features and bugfixes:
Added select() functionality to sockets library.
Support for errno in sockets library.
Byte ordering fixes.
basic lwip_ioctl(), FIONREAD, get/setsockopt() etc. support

- added additional argument to netif_add to pass state pointer so that the
if_init function has access to context information before
the interface is added, without accessing globals.

- added netif_remove()

- to conserve cpu load the tcpip_tcp_timer should only be active
when tcbs that need it exist.

- pass length of available data to callbacks for NETCONN_EVT_RCV events

- added tcpip_link_input(), a hack to allow processing of PPP
packets in tcpip_thread() context. This saves threads and context
switches.

- renamed incompatible ASSERT() macro to LWIP_ASSERT() to avoid name
collision.

- changed a bunch of %d's to %u's in format strings for unsigned values.

- added ip_frag to lwip_stats.

- changed IP_REASS_MAXAGE and IP_REASS_TMO defaults to more realistic
values.

- added sys_timeout_remove() function to cancel timeouts (needed by PPP
amongst other things).

- tolerate NULL returns from sys_arch_timeouts() since some threads might
not need to use or have timeouts.

- added sys_sem_wait_timeout()

- moved mem_malloc() function to end of mem.c to work around tasking
compiler bug.

- automatically bind to local tcp port if 0.

- allow customization of port ranges for automatic local bindings.

- corrected various typos, spelling errors, etc..

Thanks to Marc Boucher for many of these changes.
2003-02-06 22:18:56 +00:00
davidhaas
98fbb855fb Added lightweight protection. In coldfire this is implemented by disabling
interrupts. In unixsim this is implemented by using a mutex. Uses #define
SYS_LIGHTWEIGHT_PROT to enable. It is enabled in coldfire by default, but
disabled in unixsim.

Fixes bug 2005 if you enable SYS_LIGHTWEIGHT_PROT. So the bug is closed.
2003-02-04 22:52:22 +00:00
davidhaas
f5f31f5eaa ----------------------------------------------------------------------
Fixed the following bugs:
	2366: For coldfire port: pbuf is freed twice when no room on
	      output ring.
	2368: Coldfire port: buffer cleanup in 5272 driver causes
	      problems.
	2376: Can't have timeouts large enough

Note that timeouts are now 32 bits. This was done for select()
support. Coldfire and unix ports have been updated.
Committing in .

Modified Files:
	src/core/sys.c src/include/lwip/sys.h
----------------------------------------------------------------------
2003-02-04 14:50:45 +00:00
likewise
ea6432702f Added comments. Code cleanup. Clearer debugging in udp_input(). 2003-01-30 15:02:48 +00:00
likewise
faa9191191 Added commented about the signedness of pbuf_header() argument. 2003-01-30 12:38:03 +00:00
likewise
8560f6ef2b Fixed DHCP packet input filter. Added numerous comments. Code cleanup. 2003-01-30 10:18:40 +00:00
likewise
663b79ca72 ip_input() changed. A configured netif accepts any traffic and an unconfigured netif accepts only DHCP traffic.
Fixes bug #2004.
2003-01-28 18:24:25 +00:00
likewise
4a720425b7 Rebinding an active pcb did not check the given address/port against other bound pcb's. 2003-01-27 13:58:45 +00:00
likewise
0e4d59541a Fixed assignment of pcb->flags if pcb was NULL in udp_new(). 2003-01-27 12:35:16 +00:00
likewise
ba666295eb Nullified stray pointer for debugging purposes. 2003-01-27 11:31:30 +00:00
likewise
7dfd162a34 Added source documenting comments. 2003-01-27 08:50:28 +00:00
jani
721d237120 Fixes so that UDP connect() works.Enable generation of ICMP destination unreachable when the port is unavailable 2003-01-23 16:46:01 +00:00
jani
46c575c038 Fix udp_bind to allow rebind for same socket (yesterday's commit broke that) and introduce connection info for UDP pcbs.New function netconn_disconnect, do_disconnect for deatching UDP from a remote addres.Fix #2240 2003-01-22 16:18:05 +00:00
jani
16434f0d01 Don't allow multiple binds to the same UDP port/address pair.Closes bug #1896 2003-01-21 14:09:31 +00:00
likewise
2154ac3ecb Enhanced documentation on UDP PCB matchjng code. 2003-01-17 15:16:33 +00:00
jani
42309b5d6f put a state field in listen PCBs to since they are often treated as normal pcbs. patch #922, bug #2114 2003-01-17 14:18:55 +00:00
jani
049853362a ack duplicate segments too to prevent connection hanging when a single transmitted ACK gets lost 2003-01-14 09:38:10 +00:00
jani
3e6202f614 do not set rtime too many times to 0.it's enough to do it in tcp_output_segment 2003-01-14 08:37:01 +00:00
jani
a993e962f5 fix compiler warnings in DEBUGF 2003-01-14 08:22:05 +00:00
likewise
1ad5537c9b Fixed some typo's in the comments. 2003-01-13 13:22:09 +00:00
jani
4eebbdea0d print correct pcb->rtime value in debug statament.it does not directly depend on tcp_ticks 2003-01-10 15:41:02 +00:00
jani
4a2d03a517 seqno is u32_t so use %lu instead of %ld when printing it 2003-01-10 15:36:47 +00:00
jani
5212afdd8f remove already commented out function : memp_realloc 2003-01-10 09:42:27 +00:00
jani
e196108931 fix debug messages in tcp_slowtmr to reflect the correct name of this function 2003-01-10 09:41:24 +00:00
likewise
5e13d495f0 Merged patch #927 which fixes "needs modifiable lvalue" compile error in TCP_REG. 2003-01-08 15:37:20 +00:00
likewise
a528a2323e More debugging in checksum routines. 2003-01-08 15:36:25 +00:00
likewise
c786f238ef Output snd_buf size in debug message in tcp_enqueue(). 2003-01-08 14:35:02 +00:00
adamdunkels
d04f7aa4bc Added comments to the tcp_enqueue() function. 2003-01-08 14:11:24 +00:00
likewise
cc4df7100d Updated lwIP module copyright years to include 2003. Committers must check theirs. 2003-01-08 10:09:39 +00:00
jani
f946abd86b Simplify pbuf allocation for TCP packets in two places by replacing pbuf_alloc + pbuf_header
with an equivalent pbuf_alloc.When we know we'll have to adjust the payload for the TCP header
just alloc it like that from the start.
2002-12-19 09:50:53 +00:00
jani
156d2c866f sizeof(u8_t) is 1 at temperatures > 0 K 2002-12-19 09:04:58 +00:00
jani
ef68392388 renamed (hopefully everywhere) stats to lwip_stats.closes bug #1901 2002-12-18 12:49:01 +00:00
kieranm
9eebc135ce Removed dummy variable from "struct mem" and handled all MEM_ALIGNMENT cases
Fixes bug #1912
2002-12-18 12:01:24 +00:00
kieranm
771fb0f2cd Removed "static" from declaration of netif in ip_forward and ip_output
(Bug #1909)
2002-12-18 11:53:26 +00:00
jani
4c1069c38b use memset and memcpy instead of bzero and bcopy throughout lwIP core code.Archs need to update.Bug #1899 2002-12-18 10:40:01 +00:00
jani
f037bfad1e check for NO_SYS consistently using #if.Closes bug #1910 2002-12-18 10:03:33 +00:00
jani
c0a8ef6f6f Use C style comments.In debug stataments cast various struct pointers to void* to
avoid printf warnings.misc warnings in etharp.
2002-12-17 09:41:16 +00:00
likewise
5472d94b73 Added comment to ip_input() packet filter. 2002-12-11 00:21:12 +00:00
kieranm
96610c9c20 Fixed compiler warning - DEBUGF statement with too many arguments 2002-12-05 09:38:25 +00:00
kieranm
6972e81ac0 Zero pcb->acked if ack does not acknowledge new data
- prevents the sent function being called multiple times when no new data has been acknowledged
2002-12-03 10:45:47 +00:00
likewise
ea3b0fc477 Fixed missing end-of-comment. 2002-12-02 13:11:04 +00:00
likewise
99dfbfeef0 Clarified debug messages where the timers are set. 2002-12-02 12:23:37 +00:00
likewise
dcce504ade First attempt to stylize and document DHCP sources. 2002-12-01 19:49:45 +00:00
likewise
4619bbc3ea Changed dhcp_init() to NULL the client_list (on re-inits). 2002-11-25 22:36:25 +00:00
likewise
c73606309f Fixed argument type compiler warnings of the bcopy() call using type casting. 2002-11-24 22:27:10 +00:00
jani
0442c1e228 new file ip_frag for IP SAR.reassembly code moved from ip.c and fixed 2002-11-22 15:46:50 +00:00
jani
8210edfeea fix pbuf_alloc for layer PBUF_LINK 2002-11-22 08:32:31 +00:00
likewise
c9bd32d12b Added SNMP call-outs for monitoring of default SNMP status items for TCP/IP. 2002-11-21 10:32:19 +00:00
likewise
dfe1ab7438 Added debug messages for corner cases of TCP states. 2002-11-21 10:29:51 +00:00
likewise
1b798ed6d3 Added PBUF_REF (payload external, copied on queueing). 2002-11-18 09:51:48 +00:00
jani
f2fbcdf00a typo fixes.The unterminated comment already got two bugreports so it was time. 2002-11-18 07:36:29 +00:00
likewise
1dd7e81df7 DHCP cleanup redux (patch #654). 2002-11-15 12:44:50 +00:00
adamdunkels
43a06e8e37 The code that increased the retransmission time was commented out for some reason. This has been fixed. Also removed some old, out-commented, code. 2002-11-15 09:40:05 +00:00
jani
131eed412a Fix function names in DEBUGF stataments.Remove reference to "reclaimed" field in stat. 2002-11-14 12:20:37 +00:00
kieranm
4b9e035a9f Initialize err in tcp_slowtmr to prevent compiler warning. 2002-11-13 21:54:22 +00:00
adamdunkels
1f1e6eb5a1 Fixed a few C style issues to make it compatible with the rest of lwIP. 2002-11-13 08:11:52 +00:00
likewise
10bf9ef2ef ip_output() no longer frees pbuf in case no route could be found. 2002-11-11 14:49:17 +00:00
likewise
bca526b634 Workaround for compile error on TCP_REG. This workaround is disabled by default. 2002-11-11 14:47:26 +00:00
likewise
9b76f5bf53 Fixes all issues that showed up after the first commit. 2002-11-11 14:40:03 +00:00
likewise
3e62b75529 memp_alloc() now zeroes allocated memory (for robustness). Callers must NOT assume this. 2002-11-11 14:31:00 +00:00
likewise
ad55cb6733 Added pbuf_ref_chain() which increases ref count of all pbufs in a chain. 2002-11-11 11:22:49 +00:00
likewise
8077dd838c Added DHCP client by Leon Woestenberg 2002-11-08 15:57:23 +00:00
likewise
72e3d22271 To prevent compiler warnings, added UL to some bit mask constants. 2002-11-06 10:00:32 +00:00
kieranm
8b5fcad039 Added check on entire sequence number of received packet being less than the rcv_nxt variable.
(see http://www.sics.se/mailing-lists/lwip.html/msg01409.html)
2002-10-24 13:34:36 +00:00
adamdunkels
aa69784495 Replaced a += (combined addition and assignment) with an explicit assignment and addition to avoid compiler warnings. 2002-10-24 13:20:42 +00:00
kieranm
4933bfaaa0 Fixed bug in duplicate ack handling
(see http://www.sics.se/mailing-lists/lwip.html/msg01460.html)
Solution adds check on right window edge when duplicate ack received, if it is different it is not a duplicate.
2002-10-24 13:14:52 +00:00
kieranm
8fe9e007c9 Fixed congestion window bug where the pcb->cwnd variable overflowed when increased. 2002-10-24 10:57:44 +00:00
adamdunkels
814f8c505e Updated TCP out-of-sequence handling to use recv_data variable instead of old pcb->recv_data. 2002-10-23 19:58:16 +00:00
adamdunkels
28832ba9c2 Added #if LWIP_UDP around udp_init() body, fixed bug where un-connected UDP PCBs did not always receive correct datagram 2002-10-23 19:44:32 +00:00
likewise
bcb2600107 New file structure towards SLIP/PPP. Renamed tcp_*.c for 8.3 sake.
See lwip@sics.se Mon, 21 Oct 2002 magnus.ivarsson
2002-10-22 12:32:58 +00:00
likewise
fecc7424e4 Added redundant brackets in an if statement to keep a flaky compiler happy. 2002-10-20 15:20:30 +00:00
likewise
9ede36a386 Allocate struct tcp_seg *prev, *cseg only if TCP_QUEUE_OOSEQ is defined. 2002-10-20 15:19:20 +00:00
likewise
f06e955072 Initial revision 2002-10-19 12:59:30 +00:00