Commit Graph
2287 Commits
Author SHA1 Message Date
Olaf Bergmann ca44071b8a net.h: do not include sys/select.h in Windows builds
Windows apparently has no select.h header, therefore it is not
included for Windows builds.
2021-09-01 09:50:45 +02:00
Olaf Bergmann e984f38b8f [DTLS] make buffer sizes for psk and psk_identity configurable
The pre-processor values COAP_DTLS_MAX_PSK and
COAP_DTLS_MAX_PSK_IDENTITY now can be set at build time. Both values
default to 64. Static buffer sizes in the TLS library wrappers are
adjusted accordingly.
2021-09-01 09:35:38 +02:00
Olaf Bergmann 54dbc3eeb8 [RIOT] coap_time.h: fix COAP_TICKS_PER_SECOND for undefined XTIMER_HZ
With ztimer usage, XTIMER_HZ is not defined anymore in xtimer.h. As a
workaround, XTIMER_HZ_BASE is used.
2021-09-01 09:34:47 +02:00
Olaf Bergmann 05e7f12d7c net.h: Include sys/select.h for fd_set 2021-09-01 09:34:47 +02:00
obgm 0585fb4398 Merge pull request #731 from mrdeep1/cmake_mac
CMakeLists.txt: Fix macOS builds by checking for if_nametoindex support
2021-08-02 12:22:32 +02:00
obgm 65e380ab83 Merge pull request #733 from mrdeep1/event_enum
coap_event.h: Make coap_event_t an enum
2021-08-02 12:07:55 +02:00
obgm 12eb676fff Merge pull request #736 from mrdeep1/tiny_fix
tiny.c: Fix message id generation
2021-08-02 12:04:20 +02:00
Jon Shallow a1d78d505d tiny.c: Fix message id generation 2021-08-02 10:09:21 +01:00
Jon Shallow 67f189f134 CMakeLists.txt: Fix macOS builds by checking for if_nametoindex support
Set -D__APPLE_USE_RFC_3542=1 if APPLE

Do not install uthash.h.
2021-08-02 09:21:03 +01:00
Jon Shallow 8ce139d349 coap_event.h: Make coap_event_t an enum
examples/coap-client.c:
examples/coap-server.c:

Explicitly define each enum case to remove complier warnings.
2021-07-31 17:08:10 +01:00
obgm a0754473f9 Merge pull request #729 from mrdeep1/observe_fix
resource.c: Delete previous subscription correctly
2021-07-30 17:56:23 +02:00
obgm 320a1e6e0c Merge pull request #727 from mrdeep1/async_mid
async: Correct MID usage in response
2021-07-30 17:27:49 +02:00
Jon Shallow b0ca3ae643 resource.c: Delete previous subscription correctly
Fix the coap_find_observer_cache_key() function comparison to correctly match
previously set up subscription.

Handle NULL return from coap_cache_derive_key_w_ignore().

Update diagnostic logging.

Start the reported Observe value from 2, to remove confusion with the
usage of values of 1 and 0.
2021-07-29 19:36:47 +01:00
Jon Shallow 98b9179d56 async: Correct MID usage in response
There currently are 2 requirements for async (delayed response)

1. Application support to delay separate response while doing other processing
2. Delay any response for random time if receiving multicast request

The MID is used by the client to match initial response (empty ack or
piggy-backed response).  Any subsequent response (usually the separate
response or unsolicited Observe) should have a different MID as generated by
the server (and are matched using the token).

Fix is to move the tracking of the client MID from coap_register_async()
(so 1. is supported correctly) into handle_request() for multicast requests
(so that 2. continues to be supported correctly).

coap_check_async() will then call the appropriate request handler with the
appropriate MID (application different, multicast same).
2021-07-21 15:15:13 +01:00
obgm a80d462ff5 Merge pull request #722 from mrdeep1/lg_xmit_release
RFC7959: session->lg_xmit not being released for a server
2021-07-07 17:22:08 +02:00
Jon Shallow c61748f4dd RFC7959: session->lg_xmit not being released for a server
Following transmission of a large body by a server using BLOCK2,
session->lg_xmit is not getting released. It does get released when the session
is freed off.

A client doing transmission of a large body idoes release session->lg_xmit.

Timeout lg_xmit after 4 * ACK_TIMEOUT seconds after final block is transmitted.
2021-07-07 15:27:06 +01:00
obgm 545fbc6b31 Merge pull request #721 from Delsian/develop
gnutls:  GNUTLS_CRT_RAW not defined
2021-07-07 15:08:10 +02:00
Eug Krashtan 482be755fe gnutls: GNUTLS_CRT_RAW not defined
Old version of GnuTLS, used in Raspbian,  contains no definition
for GNUTLS_CRT_RAW. This patch fixes build error:
`error: ‘GNUTLS_CRT_RAW’ undeclared`

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2021-07-07 15:59:54 +03:00
obgm 208a2e8b9a Merge pull request #719 from mrdeep1/man_1
man: Update man page documentation
2021-07-06 12:30:28 +02:00
Jon Shallow e0d6477b5e man: Update man page documentation
man/coap.txt.in:

Include all the current man pages

man/coap_block.txt.in:

Clarification updates to handle questions being raised

man/coap_resource.txt.in:

Incoming PDU is now no longer NULL if triggered by Observe.
2021-07-06 11:13:47 +01:00
obgm f7c9b13dd6 Merge pull request #715 from mrdeep1/remove_slash
coap_resource_init: Leading '/' is not required for uri_path
2021-07-01 09:49:56 +02:00
Jon Shallow d52986f004 coap_resource_init: Leading '/' is not required for uri_path
Remind users in the documentation that the full path defining the resource in
the uri_path parameter does not normally need a leading '/'.

