Commit Graph
2144 Commits
Author SHA1 Message Date
Olaf Bergmann acb4f91633 test_pdu.c: fix type warnings
Commit e4e067e5f has introduced a new type for PDU request and status
codes, coap_pdu_code_t. This change now uses proper enums values to
fix compiler warnings (-Wenum-conversion).
2021-04-20 15:55:59 +02:00
obgm 04c641f7f0 Merge pull request #639 from mrdeep1/obf_pdu_t
coap_pdu_t: Obfuscate coap_pdu_t for applications
2021-04-20 15:22:08 +02:00
obgm 0dea676758 Merge pull request #648 from mrdeep1/doc_main
Doxygen: Add in RFCs and TLS libraries supported to main page.
2021-04-20 15:03:50 +02:00
obgm 6ff6180add Merge pull request #634 from mrdeep1/build_install_test
build: Add in installation check
2021-04-20 15:01:54 +02:00
obgm a2fd15b807 Merge pull request #643 from mrdeep1/doxygen_checks
Doxygen: Catch generated warnings as errors
2021-04-20 14:19:42 +02:00
Olaf Bergmann 9e3ba503ec coap_dtls.h: Fix doxygen warning
This change removes a doxygen comment starter because doxygen is
getting confused otherwise because of the immediately preceding
documentation group start.
2021-04-20 14:15:51 +02:00
Jon Shallow e4e067e5fb coap_pdu_t: Obfuscate coap_pdu_t for applications
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.
2021-04-20 10:31:14 +01:00
Olaf Bergmann fd5ecf5697 Add in configuration option for async (separate responses)
The new configuration option --disable-async now allows to switch
of support for asynchronous operations.

The new function coap_async_is_supported() can be used to check
if the library was built with async support.
2021-04-20 10:36:48 +02:00
obgm b9989ef485 Merge pull request #645 from mrdeep1/mcast_delay
Multicast: Add in response delay
2021-04-20 10:31:57 +02:00
obgm 8aedff47c6 Merge pull request #635 from mrdeep1/obf_packet_socket_t
internal structs: Obfuscate coap_packet_t and coap_socket_t for applications
2021-04-20 09:02:29 +02:00
obgm ea1deffa6b Merge pull request #647 from mrdeep1/travis_fix
[CI]: Fix travis builds
2021-04-20 08:35:32 +02:00
Jon Shallow e008d905fd Multicast: Add in response delay
See https://tools.ietf.org/html/rfc7252#section-8.2

Also updated coap_find_async() to search on token instead of mid as
mid is not used in reliable transports.
2021-04-19 11:09:19 +01:00
Jon Shallow 88a15a53b5 Doxygen: Add in RFCs and TLS libraries supported to main page. 2021-04-19 09:41:57 +01:00
Jon Shallow 57eb1147b3 [CI]: Fix travis builds
Use 'docker run --privileged"
2021-04-17 19:36:03 +01:00
Jon Shallow 028b3062f6 internal structs: Obfuscate coap_packet_t and coap_socket_t for applications
Move coap_socket_t and coap_packet_t to coap_io_internal.h.

Move internal io based function definitions to coap_io_internal.h.

Replace most references to "struct coap_socket_t" with "coap_socket_t" and
references to "struct coap_packet_t" with "coap_packet_t".
2021-04-16 22:08:10 +01:00
Jon Shallow 56f5aeb2ff Doxygen: Catch generated warnings as errors
Fix coap_net_internal.h issue.
2021-04-16 19:24:49 +01:00
obgm d9ff2f0ff7 Merge pull request #630 from mrdeep1/obf_async_t
coap_async_state_t: Obfuscate coap_async_state_t for applications
2021-04-16 20:13:23 +02:00
Olaf Bergmann 1b15bf244f coap_net_internal.h: add missing doxygen group end marker 2021-04-16 18:27:55 +02:00
obgm d489232ecc Merge pull request #640 from mrdeep1/man_cleanup
man: Extra checks on function definitions
2021-04-16 17:09:30 +02:00
Jon Shallow db2b7de91b Update 2021-04-16 16:09:17 +01:00
Jon Shallow 3809d0d3b1 man: Extra checks on function definitions
Correct man pages as appropriate to line up with the header files.
If there were no EXAMPLES, previously this was not caught.
2021-04-16 14:40:44 +01:00
Jon Shallow dc1ca3c001 coap_async_state_t: Obfuscate coap_async_state_t for applications
Move coap_async_state_t to coap_async_internal.h and rename to coap_async_t
as it no longer has any state.

