goldsimon
95b15fe463
Fix typo, add comment
2008-06-27 20:34:51 +00:00
jifl
a3bc6cd666
* err.h, err.c, sockets.c: Fix bug #23119 : Reorder timeout error code to
...
stop it being treated as a fatal error.
2008-05-09 12:14:23 +00:00
goldsimon
05587f5da9
Changed the pbuf_free/mem_free callback functions a little: created extra functions for that
2008-03-28 07:56:47 +00:00
goldsimon
43dd38df0a
fixed bug #21433 (Calling mem_free/pbuf_free from interrupt context isn't safe): set LWIP_USE_HEAP_FROM_INTERRUPT to 1 in lwipopts.h or use tcpip_callback_nonblocking(pbuf_free_int, p)/ tcpip_callback_nonblocking(mem_free, m) to free pbufs or heap memory from interrupt context
2008-03-27 19:29:35 +00:00
fbernon
7774b57a1c
api_msg.c: fix wrong mailbox invalidate (NULL was used instead of SYS_MBOX_NULL). Spoted by Silas Boyd-Wickizer.
2008-03-21 16:23:14 +00:00
goldsimon
90cb4b4e09
Corrected comment in do_writemore()
2008-03-19 20:59:59 +00:00
fbernon
e07d71f5e8
sockets.c: Fix bug #22435 "lwip_recvfrom with TCP break;". Using (lwip_)recvfrom with valid "from" and "fromlen" parameters, on a TCP connection caused a crash. Note that using (lwip_)recvfrom like this is a bit slow and that using (lwip)getpeername is the good lwip way to do it (so, using recv is faster on tcp sockets).
2008-03-13 20:03:57 +00:00
fbernon
afcf49ad3a
api_msg.c: minor change, fix warning.
2008-03-13 19:57:11 +00:00
fbernon
a2f1892480
api_msg.c: fix the netbuf::addr field to point on the ip_src on the pbuf's copy (about bug#22530).
2008-03-12 12:58:07 +00:00
fbernon
552106e2a4
api_msg.c: Fix bug #22530 "api_msg.c's recv_raw() does not consume data".
2008-03-12 10:55:54 +00:00
fbernon
7b11fb75d9
Minor changes: replace directy call to memcpy by MEMCPY macro.
2008-01-26 16:11:39 +00:00
fbernon
7518acf634
rawapi.txt, api_msg.c, tcp.c, tcp_in.c, tcp.h: changes for task #7675 "Enable to refuse data on a TCP_EVENT_RECV call". Important, behavior changes for the tcp_recv callback (see rawapi.txt).
2008-01-14 21:07:08 +00:00
fbernon
55bcc20deb
tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field netconn::sem per netconn::op_completed like suggested for the task #7490 "Add return value to sys_mbox_post".
2008-01-12 11:52:21 +00:00
fbernon
9906e4c984
api_msg.c, opt.h: replace DEFAULT_RECVMBOX_SIZE per DEFAULT_TCP_RECVMBOX_SIZE, DEFAULT_UDP_RECVMBOX_SIZE and DEFAULT_RAW_RECVMBOX_SIZE (to optimize queues sizes), like suggested for the task #7490 "Add return value to sys_mbox_post".
2008-01-11 23:50:10 +00:00
fbernon
4e40fee1db
tcpip.h, tcpip.c: add tcpip_callback_with_block function for the task #7490 "Add return value to sys_mbox_post". tcpip_callback is always defined as "blocking" ("block" parameter = 1).
2008-01-10 21:47:52 +00:00
fbernon
bceff76c70
tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field netconn::mbox (sys_mbox_t) per netconn::sem (sys_sem_t) for the task #7490 "Add return value to sys_mbox_post".
2008-01-10 21:34:25 +00:00
goldsimon
a41f113b8f
Added function netconn_free(), which deallocates all mboxes and frees the netconn (to be used from different places) - the PCB is not freed!
2008-01-06 14:28:04 +00:00
fbernon
5941b3c86e
sys_arch.txt, api.h, api_lib.c, api_msg.h, api_msg.c, tcpip.c, sys.h, opt.h: Introduce changes for task #7490 "Add return value to sys_mbox_post" with some modifications in the sys_mbox api: sys_mbox_new take a "size" parameters which indicate the number of pointers query by the mailbox. There is three defines in opt.h to indicate sizes for tcpip::mbox, netconn::recvmbox, and for the netconn::acceptmbox. Port maintainers, you can decide to just add this new parameter in your implementation, but to ignore it to keep the previous behavior. The new sys_mbox_trypost function return a value to know if the mailbox is full or if the message is posted. Take a look to sys_arch.txt for more details. This new function is used in tcpip_input (so, can be called in an interrupt context since the function is not blocking), and in recv_udp and recv_raw.
2008-01-05 21:10:32 +00:00
fbernon
9c4daa312d
Minor changes in lwip folder: fix some warnings, coding style, and rename "internal" netconn_alloc function.
2008-01-04 23:07:44 +00:00
fbernon
32005617b9
rawapi.txt, api.h, api_lib.c, api_msg.h, api_msg.c, sockets.c, tcp.h, tcp.c, tcp_in.c, init.c, opt.h: rename backlog options with TCP_ prefix, limit the "backlog" parameter in an u8_t, 0 is interpreted as "smallest queue", add documentation in the rawapi.txt file.
2008-01-04 22:18:27 +00:00
goldsimon
1ed34774c8
tcp.h, opt.h, api.h, api_msg.h, tcp.c, tcp_in.c, api_lib.c, api_msg.c, sockets.c, init.c: task #7252 : Implement TCP listen backlog: Warning: raw API applications have to call 'tcp_accepted(pcb)' in their accept callback to keep accepting new connections.
2007-12-21 16:47:56 +00:00
goldsimon
48e62e25e9
sys.h, api_lib.c, api_msg.c, sockets.c: fix bug #21698 : "netconn->recv_avail is not protected" by using new macros for interlocked access to modify/test netconn->recv_avail.
2007-12-21 14:59:10 +00:00
goldsimon
ba4254231e
Corrected assert when netconn_new_* fails
2007-12-16 16:15:08 +00:00
fbernon
2b54da5070
api_msg.c, err.h, err.c, sockets.c, dns.c, dns.h: replace "enum dns_result" by err_t type. Add a new err_t code "ERR_INPROGRESS".
2007-12-13 23:06:49 +00:00
fbernon
1dd1064051
Fix err_stderr[] table with new err.h defines.
2007-12-12 08:25:23 +00:00
fbernon
ac10470643
netdb.c: add a LWIP_DNS_API_HOSTENT_STORAGE option to decide to use a static set of variables (=0) or a local one (=1). In this last case, your port should provide a function "struct hostent* sys_thread_hostent( struct hostent* h)" which have to do a copy of "h" and return a pointer ont the "per-thread" copy.
2007-12-05 23:00:02 +00:00
goldsimon
113a52d091
fix bug #21656 (recvmbox problem in netconn API): always allocate a recvmbox in netconn_new_with_proto_and_callback. For a tcp-listen netconn, this recvmbox is later freed and a new mbox is allocated for acceptmbox. This is a fix for thread-safety and allocates all items needed for a netconn when the netconn is created.
2007-12-02 14:53:50 +00:00
goldsimon
6746beb2a3
Compacted code: moved the code creating a netconn (without pcb) from netconn_new_with_proto_and_callback to new (synchroneous) function netconn_alloc_with_proto_and_callback and call this function from netconn_new_with_proto_and_callback and accept_function.
2007-11-30 12:54:10 +00:00
goldsimon
03777ccb21
Changed error handling: ERR_MEM, ERR_BUF and ERR_RTE are seen as non-fatal, all other errors are fatal. netconns and sockets block most operations once they have seen a fatal error.
2007-11-27 21:15:44 +00:00
goldsimon
4dcfdac2f5
initialize netconn->socket to -1 instead of 0 since 0 is a valid socket!
2007-11-25 16:13:56 +00:00
goldsimon
9343b767f8
lock event_callback against lwip_accept for data that arrives right away after an accept (before lwip_accept has processed the new conn)
2007-11-25 16:04:38 +00:00
fbernon
77d9233427
Minor change (redundant code)
2007-11-25 15:32:29 +00:00
goldsimon
f63a3c1f62
Added an explaining comment for the line 'nsock->rcvevent += -1 - newconn->socket;' in lwip_accept
2007-11-25 14:33:23 +00:00
goldsimon
e1f49d990b
Fix some warnings discovered by compiling the unixsim under cygwin (gcc pedantic)
2007-11-25 13:57:05 +00:00
goldsimon
c7a0f32c98
Back to old alloc_socket(), lwip_accept had a bug in last revision
2007-11-25 10:04:04 +00:00
fbernon
3d9c76a69c
Minor change (doxygen tags)
2007-11-24 22:13:25 +00:00
goldsimon
7797ada1f5
Added documentation
2007-11-24 21:19:47 +00:00
goldsimon
8cfd923aaa
Added some documentation (mainly what is unimplemented in contrast to 'std-BSD'), alloc_socket returns the sock pointer directly (for speedup)
2007-11-24 17:39:53 +00:00
goldsimon
c86b446d4c
Moved lwip_gethostbyname from sockets.c to the new file netdb.c; included lwip_getaddrinfo.
2007-11-24 16:12:02 +00:00
goldsimon
dc515c7ad3
Fixed bug #20287 : tcp_output_nagle sends too early. This fixes the nagle algorithm; nagle now also works for all raw API applications and has to be explicitly disabled with 'tcp_pcb->flags |= TF_NODELAY'
2007-11-21 17:59:03 +00:00
goldsimon
e7483f2e64
Added return value comments to netconn_gethostbyname
2007-11-20 21:23:24 +00:00
goldsimon
9a524dac86
Adopted lwip_gethostbyname and lwip_gethostbyname_r to the new return values of dns_gethostbyname/netconn_gethostbyname
2007-11-20 21:22:45 +00:00
fbernon
f58515b51e
api_msg.c, dns.h, dns.c: Implement DNS_DOES_NAME_CHECK option (check if name received match the name query), implement DNS_USES_STATIC_BUF (the place where copy dns payload to parse the response), return an error if there is no place for a new query, and fix some minor problems.
2007-11-19 22:42:01 +00:00
goldsimon
9dd4ad6c1f
Added thread-safe function gethostbyname_r (as in glibc)
2007-11-18 16:36:34 +00:00
fbernon
edc46281a4
Minor changes on DNS client.
2007-11-18 14:19:27 +00:00
goldsimon
e6ec23d7cc
Added sequential (socket API) function gethostbyname and the struct hostent it uses
2007-11-16 17:29:30 +00:00
goldsimon
e2cd201f6a
Added sequential dns resolver function for netconn api (netconn_gethostbyname)
2007-11-16 17:16:17 +00:00
fbernon
0c0e8d6544
opt.h, init.c, tcpip.c, dhcp.c, dns.h, dns.c: add DNS client for simple name requests with RAW api interface. Initialization is done in lwip_init() with build time options. DNS timer is added in tcpip_thread context. DHCP can set DNS server ip addresses when options are received. You need to set LWIP_DNS=1 in your lwipopts.h file (LWIP_DNS=0 in opt.h). DNS_DEBUG can be set to get some traces with LWIP_DEBUGF. Sanity check have been added. There is a "todo" list with points to improve.
2007-11-14 23:27:13 +00:00
fbernon
a4d14722f3
sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fixed bug #20900 . Now, most of the netconn_peer and netconn_addr processing is done inside tcpip_thread context in do_getaddr.
2007-11-12 22:39:24 +00:00
goldsimon
f3dbd986cb
Task #7410 : Removed the need to include core header files in api.h (ip/tcp/udp/raw.h) to hide the internal implementation from netconn api applications.
2007-11-06 20:31:28 +00:00
fbernon
ecce865cfe
api.h, api_lib.c, api_msg.c, sockets.c, opt.h: add SO_RCVBUF option for UDP & RAW netconn. You need to set LWIP_SO_RCVBUF=1 in your lwipopts.h (it's disabled by default). Netconn API users can use the netconn_recv_bufsize macro to access it. This is a first release which have to be improve for TCP. Note it used the netconn::recv_avail which need to be more "thread-safe" (note there is already the problem for FIONREAD with lwip_ioctl/ioctlsocket).
2007-11-02 10:37:08 +00:00
fbernon
cbe9b050a9
sockets.h, sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c, tcp.h, tcp_out.c: Integrate "patch #6250 : MSG_MORE flag for send". MSG_MORE is used at socket api layer, NETCONN_MORE at netconn api layer, and TCP_WRITE_FLAG_MORE at raw api layer. This option enable to delayed TCP PUSH flag on multiple "write" calls. Note that previous "copy" parameter for "write" APIs is now called "apiflags".
2007-11-01 17:37:50 +00:00
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.
2007-10-24 12:09:18 +00:00
goldsimon
270c7c1110
Removed check for conn->err for functions whose counterparts in api_msg.c also do the check (1. remove redundant code, 2. check is better done in tcpip thread context)
2007-10-22 20:01:16 +00:00
goldsimon
2d3a64815f
Minor coding style fixes, added comment
2007-10-22 19:59:52 +00:00
fbernon
649d43c2c5
Minor change (define DHCP_COARSE_TIMER_MSECS - using DHCP_COARSE_TIMER_SECS - to use milliseconds like all others timers)
2007-10-15 21:31:42 +00:00
fbernon
cf998b7bf8
Minor fix (remove warning)
2007-10-10 08:13:58 +00:00
goldsimon
199648ff37
Changed initialization: many init functions are not needed any more since we now rely on the compiler initializing global and static variables to zero!
2007-10-09 19:59:56 +00:00
goldsimon
b1a4b00091
Preprocessor statements have to start at the beginning of a line for old compilers!
2007-10-09 19:30:17 +00:00
goldsimon
c1c9983cfe
Removed <warning: potential uninitialized reference to
...
"buf" in function "lwip_recvfrom">
2007-10-09 19:29:54 +00:00
fbernon
87e16a8f47
sockets.c, api.h, api_lib.c: First step to fix "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". VERY IMPORTANT: this change cause an API breakage for netconn_peer, since a parameter type change. Any compiler should cause an error without any changes in yours netconn_peer calls (so, it can't be a "silent change"). It also reduce a little bit the footprint for socket layer (lwip_getpeername & lwip_getsockname use now a common lwip_getaddrname function since netconn_peer & netconn_addr have the same parameters).
2007-10-07 17:26:54 +00:00
goldsimon
cb71d6d393
Moved ethernet_input from tcpip.c to etharp.c so all netifs (or ports) can use it.
2007-10-05 14:00:48 +00:00
fbernon
79c00be516
netifapi.h, netifapi.c: add function netifapi_netif_set_default. Change the common function to reduce a little bit the footprint (for all functions using only the "netif" parameter).
2007-10-05 13:34:48 +00:00
fbernon
949efb414a
netifapi.h, netifapi.c: add functions netifapi_netif_set_up, netifapi_netif_set_down, netifapi_autoip_start and netifapi_autoip_stop. Use a common function to reduce a little bit the footprint (for all functions using only the "netif" parameter).
2007-10-03 16:54:27 +00:00
fbernon
2bdd916b06
udp.h, udp.c, sockets.c: Changes for " #20503 IGMP Improvement". Add IP_MULTICAST_IF option in socket API, and a new field "multicast_ip" in "struct udp_pcb" (for netconn and raw API users), only if LWIP_IGMP=1. Add getsockopt processing for IP_MULTICAST_TTL and IP_MULTICAST_IF.
2007-09-15 15:19:41 +00:00
fbernon
95f2d48ac4
Avoid to lost previous error codes in sockets.c and api_lib.c.
2007-09-13 15:03:42 +00:00
fbernon
c265fa3331
Add missing #if/#endif to fix build problems with:
...
#define NO_SYS 0
#define LWIP_SOCKET 0
#define LWIP_NETCONN 0
2007-09-12 09:19:43 +00:00
fbernon
1c6e31173d
Add missing include files.
2007-09-09 22:34:55 +00:00
fbernon
8205737fdb
sockets.c, ip.h, api.h, tcp.h: declare a "struct ip_pcb" which only contains IP_PCB. Add in the netconn's "pcb" union a "struct ip_pcb *ip;" (no size change). Use this new field to access to common pcb fields (ttl, tos, so_options, etc...). Enable to access to these fields with LWIP_TCP=0.
2007-09-07 23:47:02 +00:00
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.
2007-09-07 23:01:59 +00:00
fbernon
90a3f88c08
Change parameters list for sys_thread_new (see "task #7252 : Create sys_thread_new_ex()"). Two new parameters have to be provided: a task name, and a task stack size. For this one, since it's platform dependant, you could define the best one for you in your lwipopts.h. For port maintainers, you can just add these new parameters in your sys_arch.c file, and but it's not mandatory, use them in your OS specific functions.
2007-09-05 16:14:28 +00:00
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).
2007-09-03 14:53:18 +00:00
fbernon
245bce04d1
Add netbuf.h, netbuf.c, Change api.h, api_lib.c: #7249 "Split netbuf functions from api/api_lib". Now netbuf API is independant of netconn, and can be used with other API (application based on raw API, or future "socket2" API). Ports maintainers just have to add src/api/netbuf.c in their makefile/projects.
2007-08-30 16:55:10 +00:00
fbernon
cd208314e0
igmp.h, igmp.c, tcpip.c, init.c, netif.c: change igmp_init and add igmp_start. igmp_start is call inside netif_add. Now, igmp initialization is in the same spirit than the others modules. Modify some IGMP debug traces.
2007-08-29 21:12:32 +00:00
fbernon
da7b5135de
Minor Fix (ident)
2007-08-29 20:50:53 +00:00
fbernon
48db3a3e92
Add init.h, init.c, Change opt.h, tcpip.c: Task #7213 "Add a lwip_init function" Add lwip_init function to regroup all modules initializations, and to provide a place to add code for task #7142 "Sanity check user-configurable values". Ports maintainers should remove direct initializations calls from their code, and add init.c in their makefiles. Note that lwip_init() function is called inside tcpip_init, but can also be used by raw api users since all calls are disabled when matching options are disabled. Also note that their is new options in opt.h, you should configure in your lwipopts.h (they are enabled per default).
2007-08-29 08:11:06 +00:00
fbernon
7182fb8fb0
tcpip.c: Fix TCPIP_MSG_INPKT processing: now, tcpip_input can be used for any kind of packets. These packets are considered like Ethernet packets (payload pointing to ethhdr) if the netif got the NETIF_FLAG_ETHARP flag. Else, packets are considered like IP packets (payload pointing to iphdr).
2007-08-29 07:51:20 +00:00
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).
2007-08-27 10:08:53 +00:00
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).
2007-08-26 23:58:33 +00:00
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