This then makes sure that all things libcoap are properly initialized
before use, and coders realize they need to do this.
Note: coap_new_context() continues to make sure that coap_startup()
is invoked if not done previously, but this may be too late.
examples/coap-client.c:
examples/coap-server.c:
Add in Q-Block intelligence.
include/coap3/block.h
include/coap3/coap_block_internal.h
include/coap3/coap_event.h
Add in Q-Block references.
Add in new functions
coap_block_check_q_block1_xmit()
coap_block_check_q_block2_xmit()
coap_send_q_blocks()
coap_send_q_block1()
coap_send_q_block2()
coap_block_drop_resp_q_block_xmit()
coap_block_drop_resp_q_block2_crcv()
coap_q_block_is_supported()
include/coap3/coap_session.h:
Add in new Congestion Control defaults and ability to configure them.
include/coap3/pdu.h:
Add in the new options.
libcoap-3.map:
libcoap-3.sym:
Expose external Congestion Control functions.
man/coap-client.txt.in:
man/coap-server.txt.in:
man/coap_block.txt.in:
man/coap_handler.txt.in:
man/coap_recovery.txt.in:
man/coap.txt.in:
Add in Q-Block information.
src/block.c:
Add in the new functions to support Q-Block.
src/coap_debug.c:
Output the new options as appropriate.
src/coap_io.c:
Check for Q-Block transmission timeouts.
src/coap_session.c:
Add in the Congestion Control support.
src/net.c:
src/resource.c:
Add in Q-Block support.
configure.ac
CMakeLists.txt
Add in support for enabling/disabling Q-Block support (enabled by default).
Move some existing header inline code into source files.
Update coap_resolve_address_info() to remove need for client based app
code to have to understand IPv4/IPv6 code.
Remove IPv4/IPv6 specific code from examples code.
This means that apps need to have no knowledge of what IP support is available.
Updates coap_uri_into_options() and coap_resolve_address_info()
which have only been recently added to develop branch and are not in any
previous release.
Add in new file src/coap_dtls.c.
Add in coap_(d)tls_establish() functions which are called when netif
accept / connect take place.
Add in coap_session_establish() function which is called when (D)TLS
has established as well as at the session layer if there is no (D)TLS
in preparation for properly supporting protocol layers.
Add in coap_(d)tls_close() functions which are called prior to
coap_netif_close().
Add in skeleton coap_netif.c coap_netif_internal.h files, populated with
coap_netif_dgrm_read(), coap_netif_dgrm_read_ep(), and coap_netif_dgrm_write()
functions that are called by the CoAP and (D)TLS code which in turn call
the appropriate coap_socket_*() functions.
The coap_dtls_send() function parameters are aligned with
coap_netif_dgrm_write().
coap_resolve_address_info() emulates getaddrinfo() but has the extensibility to
support other socket types based on the address to resolve.
coap-client, coap-server and lwip/client updated to use this new functionality.
coap_address(3) updated to include the new functions.
Based on work done in https://gitlab.informatik.uni-bremen.de/obergman/libcoap
New directories with files
include/oscore
src/oscore
New files
include/coap3/coap_oscore.h
include/coap3/coap_crypto_internal.h
include/coap3/coap_oscore_internal.h
man/coap-oscore-conf.txt.in
man/coap_oscore.txt.in
src/coap_oscore.c
tests/test_oscore.c
tests/test_oscore.h
Supported by new option (enabled by default)
./configure --enable-oscore
cmake .. -DENABLE_OSCORE=ON
Requires a TLS library configured to do the OSCORE encryption and hashing.
Drop the use of syslog LOG_DEBUG etc. for coap_log() and use the
coap_log_debug() etc. macros which make use of COAP_LOG_DEBUG etc.
Application examples updated, as well as the man page examples.
The dtls versions of the server and client are built as
server-dtls and client-dtls.
Add in flexible option support for server and client. These are
a subset of the coap-server and coap-client options.
Simplify code for applications by providing coap_uri_into_options()
which then adds the (optional) port and splits out the path / query
as CoAP options, adding them to the optlist_chain for subsequent use.
Added a new coap_delete_uri() for completeness.
Update documentation to include the uri based functions.
Update examples to use the new coap_uri_into_options() function.
New demo client app.
Update some of the memory sizes.
New coap_lwip_dump_memory_pools() to dump LwIP memory pool usage.
Add in logic to handle new client sessions.
New coap_io_process() to handle LwIP which can invoke a callback handler
to wait / timeout for the next input handler.
New coap_lwip_set_input_wait_handler() to define this handler.
Update coap_io_prepare_io() to handle LwIP.
Support re-use of pbuf for PDU re-transmissions.
Make sure that NSTART is correctly obeyed.
Build the client with client only libcoap code.
Build the server with server only libcoap code.
Update LwIP source to latest stable release.
Reserve memory for a response PDU.
New coap_lwip(3) man page.
Update directory structures for config files.
Update files contained in "make dist" and check lwip rebuilds
in the github workflows.
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
.github/workflows/main.yml:
Build all the cmake TLS variants.
CMakeLists.txt:
Add in missing file.
examples/tiny.c:
include/coap2/encode.h:
Move COAP_PSEUDOFP_ENCODE_8_4 functions from encode.h to tiny.c.
Fix COAP_PSEUDOFP_ENCODE_8_4_DOWN 'ls' ordering complaint.
man/examples-code-check.c:
Fix compile warning, allow 'Unused but set variables' in examples and set
-Werror when compling the examples.
examples/lwip/Makefile:
Remove compilation option -fpack-struct
This updates the initial work done for adding in cache support
include/coap2/coap_cache.h: (new)
include/coap2/coap_cache_internal.h: (new)
src/coap_cache.c: (new)
New files to support cache support.
CMakeLists.txt:
Makefile.amMakefile.am:
Makefile.libcoap:
configure.ac:
examples/lwip/Makefile:
include/coap2/coap.h.in:
include/coap2/coap.h.windows:
win32/libcoap.vcxproj:
win32/libcoap.vcxproj.filters:
Add in the new files.
examples/client.c:
Fix valgrind reported memory leak.
examples/coap-server.c:
Add in new example_data resource that uses the new caching logic.
Update hnd_put() to use the new cache logic for BLOCK1 PUTs.
include/coap2/coap_forward_decls.h:
include/coap2/coap_internal.h:
include/coap2/coap_session.h:
include/coap2/net.h:
Add in new cache support.
libcoap-2.map:
libcoap-2.sym:
Include the new functions.
man/Makefile.am:
man/coap.txt.in:
man/coap_cache.txt.in: (new)
Update documentation.
src/coap_io.c:
Idle timeout cache entries.
src/coap_session.c:
Delete cache entry when session is deleted.
src/net.c:
Delete cache entries when context is freed off.
src/coap_gnutls.c:
src/coap_mbedtls.c:
src/coap_notls.c:
src/coap_openssl.c:
src/coap_tinydtls.c:
Add in SHA256 digest support.
Calling coap_free_context() does not free off any async entries, and so
raises assertion errors when coming to freeing off sessions if any async
entries exist.
async_data_t is a union, but the size of val and ptr are not the same - so
usage can have uninitialized data - hence bad timeout values.
Makefile.am:
Do not expose coap_delete_all*() functions.
examples/coap-server.c:
Fix async_data_t issue.
examples/etsi_iot_01.c:
Fix 32 bit compiler warnings using same logic as coap-server for holding the
async timeout value.
examples/lwip/Makefile:
Include async.c for the LwIP build.
include/coap2/async.h
Define coap_delete_all_async() function.
include/coap2/net.h
include/coap2/resource.h
Document coap_delete_all*() functions as internal.
libcoap-2.map
libcoap-2.sym
Remove non-exposed coap_delete_all*() functions.
src/async.c
Provide coap_delete_all_async() function.
src/net.c
Call coap_delete_all_async() from within coap_free_context().
In the same way that coap_split_uri() allows coaps:// scheme even if DTLS is
not available, it should allow coap+tcp:// and coaps+tcp:// scheme and let
other functions check whether TCP/TLS is available or not.
examples/client.c:
Verify if TCP is supported for scheme coap+tcp://.
src/coap_session.c:
Verify that the underlying CoAP transport protocol is supported in
coap_session_create_client().
Add verify for TCP protocol in coap_new_endpoint(), as well as always check
if TLS is supported.
src/uri.c:
Always allow coap+tcp:// and coaps+tcp:// in coap_split_uri() as a parsed
scheme in same way that coaps:// is always allowed.
Makefile.libcoap:
Include coap_tcp.c to include coap_tcp_is_supported() function.
examples/lwip/Makefile:
Include coap_tcp.o to include coap_tcp_is_supported() function.
This is compiler version dependent when doing static inline expansions.
examples/client.c:
Make hex2char() just static.
examples/etsi_iot_01.c:
Make coap_add_payload() just static.
include/coap2/address.h:
src/address.c:
Make coap_address_init() an actual function.
libcoap-2.map:
libcoap-2.sym:
Expose coap_address_init() as a function.
Makefile.libcoap:
Include address.c as one of the libcoap files for Contiki.
examples/lwip/Makefile:
Include address.o as one of the libcoap files for LwIP.
As a server, idle sessions are left around in case the client wants to do
further work using the same 5 tuple IP information.
With constrained systems, the number of sessions is limited, and so it is
easy to run out of sessions.
src/coap_session.c:
If there is an idle session, context->max_idle_sessions is not set and
a new session cannot be created, free off the oldest session and retry
the creation again.
examples/contiki/README:
examples/lwip/README:
Tidy up the documentation