coap_network_send() uses the address given by local_interface as
source address of outgoing IP packets. For responses to requests
that have been received via IP multicast, this address is a
multicast group and thus must not be set as source in the IP header.
As a workaround, this change clears the address and ifindex so that
the kernel selects a suitable outbound interface.
When a request has been received via IP multicast, negative
responses including RST should not be sent. This modification
uses the new result code COAP_DROPPED_RESPONSE to indicate that
the response was intentionally suppressed. As the error handling
code only checks for COAP_INVALID_TID, no error messages will
be emitted due to this new behavior.
The calculation of transaction ids did not ensure that the result
is always greater or equal zero. To avoid conflicts with the error
codes returned by coap_send(), the calculation now masks out the
lower half.
Some unit tests in tests/test_options.c and tests/test_pdu.c check
for error cases, causing warning messages to be emitted by the
library code. As the expected result is checked separately, the
warnings can be suppressed to avoid confusion.
With this change, the new No-Response option is recognized by the
helper function msg_option_string() called from coap_show_pdu() for
pretty-printing CoAP messages.
The implementation of option filters based on coap_opt_filter_t
has changed to improve support for long option numbers. An option
filter is now a sparse field of a fixed size that can hold up to
COAP_OPT_FILTER_LONG options with a number larger than 255, and
up to COAP_OPT_FILTER_SHORT options with a number of 255 or less.
The space taken by coap_opt_filter_t is
2 * ((((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) + 1),
or 12 bytes with the default settings for COAP_OPT_FILTER_SHORT == 6
and COAP_OPT_FILTER_LONG == 2.
Three new functions have been added to the option filter API:
* coap_option_filter_set() to store an option number in a filter,
* coap_option_filter_get() to check if a filter contains a given
option number, and
* coap_option_filter_unset() to remove an option number from a
filter.
The previously existing functions coap_option_setb(), coap_option_getb(),
and coap_option_clrb() continue to work on the new option filter
unchanged but now are deprecated.
The function print_readable() did not add a terminating zero in case
len == 0. Now, the output buffer will always have a terminating '\0'
when buf has at least one byte free (i. e. buflen > 0). Note that the
function result does not include the trailing zero-byte.
The new format[0] was inspired by the discussion[1] on the IETF CoRE
mailing list. Changes include:
* Print human-readable message type and method/response code
* Output token included in {...} even if token is empty
* Print human-readable option types
* Print human-readable option values where possible
* Print human-readable Content-Format and Block options
* Print hex string included in <<...>> for binary content,
human-readable string included in '...' for text content
* Use '::' as payload delimiter if message contains a payload
[0] http://www.ietf.org/mail-archive/web/core/current/msg06069.html
[1] http://www.ietf.org/mail-archive/web/core/current/msg06062.html
The header coap.h should be the only header file a user has to include
to get functions from the libcoap available. Bu we have to provide not
only the header interface to the user, the user needs also some extra
information like the libcoap version or upstream related infos.
To get these automated in to a shipped coap.h header file we simple can
use some autotool magic and expand some macros while configure is
running and pasing i/c/coap.h.in. By this we can currently add the
following macro variables:
LIBCOAP_PACKAGE_BUGREPORT -> upstream email contact
LIBCOAP_PACKAGE_NAME -> the used package name (libcoap)
LIBCOAP_PACKAGE_STRING -> package name + version
LIBCOAP_PACKAGE_URL -> upstream homepage
LIBCOAP_PACKAGE_VERSION -> the current used version
All these macros variables are expanded from the respective macro names
from the configure run. The variables are prefixed because this with
LIBCOAP_ to not get name clashing on the user side while running the
autotools of the users project.
There are probably more predefined macros needed, but they can be easily
added later into include/coap/coap.h.in.
As we never want to break the API it makes no deeper sence to use a
numbered version '1.0' as this is the same as like a simple '1'.
The defined API number is used within the library so a defined version
'1.0' is also used for the namimg inside the library and other tools
reading them from the library.
Let's reduce the API version to '1' and simplify the naming for the
library by this.
The FreeSans font isn't shipped by doxygen anymore so we can not asumme
that the font is available on the system of the user.
Just let doxygen pick up a usable font by itself.
The old behavior didn't allow a additonal setting of the DESTDIR
variable. This is a serious problem while building within a chroot for
example. Also the implementation of the stamp file was triggering
multiple builds in some cirumstances. This handling is reverted with the
remove of the old stamp file handling.
context->message_id has been incremented as a side-effect of calling
the htons macro. To avoid potential issues with this, the increment
operation has been moved outside the macro call.
Just fixing up the warning from doxygen so the documentation will be
more usable. Also fixing up some whitespace, punctiation marking and
indentation issues.
The file CONTRIBUTE is primarily for user who wants to help to improve
the libcoap project. Please expand this file with helpful informations
for anybody who is interests in helping.
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>