E.g. It should be "full/path/for/resource", not "/full/path/for/resource".
2021-06-30 14:05:22 +01:00
obgm 97a2c0f186 Merge pull request #716 from mrdeep1/remove_bad_code
pdu.h: Remove unassigned response code COAP_RESPONSE_CODE_OK
2021-06-30 14:21:11 +02:00
Jon Shallow 60c69557f3 pdu.h: Remove unassigned response code COAP_RESPONSE_CODE_OK 2021-06-30 12:11:54 +01:00
obgm 9b6451c365 Merge pull request #713 from mrdeep1/esp_idf_psk
coap_mbedtls.c: Allow ESP-IDF systems to be compiled without PSK support
2021-06-28 15:30:18 +02:00
Jon Shallow 87fab6d573 coap_mbedtls.c: Allow ESP-IDF systems to be compiled without PSK support
Also fix a warning when DTLS is not enabled in ESP-IDF.
2021-06-28 09:52:37 +01:00
obgm 51f5d45333 Merge pull request #711 from technodromega/develop
Fix condition for MBEDTLS_INCLUDE_DIRS
2021-06-23 09:21:37 +02:00
Danijel Hodzic 77d1aae06b Fix condition for MBEDTLS_INCLUDE_DIRS 2021-06-22 19:57:23 +02:00
Olaf Bergmann 1da37b9abb Bump version to 4.3.0 v4.3.0 2021-06-21 10:39:42 +02:00
Olaf Bergmann 64505862d1 update release version to rc4 in configuration v4.3.0-rc4 2021-06-15 10:27:25 +02:00
Olaf Bergmann 80e304271d [tinydtls] update to latest version
libcoap now includes tinydtls commit 59055b8
2021-06-15 10:22:40 +02:00
obgm 7274ffecd0 Merge pull request #702 from mrdeep1/without_async
async: Fix building with './configure --disable-async'
2021-06-14 14:15:36 +02:00
Jon Shallow 9447930cde async: Fix building with './configure --disable-async'
Correct some parameters for the dummy coap_async_*() functions.

Update some documentation for clarity.
2021-06-14 13:04:35 +01:00
Olaf Bergmann 60421db0a5 Add SPDX-License-Identifier to source files
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
2021-06-08 18:14:03 +02:00
Olaf Bergmann 677b0c8330 coap.h.windows{,.in}: Remove bits.h 2021-06-08 15:53:23 +02:00
Olaf Bergmann 21d7063e78 Cleanup: Remove bits.h from win32 projects 2021-06-08 15:40:25 +02:00
Olaf Bergmann 2562f15b1a Cleanup: Remove bits.h from CMakelists.h 2021-06-08 15:40:00 +02:00
Olaf Bergmann db79086c67 Cleanup: Remove unused header file bits.h
The functions in bits.h have not been used anymore and can be removed.
2021-06-08 15:26:52 +02:00
Olaf Bergmann 44075adb52 uthash: Update URIs to uthash homepage
* Update uthash.h and utlist.h from upstream. These files now include
  the fixed URI to the uthash homepage.
* Update uthash URI in the LICENSE file.
2021-06-08 14:57:16 +02:00
obgm ab416bfb69 Merge pull request #695 from mrdeep1/dup_obj
examples: Fix RPM Package Manager complaining about duplicate objects
2021-06-08 10:11:26 +02:00
Jon Shallow 7cff27fb7a examples: Fix RPM Package Manager complaining about duplicate objects
For example (when building OpenSSL variant), coap-client and
coap-client-openssl are identically built and debug information is being
abstracted, it complains that the two binaries are identical.

Make coap-server, coap-client and coap-rd non-installable, (they still need
to be built in the examples directory, so cannot use check_PROGRAMS) and then
soft-link them as appropriate in the target $(bindir).
2021-06-08 09:00:33 +01:00
obgm ccefb06c03 Merge pull request #697 from mrdeep1/issue_tidy
config.yml: Tidy up / Clarify documentation
2021-06-08 09:33:31 +02:00
Jon Shallow 9357720646 config.yml: Tidy up / Clarify documentation 2021-06-04 12:02:57 +01:00
obgm 570ff6bc68 Merge pull request #696 from mrdeep1/issue_templates
Issue Reporting: Add in Issue Templates to get better Issue information
2021-06-04 12:07:24 +02:00
Jon Shallow 25f4f24477 Issue Reporting: Add in Issue Templates to get better Issue information 2021-06-04 10:02:11 +01:00
obgm b7f7e61b83 Merge pull request #693 from mrdeep1/trailing_blanks
test_pdu.c: Remove unwanted trailing blank
2021-06-03 18:03:53 +02:00
Jon Shallow 3730437b05 test_pdu.c: Remove unwanted trailing blank 2021-06-03 12:42:09 +01:00
obgm 25fe796cab Merge pull request #692 from mrdeep1/blocked_response
man pages: Update to use the coap_block(3) functions
2021-06-03 11:05:40 +02:00
obgm 027907a658 Merge pull request #691 from mrdeep1/raising_issues
man pages: Indicate where to raise issues
2021-06-03 11:03:33 +02:00
obgm 7bfbba9895 Merge pull request #688 from mrdeep1/coap_send
coap_send(): Consolidate coap_send() and coap_send_large() for applications
2021-06-03 11:02:58 +02:00