Commit Graph
572 Commits
Author SHA1 Message Date
Jon Shallow e25cf94d2a RIOT: Update to use SOCK i/f, not Posix
Remove all references to Posix functions, using Sock functions as appropriate.

Update coap_address_t to be RIOT specific when doing RIOT builds.
2024-03-12 17:15:01 +00:00
Jon Shallow a733325b16 multithread: Re-arrange lock checks for locked callbacks
Should fix CIDs
1583518-1583525
1583527-1583549
1583551-1583553
1583555-1583562
1583565-1583584
1583586-1583589
2024-02-21 16:54:32 +00:00
Denis Begun c7c3275e53 This fixes the issue of a client not ACKing a duplicate CON message from the server.
A duplicate CON message is sent by the server if the client's ACK to the original
confirmable message did not reach the server.
See issue #1306 for full description: https://github.com/obgm/libcoap/issues/1306
2024-01-06 14:51:30 +00:00
Jon Shallow 8237c1d801 Copyright: Update to 2024 2024-01-02 08:45:59 +00:00
Jon Shallow cc1cc1ad27 coap_net.c: Check for invalid PDU class codes 2023-12-27 11:31:26 +00:00
Jon Shallow e7105286f6 coap_threadsafe.c: Fix NPE in coap_delete_resource() 2023-12-20 10:54:54 +00:00
Jon Shallow 0f3ae5022d coap_block.c: Support server setting max block size for Block1/Block2 2023-11-30 16:48:10 +00:00
Jon Shallow c69c5d5af0 multi-thread: Add in thread safe support
Optional compile time thread safe code supported.

Locking is done at the coap_context_t level, and if enabled is primarily
done coap_threadsafe.c and coap_threadsafe_internal.h.

coap_threadsafe_internal.h causes coap_X() to get mapped to coap_X_locked()
throughout the libcoap library code with the exception of coap_threadsafe.c
if thread safe is enabled.
2023-11-25 11:41:26 +00:00
Jon Shallow 6b4fac968d PKI: Document intermediate CAs
Correct some typos
2023-11-20 11:27:58 +00:00
Jon Shallow 2e7cb35c01 WebSocket: Add support for noTLS and TinyDTLS
Use SHA1 code from RFC3174 sections 7.1 and 7.2.
2023-11-15 10:06:44 +00:00
Jon Shallow 805d148dd0 LwIP: Support TCP
If LWIP_TCP is set, then CoAP TCP support is compiled in.
2023-11-11 10:24:08 +00:00
kkrentz 3b246dfe73 OSCORE: Treat CoAP pings as requests 2023-11-07 16:18:07 +00:00
Jon Shallow 17e44c73df memory: Support debug tracking of memory usage
New function coap_dump_memory_type_counts().

Requires COAP_MEMORY_TYPE_TRACK to be defined as 1.
2023-10-24 12:43:13 +01:00
Jon Shallow 203d228638 RIOT: library fixes for different build types
coap_debug.h: Support logging level set to _COAP_LOG_EMERG
coap_pdu.h: handle small ints
coap_pdu_internal.h: handle small ints
coap_session_internal.h: handle small ints
coap_uthash_internal.h: handle small ints
coap_block.c: Handle small ints
coap_debug.c: Fix use of vsnprintf() and vfprintf()
coap_pdu.c: Handle small ints
coap_tinydtls.c: Handle small ints
coap_uri.c: Fix alignment issue in coap_new_uri()

uncrustify run on RIOT examples to conform to RIOT's coding standards/
2023-10-23 14:38:57 +01:00
Jon Shallow 05d02be7a9 coap_net.c: Fix CSM timeouts in coap_client_delay_first()
Reduce timeout to 1 second and enter established state for servers that
only partially implement RFC8323 for TCP support, but do not send a CSM.

Add new coap_context_set_csm_timeout_ms() to control the value of the timeout.
2023-10-23 14:32:46 +01:00
kkrentz 6addbef1b1 Suppress RST when the processing of a non-empty ACK fails 2023-10-19 15:00:24 +01:00
Jon Shallow 26302a076b coap-server.c: Add in support for output to syslog 2023-10-19 11:26:41 +01:00
Jon Shallow 48753b155b Stateless: Add in some stateless support
Client able to send data for every FETCH command to get next Block2 response.