Refactor the async logic to simplify usage and provide libcoap based delay
functionality support for request/response traffic such as multicast.  Let
libcoap decide when the delayed response is to be sent.

Move internal async based function definitions to coap_async_internal.h.

Replace most references to "struct coap_async_state_t" with
"coap_async_t".

Provide new functions to allow applications to access parts of
coap_async_t as appropriate.

Update examples to use these new access functions where appropriate.

Add in new man page.
2021-04-16 14:29:52 +01:00
obgm ea5800d0a9 Merge pull request #628 from mrdeep1/obf_context_t
coap_context_t: Obfuscate coap_context_t for applications
2021-04-16 14:24:36 +02:00
Jon Shallow f8d9af4b93 coap_context_t: Obfuscate coap_context_t for applications
Move coap_context_t and coap_queue_t to coap_net_internal.h.

Move internal context and queue based function definitions to
coap_net_internal.h.

Replace most references to "struct coap_context_t" with "coap_context_t".

Provide new functions to allow applications to access parts of coap_context_t
as appropriate and document these functions.

Update examples to use these new access functions where appropriate.

For the man documentation, move the server session setup functions to (new)
coap_endpoint_server(3) and update coap_context(3) with all the context access
functions as these are common to both the client and server.
2021-04-15 17:27:02 +01:00
Olaf Bergmann 6d8aaa9b90 scripts/api-version-bump.sh: fix missing file
Fix API version in files generated from man/examples-code-check.c.

Call autoreconf after updating configure.ac to ensure configure is
re-run the next time make is executed.
2021-04-15 12:04:56 +02:00
obgm c2e7b42e30 Merge pull request #637 from mrdeep1/siocgifindex
siocgifindex: use if_nametoindex() if available
2021-04-15 10:41:47 +02:00
Olaf Bergmann 8efab74066 scripts/api-version-bump.sh: require explicit version parameter
To avoid accidentally changing the API version, the script now aborts
if no new version other than the current API version has been
specified.
2021-04-14 13:06:15 +02:00
Jon Shallow 6d414205c1 siocgifindex: use if_nametoindex() if available
Fixes MacOS builds
2021-04-13 17:10:25 +01:00
Jon Shallow 4ac724334f build: Add in installation check 2021-04-09 18:55:01 +01:00
obgm d9ecb04a99 Merge pull request #627 from mrdeep1/obf_session_t
coap_session_t: Obfuscate coap_session_t for applications
2021-04-09 15:05:00 +02:00
Jon Shallow 0c3928f536 coap_session_t: Obfuscate coap_session_t for applications
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.]
2021-04-09 13:13:46 +01:00
obgm 3b8a77d744 Merge pull request #633 from mrdeep1/libraries
libraries: Rename libcoap-x to libcoap-x-notls and make libcoap-x default linker
2021-04-08 18:24:16 +02:00
Jon Shallow 9612b50c5f libraries: Rename libcoap-x to libcoap-x-notls and make libcoap-x default linker
Make the old installed libcoap-2.{so,la,a,pc} libcoap-2-notls.{so,la,a,pc}, and
make the installed libcoap-2.{so,la,a,pc} be a set of soft links to installed
libcoap-2.{tlstype}.{so,la,a,pc}.

Thus installed libcoap-2.{so,la,a,pc} will be based on the latest (D)TLS
library build.

