goldsimon
f9c30017b0
Fixed bug #20429 : use the new pbuf_copy_partial instead of the old copy_from_pbuf, which illegally modified the given pbuf; Introduced pbuf_copy_partial, making netbuf_copy_partial use this function.
2007-07-25 18:53:45 +00:00
goldsimon
eb875de67e
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 20:28:35 +00:00
goldsimon
9a4a5b1816
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-03 19:29:59 +00:00
fbernon
af71292aba
Minor fix (extra spaces)
2007-06-29 13:37:33 +00:00
goldsimon
bb9e9e5480
Changed the expression of LWIP_ERROR to the same as for LWIP_ASSERT
2007-06-22 20:50:21 +00:00
goldsimon
f49fc35f55
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 19:32:26 +00:00
goldsimon
9f05cabf87
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-21 18:40:21 +00:00
goldsimon
173e63f01b
Minor fix: coding style
2007-06-16 15:03:09 +00:00
goldsimon
775deefeaa
Done some work on task #1549 (function documentation), added some LWIP_ERROR checks, created define instead of extra-function for netconn_new, netconn_new_with_callback and netconn_err
2007-06-16 13:57:30 +00:00
fbernon
d8fe18c28e
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 18:08:49 +00:00
fbernon
9ee85fb1b6
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 (some others change will be done...).
2007-06-13 18:00:54 +00:00
fbernon
090aaefb39
Add LWIP_TCPIP_CORE_LOCKING option (0 as default value) to experiment "locking" as feature to communicate with tcpip_thread for sequential API (netconn & socket layers). Add a alternative code for lwip_sendto to how the code can be optimized with such feature....
2007-06-08 19:27:59 +00:00
fbernon
a3fdc33f88
api_lib.c: Implement SO_RCVTIMEO for accept and recv on TCP connections, such present in patch #5959 .
2007-05-23 19:18:09 +00:00
fbernon
a330917ee8
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 18:43:30 +00:00
fbernon
0fe5dd8d43
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-23 17:53:35 +00:00
fbernon
953d783a3e
api.h, api_lib.c, api_msg.c, sockets.c: group the different NETCONN_UDPxxx code in only one part...
2007-05-23 17:46:53 +00:00
fbernon
d1ef610822
Minor fix (spaces, indent) and check for LWIP_SO_RCVTIMEO..
2007-05-22 21:29:04 +00:00
fbernon
2ff620e1b5
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 20:51:34 +00:00
fbernon
499f4689be
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 09:54:00 +00:00
goldsimon
81ac03a28b
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-22 07:31:06 +00:00
fbernon
6bfa99a774
Minor fixs to reduce footprint on the "recv part" of Sequential API...
2007-05-19 13:54:56 +00:00
goldsimon
8fa3b6802e
Added #if !NO_SYS to most of the api files since they only work with a sys layer (makes it easier for port projects).
2007-05-18 11:27:46 +00:00
fbernon
9cf1390dc6
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-11 08:58:23 +00:00
goldsimon
255d5a748f
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-10 05:20:05 +00:00
fbernon
5a12aeb4a1
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-05-04 15:18:29 +00:00
jifl
0c94f22ded
* 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.
2007-04-11 15:41:03 +00:00
fbernon
913a99dd35
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 17:26:06 +00:00
fbernon
005e5f2f72
api_lib.c (from Dmitry Potapov) : 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-26 15:37:48 +00:00
fbernon
db739d16ce
api_lib.c: somes resources couldn't be freed if there was errors during netconn_new_with_proto_and_callback.
2007-03-22 09:27:04 +00:00
fbernon
3eb38d7611
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 16:38:58 +00:00
fbernon
a24a170b84
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).
...
Mace Gael for the upper layers, Steve Reynolds for lower ones...
2007-03-11 19:16:38 +00:00
goldsimon
bc4b3764fc
Fixed bug #19251 (missing `const' qualifier in socket functions), to get more compatible to standard POSIX sockets.
2007-03-11 17:57:13 +00:00
fbernon
fdcb87db19
Implement LWIP_SO_RCVTIMEO configuration option to enable/disable SO_RCVTIMEO on UDP sockets/netconn.
2007-03-08 20:58:46 +00:00
fbernon
7fd37d4e87
Implement SO_RCVTIMEO on UDP sockets/netconn.
2007-03-06 16:41:02 +00:00
fbernon
12e0a2ef7d
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 14:49:46 +00:00
kieranm
527d18a526
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-28 14:15:43 +00:00
jifl
de665f7cf9
2007-02-26 Jonathan Larmour (based on patch from Simon Goldschmidt)
...
* api_lib.c: Use memcpy in netbuf_copy_partial.
2007-02-26 19:49:49 +00:00
christiaans
b5f4672155
Partially accepted patch #5449 for ANSI C compatibility / build fixes. Fixed bug #17574 corrected UDP-Lite protocol identifier.
2006-10-11 12:04:04 +00:00
christiaans
7026bbcdd4
Removed conn->sem creation and destruction from netconn_write() and added sys_sem_new to netconn_new_*
2006-05-26 07:39:39 +00:00
christiaans
e1b215aa73
Introduced cc.h formatters and removed SO_REUSE from transport layers.
2005-11-25 12:03:38 +00:00
kieranm
19d8ffe177
Kieran Mansley - kjm25@cam.ac.uk - 20th September 2004
...
* Check if the pbuf is NULL before freeing it, when draining the mbox as part of netconn_delete.
2004-09-20 16:58:01 +00:00
likewise
e1c4bfad05
Merged from DEVEL, except for the API change in etharp.c.
2004-02-07 00:30:03 +00:00
likewise
e4a6d199fe
Merged from DEVEL into main tree.
2003-11-14 13:17:23 +00:00
marcbou
351e590e01
Merged from DEVEL.
2003-06-27 20:46:11 +00:00
kieranm
8014551908
Changed DEBUGF to LWIP_DEBUGF
2003-06-10 10:45:29 +00:00
likewise
df99ce9d98
Replaced all tabs with two spaces (regardless of indentation is correct).
2003-06-09 21:14:47 +00:00
jani
cd65d36822
patches 1492, 1493 and 1494 from Marc
2003-05-19 14:41:54 +00:00
likewise
03bc7c868b
Major stylo search/replace for "One space between keyword and opening bracket."
2003-05-01 13:24:01 +00:00
davidhaas
0bce6f8974
Fixed bug where tearing down a connection would cause loss of memory.
2003-04-09 20:12:12 +00:00
kieranm
a5be8fe82c
Fixed bug in netconn_peer (test pcb for NULL before accessing)
2003-03-31 09:34:56 +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
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
davidhaas
7b3e158c92
sys_thread_new() now returns the thread (request from Marc Boucher).
...
Removed some unused .h files in coldfire port.
Support LWIP_DIAG and LWIP_ASSERT in coldfire (sort of).
Fix to last api fix to make sure select() is triggered, even when there has
been a FIN.
Allow build of unixsim from cygwin by specifying "make ARCH=cygwin" or from
linux by specifying "make ARCH=linux".
2003-02-11 21:00:14 +00:00
jani
848dea2058
Only access non-NULL pbufs on some paths where they can be NULL in newly introduced callback code
2003-02-11 16:33:02 +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
jani
6d0a8a85c7
Fix locking for disconnect operation (use post and fetch on the connection's mbox in the two threads like other operations).Make netconn_peer take a pointer to addr instead of pointer to pointer to addr.Addr is a 4 byte struct an IP address so use structure assignment not just pointer assignment when saving the peer.This way the address is really saved :fixes bug #1897
2003-01-24 09:24:44 +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
likewise
cc4df7100d
Updated lwIP module copyright years to include 2003. Committers must check theirs.
2003-01-08 10:09:39 +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
f06e955072
Initial revision
2002-10-19 12:59:30 +00:00