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.
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.
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
Move coap_pdu_t to coap_pdu_internal.h.
Move internal PDU based function definitions to coap_pdu_internal.h.
Replace most references to "struct coap_pdu_t" with "coap_pdu_t".
Create new enum coap_pdu_type_t, enum coap_pdu_code_t and coap_option_num_t,
using them where appropriate for clarity of documentation.
Provide new functions to allow applications to access/update parts of
coap_pdu_t as appropriate and document as appropriate.
Update examples to use these new access functions where appropriate.
Move coap_session_t and coap_addr_hash_t to coap_session_internal.h.
Move internal session based function definitions to coap_session_internal.h.
Replace most references to "struct coap_session_t" with "coap_session_t".
Provide new functions to allow applications to access parts of coap_session_t
as appropriate and document these functions.
Update examples to use these new access functions where appropriate.
For the man documentation, move the client session setup functions to (new)
coap_endpoint_client(3) and update coap_session(3) with all the session access
functions as these are common to both the client and server.
[coap_endpoint_server(3) will be created when coap_context_t is obfuscated.]
CoAP transaction id was formerly defined as a hash of the remote address and
message id of the CoAP PDU. It now only refers to, and is used as, the
message id.
Replace occurences of 'transaction id' with 'message id' to reflect naming in
RFC7252.
Correct the definition of coap_tid_t to what it actually represents.
Replace occurrences of coap_tid_t with coap_mid_t.
Replace uses of tid with mid
Remove unused function coap_find_transaction().
Remove the UNUSED and UNUSED_PARAM definitions and use a single definition
of COAP_UNUSED as defined in libcoap.h
Replace all UNUSED / UNUSED_PARAM usages with COAP_UNUSED.
.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
.github/workflows/main.yml:
Do a 'make check' for matrix builds.
Move documentation into separate job to reduce matrix build times
Add in CMake job.
Add in distribution job.
Add in tinydtls job.
Add in contiki/lwip job.
scripts/github_dist.sh:
Do the distribution checks using a script.
examples/etsi_iot_01.c:
examples/tiny.c:
Fix include coap.h directory in old examples.
README.md:
Update status badges to get only the branch actions and remove CMake
status badge.
examples/client.c:
examples/coap-rd.c:
examples/coap-server.c:
examples/etsi_iot_01.c:
examples/tiny.c:
Make the applications ignore SIGPIPE.
examples/coap-rd.c:
Support clean exit for SIGTERM / SIGQUIT for valgrind testing.
Update all the coap_ calls to use the new API, and the updated structures.
Introduce using session instead of context.
Correct all the compiler warnings.
Make coap_pdu-t independent of the header style.
Use C99 sized types when applicable.
Use transaction ids in host byte order in the library.
Make coap_pdu_t payload storage grow on demand.
Add parsing and encoding of PDUs with UDP or TCP style headers.
Adapt examples and unit tests to the new PDU format.
From jsucaet's error description (Credits to Marc Haesen for revealing this bug):
The intent of the current code of coap_send is to release the allocated
memory upon success and not to release when an error has occured. However
this is broken (returning from coap_send with an error and a deallocated
pdu ptr is possible).
In the patch, I propose to let the calling function (of coap_send) be
responsible for free'ing the allocated pointer.