Update the linking documentation.
2021-04-08 16:40:17 +01:00
Olaf Bergmann 145d86f96d scripts/api-version-bump.sh: Adjust hard-coded API version
This script is called from the package's top directory to adjust
all places where the current API version is hard-coded. The
current version is detected from the LIBCOAP_API_VERSION in
configure.ac. The target version is LIBCOAP_API_VERSION + 1 if no
parameter is provided on the command line. Otherwise, the given
value is used as target version.

Note that calling this script also results in 'git mv' operations.
git commit must be called manually after running this script.
2021-04-08 14:32:52 +02:00
Olaf Bergmann 60dd7aa32a [LWIP] Makefile: Fix include path for lwippools.h
Create path for pre-processor includes from LIBCOAP_API_VERSION in
configure.ac. This avoids breaking the example after API version
change.
2021-04-08 14:32:20 +02:00
obgm 4426fa2a69 Merge pull request #624 from mrdeep1/versioning
versioning: Include api version in non-posix coap_config.h/coap.h .in…
2021-04-08 14:29:14 +02:00
obgm 707822005e Merge pull request #622 from mrdeep1/esp_idf_1
esp-idf: Fix for esp-idf builds
2021-04-08 10:39:30 +02:00
obgm 3b9ec3b691 Merge pull request #625 from mrdeep1/duplicate_ack
net.c: Handle duplicate empty ACK
2021-04-07 17:13:56 +02:00
obgm 98ccc9f35a Merge pull request #631 from mrdeep1/invalid_tid
COAP_INVALID_TID: Inform this is deprecated and to use COAP_INVALID_MID
2021-04-07 17:09:47 +02:00
obgm e4b92da827 Merge pull request #629 from mrdeep1/lib_ver
Examples: Output runtime libcoap version in usage()
2021-04-07 17:04:58 +02:00
Jon Shallow 91737ccb46 versioning: Include api version in non-posix coap_config.h/coap.h .in files
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.
2021-04-07 13:01:42 +01:00
obgm e20ae3c298 Merge pull request #623 from mrdeep1/nits
nits: Fix runtime warnings
2021-04-07 13:11:01 +02:00
Jon Shallow 640ede340e COAP_INVALID_TID: Inform this is deprecated and to use COAP_INVALID_MID
Doxygen comment only, but allow COAP_INVALID_TID to still be used.
2021-04-07 11:48:03 +01:00
Jon Shallow e7bcd53375 esp-idf: Fix for esp-idf builds
src/coap_mbedtls.c:

Add in fix for memory leak found by esp-idf.

src/coap_io.c:
src/net.c:

Update multicast setup logic to support esp-idf.
2021-04-07 11:40:06 +01:00
Jon Shallow db075ce659 Examples: Output runtime libcoap version in usage()
Helps to diagnose issues.
2021-04-06 14:07:09 +01:00
Jon Shallow bdeeae9c04 net.c: Handle duplicate empty ACK
An empty response ACK is ignored if there was a request on the Send-Q.

However if there was a subsequent duplicate ACK this would then fall through
to the general handling logic in coap_dispatch(), and would trigger the ping
handler (if set) and send a RST (if not mcast) which is not correct.

Correct a change added in by #554 so that all empty response ACKs are ignored.
2021-03-31 12:56:03 +01:00
Jon Shallow 7b9f7db224 nits: Fix runtime warnings
src/coap_debug.c:

Increase available buffer space.

src/coap_gnutls.c

Do not access NULL pointer offset.
2021-03-27 12:41:07 +00:00
Olaf Bergmann 4cab59dbbf configure.ac: bounce version number to v4.3.0rc1
Set library version to

LT_LIBCOAP_CURRENT=3
LT_LIBCOAP_REVISION=0
LT_LIBCOAP_AGE=0
v4.3.0-rc1
2021-03-18 15:05:02 +01:00
obgm f8048b4ad2 Merge pull request #621 from mrdeep1/win32
win32/libcoap.sln: Fix Debug DLL build issue
2021-03-18 14:38:00 +01:00
Jon Shallow b32ef3f31b win32/libcoap.sln: Fix Debug DLL build issue
Fix Debug DLL issue and re-order NoTLS entries as updated by VS
configuration manager.
2021-03-18 13:16:25 +00:00