Remember the query string used during the observe request and pass it to the resource handler.
Support partial notification of observers based on the query string.
The signature of several dummy functions that are defined to make
compilers happy that complain on empty modules was not standards
compliant. To avoid related compiler warnings, the formal argument
list of this function now is explicitly declared as void.
The environment variable TLS now controls the DTLS-specific configuration
options. The following values are defined:
no turn off DTLS support
openssl use OpenSSL library
gnutls use GnuTLS library
tinydtls use tinydtls library
Any other value will be mapped to gnutls which is the default.
Commit 5b1a8f67 added two macros LL_SEARCH_PAIR and LL_SEARCH_PAIR2
to utlist.h which is maintained at [1]. To simplify updates of this
file, the macros have been moved into async.c as this is the only
place where they are used. To avoid confusion with linked list macros
from utlist.h, the prefix "LL_" has been removed from the custom
macros.
[1] https://github.com/troydhanson/uthash
With gcc 7.2.0, new compiler warnings related to utlist.h and
uthash.h have occured. Several have been fixed by updating the
header files to the latest version from [1].
[1] https://github.com/troydhanson/uthash
The message id in the CoAP header is used for reliability when
transferring a CoAP PDU over a non-reliable transport protocol
such as UDP. For message de-duplication, it is useful to have
a monotonously increasing number space within a session. Therefore,
the context-global value has been moved to coap_session_t.
The function coap_new_message_id() now takes a coap_session_t
object as its argument.
In the main of examples/coap-server.c wait_ms was set to
COAP_RESOURCE_CHECK_TIME * 1000, then coap_run_once() was invoked
with parameter timeout_ms as COAP_RESOURCE_CHECK_TIME * wait_ms,
i.e., squaring the resource check time.
This bug has been fixed by removing COAP_RESOURCE_CHECK_TIME from
the call to coap_run_once().
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
ctags is being used to create the symbol maps for dynamic library
generation. Exported symbols from other platforms such as LWIP
must be excluded from these maps to avoid linker errors for undefined
symbols.
This modification adds the LWIP-specific function coap_socket_send_pdu()
to the exclusion list.
coap-client now prints PDUs that are sent and received in log level
INFO so that these are output with '-v6' or higher. These messages
are now visible without turning on the full debug.
print_content_format() converts numeric Content-Format specifiers
to readable media type names. This change adds the new content
formats from RFC 8152 to this list.
coap_async_state_t now contains a reference to the session that is
associated with the respective async state. As the response must
be sent over this session, the local_if parameter of check_async()
is not used anymore and can be removed.
coap_send() now takes ownership of the coap_pdu_t object passed
as second argument. Therefore, it is no longer necessary to release
the PDU structure in case of an error.
Zero-length strings passed to -u are valid user names for DTLS.
The function cmdline_read_user() therefore returns 0 when the
argument passed with option '-u' is an empty string.
The new option '--with-tinydtls' allows selecting tinydtls as
DTLS implementation. This option must be combined with '--disable-shared'
as tinydtls supports only static linkage. Unlike GnuTLS and OpenSSL,
tinydtls is not enabled automatically during configuration.
Sendqueue nodes and send operations now require a session object.
This modification calls coap_new_client_session() on a global
coap_context_t object to create a fake session on the loopback
interface.
Adjusting version numbers in various places for dot and doxygen is
tedious and error prune. So set up the required versions right before
the code block for those checks.
To be able to use the collected CFLAGS and LIBS variables in the main
Makefile substitute DTLS_CFLAGS and DTLS_LIBS with the found values from
previous made checks and exporting them to autoconfigure.
Also define the found development crypto library into the configuration
header file 'coap_config.h.
We may need to add the flags also to examples/Makefiles.am too.
Giving some more information to the user than the output of the
configure with it's calls itself. By adding this output function the
user will see which library with which version etc will be used.
DTLS features are needing external cryptographic libraries for proper
working. There are some possibilities to use existing libraries of that
kind.
Based on discussions on the ML and also the issue tracker on GitHub we
found some consensus to use and support GnuTLS and OpenSSL at least in
the beginning of implementing DTLS support. The added code is using
GnuTLS 3.2.0 and OpenSSL 1.1.0 as required minimum versions.
This commit is adding a new configure option '--enable-dtls' which is
turned on by default to build libcoap by default with DTLS
functionality.
It's adding also two more additional options that let the user decide
which cryptographic library should be used for DTLS support. The two
optional options are '--with-gnutls' and '--with-openssl'.
These two options are optional and a user doesn't need to set any of
them if he doesn't care which library should be used. If these options
are not given the logic will first try to find the GnuTLS library for
usage and if not found do a fallback to OpenSSL.
The following behaviour is now implemented into configure by this commit:
$ ./configure --disable-dtls
or
$ ./configure --enable-dtls=no
Both options configuring the source to not implement any DTLS
support.
$ ./configure # without additionally options '--with-gnutls' or '--with-openssl'
The configure script is trying first to find GnuTLS for DTLS.
If the system hasn't GnuTLS development files the configure script is
moving over to OpenSSL and try to find the development files of
OpenSSL. If any files can't be found the script will break with a error
message.
$ ./configure --with-gnutls
The development files for GnuTLS will be explicit searched and used even
if also OpenSSL is available and usable.
$ ./configure --with-openssl
Like before but with the needing for OpenSSL development files. A
optional availability of GnuTLS on the host will be ignored.