Commit Graph
15 Commits
Author SHA1 Message Date
Olaf Bergmann f6b45cb674 Contiki: implement coap_malloc_type() for COAP_PDU
To get rid of the awful (and buggy!) ALIGNPTR stuff that used to
be in coap_pdu_clear(), a new memory type COAP_PDU_BUF has been
introduced for Contiki. This allows storing the message payload
in its own memory chunk similar to the way it is stored for lwIP.
2015-02-15 22:32:56 +01:00
Olaf Bergmann ebb00c4dfe Merge remote-tracking branch 'coap-lwip/chrysn-lwip-fixes' into develop
Conflicts:
	coap_io.h
	mem.h
	net.c
	pdu.c
2015-02-14 20:45:48 +01:00
chrysn 6caf836023 lwip pdu implementation: shift from contiguous to memp + pbuf
the old implementation stuffed the pdu struct in front of the
transport-level pbuf, and preserved it on the stack while the packages
were sent.

this had two advantages:

* saving ram
* preserving the other implementation's structure of pdu->hdr == pdu+1
  (ie. starting right after the pdu struct)

but two disadvantages:

* bad readability and pointer juggling in the send routine
* relying on the send function to block until the package is out (which
  works for simple implementations of lwip drivers but not dma etc)

if something really assumes the contiguous memory structure, it will
show (unfortunately by corrupting other pdu structs), and chances are
people use ->hdr anyway.
2015-01-16 12:03:25 +01:00
chrysn bafa1ca05e coap_malloc_type implementation for lwip based on memp
those things need to reside in mem.h (instead of living implementation
dependently inside mem.c) because coap_malloc_type(MY_TYPE, ...) is
converted to memp_malloc(MEMP_MY_TYPE) and thus needs to be done in the
preprocessor. (the alternative would be to switch on the MY_TYPE enum,
which would be harder to maintain).
2015-01-15 13:34:21 +01:00
chrysn 421170b704 use coap_malloc_type to ease lwip porting 2015-01-15 13:34:21 +01:00
Olaf Bergmann 99108e82d9 fixed alignment bug in PDU memory 2014-11-05 23:47:18 +01:00
Olaf Bergmann a1ec0371ff Implemented new network-I/O functions for Contiki 2014-09-15 14:30:05 +02:00
Sebastian Sontberg 8ee0342809 Convert function declarations to strict-prototypes format 2014-08-05 01:31:05 +02:00
Olaf Bergmann 77183cdc48 Use type tag in coap_free_type(). 2014-06-18 23:35:19 +02:00
Olaf Bergmann 6dcf3c7128 added header include for size_t 2014-06-18 18:52:25 +02:00
Olaf Bergmann 0d78eab2e1 Some small additions for combined memory management.
Two new functions coap_malloc_type() and coap_free_type() have been
added to centralize the typed memory allocation for Contiki and LWIP.
Currently, calls to memb_alloc(), memp_malloc() and coap_malloc() are
distributed across several modules. The idea of the new functions is
to centralize memory management in one place (mem.c). coap_malloc()
and coap_free() are still available as wrappers for the new functions.
2014-06-18 16:30:07 +02:00
Olaf Bergmann 3358f2901d Fixed license info.
Options iterator.
Address abstraction to allow IPv4 addresses.
more changes for draft-ietf-core-coap-06.
2011-06-02 02:43:59 +02:00
Olaf Bergmann 758b7f775e Applied patches from Markus Becker (thanks!)
* 0001-Trailing-whitespace-cleanup.patch
* 0001-Went-back-to-2.65-of-autoconf.patch
* 0002-Fix-compiler-warning-for-str.patch
* added several files to Makefile target .gitignore
2010-11-22 13:01:00 +01:00
Olaf Bergmann 94cc2c4f42 added license information and general project information 2010-10-18 14:53:04 +02:00
Olaf Bergmann 174a86f491 new implementation of ordered lists
wrapper macro for memory handling
new Makefile target .gitignore
2010-07-12 17:15:45 +02:00