1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

115 Commits

Author SHA1 Message Date
Francisco Molina
c67a2086de sys/net/application_layer/gcoap: use COAP_PORT 2022-04-14 09:24:35 +02:00
Cenk Gündoğan
9746c3a830
nanocoap: add COAP_IGNORE for when method parsing is not important 2022-03-11 14:53:17 +01:00
Cenk Gündoğan
fa19b62cdb
gcoap/forward_proxy: add submodule 2022-03-11 14:53:17 +01:00
Martine Lenders
287bfdc10d
gcoap: multi-transport support for listeners 2022-03-01 19:33:15 +01:00
Martine Lenders
90eae8e0a4
gcoap: multi-transport support for clients
23a8659bdf introduced DTLS support for
CoAP, but did not make it possible to select the transport on request.
Since switching between CoAP and CoAPS (CoAP-over-DTLS) as client is a
valid use case (one might want to e.g. talk to one server over CoAP and
to another over CoAPS), this change makes that possible.
2022-03-01 19:26:10 +01:00
Benjamin Valentin
7dc2f730d2 nanocoap: check if all critical options were handled 2022-02-24 12:20:05 +01:00
Benjamin Valentin
d680743fe9 net/coap: specify timeout in milliseconds
This allows for more flexibility when choosing timeouts.
2022-01-27 14:42:49 +01:00
Karl Fessel
6347dcdffc
Merge pull request #17141 from kfessel/p-ztimer-gcoap
net/gcoap: port to ztimer
2021-12-09 15:22:10 +01:00
Benjamin Valentin
1db8ab4f72 sys/net/gcoap: add ; after DEBUG() 2021-12-08 20:41:21 +01:00
Karl Fessel
9195a4f02b net/gcoap: most ZITMER_USEC to ZTIMER_MSEC 2021-12-06 13:31:18 +01:00
Karl Fessel
f56eb9bb83 net/gcoap: port to ztimer_usec 2021-12-06 13:31:18 +01:00
Karl Fessel
2dd0cec4e9 net/gcoap: clean xtimer include from header 2021-12-06 13:31:18 +01:00
chrysn
a92cdb535e
Merge pull request #16378 from chrysn-pull-requests/gcoap-handle-truncation
sys/net/gcoap: Use socket _buf API to recognize truncated requests
2021-10-27 08:55:52 +02:00
Martine Lenders
e74b54d3ae
gcoap_dtls: destroy session in _tl_send only on connection errors 2021-10-08 12:24:57 +02:00
chrysn
2e70f29d4f sys/net/gcoap: Use socket _buf API to recognize truncated requests
Closes: https://github.com/RIOT-OS/RIOT/issues/14167
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2021-09-02 16:49:46 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Martine Lenders
5d59065b09
gcoap: provide buffer version of gcoap_req_init()
This simplifies the usage of `gcoap` with modules such as `uri_parser`
greatly.
2021-08-05 13:31:07 +02:00
Martine Lenders
4b7ef70e66
gcoap: fix socket type naming
The `coap_socket_t` and `coap_socket_type_t` types are used by gCoAP
only and the `coap_` prefix is usually used to namespace the `nanocoap`
module's API. This makes it confusing to locate the types in question.

Signed-off-by: Martine Lenders <m.lenders@fu-berlin.de>
2021-07-27 22:37:04 +02:00
János Brodbeck
23a8659bdf
net/gcoap: support DTLS 2021-07-07 14:45:30 +02:00
János Brodbeck
2e523bf101
net/gcoap: change return type from gcoap_req_send() to ssize_t 2021-06-04 17:15:04 +02:00
Jose Alamos
0bee606bd4
gcoap: remove gcoap_add_qstring
This feature was marked to be deprecated after the release 2020.10.
Therefore this commit removes that feature.
2021-01-14 16:03:00 +01:00
János Brodbeck
16c5fd6fbd
net/gcoap: relabel _sock to _sock_udp 2020-11-05 17:19:42 +01:00
János Brodbeck
c4e646037d
net/gcoap: split out the coap processing part of _on_sock_evt 2020-11-05 17:19:41 +01:00
Cenk Gündoğan
7d820f7ada
nanocoap: gcoap: use const parameter for coap_method2flag 2020-10-28 15:40:35 +01:00
Cenk Gündoğan
d4370e690e
gcoap: add a handler for request matching 2020-10-28 15:40:35 +01:00
chrysn
c0bc0c41b1 net/goap: State and check that listeners are added individually
Add a an assertion on the added listener not having a trailing chain
instead of silently overwriting it, point out the precondition in the
documentation, and guide users who want to add more than one listener
towards a more efficient way.
2020-10-23 22:33:43 +02:00
benpicco
b5cd19e73e
Merge pull request #14178 from chrysn-pull-requests/gcoap-handle-con-response
gcoap: Process CON responses
2020-10-23 14:21:33 +02:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
chrysn
462f8861f4 gcoap: Suppress retransmissions when ACK was received
This introduces an additional state to the COAP_MEMO_* series to avoid
enlarging the memo struct needlessly. While they are documented
publicly, practically only the COAP_MEMO_TIMEOUT and COAP_MEMO_RESPONSE
are used in communication with the application, as a
gcoap_request_memo_t is only handed out in that state.
2020-10-22 19:08:39 +02:00
chrysn
f32d758819 gcoap: Prepare to cease retransmission
The actual implementation will follow in a separate commit, this does
the groundwork and sets the intention.
2020-10-22 19:08:39 +02:00
chrysn
0a2f97680f gcoap: Cleanup around empty responses
Simplify the code path and give consistent debug messages.
2020-10-22 19:08:39 +02:00
chrysn
ff00d66d69 gcoap: Process CON responses
This generalizes the existing code for answering CoAP pings into general
message-layer responses. Such responses are now also sent as a reaction
to CON responses, which can otherwise follow the same code path as
existing other responses.

