Add in new ./configure options --enable-client-mode or
--enable-server-mode which by default are enabled.
If --disable-client-mode is set, then disable all the client specific code.
[ COAP_CLIENT_SUPPORT is not defined ]
If --disable-server-mode is set, then disable all the server specific code.
[ COAP_SERVER_SUPPORT is not defined ]
Functions and variables are only #ifdef'd out in the include/coap3/*_internal.h
files. They cannot be #ifdef'd out in the other include files as
COAP_CLIENT_SUPPORT and COAP_SERVER_SUPPORT are not available for application
compilations. The result of this is if, say, client only API functons are used
in a server application and COAP_CLIENT_SUPPORT is not defined, there will be
linking issues (missing functions). Providing stub functions unecessarily
increases the code size.
For coap-server, if it is able to provide proxy support, requires both
COAP_SERVER_SUPPORT and COAP_CLIENT_SUPPORT to set up the ongoing sessions.
So, the build environment deliberatly sets SERVER_CAN_PROXY=0 if
COAP_CLIENT_SUPPORT is not available to allow linking.
Some of the tests have to be disabled if COAP_SERVER_SUPPORT or
COAP_CLIENT_SUPPORT is not set.
Code size change indications
text data bss sum filename
155912 1728 12080 169720 libcoap-3-notls.a
138300 1728 12080 152108 libcoap-3-notls.a --disable-client-mode
106734 1632 10304 118670 libcoap-3-notls.a --disable-server-mode
180485 1733 12080 194298 libcoap-3-openssl.a
160306 1733 12080 174119 libcoap-3-openssl.a --disable-client-mode
125543 1637 10304 137484 libcoap-3-openssl.a --disable-server-mode
181755 1728 12080 195563 libcoap-3-gnutls.a
160972 1728 12080 174780 libcoap-3-gnutls.a --disable-client-mode
127178 1632 10304 139114 libcoap-3-gnutls.a --disable-server-mode
165879 1855 12128 179862 libcoap-3-tinydtls.a
147022 1855 12128 161005 libcoap-3-tinydtls.a --disable-client-mode
115618 1759 10352 127729 libcoap-3-tinydtls.a --disable-server-mode
171690 1728 13744 187162 libcoap-3-mbedtls.a
152099 1728 13712 167539 libcoap-3-mbedtls.a --disable-client-mode
118786 1632 11984 132402 libcoap-3-mbedtls.a --disable-server-mode
This change adds 'SPDX-License-Identifier: BSD-2-Clause' [1] to
the source code files that originate in the libcoap project.
Note that not all files are tagged because they are pulled in
from other sources and thus may fall under a different license.
More information about these is contained in the LICENSE file.
[1] https://spdx.org/licenses/BSD-2-Clause.html
Add in some new .in files, but still keep original files in distribution
files.
Essentially, use coap@LIBCOAP_API_VERSION@ (or equivalent) instead of
coap2. so resultant files have the correct value.
coap_config.h.lwip.in: (new)
coap_config.h.riot.in: (new)
include/coap2/coap.h.windows.in: (new)
As per https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html, many of the
coap2/ prefixes are not required for #include, so these have been removed.
Make sure that the test suite accesses the latest source version of
coap@LIBCOAP_API_VERSION@/coap.h by creating a tests/test_common.h.in that
makes the correct tests/test_common.h which is included in all of the test
suite files.
Created new 'CU_ASSERT_PTR_EQUAL_C(actual, expected)' to handle const variable matching
Where appropriate
Replace 'unsigned char' with 'const uint8_t'
Replace 'str' with 'coap_str_c_t'
Replace 'str' with 'coap_string_t'
Prefix with 'const' some type casts
Update coap_add_attr() calls inline with updated API
Update coap_resource_init() calls inline with updated API
Make use of coap_make_str_const() for defining parameters
tests*/.c
Update code to stop memory leaks (as found by valgrind)
examples/coap-rd.c
Track the fact that uri_path in coap_resource_t is now a pointer
As unit tests with IPv6 addresses keep failing on docker-based
travis CI, this changes reverts to IPv4 usage in following files:
test_wellknown.c
test_sendqueue.c
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.
The testdriver was linked against the statically generated library of
libcoap. By this the testdriver will *always* find any symbols, no
matter if it is a private or public symbol.
Due this the testing behavior isn't the same as a user would use the
shared library and can get a potentially pitfall even if the testdriver
was successful.
Due previous changes to the public header the testdriver source needs
now the local header coap_config.h to find all needed functions so there
are small changes needed to the source files.