Setting NDEBUG already replaces dtls_dsrv_hexdump_log(), dtls_dsrv_log_addr()
etc with dummy implementations.
This extends this to also replace dsrv_log() and dtls_{get,set}_log_level()
with a no-op implementation.
string.h is required for memcmp() that is used in session.c and
dtls_debug.c. Therefore, the header file needs to be included
only in these two files.
Change-Id: I11db1c37a7cc13d8fa2826f6d3e38d3765f4a4ec
Allow the application to define a log handler callback to use to provide
consistency in the logging output logic.
Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
Follow the model of how things are done for Contiki.
Set up a new WITH_LWIP_NO_SOCKET (which happens with NO_SYS = 1)
and use this when setting up addresses.
Add in platform specific for dtls_prng_lwip.c and lwip_platform.h
Update dtls_time.[ch] to handle LWIP version of time.
Code works for NO_SYS = 1 or NO_SYS = 0.
Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
Providing a too small buffer may result in missing the zero termination.
This adds an assert to ensure, that the buffer is large enough.
Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
dtls.c:
Add in const for dtls_handshake_type_to_name()
dtls_debug.[ch]:
Add in const where appropriate for dsrv_log().
In addition, get dsrv_log() to check printf syntax.
sha2/sha2.c:
Re-order "const static" to "static const" and add in needed const.
Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
Some helper functions such as hexdump() were declared as empty
when the NDEBUG symbol was defined. To clean up the API, the
actual implementation now is moved from dtls_debug.h (were it
was inlined) to dtls_debug.c.
Change-Id: I465f35310e1c64eb59e122a06ae79880fa21aec1
NOTE: RIOT OS own lines for debugging and print must be used
in future patch.
Change-Id: I8733215fd0c649c02a4ecfd8587d1916f020f4b8
Signed-off-by: Raul Fuentes <ra.fuentes.sam@gmail.com>
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
Statically define PACKAGE_NAME and PACKAGE_VERSION in contiki platform header.
This will require maintaining them in addition to values in configure.ac.
Change-Id: I08948dfdb4ddeafeed273a917367ee5ad237df8f
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>
The code has been cleaned up to
1. provide proper prototypes for functions that take no arguments (void),
2. avoid signedness issues, and
3. provide missing cases for switch statements.
Change-Id: I9e84ddb9ef6594c374ad817330a43b22642ebb33
* UIP_CONF_IPV6 is now called NETSTACK_CONF_WITH_IPV6
* As sprintf() is used anyway when NDEBUG is not set, we can also
use it for printing IPv4 addresses.
Change-Id: I91247ba0292c23a2e389a4a6a8f15c6204473b5f
When building with contiki, 'CONTIKI' is defined and is used to detect contiki.
Configure options can be configured with:
DTLS_CONF_ECC, DTLS_CONF_PSK, DTLS_CONF_NDEBUG
All files now include 'tinydtls.h' instead of 'dtls_config.h'.
Change-Id: I9a558a7d6bd777656d7b29028852bfc08911b8b7
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>
Fixes dtls_config.h not visible in headers
Include dtls_config.h in tinydtls.h and include tinydtls.h in all necessary
headers.
Remaining headers do not use 'ifdef', but they may require it too.
Change-Id: I39c86dffc8bbc8bd7551e74386994f92f49d00ec
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>