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.
libcoap: A C implementation of IETF Constrained Application Protocol (RFC 7252)
Copyright (C) 2010--2014 by Olaf Bergmann bergmann@tzi.org
ABOUT LIBCOAP
libcoap is a C implementation of a lightweight application-protocol for devices that are constrained their resources such as computing power, RF range, memory, bandwith, or network packet sizes. This protocol, CoAP, is standardized by the IETF as RFC 7252. For further information related to CoAP, see http://coap.technology.
PACKAGE CONTENTS
This directory contains a protocol parser and basic networking functions for platform with support for malloc() and BSD-style sockets. The examples directory contains a client and a server to demonstrate the use of this library.
LICENSE INFORMATION
This library is published as open-source software without any warranty of any kind. Use is permitted under the terms of the GNU General Public License (GPL), Version 2 or higher, OR the revised BSD license. Please refer to LICENSE.GPL oder LICENSE.BSD for further details.