As a side effect, issues that would crop up when responding to odd empty
requests that have token length set are resolved.

Contributes-To: https://github.com/RIOT-OS/RIOT/issues/14169
2020-10-22 19:08:39 +02:00
chrysn
6350d22bc9 net/gcoap: Register additional resources head-first
This simplifies (written and compiled) code by doing a head rather than
a tail insertion of the new listener into gcoap's list.

As handling of listeners without a link_encoder is now fixed,
gcoap_get_resource_list can handles this now without having to manually
skip over the .well-known/core handler (which is not the first entry any
more now).

Incidentally, this allows the user to install a custom handler for
.well-known/core, as the default handler is now evaluated last.
2020-10-02 21:04:25 +02:00
chrysn
e3db58f013 net/gcoap: Avoid endless loop on error
The NULL case can not regularly be reached (because regularly
gcoap_register_listener sets thel link_encoder to a default one), but if
it is (eg. because an application unsets its link_encoder to hide a
resource set at runtime), the existing `continue` is a good idea (skip
over this entry) but erroneously created an endless loop by skipping the
advancement step.
2020-10-02 20:53:05 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:

   KCONFIG_MODULE_ => KCONFIG_USEMODULE_
   KCONFIG_PKG_ => KCONFIG_USEPKG_
   MODULE_ => USEMODULE_
   PKG_ => USEPKG_
2020-08-31 09:37:09 +02:00
Leandro Lanzieri
3920dd8c20
net/gcoap: Remove gcoap_finish 2020-07-17 16:33:19 +02:00
Leandro Lanzieri
9e427e1584
net/coap: Move COAP_MAX_RETRANSMIT to 'CONFIG' namespace
COAP_MAX_RETRANSMIT is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:43 +02:00
Leandro Lanzieri
afe4244ac9
net/coap: Move COAP_RANDOM_FACTOR_1000 to 'CONFIG' namespace
COAP_RANDOM_FACTOR_1000 is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:43 +02:00
Leandro Lanzieri
072a0d8563
net/coap: Move COAP_ACK_TIMEOUT to 'CONFIG' namespace
COAP_ACK_TIMEOUT is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:40 +02:00
Ken Bannister
6eae4ded84 net/gcoap: create CoAP ping request 2020-04-17 08:15:20 -04:00
Ken Bannister
f5a85e2aff net/gcoap: handle CoAP ping request 2020-04-17 08:15:20 -04:00
Leandro Lanzieri
b6be8af81c
net/nanocoap: Move NANOCOAP_QS_MAX to 'CONFIG_' namespace 2020-04-07 17:00:53 +02:00
Leandro Lanzieri
4052c01e85
net/nanocoap: Move NANOCOAP_URI_MAX to 'CONFIG_' namespace 2020-04-07 17:00:53 +02:00
Benjamin Valentin
c8b2483de5 net/gcoap: make use of coap_opt_add_path() 2020-04-04 17:06:04 +02:00
Martine S. Lenders
411e320b0c
sock_async_event: update for async callback argument support 2020-03-11 16:54:12 +01:00
Martine S. Lenders
6e6e435c65
sock_async: add optional callback argument 2020-03-11 16:54:11 +01:00
Ken Bannister
e98a6e5932 net/gcoap: update copyright date 2020-02-24 06:22:04 -05:00
Ken Bannister
c8cd3f0229 net/gcoap: fix vera++ code style warnings 2020-02-24 06:20:43 -05:00
Ken Bannister
9b63abb718 net/gcoap: cast required for pic32 platform
Fixes bug found during rework for sock_async implementation.
2020-02-22 05:46:07 -05:00
Ken Bannister
0dc1e4c4e7 net/gcoap: fix when no timeout event
Fixes bug found during rework for sock_async implementation.
2020-02-22 05:46:07 -05:00