Commit Graph

425 Commits

Author SHA1 Message Date
likewise
031a4cbdd8 Increased number of debug messages to see pbuf chain actions. 2003-06-05 14:15:46 +00:00
likewise
326b8ff728 Fixed a memory leak when only a part of a PBUF_POOL chain could be allocated. 2003-06-04 19:09:11 +00:00
likewise
9ed2b7e03c pbuf_alloc() forgot to set tot_len field for PBUF_POOL pbufs. 2003-06-04 09:06:22 +00:00
likewise
08703f46f8 Several additional documentation fixes. 2003-06-04 08:58:51 +00:00
jani
ea08652416 fixed sio_read_abort prototype 2003-06-02 11:30:47 +00:00
jani
26d9b28f77 sio and PPP updates from Marc 2003-06-02 11:12:56 +00:00
jani
2bfd55fd69 sys_msleep and sys_jiffies used by PPP code.From Marc 2003-06-02 11:10:20 +00:00
jani
39a6db4097 inet_ntoa and inet_aton from Marc 2003-06-02 11:09:01 +00:00
jani
ff63557d39 Cleanups in PPP: C++ comments removed, make it compile for unixsim too. Does not work yet only compiles 2003-05-30 08:49:34 +00:00
jani
31776e23fe add PPP stack from Marc. Work in progress 2003-05-27 14:37:56 +00:00
jani
6719f10034 put LWIP_MAX and LWIP_MIN macros in def.h and use these instead of locally declaring them in .c files 2003-05-27 13:44:08 +00:00
jani
b0273c9209 fix warning 2003-05-27 13:40:54 +00:00
likewise
4ae13c6c26 Set UDP_FLAGS_CONNECTED in udp_connect(). 2003-05-20 11:23:59 +00:00
likewise
cf7054dff2 Merging some fixes that had been committed into STABLE. 2003-05-20 09:49:04 +00:00
likewise
b8eeee5528 dhcp_recv() left dangling dhcp->p pointer in case of unexpected message.
This could result in pbuf_free() assertion (ref count 0) or crashes.
2003-05-20 09:04:10 +00:00
likewise
30d5b11628 Cleanup of some formatting and comments. 2003-05-20 08:16:29 +00:00
jani
cd65d36822 patches 1492, 1493 and 1494 from Marc 2003-05-19 14:41:54 +00:00
likewise
cda867d52b Applied patches posted by Marc Boucher on lwip-users May 18th 2003. 2003-05-18 22:29:10 +00:00
jani
24a9063721 add sio_read and sio_write to beused by PPP 2003-05-06 12:20:57 +00:00
jani
840953c0e3 empty lightweight protection macros defined not only for no_sys 2003-05-06 12:19:53 +00:00
jani
398bf575d9 C++ comments cleanup 2003-05-06 12:15:08 +00:00
jani
8bfe344923 fix format warning 2003-05-06 12:13:34 +00:00
jani
c3fa5819fd simplify MEM_ALIGN_SIZE macro 2003-05-06 11:24:42 +00:00
likewise
7e73e4728d Made pbuf flags unsigned. Added "incoming broadcast" flag. 2003-05-03 09:44:09 +00:00
likewise
03bc7c868b Major stylo search/replace for "One space between keyword and opening bracket." 2003-05-01 13:24:01 +00:00
jani
4c3f44b0d2 add PPP_DEBUG option and align all options to teh same colums using spaces and no tabs.closes patch #1306 too 2003-05-01 09:36:08 +00:00
likewise
b031be753a Patch #1308. Disabled, as one issue in dhcp.c (file field overloading) needs fix. 2003-05-01 09:03:20 +00:00
likewise
6e9c995fc8 Fixed packet header debug formatters. 2003-05-01 08:37:24 +00:00
likewise
6ee1644db7 Patch #1183 applied. This drops short ICMP packets. 2003-05-01 08:29:54 +00:00
likewise
7cb64f2a43 Patch #1183 applied. This drops short UDP/TCP packets. 2003-05-01 08:03:51 +00:00
likewise
6c907ce8d1 Patch #1308. Still disabled, as it needs to make sure no file field is not overloaded. 2003-05-01 08:00:41 +00:00
likewise
a0eb47d561 Implemented packet (de)queueing. Unused, etharp.c must be adapted next. 2003-05-01 07:48:01 +00:00
anderscarlman
084c45d3db Added dummy parameters for the empty macros snmp_add_ifinoctets and
snmp_add_ifoutoctets in order to avoid compiler warnings.
2003-04-27 09:51:59 +00:00
anderscarlman
0ef3b9b3c5 Re-added code for checking tail-parameter for NULL in
pbuf_chain() to provide for better backward compatibility.
2003-04-26 20:32:23 +00:00
likewise
12bb78a425 Either first or last packet can be queued through ARP_QUEUE_FIRST option. 2003-04-22 15:09:56 +00:00
likewise
042b2a39d9 Either first or last packet can be queued. Fixed (err_t)NULL return value in etharp_query(). 2003-04-22 15:08:47 +00:00
jani
1204e461c8 add definitions for PF_UNSPEC and IPPROTO_IP 2003-04-22 13:37:14 +00:00
likewise
9bc16878ea Fixed tabs into spaces. Fixed other stylos. 2003-04-16 07:39:48 +00:00
jani
7662015de6 obsolete PCB handling only active when TCP is enabled 2003-04-15 14:58:35 +00:00
jani
e4775d4162 alignment fix from Marc Boucher 2003-04-15 14:56:03 +00:00
likewise
ed14a32224 Stylo. 2003-04-15 14:40:55 +00:00
likewise
4ecb01f4fd Changed netif name formatting from %s to %c%c. 2003-04-15 14:32:13 +00:00
likewise
a1efd95d0f hexadecimal notation for NETIF_FLAGS_ 2003-04-15 12:44:15 +00:00
likewise
ac2b4c2174 Debug levels set on some serious debug messages. 2003-04-15 12:43:15 +00:00
likewise
9ef5a61b1e Prevent compiler warning on unused function arguments. 2003-04-15 12:41:52 +00:00
likewise
b68c91c973 Debug message shows requested pbuf type (of ROM/REF) upon memory allocation failure. 2003-04-15 12:38:48 +00:00
likewise
710ac00024 dhcp_inform() did not set and unset netif->dhcp. always generated assert failure. 2003-04-15 12:37:06 +00:00
likewise
a96a12ed1f Prevent warnings about unused function arguments. 2003-04-15 11:27:52 +00:00
likewise
a8976fd367 Again accepted NULL to indicate IP_ADDR_ANY. 2003-04-15 09:16:39 +00:00
likewise
11e0cf6f40 Added NETIF_FLAG_LINK_UP. Not used yet. 2003-04-14 12:29:45 +00:00
likewise
dc1ac6107f Disabled pbuf_dechain() as it not currently in use. 2003-04-14 12:17:08 +00:00
likewise
f9538c9395 Disabled pbuf_dechain() as it not currently in use. Fixed comment position. 2003-04-14 11:37:12 +00:00
likewise
445a64d933 Stronger debugging/assertion. 2003-04-14 11:36:17 +00:00
anderscarlman
d1940302bb Removed the lines setting dhcp->msg_in and dhcp->options_in to NULL, since this is done implicitly through dhcp_free_reply(). 2003-04-12 15:40:43 +00:00
davidhaas
3defc437c6 Got rid of pbuf_pool_alloc_cache and pbuf_pool_free_cache. Also got rid of
pbuf_refresh(). This has sped up pbuf pool operations.
2003-04-11 14:39:15 +00:00
likewise
40f10b69f7 All debug messages now show actual config _after_ setting netif config. 2003-04-11 14:02:48 +00:00
likewise
4c5117101d Fixed debug message for PBUF_REF/ROM allocation failure. 2003-04-11 12:56:13 +00:00
likewise
4bcfd81923 Macro IP_ADDR_ are cast non-const as lots of functions miss const qualifier for arguments. 2003-04-11 08:45:15 +00:00
likewise
f6a8994521 ip_addr_any and _broadcast are type-declared as being const. 2003-04-11 08:10:17 +00:00
davidhaas
50f47f18c1 Fix memory leaks.
When pbufs are chained, the second pbuf must be freed, if no higher level
application refers to it any longer.
2003-04-09 20:28:15 +00:00
davidhaas
18a215e6a8 Made memory stats more accurate (real amount and max amount of memory used).
Also fixed a protection bug which occurred when memory allocation failed.
2003-04-09 20:19:27 +00:00
davidhaas
0bce6f8974 Fixed bug where tearing down a connection would cause loss of memory. 2003-04-09 20:12:12 +00:00
likewise
1254b42e66 Enabled code to abort/replace TCP pcbs upon netif address change. 2003-04-09 15:17:57 +00:00
likewise
a389b630ac Added (non-active) code handling pcbs upon changing IP address. 2003-04-08 12:19:02 +00:00
likewise
a4a7a7a47e TCP data can be safely referenced as PBUF_ROM instead of PBUF_REF. 2003-04-07 21:28:16 +00:00
jani
a3087737bd initial PPP options 2003-04-07 08:54:18 +00:00
likewise
12fc0239c2 Fixed bug #3112 (faulty behaviour calling tcp_listen() when already listening) 2003-04-06 20:35:50 +00:00
likewise
0418edb7b6 Added debugging to verify correct result of udp_bind() / udp_connect(). 2003-04-04 08:14:49 +00:00
likewise
2e233cb35b Fixed stylo. 2003-04-04 08:14:04 +00:00
likewise
e36394e6cc Only changes to comments. 2003-04-03 19:11:02 +00:00
likewise
6d3149714f Print debug message before actually changing netif IP address config. 2003-04-03 12:09:39 +00:00
likewise
9ea10ce05d In pbuf_take(): Got rid of variable 'f'. Fixed stylo (typo in style). Renamed 'top' to 'head'. 2003-04-03 08:50:57 +00:00
davidhaas
21d17e41fd Fixed last change to pbuf_take. There were two calls to pbuf_free in a row. 2003-04-01 15:54:25 +00:00
likewise
af8f280811 Fixed ip_addr_set() to deal with IP_ADDR_ANY. Added "ip_addr.h" include. 2003-04-01 15:00:26 +00:00
likewise
7abb278b60 Added assertion checking against dupes in pcb active list. Added comments. 2003-04-01 14:52:41 +00:00
likewise
7842a0190a IP_ADDR_ANY is now a pointer to { 0UL } (see IP_ADDR_BROADCAST).
For easier debugging of IP addresses.
2003-04-01 14:50:00 +00:00
likewise
a22e66f5ee IP_ADDR_ANY is now a pointer to { 0UL } (see IP_ADDR_BROADCAST). 2003-04-01 14:49:37 +00:00
likewise
1a72feb128 etharp_query() has error return type now. Matched dhcp.c with this change.
Added debug messages in other places.
2003-04-01 14:02:50 +00:00
likewise
a28af1be11 Fixed another assert. Removed another redundant assignment. 2003-04-01 12:28:45 +00:00
likewise
b04ac8f3be Lots of comments added. Removed redundant assignment. Moved assertion. 2003-04-01 12:17:55 +00:00
likewise
5f35f4bb3b Reverted back to David Haas' patch of pbuf_chain() from 1.34. 2003-04-01 09:35:20 +00:00
likewise
4c3512c0a2 Replaced pbuf.c 1.34 pbuf_take() change by simpler alternative. 2003-03-31 23:28:54 +00:00
davidhaas
09ca7a181b In keeping with pbuf->ref always having the count of the number of pointers
to the particular buffer (and the last rewrite of pbuf_free), changed most
pbuf_ref_chain() calls back to pbuf_ref(). I think this was causing some pbuf
leaks.
2003-03-31 22:09:39 +00:00
davidhaas
82a32be1d6 Fixed issue in pbuf_take(): old pbuf of type PBUF_REF was being referenced
after being freed. Also, it was not being freed if it had been the first
buffer in chain. It still needs to be freed then.
2003-03-31 21:32:30 +00:00
davidhaas
9f3511231a Fix pbuf_chain() to update tot_len of last buffer in first chain properly.
Previous code skipped it.

