fbernon
7077d51f1f
api.h, api_lib.c, api_msg.c: Add macro API_EVENT in the same spirit than TCP_EVENT_xxx macros to get a code more readable. It could also help to remove some code (like we have talk in "patch #5919 : Create compile switch to remove select code"), but it could be done later.
19 years ago
goldsimon
2d3a64815f
Minor coding style fixes, added comment
19 years ago
fbernon
e3cd1ac1f9
Minor changes (but in lot of files): add #if/#endif for options where they could miss. #if LWIP_xxx if always put after #include "lwip/opt.h" (note this one indirectly include cc.h). Move others includes inside #if/#endif block.
19 years ago
fbernon
62b4741b19
Changes for "#20503 IGMP Improvement". Initialize igmp_mac_filter to NULL in netif_add (this field should be set in the netif's "init" function). Use the "imr_interface" field (for socket layer) and/or the "interface" field (for netconn layer), for join/leave operations. The igmp_join/leavegroup first parameter change from a netif to an ipaddr. This field could be a netif's ipaddr, or "any" (same meaning than ip_addr_isany).
19 years ago
fbernon
54c1025ec0
First fix for "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state and remove obsolete ones (NETCONN_RECV & NETCONN_ACCEPT).
19 years ago
marcbou
180e6d2c75
Reset the callbacks and arg (conn) to NULL in do_close_internal(), because
...
TCP callbacks in api_msg.c can under certain circumstances be called with an
invalid conn pointer after the connection has been closed (and conn has been
freed).
19 years ago
fbernon
2be122875a
Minor changes (tabs, ident, coding style...)
19 years ago
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.
19 years ago
fbernon
9152d6671c
Comments Fix for Doxygen documentation
19 years ago
fbernon
b8b04271b5
Minor fix (warning, linker helper) signaled by Bill Florac
19 years ago
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).
19 years ago
fbernon
a1d8335a8c
Fix do_delconn when used with LWIP_TCPIP_CORE_LOCKING=1 on "non-TCP" connections...
19 years ago
goldsimon
62c3de30b9
Fix bug #20480 : Check the pcb passed to tcp_listen() for the correct state (must be CLOSED).
19 years ago
fbernon
6a452951f5
api_msg.c: Fix bug #20318 : api_msg "recv" callbacks don't call pbuf_free in all error cases.
19 years ago
fbernon
a891854ef5
Fix bug #20315 : possible memory leak problem if tcp_listen failed, because current code doesn't follow rawapi.txt documentation.
19 years ago
goldsimon
2a77b9fcc7
Bug in last version (fix to close problems): netconn thread might get active before calling its callback, so conn was already deallocated.
19 years ago
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.
19 years ago
goldsimon
bb9e9e5480
Changed the expression of LWIP_ERROR to the same as for LWIP_ASSERT
19 years ago
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).
19 years ago
goldsimon
67795ad26e
Corrected do_write for LWIP_TCPIP_CORE_LOCKING=1
19 years ago
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.
19 years ago
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.
19 years ago
goldsimon
261e92c57b
In accept_function, one LWIP_ERROR had a wrong expression (since it is inverted compared to LWIP_ASSERT...)
19 years ago
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_*())
19 years ago
goldsimon
15e8208457
pcb_new sets conn->err if protocol is not implemented -> netconn_new_..() does not allocate a new connection for unsupported protocols.
19 years ago
fbernon
d81841f54e
Minor fix (coding style)
19 years ago
goldsimon
95f4c02381
Included switch LWIP_UDPLITE (enabled by default) to switch off UDP-Lite support if not needed (reduces udp.c code size)
19 years ago
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....
19 years ago
fbernon
953d783a3e
api.h, api_lib.c, api_msg.c, sockets.c: group the different NETCONN_UDPxxx code in only one part...
19 years ago
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 ).
19 years ago
fbernon
2106f491d0
Minors fix (spaces, comments, unused variable)
19 years ago
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.
19 years ago
goldsimon
613644bfc6
Re-included unneeded cases in do_disconnect() and do_send() to prevent warnings.
19 years ago
fbernon
7f5d6bc964
api_msg.c: Fix some errors forwarding ( https://savannah.nongnu.org/task/?6880 )
19 years ago
fbernon
d5e37309e5
Minor Fix (unsed code, spaces, idents..)
19 years ago
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).
19 years ago
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 ).
19 years ago
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).
19 years ago
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".
19 years ago
fbernon
787eecbf43
Fix mistakes in netconn's error field checking.
19 years ago
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.
19 years ago
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.
19 years ago
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.
19 years ago
fbernon
9ec08fa76a
Missing recv_timeout initialize in accept_function. Minor style fix (indent, mbox checking...)
19 years ago
fbernon
544e469eeb
api_msg.h, api_msg.c: Remove obsolete API_MSG_ACCEPT and do_accept (never used).
19 years ago
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.
19 years ago
fbernon
bb34d8cfd1
api_msg.c, igmp.c, igmp.h: Fix C++ style comments
19 years ago
fbernon
b035a6196a
Add return types to tcpip_apimsg() and api_msg_post() to check ERR_MEM problems (api_lib.c can be change now).
19 years ago
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...
19 years ago
fbernon
1ffd049833
api_msg.c: Remove some compiler warnings : parameter "pcb" was never referenced.
19 years ago