Server able to not keep state while sending Block2 responses back.
2023-10-19 10:33:17 +01:00
kkrentz 38a726de37 Contiki-NG: Remove call to clock_init as Contiki-NG already does it 2023-10-19 10:19:32 +01:00
Jon Shallow ccf17f5914 coap.h: Tidy up coap.h.* files to make them consistent 2023-10-13 14:17:34 +01:00
kkrentz d61713d35d Contiki-NG: Renamings to avoid confusion 2023-10-13 14:12:06 +01:00
kkrentz 44cf0940c9 Contiki-NG: Re-schedule prepare timer in same occasions as the epoll timer 2023-10-13 14:12:06 +01:00
Jon Shallow 69e1784561 Update version to release 4.3.4
Update ABI to 3.1.1
2023-10-04 22:04:05 +01:00
Jon Shallow 342a2d0893 coap.h.windows: Correct sort order of includes 2023-10-04 22:03:36 +01:00
Jon Shallow 8683a3177c coap_cleanup: Allow coap_startup() to be called after coap_cleanup() 2023-10-04 22:02:31 +01:00
Jon Shallow 9cde7cdee1 Update version to release 4.3.3 2023-09-14 09:55:47 +01:00
Jon Shallow f67f44516a Update version to release 4.3.2 2023-09-07 11:51:24 +01:00
Daniel Mangum a9808ade42 Define coap_mutex_t as sys_mutex on Zephyr
Changes definition of coap_mutex_t as k_mutex to sys_mutex to build
properly with Zephyr.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-09-04 10:35:57 +01:00
Jon Shallow f176bf3c53 release 4.3.2rc2: Release candidate for 4.3.2 2023-08-14 09:37:23 +01:00
Jon Shallow cd7b5de109 Mutexes: Clean up / simplify use of mutexes
Not all OS implementations properly support static initializations.
2023-07-29 11:31:22 +01:00
Jon Shallow 3f8bb33807 coap_resolve_address_info: Add in support for defining WebSocket ports 2023-07-26 13:01:42 +01:00
Jon Shallow 084c866c69 coap_startup: Make coap_startup() first function call in examples
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.
2023-07-25 13:50:18 +01:00
Jon Shallow cb78d5fd85 release 4.3.2rc1: Release candidate for 4.3.2 2023-07-22 09:29:32 +01:00
Jon Shallow 9763b3a25a Documentation: Fix typos 2023-07-22 09:27:00 +01:00
Jon Shallow 15473b037e layers: Update coap_layer_func_t function names to be prefixed with l_
Prevents issues with things such as '#define write lwip_write'.
2023-07-20 15:25:05 +01:00
Jon Shallow 4f164dcb2f coap_mutex_internal.h: Support LwIP ! NO_SYS mutexes 2023-07-20 15:02:25 +01:00
Jon Shallow d17f47ab54 coap_address_t: Update functions documentation and add coap_is_af_unix() 2023-07-17 09:43:35 +01:00
Jon Shallow e2910a5bf1 naming: Rename remaining *.[ch] files that are not prefixed with coap_
include/coap3/block.h -> include/coap3/coap_block.h
include/coap3/pdu.h -> include/coap3/coap_pdu.h
include/coap3/resource.h -> include/coap3/coap_resource.h
src/block.c -> src/coap_block.c
src/net.c -> src/coap_net.c
src/pdu.c -> src/coap_pdu.c
src/resource.c -> src/coap_resource.c
2023-07-13 08:59:22 +01:00
Jon Shallow 8f068c0bbf pre-commit: Include re-styled include files to checks 2023-07-11 20:17:10 +01:00
Jon Shallow 57013f3377 RFC9177: Add in Q-Block support
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).
2023-07-11 11:04:04 +01:00
Jon Shallow 52dcc5201b Reliable PDUs: coap_show_pdu(): Do not show all the non-reliable headers 2023-07-05 10:53:00 +01:00
Jon Shallow ca1e4098b0 pre-commit: Include re-styled OSCORE files to checks 2023-07-05 10:50:25 +01:00
Jon Shallow 64450b6ec8 coap_mbedtls.c: Add in Connection ID support (RFC9146)
Requires MbedTLS 3.2.0 or later and MBEDTLS_SSL_DTLS_CONNECTION_ID defined
(which is the default in later versions of MbedTLS).
2023-07-03 08:54:56 +01:00
Jon Shallow a9b179ab32 Coding: Remove blank lines at ends of files 2023-06-29 09:34:52 +01:00
Jon Shallow 31f692b8b2 man: Document WebSockets support 2023-06-28 21:16:11 +01:00
Jon Shallow 295afa9f95 man: Document deprecated functions
New: man/coap_deprecated.txt.in
2023-06-28 09:53:22 +01:00
Jon Shallow 5c1e7cae34 Async: Invert WITHOUT_ASYNC define to COAP_ASYNC_SUPPORTED for clarity
Prevents possibility of name clashes when integrating with other code / OS.
2023-06-15 11:01:22 +01:00
Jon Shallow b442140bb3 Oscore: Change HAVE_OSCORE define to COAP_OSCORE_SUPPORT for clarity
Prevents possibility of name clashes when integrating with other code.
2023-06-14 12:55:25 +01:00
Jon Shallow 1d81256fc1 ipv[46]: Add in configurable support for IPv4, IPv6 and AF_UNIX
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.
2023-06-12 14:55:09 +01:00
Jon Shallow b3ec5b83c3 Windows: Fix resolve issues / remove warnings
Handle Windows x68 size_t being only 32 bits.
2023-06-09 12:07:10 +01:00