Commit Graph

174 Commits

Author SHA1 Message Date
goldsimon
b51d1b79a3 Combined etharp_request with etharp_raw for both LWIP_AUTOIP =0 and =1 to remove redundant code. 2007-06-24 12:51:22 +00:00
goldsimon
0c18e653e8 Introduced the option MEM_USE_POOLS to use 4 pools with different sized elements instead of a heap. This both prevents memory fragmentation and gives a higher speed at the cost of more memory consumption. Turned off by default. 2007-06-21 20:12:11 +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
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
goldsimon
d3f0a3211d Changed etharp to use a defined hardware address length of 6 to avoid loading netif->hwaddr_len every time (since this file is only used for ethernet and struct eth_addr already had a defined length of 6). 2007-06-19 16:22:55 +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
cbf281589b Fixed bug #20180 (TCP pcbs listening on IP_ADDR_ANY could get changed in netif_set_ipaddr if previous netif->ip_addr.addr was 0. 2007-06-16 13:32:10 +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
bdbc96f453 opt.h, mem.h, mem.c, memp.c, pbuf.c, ip_frag.c, vj.c: Fix bug #20162. Rename MEM_ALIGN in LWIP_MEM_ALIGN and MEM_ALIGN_SIZE in LWIP_MEM_ALIGN_SIZE to avoid some macro names collision with some OS macros. 2007-06-13 17:17:26 +00:00
goldsimon
046a270156 Added UDP lite support for sockets 2007-06-11 18:43:16 +00:00
goldsimon
2f293d53ba UDP Lite: corrected the use of chksum_len (based on RFC3828: if it's 0, create checksum over the complete packet. On RX, if it's < 8 (and not 0), discard the packet. Also removed the duplicate 'udphdr->chksum = 0' for both UDP & UDP Lite. 2007-06-11 18:03:57 +00:00
fbernon
1d7caed340 tcp_out.c: Fix for bug #20075 : "A problem with keep-alive timer and TCP flags" where TCP flags wasn't initialized in tcp_keepalive. Reported by Srinivas Gollakota with help of Oleg Tyshev. 2007-06-11 13:59:10 +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
e01f342048 Contrib module by Dominik Spies: autoip.h, autoip.c, dhcp.h, dhcp.c, netif.h, netif.c, etharp.h, etharp.c, opt.h: AutoIP implementation available for IPv4, with new options LWIP_AUTOIP and LWIP_DHCP_AUTOIP_COOP if you want to cooperate with DHCP. Some tips to adapt (see TODO mark in the source code). 2007-06-09 16:57:04 +00:00
goldsimon
c028619cdd Modified order of parameters for etharp_output() to match netif->output so etharp_output() can be used directly as netif->output to save one function call. 2007-06-08 22:20:05 +00:00
goldsimon
0e9cb48ea1 Changed define NETIF_INIT_SNMP(type, speed) to include the name of the struct netif to change... 2007-06-08 19:59:20 +00:00
goldsimon
945460c67e Added define NETIF_INIT_SNMP(type, speed) to initialize per-netif snmp variables, added initialization of those to slipif and loopif. 2007-06-08 17:17:41 +00:00
goldsimon
3a607a197e opt.h, ip_frag.c, ip_frag.h, ip.c: Added option IP_FRAG_USES_STATIC_BUF (defaulting to off for now) that can be set to 0 to send fragmented packets by passing PBUF_REFs down the stack. 2007-06-03 18:36:42 +00:00
goldsimon
974cf08e5d udp_input(): Input pbuf was not freed if pcb had no recv function registered, p->payload was modified without modifying p->len if sending icmp_dest_unreach() (had no negative effect but was definitively wrong). 2007-06-03 11:32:03 +00:00
goldsimon
7abfe74fa4 Corrected bug #19937: ICMP assumes p_buf has space for ethernet header. Allocating new pbuf if the input pbuf isn't big enough. 2007-06-03 10:48:23 +00:00
goldsimon
add68e0da1 Checked in patch #5914: Moved sockopt processing into tcpip_thread. 2007-06-01 17:15:54 +00:00
fbernon
0a4130a4ff Minor, fix files modified by last patch... 2007-05-23 19:49:55 +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
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
0aaf69769f Fixed bug #1895 (tcp_bind not correct) by introducing a list of bound but unconnected (and non-listening) tcp_pcbs. 2007-05-22 20:48:36 +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
goldsimon
a4f4e6e71d Addition to patch #5913: decrease size of memp_memory.
Added option MEMP_OVERFLOW_CHECK to check for memp elements to overflow.
2007-05-18 19:48:44 +00:00
goldsimon
5c89228878 Fix bug #19729: free pbuf if netif->input() returns != ERR_OK. 2007-05-16 19:54:54 +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
fd982597fe Removed semaphores from memp, changed sys_sem_wait calls into sys_arch_sem_wait calls to prevent timers from running while waiting for the heap. This fixes bug #19167. 2007-05-16 11:02:07 +00:00
goldsimon
62d705903e task #6831: removed the option PBUF_POOL_USES_MEMP and removed the old pbuf pool code, pbuf pool now always allocates from a memp pool 2007-05-13 18:17:22 +00:00
goldsimon
a5e2e9ea03 (see task #6831): Included new option PBUF_POOL_USES_MEMP to use a memp pool for PBUF_POOL pbufs instead of the old pool implementation in pbuf.c to remove redundant code. 2007-05-13 16:16:03 +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
84fc489e0c Included patch #5448: include '#ifdef __cplusplus \ extern "C" {' in all header files. Now you can write your application using the lwIP stack in C++ and simply #include the core files. Note I have left out the netif/ppp/*h header files for now, since I don't know which files are included by applications and which are for internal use only. 2007-05-10 10:59:20 +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
goldsimon
1571881f7a If MEM_LIBC_MALLOC==1, allow the defines (e.g. mem_malloc() -> malloc()) to be overriden in case the C-library malloc implementation is not protected against concurrent access. 2007-05-08 11:00:49 +00:00
goldsimon
824ef1ff2c Another attempt to fix bug #17922 2007-05-07 19:48:29 +00:00
goldsimon
79d9b36ece Further update to ARP queueing: Changed pbuf_copy() implementation so that it can be reused (don't allocate the target pbuf inside pbuf_copy()). 2007-05-04 21:31:25 +00:00
goldsimon
be316e81a7 Introduced fast one-entry-cache to speed up ARP lookup when sending multiple packets to the same host. 2007-05-04 19:31:27 +00:00
goldsimon
7f232b43ff checked in patch #5913: in memp_malloc() we can return memp as mem to save a little RAM (next pointer of memp is not used while not in pool). 2007-05-04 15:52:11 +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