fbernon
42f3c24fc4
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-22 10:04:35 +00:00
fbernon
c4b97a1710
Forget to rename this line (pbuf->flgs->pbuf->flags)
2007-08-22 08:47:48 +00:00
fbernon
885695fa67
Minor changes (tabs)
2007-08-17 10:46:07 +00:00
fbernon
e0bf309bb5
Add raw_init in tcpip_init + minor changes (tabs, ident, coding style...)
2007-08-17 09:57:37 +00:00
marcbou
d907bcd57a
lwip_recvfrom() tweaks.
2007-08-17 05:55:24 +00:00
marcbou
0167bbb89a
Per Frederic's suggestion, renamed
...
[MEMP_[NUM_]]TCPIP_MSG to [MEMP_[NUM_]]TCPIP_MSG_API
and
[MEMP_[NUM_]]TCPIP_MSG_INPUT to [MEMP_[NUM_]]TCPIP_MSG_INPKT.
Added defines in opt.h for temporary compatibility with older lwipopts.h.
2007-08-17 02:46:43 +00:00
fbernon
2be122875a
Minor changes (tabs, ident, coding style...)
2007-08-17 00:30:27 +00:00
marcbou
c517f6daf9
Backed out lwip_close() change after discussion with Frederic.
2007-08-16 23:09:04 +00:00
marcbou
07223bf5ef
Backed out last change to netconn_delete() after discussion with Frederic.
2007-08-16 23:06:42 +00:00
marcbou
c81d0f3393
fix ethernet_input() return code warning.
2007-08-16 20:50:43 +00:00
marcbou
4236699052
Split pbuf flags in pbuf type and flgs.
...
Improved lwip_recvfrom(). TCP push now propagated.
2007-08-16 20:22:15 +00:00
marcbou
a3c3f47e17
lwip_close(): call netconn_delete() under socksem to properly handle
...
concurrent closes.
2007-08-16 20:08:33 +00:00
marcbou
17f07a36ef
netconn_delete(): unblock potentially waiting recv.
2007-08-16 20:03:23 +00:00
marcbou
1b98df4a0d
Added distinct memp (MEMP_TCPIP_MSG_INPUT) for input packets to prevent
...
floods from consuming all of MEMP_TCPIP_MSG and starving other message types.
2007-08-16 19:49:08 +00:00
marcbou
58bfb0458e
Added PPPoE support to ethernet_input()
2007-08-16 19:16:03 +00:00
marcbou
0b4402ebc8
lwip_accept(): check netconn_peer() error return.
2007-08-16 18:29:37 +00:00
marcbou
d64b3f21e6
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 18:24:29 +00:00
marcbou
931fcfd0f5
Added PPPoE support and various PPP improvements.
2007-08-16 18:12:20 +00:00
fbernon
9152d6671c
Comments Fix for Doxygen documentation
2007-08-09 22:21:44 +00:00
fbernon
11c94b6566
Minor fix (spaces)
2007-08-09 10:51:26 +00:00
fbernon
fdc4c25e67
Minor fix (warnings on unused args, wrong type, cast u32_t to u16_t...)
2007-08-01 13:41:31 +00:00
fbernon
083134bc12
Minor fix (warning when LWIP_DEBUG is undefined)
2007-07-29 09:25:19 +00:00
fbernon
b8b04271b5
Minor fix (warning, linker helper) signaled by Bill Florac
2007-07-29 08:11:33 +00:00
goldsimon
f4036e8352
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 19:24:27 +00:00
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
fbernon
a1d8335a8c
Fix do_delconn when used with LWIP_TCPIP_CORE_LOCKING=1 on "non-TCP" connections...
2007-07-24 17:27:48 +00:00
goldsimon
62c3de30b9
Fix bug #20480 : Check the pcb passed to tcp_listen() for the correct state (must be CLOSED).
2007-07-24 07:41:55 +00:00
fbernon
6a452951f5
api_msg.c: Fix bug #20318 : api_msg "recv" callbacks don't call pbuf_free in all error cases.
2007-07-13 14:28:15 +00:00
fbernon
a891854ef5
Fix bug #20315 : possible memory leak problem if tcp_listen failed, because current code doesn't follow rawapi.txt documentation.
2007-07-13 13:59:11 +00:00
fbernon
5d872b26a1
sockets.c: Fix a possible problem because any new socket can't be created during the "close" (which can be "long" since fix for bug #20021 ).
2007-07-04 21:13:25 +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
2a77b9fcc7
Bug in last version (fix to close problems): netconn thread might get active before calling its callback, so conn was already deallocated.
2007-07-03 20:20:33 +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
b6750de9e8
sockets.h, sockets.c: Implement MSG_PEEK flag for recv/recvfrom functions.
2007-06-30 13:24:11 +00:00
fbernon
af71292aba
Minor fix (extra spaces)
2007-06-29 13:37:33 +00:00
goldsimon
d73ca29a07
Fixed minor indentation fault
2007-06-28 10:29:13 +00:00
fbernon
d6fbe45296
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-28 10:11:05 +00:00
fbernon
dd1cd5e491
sockets.c: process NETCONN_RAW connections with LWIP_TCPIP_CORE_LOCKING=1
2007-06-28 09:56:37 +00:00
goldsimon
6f93a8f091
Set the err_to_errno_table to be const
2007-06-26 17:38:52 +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
065b8c945b
Added ASSERT to check that lwip_send(to) is not called for length not fitting into u16_t (for UDP & RAW sockets)
2007-06-21 19:58:31 +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
67795ad26e
Corrected do_write for LWIP_TCPIP_CORE_LOCKING=1
2007-06-21 19:14:02 +00:00
goldsimon
2aef8bad55
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 18:55:09 +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
fbernon
ec7333d406
Some changes for AutoIP integration in tcpip.c, and some comments.
2007-06-19 10:11:27 +00:00
goldsimon
9e0252b209
Corrected two formatters in LWIP_DEBUGF calls
2007-06-18 19:23:27 +00:00
goldsimon
531ea17088
Forgot to implement getsockopt for SO_NO_CHECK
2007-06-17 19:18:59 +00:00
goldsimon
ced2543be0
Done some work on task #6933 : converted some LWIP_ASSERTs to LWIP_ERROR to give back an error return value for LWIP_NOASSERT=1
2007-06-17 14:39:50 +00:00
goldsimon
261e92c57b
In accept_function, one LWIP_ERROR had a wrong expression (since it is inverted compared to LWIP_ASSERT...)
2007-06-17 14:38:32 +00:00
goldsimon
96dc30dea2
Done some work on task #1549 (function documentation)
2007-06-17 12:18:11 +00:00
goldsimon
ea7b0052f3
Implemented socket options SO_NO_CHECK for UDP sockets to disable UDP checksum generation on transmit.
2007-06-17 11:46:30 +00:00
goldsimon
1db9013bc4
Done some work on task #1549 (function documentation)
2007-06-16 15:08:47 +00:00
goldsimon
060cbe15d6
Done some work on task #1549 (function documentation), added some LWIP_ERROR checks, don't call pcb_new() from do_bind() and do_connect() since a netconn without pcb can't exist any more (after the recent changes to netconn_new_*())
2007-06-16 15:07:11 +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
goldsimon
15e8208457
pcb_new sets conn->err if protocol is not implemented -> netconn_new_..() does not allocate a new connection for unsupported protocols.
2007-06-13 19:00:21 +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
ab4b59afb9
Partial fix for bug# 20147: "getsockopt() with SO_ERROR option" 'socket layer error is not updated if no operation on netconn).
2007-06-11 20:16:38 +00:00
goldsimon
046a270156
Added UDP lite support for sockets
2007-06-11 18:43:16 +00:00
fbernon
d81841f54e
Minor fix (coding style)
2007-06-10 20:02:43 +00:00
goldsimon
95f4c02381
Included switch LWIP_UDPLITE (enabled by default) to switch off UDP-Lite support if not needed (reduces udp.c code size)
2007-06-10 12:02:24 +00:00
fbernon
a42baedc28
Just add a comment to explain that the lwip_sendto patch for LWIP_TCPIP_CORE_LOCKING option is just show a sample (it's not a full implementation, RAW connection and "to" field are not handled, ...)
2007-06-09 09:59:16 +00:00
goldsimon
613acd93c0
Minor change: don't define some local (unused) variables if LWIP_TCPIP_CORE_LOCKING=1
2007-06-08 21:33:28 +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
goldsimon
8a30754e9c
Done some work on task #1549 (function documentation) and minor changes to meet coding standard
2007-06-08 11:30:14 +00:00
goldsimon
aee6c1f72f
Corrected setsockopt for LWIP_IGMP=1 (did not compile & errors were not returned)
2007-06-05 18:46:10 +00:00
goldsimon
754fe60979
Typo in lwip_setsockopt() (getsockopt_internal was called instead of setsockopt_internal!!!)
2007-06-05 07:38:39 +00:00
goldsimon
add68e0da1
Checked in patch #5914 : Moved sockopt processing into tcpip_thread.
2007-06-01 17:15:54 +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
goldsimon
b5ab0c5285
Included some missing braces in lwip_send & lwip_sendto (if !LWIP_UDP && !LWIP_RAW)
2007-05-22 20:32:22 +00:00
goldsimon
2442b985bf
Broke some (too long) lines down to multiple lines, made the file fit our coding standards
2007-05-22 20:30:30 +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
fbernon
2106f491d0
Minors fix (spaces, comments, unused variable)
2007-05-22 08:20:18 +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
goldsimon
613644bfc6
Re-included unneeded cases in do_disconnect() and do_send() to prevent warnings.
2007-05-21 09:52:23 +00:00
fbernon
7f5d6bc964
api_msg.c: Fix some errors forwarding ( https://savannah.nongnu.org/task/?6880 )
2007-05-19 16:27:02 +00:00
fbernon
d5e37309e5
Minor Fix (unsed code, spaces, idents..)
2007-05-19 16:24:40 +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
goldsimon
5e9d80fbdb
tcpip_input()/tcpip_ethinput(): don't free the pbuf if returning ERR_MEM, that is the netif driver's responsibility
2007-05-17 09:04:36 +00:00
goldsimon
2740a81103
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 18:55:25 +00:00
fbernon
0f8a2d6418
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 14:12:52 +00:00
goldsimon
efd3104fd0
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-13 14:34:02 +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
e895aa71a4
* sockets.c: Fix ioctl FIONREAD when some data remains from last recv.
...
(patch #3574 ).
2007-05-03 19:13:27 +00:00
goldsimon
4bedb07aa0
Added some more LWIP_UNUSED_ARG()s
2007-04-24 08:35:19 +00:00
goldsimon
7932bf483b
Ongoing fix to patch #5822 : converted more statements like (void)arg; into LWIP_UNUSED_ARG(arg);
2007-04-11 19:39:24 +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
35893e36dd
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-06 10:09:24 +00:00
fbernon
787eecbf43
Fix mistakes in netconn's error field checking.
2007-04-05 21:11:16 +00:00
fbernon
5f1aac1450
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-05 16:54:20 +00:00
fbernon
7fdd312cca
sockets.c: remplace ENOBUFS errors on alloc_socket by ENFILE to be more BSD compliant.
2007-04-05 16:49:33 +00:00
goldsimon
f6bdd2cae4
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-04-04 19:54:22 +00:00
fbernon
f1412f5e5a
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 09:42:16 +00:00
fbernon
9ec08fa76a
Missing recv_timeout initialize in accept_function. Minor style fix (indent, mbox checking...)
2007-03-28 18:21:24 +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
goldsimon
d956a39fec
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 14:49:04 +00:00
goldsimon
bef0503545
Removed warning: sizeof() was automatically casted to negative
2007-03-26 18:57:30 +00:00
fbernon
19338d2774
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-26 16:13:46 +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
544e469eeb
api_msg.h, api_msg.c: Remove obsolete API_MSG_ACCEPT and do_accept (never used).
2007-03-22 09:34:18 +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
goldsimon
776c01e60b
fixed bug #5067 (essentialy a signed/unsigned warning fixed by casting to unsigned).
2007-03-21 21:14:06 +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
bb34d8cfd1
api_msg.c, igmp.c, igmp.h: Fix C++ style comments
2007-03-21 14:47:52 +00:00
kieranm
7294cb080b
* 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 12:55:00 +00:00
kieranm
b422864d5d
sockets.c, igmp.c, igmp.h, memp.h: Fix C++ style comments and
...
comment out missing header include in icmp.c
2007-03-21 12:50:04 +00:00
fbernon
713e89cdb2
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 18:01:40 +00:00
fbernon
b035a6196a
Add return types to tcpip_apimsg() and api_msg_post() to check ERR_MEM problems (api_lib.c can be change now).
2007-03-19 20:35:32 +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
9b143dd5dc
Based on patch from Dmitry Potapov, bug#19225.
...
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-11 16:53:37 +00:00
fbernon
5c65d4733b
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.
...
Old TCP_KEEPALIVE can always be used, and its only difference with TCP_KEEPIDLE is this last use seconds and not milliseconds with setsockopt.
Some documentation (not perfect, but...):
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.commtechref/doc/commtrf2/setsockopt.htm
2007-03-11 15:53:43 +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
goldsimon
a868832776
Initialize dhcp timers in tcpip_thread (if LWIP_DHCP) to protect the stack from concurrent access.
2007-03-08 10:37:31 +00:00
fbernon
7cda728469
Fix some "little" build problems, and a redundancy call to "lwip_stats.link.recv++;" in low_level_input() & ethernetif_input().
...
If LINK_STATS was defined, tcpip.c couldn't be build.
Even if IP_FRAG or IP_REASSEMBLY were set, ip_frag.c functions are not build.
2007-03-06 19:31:49 +00:00
fbernon
7fd37d4e87
Implement SO_RCVTIMEO on UDP sockets/netconn.
2007-03-06 16:41:02 +00:00
fbernon
ed07d481d6
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 14:18:02 +00:00
goldsimon
7115975212
fixed compiler warning "initialization dircards qualifiers from pointer target type"
2007-03-06 07:28:22 +00:00
fbernon
1ffd049833
api_msg.c: Remove some compiler warnings : parameter "pcb" was never referenced.
2007-03-04 16:25:04 +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
goldsimon
bb8522b737
tcpip.c: Moved call to ip_init(), udp_init() and tcp_init() from tcpip_thread() to tcpip_init()
2007-03-03 16:22:38 +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
kieranm
c52ac01fbc
sockets.c: Fix BUG#19161 - ensure milliseconds timeout is non-zero
...
when supplied timeout is also non-zero
2007-02-28 12:52:44 +00:00
jifl
75beb3bd35
Fix incorrect comparison in get_socket().
...
Spotted by Frederic Bernon.
2007-02-26 20:16:38 +00:00
jifl
1d22294974
* sockets.h, sockets.c: Move socket initialization to new
...
lwip_socket_init() function.
2007-02-26 20:01:04 +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
729da3c873
Fixed Nagle algorithm as reported by Bob Grice.
2006-10-10 07:48:27 +00:00
christiaans
a82e02ef15
Partial fix for bug #15926 , flushing TCP output in do_close().
2006-08-07 10:00:44 +00:00
christiaans
63140ca7f8
Applied patch for cold case bug #11135 .
2006-06-27 10:33:52 +00:00
christiaans
1f01634029
Applied patch #5146 to handle allocation failures in accept() by Kevin Lawson.
2006-06-14 08:02:35 +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
00f8cf57cd
Added IP reassembly timer.
2006-03-01 14:51:58 +00:00
christiaans
182e1909b2
Patch from Curt McDowell fixes err_to_errno macro.
2006-02-13 08:14:11 +00:00
christiaans
e1b215aa73
Introduced cc.h formatters and removed SO_REUSE from transport layers.
2005-11-25 12:03:38 +00:00
likewise
0e96ece6c6
Surround definition of tcp_timer_needed with #if !NO_SYS #endif. (see lwip-users 15-11-2004).
2004-11-28 18:23:00 +00:00
jani
8afd3e882e
#if directive style fix
2004-11-09 11:44:06 +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
softins
a4f5673ff3
Small corrections to some debugging statements, to pacify compiler.
2004-07-22 08:06:00 +00:00
softins
afc3bc6b65
Added trivial (int) cast to keep compiler happier.
2004-07-21 08:57:05 +00:00
softins
6f066fca82
Changed recv_raw() from int to u8_t, to match prototype of raw_recv() in raw.h
...
and so avoid compiler error.
2004-07-21 08:55:26 +00:00
likewise
8d052ecf24
Source documentation added.
2004-07-12 20:42:16 +00:00
likewise
25a0273b05
LWIP_TIMEVAL_PRIVATE must be defined in architecture cc.h file, either 1 or 0. Defaults to 1.
...
Dependencies on C library memset() etc., so include <string.h> and <errno.h>.
2004-07-04 23:43:02 +00:00
jani
6d704c728e
do not export struct timeval to external users of socket.h to avoid conflicts
2004-03-26 13:21:35 +00:00
kieranm
2c8aa6f6f4
Kieran Mansley - kjm25@cam.ac.uk - 23rd March 2003
...
- Changed all #ifdef SO_REUSE into #if SO_REUSE
2004-03-23 19:33:53 +00:00
likewise
6f7c8fb355
Made #ifdef's into #if's for SO_REUSE.
2004-03-23 00:19:38 +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
likewise
ba786dc49b
Applied patch #1596 fixing wrongly cast LWIP_DEBUGF arguments.
...
(printf expects integers on the var args stack)
2003-06-11 22:11:42 +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
01a53d955e
Fixed bug in do_delcon (set tcp_arg to NULL)
2003-03-31 09:35:47 +00:00
kieranm
a5be8fe82c
Fixed bug in netconn_peer (test pcb for NULL before accessing)
2003-03-31 09:34:56 +00:00
davidhaas
f9e4f4d813
Typo bug. The wrong semaphore was being signalled.
2003-03-24 15:53:38 +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
84697ce713
Add priority argument to thread sys_thread_new.Patch from floriZ but slightly modfied
2003-03-19 15:27:56 +00:00
jani
441e9b8431
add tcpip_callback patch from Marc
2003-03-19 11:23:46 +00:00
jani
eb1a41f3c9
socket functions use socklen_t, patch from floriZ.Also set/getsockopt use void * instead of char * as fourth arg
2003-03-03 10:29:21 +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
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
jani
da40fbd054
move FD_SET defines to sockets.h from arch.h .Last arg of select is not a const according to linux and openBSD manpages
2003-02-17 11:34:48 +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
442f46a1ce
recvfrom accesses freed netbuf.If it's reused in the small window by another thread recvfrom returns bad from info.Patch #1041 by Florian Zschocke
2003-01-31 12:51: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
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
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
jani
428293a69b
make lwip_write() use lwip_send() and avoid code duplication.return copylen
...
in lwip_recvfrom since it has already been chosen as the minimum
of len and buflen.
2002-11-15 15:05:06 +00:00
kieranm
f975754ad9
Initialize err in do_close to prevent compiler warning.
2002-11-13 21:53:36 +00:00
likewise
f06e955072
Initial revision
2002-10-19 12:59:30 +00:00