Made comments in pbuf_header() more general (header can be increased or
decreased).
2003-03-31 20:45:08 +00:00
likewise
6da25968e0 pbuf_header() now only moves payload pointer upwards for PBUF_ROM/REF. 2003-03-31 18:48:52 +00:00
likewise
a70f478ef1 Fixed pbuf_dechain() assertion. Removed old documentation from pbuf.h. 2003-03-31 11:39:48 +00:00
likewise
6c147709b6 Documentation changes. Added missing trailing newlines to debug messages. 2003-03-31 10:32:35 +00:00
kieranm
8636ac26cf Fixed bug in mem_realloc (check alignment of size) 2003-03-31 09:36:18 +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
likewise
e6cc785fff Fixed missing variable. 2003-03-31 08:34:02 +00:00
likewise
00809b49f1 Better error handling. Added debug messages for serious errors. 2003-03-31 08:02:52 +00:00
likewise
917f8ec799 Added debug messages for serious errors. 2003-03-31 08:00:01 +00:00
likewise
c50f80da92 Corrected more pbuf.c functions to comply with pbuf->ref and ->tot_len invariant. 2003-03-30 22:24:10 +00:00
likewise
2bd3d51fcf Removed the pbuf_dechain() from udp_send() matching new pbuf code. 2003-03-30 00:39:03 +00:00
davidhaas
2e0829fb5a Made lwip timeout measurements accurate by no longer returning 1 millisecond
whenever sys_arch_mbox_wait() and sys_arch_sem_wait() get a message or
semaphore immediately. Updated documentation for this change.
Unix port and Coldfire port have been updated.
2003-03-28 20:46:40 +00:00
davidhaas
c4ff244c4e Fixed minor compile issues. 2003-03-28 19:45:37 +00:00
likewise
002998cf49 Fixed bugs #2968 (ref count) and #2670 (total length).
Name of pbuf_unref() falsely suggests to undo pbuf_ref(), renamed to pbuf_take().
2003-03-28 08:49:05 +00:00
likewise
7dea6dc834 pbuf_realloc() did not update ->tot_len in a chain. Fixed dealloc of REF/ROMs. 2003-03-26 13:50:03 +00:00
likewise
fd0d94af44 Fixing bug #1903 with a new pbuf_realloc() that respects mixed-type chains. 2003-03-26 13:30:38 +00:00
likewise
ab630b2875 Strong assert checking against queueing behaviour in udp_send(). 2003-03-26 10:59:31 +00:00
likewise
f4f717b20a Fixed typo affecting debugging. 2003-03-26 00:31:55 +00:00
likewise
cf188ba15c Brackets around debug in DEBUGF. Cleaned comments. 2003-03-26 00:31:24 +00:00
likewise
fa34d51b7e Added documentation and comments. 2003-03-25 12:59:42 +00:00
likewise
6621f8b88a New tail section of udp_send() that handles both queued and unqueued cases. 2003-03-25 12:58:22 +00:00
davidhaas
f9e4f4d813 Typo bug. The wrong semaphore was being signalled. 2003-03-24 15:53:38 +00:00
likewise
80b961df60 Lots of clearing up comments and use of new debugging features. 2003-03-24 15:15:18 +00:00
likewise
cea002a088 Forgot #if LWIP_DHCP around netif->dhcp = NULL; 2003-03-24 14:30:18 +00:00
likewise
e062b70da8 Retry with PBUF_RAM if PBUF_POOL allocation failed. 2003-03-24 13:27:12 +00:00
likewise
ce4dbcec6a Initialized netif->dhcp to NULL. 2003-03-24 13:06:16 +00:00
likewise
07058652c1 Added tracing debug messages. 2003-03-24 12:58:01 +00:00
likewise
7a92011933 Re-added pbuf_dechain() in udp_send() as it breaks current applications. 2003-03-24 12:57:00 +00:00
jani
c60d0de919 Add sio.h containing interface to platform specific serial layer.Make slipif use it instead of defining extern functions.This is in preparation for PPP 2003-03-24 10:54:03 +00:00
likewise
6457b93a1f Made some flag defines unsigned. 2003-03-24 10:30:12 +00:00
likewise
20667e5163 Added debug levels for some serious errors (out of memory). 2003-03-24 10:29:03 +00:00
davidhaas
96f2e162ef Fixed memory leak caused by my last pbuf_ref change. 2003-03-21 23:01:20 +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
jani
9cafc7a764 avoid compiler warning 2003-03-21 10:34:47 +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
2f7e4bd587 patch 1197 form floriZ.When debug is on and port is 0 in udp_bind ERR_USE is always returned due to missing braces.Reindent that part of code while at it 2003-03-19 16:04:54 +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
0846206bc0 rename STATS to LWIP_STATS and make it checked by #if not #ifdef.The rest of the _STATS defines should follow 2003-03-19 12:37:46 +00:00
jani
441e9b8431 add tcpip_callback patch from Marc 2003-03-19 11:23:46 +00:00
davidhaas
f9f21934ab Fix to last fix for bug 2826: find_arp_entry() was now not finding any
entries unless there was an attached buffer. Fixed so that it finds entries
without attached buffer.

