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().
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.
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.
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.
.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.
hashkey.[ch] files restored (now prefixed with coap_)
LWIP and Contiki builds now include these files
block.[ch]:
New function coap_add_data_blocked_response() to simplify GET
responses and handle adding in BLOCK2 options as appropriate.
Needs coap_hash() to generate ETag option.
net.c:
Determine if Block2 is in use, and add to coap_add_observer().
resource.[ch]:
Include Block2 request in coap_add_observer().
subscribe.h:
Include Block2 definition in coap_subscriber_t for using during
observe responses.
pdu.h:
Update comment.
coap-client.c:
No longer causes duplicate calls to coap_show_pdu()
(one in library, one in coap-client for the same PDU).
If a block'ed response received and observing, now observing continues.
(Fixes#166).
Send Observe Cancel with Block2 option if -b defined
coap-server.c:
Replaced all option setting, data addition etc. with new
coap_add_data_blocked_response() function in the GET handlers.
(Fixes#246 Issue 2).
Support PUT with BLOCK1.
(Fixes#246 Issue 1).
Add in -N option to send observe responses as non-confirmable.
Handle small wait_ms values correctly (after being decremented) for testing
whether observe should be triggered or not.
Refresh time every second by making COAP_RESOURCE_CHECK_TIME 1
Manuals:
Add in new function coap_add_data_blocked_response()
Update coap_observe with coap_delete_observer(s) functions
Correct example typo and use new function in hnd_get_time().
Add in -N option to coap-server(5)
Be more specific about COAP_RESOURCE_FLAGS_NOTIFY_NON and
COAP_RESOURCE_FLAGS_NOTIFY_CON usage for observe.
Files:
Makefile.am
Makefile.libcoap
examples/client.c
examples/coap-server.c
examples/lwip/Makefile
include/coap/block.h
include/coap/coap_hashkey.h
include/coap/pdu.h
include/coap/resource.h
include/coap/subscribe.h
libcoap-2.map
libcoap-2.sym
man/Makefile.am
man/coap-server.txt.in
man/coap_handler.txt.in
man/coap_observe.txt.in
man/coap_pdu_setup.txt.in
man/coap_resource.txt.in
src/block.c
src/coap_hashkey.c
src/net.c
src/resource.c
Update code to use new APIs
[Some code changes modelled on PR #202, some code being moved between files]
Remove #ifdef WITH_LWIP from coap_io.c as file is not used
Add in resource time to lwip
Update for Travis build
Report on Contiki memory allocate failures to ease debugging
Make the different memory type counts configurable by using the -D option
included in a CFLAGS definition to the ./configure command line
.travis.yml
BUILDING
Makefile.libcoap
examples/contiki/Makefile
examples/contiki/README new
examples/contiki/server.c
examples/contiki/.gitignore (new)
examples/lwip/Makefile
examples/lwip/README
examples/lwip/lwipopts.h
examples/lwip/server-coap.c
examples/lwip/server.c
include/coap/address.h
include/coap/coap_io.h
include/coap/lwippools.h
include/coap/pdu.h
scripts/build.sh
src/address.c
src/coap_io.c
src/coap_io_lwip.c
src/coap_session.c
src/mem.c
src/net.c
src/pdu.c
note on coap_read removal: as the lwip implementation currently launches
the package handling right from the recv callback, a coap_read function
is not meaningful (as it is in posix or contiki where it actively
fetches the messages from the network buffer).
This drops the cumbersome mintapif mechanisms from server.c, fixes
header troubles that have popped up probably during the header cleanups,
drops old workarounds and enables IPv6.
This example now uses LwIP release 1.4.1 as the devel branch seems
to have disappeared from the git repository. Moreover, we just do
a shallow clone so maybe the server does not kick us that often.
* resolve file resolution conflicts between lwip and libcoap in favor of
lwip by rearranging the makefile
* cover the config.h of a configured base libcoap with the local one
using the deprecated -I- gcc switch
* enable etharp (no idea why it wouldn't work ootb, the complete
server.c lwip-contrib copy needs to be reviewed)
* disable optimizations for easier debugging, enable -g3 for macro
expansions