Also: Now attaching buffer to arp queue before sending arp request. For
Coldfire, where ethernet receive is done under interrupts arp response was
received before buffer was attached, thus causing attached frame to never get
transmitted.
2003-03-18 14:48:40 +00:00
davidhaas
2673568cfd Added default settings for DBG_MIN_LEVEL and definitions for the possible
levels.
2003-03-17 16:59:22 +00:00
likewise
45c13ad08f Fixed bug #2826 (re-use of oldest ARP entry with queued packet leaks pbuf). Only if ARP_QUEUEING == 1. 2003-03-16 23:46:29 +00:00
likewise
76d395c8de Fixed bug #2841 (etharp.c packet queueing always picks table entry 6). 2003-03-16 22:44:05 +00:00
likewise
090b4087fc Using a negated unsigned value as func. arg. fails for Keil C166 compilers. 2003-03-16 22:39:15 +00:00
likewise
7ece19c474 pbuf_unfold_reply() lost memory if already unfold.
dhcp_stop() leaked memory if a unfold reply was still in existance.
2003-03-16 22:36:54 +00:00
likewise
dbdd0f520f Added source comments. 2003-03-13 08:50:04 +00:00
likewise
d47ef79c04 Moved DBG_MIN_LEVEL out of here to lwipopts.h 2003-03-11 14:16:27 +00:00
likewise
400ff200ee Added comments on some ARP options. 2003-03-11 13:57:25 +00:00
likewise
daeb21b3b9 Include "netif.h" for ntohl and friends. 2003-03-10 16:13:25 +00:00
likewise
7e36c58529 Make sure that BYTE_ORDER is actually defined. Panic with #error if not. 2003-03-10 16:12:41 +00:00
likewise
aa84869fdb Fixed cyclic dependency by including netif.h. Not sure if this breaks other compilers? 2003-03-10 16:09:41 +00:00
likewise
bd6b1a0237 DBG_TYPES_ON added (must be overridden in lwipopts.h). 2003-03-10 16:08:52 +00:00
likewise
adf088e575 DBG_TYPES_ON removed (must be in lwipopts.h instead). 2003-03-10 16:07:50 +00:00
jani
8613f2a48e factor out netif_set_addr so address of netif can be changed 2003-03-07 10:55:58 +00:00
jani
f308f7cc80 Add sys_untimeout stub in case of NO_SYS 2003-03-07 10:29:25 +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
davidhaas
ee2c049518 Fixed build for coldfire after last debug.h and opt.h changes. 2003-02-25 21:46:04 +00:00
jani
0ba9a45d32 icmp messages need only PBUF_IP layer 2003-02-25 16:00:21 +00:00
jani
bcfc7173f3 default value for NO_SYS 2003-02-24 13:57:39 +00:00
jani
d390ca7056 cleaned up opt.h a bit, added more option defaults ad changed SYS_LIGHTWEIGHT_PROT to be a 0/1 define.The same for COMPAT_SOCKET 2003-02-24 10:49:05 +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
jani
d372121d6e dhcp.h and ip.h declare struct netif and don't include netif.h to avoid warnings. 2003-02-20 17:16:30 +00:00
jani
8e9aa84070 do not directly include lwipopts.h but lwip/opt.h instead 2003-02-20 16:32:22 +00:00
jani
6319ffbcb8 delete ethernetif.h 2003-02-20 15:23:04 +00:00
likewise
d1c03cbd69 Fixed some issues open after merging 'leon-dhcp'. 2003-02-20 14:35:40 +00:00