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
Bas Stottelaar
80d9da90df
sys/*: add missing include of assert.h
2020-10-22 11:13:09 +02:00
Bas Stottelaar
47d376c5c3
sys/*: add explicit include of timex.h
2020-10-21 21:47:31 +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
Benjamin Valentin
f163f1580b
sys/net/uhcp: use LOG_ functions
...
Using `gnrc_border_router` with `uhcp` is quite noisy.
uhcpc will regularly refresh the prefix and print a bunch of status messages.
Allow the user to tone it down by setting a higher `LOG_LEVEL`.
For this, convert calls to `printf()` and `puts()` to `LOG_xxx()`.
This requires a dummy header for `uhcpd`.
2020-09-29 09:55:28 +02:00
Hauke Petersen
3b424858de
net/emcute: fix buffer overflow in _willupd_msg()
2020-09-22 11:43:00 +02:00
Akshai M
bb8d3cd72b
sys/net/cord : Expose to Kconfig
...
Expose configurations to Kconfig
Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2020-09-02 23:36:48 +05:30
Akshai M
536a99022c
sys/net/cord : Move 'CONFIG_CORD_EP' to 'CONFIG_'
2020-09-02 23:36:48 +05:30
Akshai M
e09063e7f1
sys/net/cord : Move 'CORD_UPDATE_INTERVAL' to 'CONFIG_'
2020-09-02 23:36:48 +05:30
Akshai M
de2d33f65b
sys/net/cord : Move 'CORD_LT' to 'CONFIG_'
2020-09-02 23:36:48 +05:30
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
Marian Buschsieweke
3b6fa61829
sys: Cleanup access to internal variables
...
Replace direct accesses to sched_active_thread and sched_active_pid with
the helper functions thread_getpid() and thread_get_active(). This serves
two purposes:
1. It makes accidental writes to those variable from outside core less likely.
2. Casting off the volatile qualifier is now well contained to those two
functions
2020-08-24 20:28:11 +02:00
Benjamin Valentin
d4aa8aad10
nanocoap: validate input with NDEBUG
...
A malformed or malicious CoAP request may contain invalid field lengths.
`nanocoap` protects with this by using `assert()`, which safely crashes
the application in debug mode.
In release mode the check is removed.
Instead of allowing arbitrary memory writes, return 0 on invalid inputs.
Discovered by [Coverity](https://scan3.coverity.com/reports.htm#v46910/p10250/fileInstanceId=38357789&defectInstanceId=9793779&mergedDefectId=297306 )
2020-08-11 15:54:23 +02:00
Akshai M
0413a5881f
net/dhcpv6 : Expose to Kconfig
...
Expose configurations to Kconfig. Add conditional CFLAGS to avoid
conflicts with Kconfig.
2020-07-24 00:23:08 +05:30
Akshai M
1c37e11c0e
net/dhcpv6 : Move 'DHCPV6_CLIENT_PFX_LEASE_MAX' to 'CONFIG_'
2020-07-23 21:10:26 +05:30
Leandro Lanzieri
3920dd8c20
net/gcoap: Remove gcoap_finish
2020-07-17 16:33:19 +02:00
Leandro Lanzieri
60f7e3aadf
net/cord/lc: Replace usage of deprecated gcoap_finish
2020-07-17 10:01:55 +02:00
Leandro Lanzieri
f92c693682
net/cord/epsim: Replace usage of deprecated gcoap_finish
2020-07-17 09:51:34 +02:00
Akshai M
e9f270c78a
net/asymcute : Expose to Kconfig
2020-07-07 16:27:57 +05:30
Akshai M
8a6d2882f7
net/asymcute : Move 'ASYMCUTE_KEEPALIVE_PING' to 'CONFIG_'
2020-07-07 16:27:57 +05:30
Akshai M
a1df2e33b0
net/asymcute : Move 'ASYMCUTE_N_RETRY' to 'CONFIG_'
2020-07-07 16:27:57 +05:30
Akshai M
6dc5747c4b
net/asymcute : Move 'ASYMCUTE_T_RETRY' to 'CONFIG_'
2020-07-07 16:27:57 +05:30
Akshai M
1753b84cba
net/asymcute : Move 'ASYMCUTE_KEEPALIVE' to 'CONFIG_'
2020-07-07 16:27:57 +05:30
Akshai M
7ba0d3c76f
net/asymcute : Move 'ASYMCUTE_TOPIC_MAXLEN' to 'CONFIG_'
2020-07-07 16:27:57 +05:30
Aiman Ismail
869052dcd8
cord: add RD lookup client
2020-07-07 10:54:10 +02:00
Martine Lenders
2b1be158e3
Merge pull request #13837 from benpicco/dhcpv6-stale_replies
...
sys/net/dhcpv6: discard stale replies
2020-06-25 12:18:31 +02:00
Benjamin Valentin
2d1160426d
sys/net/dhcpv6: discard stale replies
...
The DHCPv6 server might send reponses multiple times.
The DHCPv6 client will only handle the first response, if additional
responses are comming in they are left in the RX queue.
That results in the client always reading the response of a previous
transaction on any subsequent transactions.
In this case the client will try again, creating a new transaction - that
will again only read the previous response.
To fix this, discard previous responses by flushing the RX queue before
sending a new message to the DHCPv6 server.
fixes #13834
2020-06-21 22:07:32 +02:00
Maciej Jurczak
edf016a6cb
nanocoap: Added token length validation.
...
Implemented a check in coap_parse() to verify if TKL value is within valid range as specified by RFC7252. The token length must be within 0-8 range, any other value should be considered as invalid and the packet should produce message format error.
A test case was added to tests-nanocoap.c to verify correct behavior in case of TKL in range and out of range.
Update sys/net/application_layer/nanocoap/nanocoap.c
Prefixed debug message with module name and abbreviations expanded.
Co-authored-by: Martine Lenders <mail@martine-lenders.eu>
Update sys/net/application_layer/nanocoap/nanocoap.c
Prefixed debug message with module name and abbreviations expanded.
Co-authored-by: Martine Lenders <mail@martine-lenders.eu>
2020-05-25 22:44:50 +02:00
Maciej Jurczak
3be2c51c42
nanocoap: Fixed buffer read out of the input packet bounds issue.
...
If token length in the header was longer than actually provided in the following payload, read out of the input buffer bounds or processing of data beyond the actual input packet bound could happen. In order to remove the risk, the options loop condition was modified to early detect the condition and abort packet processing if a malformed packet is detected.
nanocoap: Added pointer range check after token length parsing.
Added a check to verify if the current packet parsing pointer is still within the packet boundaries after incrementing by the token length declared in the header. If packet is malformed an error code is returned.
nanocoap: Combined packet length checks
Combined packet length checks after reading token length and processing options into a single packet length validation after the options parsing loop. The entry to the options parsing loop is safe as the while loop condition protects against entering the loop if the token length was invalid.
2020-05-25 22:44:39 +02:00
Ken Bannister
595e8c631f
Merge pull request #13726 from benpicco/nanocoap-payload_helper
...
nanocoap: add payload helper functions
2020-05-03 08:56:30 -04:00
Benjamin Valentin
e5c20b143d
nanocoap: add coap_payload_put_char()
2020-05-01 13:58:22 +02:00
Benjamin Valentin
2751708341
nanocoap: add payload helper functions
...
This adds two functions `coap_payload_add()` and `coap_payload_advance()`.
- `coap_payload_add()` will add n bytes to the payload buffer and advance
payload pointer accordingly.
const char hello[] = "Hello CoAP!";
coap_payload_add(pkt, hello, sizeof(hello));
- `coap_payload_advance()` will advance the payload buffer after data
has been added to it.
int len = snprintf(pkt->payload, pkt->payload_len, "%s %s!", "Hello", "CoAP");
coap_payload_advance(pkt, len);
I considered adding an additional parameter to keep track of the total request size
(returned size from coap_opt_finish() incremented by each added payload fragment),
but decided against it to keep consistency with the existing API.
2020-05-01 13:58:22 +02:00
Leandro Lanzieri
b91c8502dc
net/nanocoap/kconfig: Explicitly define type of MODULE_NANOCOAP
2020-04-27 10:06:01 +02:00
Leandro Lanzieri
eeea9b7dae
net/coap: Expose configurations to Kconfig
2020-04-24 10:06:45 +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
Cenk Gündoğan
ea616abfda
nanocoap: allow coap_opt_add_string() for zero-terminated strings
2020-04-22 12:28:48 +02:00
Leandro Lanzieri
46507ff247
Merge pull request #13894 from kb2ma/gcoap/ping
...
net/gcoap: add CoAP ping request
2020-04-21 12:23:54 +02:00
Cenk Gündoğan
6859de7855
nanocoap: export coap_opt_get_uint()
2020-04-17 22:39:44 +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
Ken Bannister
2d3eb1a343
net/nanocoap: validate empty message length
2020-04-17 08:15:20 -04:00
Leandro Lanzieri
0137a06896
net/nanocoap: Expose configurations to Kconfig
2020-04-07 17:00:55 +02:00
Leandro Lanzieri
e80dcf2d8b
net/application_layer: Add Kconfig file and CoAP menu
2020-04-07 17:00:54 +02:00
Leandro Lanzieri
b6be8af81c
net/nanocoap: Move NANOCOAP_QS_MAX to 'CONFIG_' namespace
2020-04-07 17:00:53 +02:00
Leandro Lanzieri
2f72189aa2
net/nanocoap: Move NANOCOAP_BLOCK_SIZE_EXP_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
Leandro Lanzieri
c84576ef6e
net/nanocoap: Move NANOCOAP_NOPTS_MAX to 'CONFIG_' namespace
2020-04-07 17:00:52 +02:00
Ken Bannister
b32fcd28d1
Merge pull request #13815 from kb2ma/nanocoap/add_canonical_uri_query
...
net/gcoap: add canonical uri query function names
2020-04-07 06:32:13 -04:00
Ken Bannister
5d95436334
net/cord: use canonical function name to add Uri-Query option
2020-04-06 06:19:44 -04:00
Ken Bannister
d57340c964
net/nanocoap: use new Uri-Query functions as primary implementation
2020-04-06 06:19:44 -04:00
Martine Lenders
5c95df3151
Merge pull request #13806 from benpicco/sys/net/dhcpv6-multiple_prefixes
...
sys/net/dhcpv6: fix requesting multiple prefixes
2020-04-05 01:14:27 +02:00
Benjamin Valentin
c8b2483de5
net/gcoap: make use of coap_opt_add_path()
2020-04-04 17:06:04 +02:00
Benjamin Valentin
0e5595cffd
sys/net/dhcpv6: fix requesting multiple prefixes
...
There were two subtle bugs that prevented the DHCPv6 client to request
multiple prefixes for different interfaces.
- `dhcpv6_client_req_ia_pd()` would fill up *all* leases with the same interface
- `_parse_reply()` would return after parsing the first answer
With this patch, `gnrc_border_router` gets a prefix on both interfaces of the at86rf215.
2020-04-03 17:02:57 +02:00
Cenk Gündoğan
50900a1fbe
nanocoap: add convenience function for PROXY_URI
2020-03-28 14:50:51 +01:00
Cenk Gündoğan
5e42e26a6e
nanocoap: add const qualifier to pkt of coap_opt_get_opaque()
2020-03-25 13:38:21 +01:00
1d5010e126
nanocoap: make separate tree handling function
...
This refactors nanocoap to seperate out the resource tree parsing. It
allows for calling the tree handler with custom resource trees. The
advantage is that a resource with COAP_MATCH_SUBTREE can parse a new
separate resource tree.
2020-03-23 15:08:53 +01:00
Ken Bannister
ec2aff4546
Merge pull request #13240 from kb2ma/gcoap/deprecate_add_qstring
...
net/coap: deprecate gcoap_add_qstring() and update uses
2020-03-13 08:04:50 -04:00
Martine Lenders
20e30ec58b
Merge pull request #13622 from gschorcht/net/dhcpv6_fix_opt_len
...
sys/net/dhcpv6: fixes option length handling in client implementation
2020-03-12 18:56:43 +01:00
Gunar Schorcht
a25c61bc8b
sys/net/dhcpv6: fix client option length handling
2020-03-12 18:33:17 +01:00
benpicco
1212165222
Merge pull request #13584 from kb2ma/nanocoap/add_uquery_improvements
...
net/nanocoap: add uquery improvements
2020-03-12 15:18:07 +01:00
Ken Bannister
c55837d809
net/nanocoap: add query option directly
2020-03-12 08:44:26 -04: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
Aiman Ismail
64f9658472
nanocoap: add coap_opt_add_uquery2()
2020-03-05 19:06:14 +01:00
Martine Lenders
ec6c07d35d
Merge pull request #13424 from miri64/examples/enh/dhcpv6-br
...
examples/gnrc_border_router: add optional DHCPv6 support
2020-02-25 20:08:31 +01:00
benpicco
d044800300
Merge pull request #13450 from benpicco/dns-fixes
...
fix DNS resolution in ping6
2020-02-24 21:58:34 +01:00
Benjamin Valentin
1de14931b8
sock_dns: use the same buffer for request & reply
...
Saving RAM is more important than saving a few cycles
used by re-creating the request buffer in the error case.
Also reduce the size of the buffer to 128 bytes.
If we are just requesting the AAAA record it is unlikely
for the reply to take up the maximum size of 512 bytes.
We were already placing restrictions on the domain name length,
those are now actually a bit more relaxed (112 bytes instead of 64)
2020-02-24 14:29:17 +01:00
Benjamin Valentin
e9a40933f7
sock_dns: fix off-by-one error in _parse_dns_reply()
2020-02-24 14:19:50 +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
Martine S. Lenders
b929d013d8
dhcpv6_client: re-send SOLICITs after failed ADVERTISE
2020-02-20 16:41:48 +01:00
Ken Bannister
d6fa3c7c2f
net/gcoap: add timeout event/handler for server response
2020-02-16 09:17:48 -05:00
Ken Bannister
ea62734baf
net/gcoap: add sock_async event handling
...
Rework from earlier custom event/msg handling.
2020-02-16 09:17:48 -05:00
Ken Bannister
7f3e953893
net/cord: update for deprecated gcoap function
2020-01-30 06:00:53 -05:00
Ken Bannister
0ed4fe2da6
net/coap: move/rename function to add query option
2020-01-29 09:23:47 -05:00
Cenk Gündoğan
c84d7d2623
Merge pull request #12887 from leandrolanzieri/pr/kconfig_migrate/gcoap
...
Kconfig: Expose Gcoap configurations
2020-01-28 18:58:29 +01:00
Leandro Lanzieri
926d32ff30
Kconfig: Expose Gcoap configurations
2020-01-28 11:59:52 +01:00
Leandro Lanzieri
bab6f4737c
net/gcoap: Move config macros to 'CONFIG_' namespace
...
Macros that changed:
GCOAP_MSG_QUEUE_SIZE -> CONFIG_GCOAP_MSG_QUEUE_SIZE
GCOAP_NO_AUTO_INIT -> CONFIG_GCOAP_NO_AUTO_INIT
GCOAP_NO_RETRANS_BACKOFF -> CONFIG_GCOAP_NO_RETRANS_BACKOFF
GCOAP_NON_TIMEOUT -> CONFIG_GCOAP_NON_TIMEOUT
GCOAP_OBS_CLIENTS_MAX -> CONFIG_GCOAP_OBS_CLIENTS_MAX
GCOAP_OBS_OPTIONS_BUF -> CONFIG_GCOAP_OBS_OPTIONS_BUF
GCOAP_OBS_REGISTRATIONS_MAX -> CONFIG_GCOAP_OBS_REGISTRATIONS_MAX
GCOAP_OBS_VALUE_WIDTH -> CONFIG_GCOAP_OBS_VALUE_WIDTH
GCOAP_PDU_BUF_SIZE -> CONFIG_GCOAP_PDU_BUF_SIZE
GCOAP_PORT -> CONFIG_GCOAP_PORT
GCOAP_RECV_TIMEOUT -> CONFIG_GCOAP_RECV_TIMEOUT
GCOAP_REQ_OPTIONS_BUF -> CONFIG_GCOAP_REQ_OPTIONS_BUF
GCOAP_REQ_WAITING_MAX -> CONFIG_GCOAP_REQ_WAITING_MAX
GCOAP_RESEND_BUFS_MAX -> CONFIG_GCOAP_RESEND_BUFS_MAX
GCOAP_RESP_OPTIONS_BUF -> CONFIG_GCOAP_RESP_OPTIONS_BUF
GCOAP_TOKENLEN -> CONFIG_GCOAP_TOKENLEN
2020-01-28 11:59:52 +01:00
Leandro Lanzieri
3f382dc323
net/gcoap: Use COAP_RANDOM_FACTOR_1000 to calculate timeout range
...
With this the range for the random timeout is calculated using
COAP_RANDOM_FACTOR_1000 (ACK_RANDOM_FACTOR in RFC 7252).
2020-01-27 19:47:20 +01:00
Martine Lenders
1048d67c76
dhcpv6: provide initial client implementation
...
This implements a client for DHCPv6 IA_PD (Identity Association for
Prefix Delegation). Goal was to have a IETF-compliant alternative to
UHCP. The implementation was based on RFC 8415.
2020-01-16 12:36:03 +01:00
Hauke Petersen
3a7b60e4d4
net/cord_epsim: adapt to gcoap API changes
2019-11-28 12:50:24 +01:00
Hauke Petersen
7b1217a529
net/cord_ep: adapt to gcoap API changes
2019-11-28 12:50:24 +01:00
Hauke Petersen
3fd8357071
net/gcoap: allow to pass user context to requests
2019-11-28 12:50:24 +01:00
Hauke Petersen
383f395af3
net/gcoap: pass memo to resp_handler directly
2019-11-28 12:48:37 +01:00
Hauke Petersen
17b1b19fda
net/gcoap: do not allocate RX buf on stack
2019-11-26 15:00:03 +01:00
d4f3747705
sys/net: fix typos
2019-11-23 22:39:38 +01:00
8b06560c02
sys/net/nanocoap: correctly initialize array
2019-10-30 17:03:06 +01:00
95da51bd7f
sys/net/nanocoap: fix potential use of uinitialized variable
2019-10-30 17:03:06 +01:00
5d1480a4b8
sys/net/nanocoap: fail when start data cannot be parsed
2019-10-30 17:03:06 +01:00
1aa1e2c8cc
sys/net/nanocoap: return ENOENT if parsing option failed
...
This fixes a potential use of uninitialized len in subsequent function calls.
This was reported by scan-build
2019-10-30 17:03:06 +01:00
a9399810d5
sys/net/uhcp: remove unused returned value in uhcp_client
2019-10-28 15:14:40 +01:00
aaadaccc3f
sys/net/nanocoap: fix dead assignment in nanocoap server
2019-10-27 10:49:41 +01:00
Martine Lenders
9d0faa9e5f
Merge pull request #11957 from miri64/emcute/fix/payload-copy-error
...
emcute: fix payload copy error for emcute_pub
2019-10-07 17:17:44 +02:00
Martine Lenders
999a7714b0
Merge pull request #12382 from nmeum/pr/asymcute_continue
...
emcute: never return from receive loop
2019-10-07 16:28:09 +02:00
Sören Tempel
74e19d451c
emcute: never return from receive loop
...
Without this change an attacker would be able to stop the emcute server
by sending a crafted packet triggering this branch. The solution is
using `continue` instead of `return`.
2019-10-07 15:12:20 +02:00
Francisco
7d7596ea6c
Merge pull request #11057 from kb2ma/coap/block_optimization
...
net/coap: Block optimizations
2019-10-04 09:41:05 +02:00
Ken Bannister
2dc4209c0e
net/nanocoap: optimize determination of exponent for block szx
2019-10-03 13:17:09 -04:00
Ken Bannister
e22d4729e1
net/nanocoap: initialize offset attribute
2019-10-02 05:51:59 -04:00
Ken Bannister
2abcbc0d20
net/coap: add generic get block function
2019-10-02 05:51:59 -04:00
Ken Bannister
5eaa51e426
net/nanocoap: remove unused function
2019-10-02 05:51:59 -04:00
Ken Bannister
efb75c5c4c
net/coap: improve slicer to block helper
2019-10-02 05:51:59 -04:00
Ken Bannister
dae9c4ab89
net/nanocoap: use coap_opt_add_uint() and remove unused
2019-10-02 05:51:59 -04:00
Ken Bannister
233dd31e17
net/nanocoap: add generic uint block option
2019-10-02 05:51:59 -04:00
Martine Lenders
aab312e8df
Merge pull request #11958 from miri64/emcute/fix/length-calculation
...
emcute: fix length field calculation
2019-10-01 09:29:58 +02:00
benpicco
e942f86837
Merge pull request #11056 from kb2ma/coap/pkt_api_block_write
...
net/gcoap: add/use Packet API Block implementation
2019-09-24 21:43:33 +02:00
Sören Tempel
30e4823e94
asymcute: don't make the assumption that req->arg is non-NULL
...
This fixes a denial of service where an attacker would be able to cause
a NULL pointer dereference by sending a spoofed packet. This attack only
requires knowledge about pending message ids.
2019-09-24 12:00:12 +02:00
benpicco
bf2aaa1a5d
Merge pull request #12049 from Sizurka/fix-asymcute-reconnect
...
asymcute: Reset keepalive counter on connection ACK
2019-09-12 15:55:11 +02:00
Ken Bannister
39eddce078
net/nanocoap: add function to retrieve opaque option
2019-09-11 05:40:14 -04:00
Sebastian Meiling
9f5951d216
Merge pull request #10214 from bergzand/pr/nanocoap/flags_uint32t
...
nanocoap: change method flag type to uint16_t
2019-09-09 12:33:17 +03:00
bde253cca3
gcoap: use coap_method_flags_t
2019-09-09 09:40:14 +02:00
4d399bf444
nanocoap: change method flag type to uint32_t
2019-09-09 09:40:14 +02:00
Ken Bannister
4e89741b79
net/nanocoap: add function to iterate over options
2019-08-24 06:51:29 -04:00
Ken Bannister
6c8e646b83
net/nanocoap: check for payload marker when parse option
2019-08-24 06:51:29 -04:00
Derek Hageman
18910cf4e2
asymcute: Reset keepalive counter on connection ACK
...
When a keepalive timeout occurs keepalive_retry_cnt remains zero,
so when the connection is re-established _on_keepalive_evt will
immediately disconnect instead of actually sending a keepalive ping.
The sequence looks like:
1. _on_connack: start con->keepalive_timer
2. Server does not respond to keepalive pings
3. _on_keepalive_evt: con->keepalive_retry_cnt reaches zero
4. Connection torn down and ASYMCUTE_DISCONNECTED sent to application
5. Application starts reconnection
6. _on_connack: start con->keepalive_timer again
7. First _on_keepalive_evt: con->keepalive_retry_cnt is still zero
8. Repeat from 4.
So this simply resets keepalive_retry_cnt in _on_connack when
the keepalive timer is restarted. It's a new connection, so
resetting the keepalive retry counter make senses regardless.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-08-20 17:23:05 -06:00
Benjamin Valentin
e8dc1119b8
sys: make use of ARRAY_SIZE macro
2019-08-06 19:43:54 +02:00
Martine S. Lenders
89afc378a9
emcute: fix length field calculation
...
The length field in an MQTT packet carries the _total_ length of the
packet. If it is below 256 (i.e. fits in one byte) only one byte is
used for the length field. If it is larger than that 3 bytes are used,
with the first byte having the value `0x01` and the remaining bytes
representing the length in as a 2 byte unsigned integer in network byte
order. Resulting from that it can be assessed that the check in
`emcutes`'s `set_len()` function is wrong as it needs to be checked if
`len` is lesser or equal to `0xff - 1`. `len <= (0xff - 1)` can be
simplified to `len < 0xff`. For some larger packages this safes 2 bytes
of wasted packet space.
2019-08-05 13:08:20 +02:00
Martine S. Lenders
10a3f3e8ed
emcute: fix payload copy error for emcute_pub
...
`len` is used with the `memcpy()` to copy the payload to `tbuf`. With a
payload provided that is just long enough to fill `tbuf`, `len += 6`
leads to the `memcpy()` overriding data after `tbuf` (e.g. the
`mutex` that is unlocked right after) and thus resulting in potential
segmentation faults.
Additionally `+ 6` can only be applied if the total packet length is
below 256 (see spec), so `len + pos` is what needs to be provided to the
corresponding send functions instead (`pos` adapts to the header length
of the PUBLISH message).
2019-08-05 13:07:15 +02:00
Ken Bannister
513ddfd79c
net/nanocoap: add Packet API block write functions
2019-08-02 09:46:24 -04:00
Ken Bannister
c8e87e7854
Merge pull request #11787 from miri64/gcoap/enh/backoff-config
...
gcoap: allow for retransmission backoff to be turned off
2019-08-02 06:40:07 -04:00
Ken Bannister
28317019fc
Merge pull request #11784 from miri64/gcoap/fix/ack-variance-0
...
gcoap: don't call random_uint32_range() when COAP_ACK_VARIANCE=0
2019-08-02 05:10:45 -04:00
Ken Bannister
b5200e96a7
Merge pull request #11024 from kb2ma/coap/add_block_helpers
...
net/nanocoap: Buffer API Block helper functions
2019-07-31 12:41:25 -04:00
Ken Bannister
64b4e0ad2d
net/nanocoap: add block slicer init function
2019-07-30 13:10:10 -04:00
Ken Bannister
a6f919ef3e
net/nanocoap: refactor block2_finish()
2019-07-30 13:10:10 -04:00
Ken Bannister
86edea81be
net/nanocoap: use block init helper internally
2019-07-30 13:10:10 -04:00
Ken Bannister
69efaa1d56
net/nanocoap: add block init helper function
2019-07-30 13:10:10 -04:00
Ken Bannister
f4df9d79e9
Merge pull request #11002 from kb2ma/coap/block_finish_proto
...
net/nanocoap: Buffer API Block implementation
2019-07-30 12:49:12 -04:00
Leandro Lanzieri
a9ab9d37e2
Merge pull request #11765 from kb2ma/coap/encode_resources
...
net/gcoap: add/publish link format attributes for a resource
2019-07-27 22:36:33 +02:00
Ken Bannister
d481ca9da7
net/gcoap: add selectable function to write a link
2019-07-27 07:09:40 -04:00
Ken Bannister
9dce54b54b
net/nanocoap: refactor block option control use
2019-07-22 05:42:08 -04:00
Ken Bannister
4311f17e81
net/nanocoap: refactor block option put
2019-07-22 05:42:08 -04:00
Ken Bannister
64ba8e4ea9
net/nanocoap: document internal option functions
2019-07-18 05:21:40 -04:00
6c02521591
nanocoap: make coap_get_block2() actually fill struct
2019-07-05 15:29:58 +02:00
Hauke Petersen
eb50d4704a
net/emcute: make cli ID conform to standard
2019-07-04 11:04:22 +02:00
Hauke Petersen
785f59fb7f
net/asymcute: make cli ID len conform to standard
2019-07-04 11:03:37 +02:00
Martine S. Lenders
c31c9ed216
gcoap: allow for retransmission backoff to be turned off
2019-07-03 16:35:48 +02:00
Martine S. Lenders
1bde141697
gcoap: don't call random_uint32_range() when COAP_ACK_VARIANCE=0
...
`COAP_ACK_VARIANCE` is a configurable macro, so when it is 0, the
[precondition for `random_uint32_range()`][1] is not held.
[1]: https://doc.riot-os.org/group__sys__random.html#gab6ee09e1e56df3cc78acd1fbf97bfb24
2019-07-03 15:45:45 +02:00
Martine S. Lenders
7e70bf3ac1
cord_epsim: replace gcoap_req_send2()
2019-07-03 15:02:22 +02:00
Martine S. Lenders
0579ef952e
cord_ep: replace gcoap_req_send2()
2019-07-03 15:02:15 +02:00
Martine S. Lenders
c9179a26c8
gcoap: replace internal references to gcoap_req_send2()
...
`gcoap_req_send2()` is deprecated and was replaced with
`gcoap_req_send()`.
2019-07-03 15:00:06 +02:00
Ken Bannister
8aa5258ba7
Merge pull request #11445 from miri64/gcoap/fix/rm-deprecated
...
gcoap: remove deprecated function gcoap_req_send()
2019-05-03 13:44:02 -04:00
0ec9c57b2b
add copyrights from IOTPUSH project
2019-05-02 12:09:37 +02:00
Martine Lenders
a11f817604
gcoap: rename gcoap_req_send2() to gcoap_req_send()
2019-04-25 13:40:32 +02:00
Martine Lenders
affd115405
gcoap: remove deprecated function gcoap_req_send()
2019-04-25 13:39:50 +02:00
chrysn
09dc930d3a
nanocoap: add some const qualifiers
2019-04-12 11:04:47 +02:00
chrysn
a51460984b
nanocoap: Add coap_opt_add_opaque
...
This option complements the existing coap_opt_add_{uint,string} and even
more special-purpose functions; its implementation is trivial given the
existing static _add_opt_pkt function.
The method is useful when working with ETags (ETag, If-Match options).
2019-04-12 11:04:47 +02:00
88171698e0
Merge pull request #10931 from kb2ma/nanocoap/pktapi_opt_enospc
...
net/nanocoap: Packet API return error if buffer full
2019-04-03 14:49:44 +02:00
Hauke Petersen
840c8aeba2
cord/epsim: remove standalone submodule
2019-03-27 18:26:37 +01:00
Hauke Petersen
ec461661d8
net/cord_epsim: pass RD endpoint on runtime
2019-03-27 18:26:37 +01:00
Ken Bannister
5bf2fc6227
net/nanocoap: return error from coap_opt_finish if no space
2019-03-19 05:30:04 -04:00
Ken Bannister
3cdf43607c
net/nanocoap: Return error from coap_opt_add_xxx() if no space
2019-03-19 05:30:04 -04:00
Leandro Lanzieri
6bb4158c31
sys/net/application_layer/nanocoap: Add path prefix opt
...
This adds a prefix option for the methods field of a coap resource and
modifies the way the path is matched on a request to accept prefix
matching.
2019-03-17 14:26:11 +01:00
Ken Bannister
34e880499e
examples/cord_ep: use coap_opt_finish()
2019-03-13 00:24:29 -04:00
Ken Bannister
682c1e9a7d
examples/cord_epsim: use coap_opt_finish()
2019-03-13 00:24:29 -04:00
297efdd5b2
Merge pull request #10892 from kb2ma/gcoap/use_opt_finish
...
net/gcoap: Replace use of gcoap_finish() with coap_opt_finish()
2019-03-12 22:16:32 +01:00
Ken Bannister
05195ec4a1
net/nanocoap: don't abort server on recv error
2019-02-26 12:35:49 -05:00
Martine Lenders
b30cdb51a5
sock_dns: correctly report too short messages
2019-01-29 22:32:50 +01:00
Ken Bannister
93da7372fd
net/gcoap: use coap_opt_finish within gcoap
2019-01-27 08:56:26 -05:00
Sebastian Meiling
a65fede8c4
Merge pull request #10855 from kb2ma/nanocoap/simple_reply_safety
...
net/nanocoap: verify simple reply buffer
2019-01-24 12:08:31 +01:00
Ken Bannister
3343ed3674
net/nanocoap: verify reply length before write
2019-01-24 05:18:12 -05:00
Sebastian Meiling
44234783da
Merge pull request #10823 from kb2ma/nanocoap/verify_before_write_option
...
net/nanocoap: validate option length
2019-01-24 09:23:26 +01:00
Ken Bannister
e35bcb6853
net/nanocoap: fix remaining space calculation
...
The space calculation must use the same length as the eventual
return value.
2019-01-23 16:36:20 -05:00
Ken Bannister
7e77ac7ace
Merge pull request #10845 from kb2ma/nanocoap/server_debug_msg
...
net/nanocoap: add debug message for server
2019-01-23 11:41:47 +00:00
Ken Bannister
b4f8b7a10b
net/nanocoap: add debug message for server
2019-01-22 08:42:16 -05:00
Sebastian Meiling
9d3f1107c9
Merge pull request #10791 from kb2ma/gcoap/options_buf_macros_config
...
net/gcoap: make options buf macros configurable
2019-01-22 14:20:33 +01:00
Ken Bannister
85a658634f
net/nanocoap: validate option length before write
2019-01-18 12:34:55 -05:00
Ken Bannister
b9f6354067
net/nanocoap: document function that writes option header
2019-01-18 12:34:55 -05:00
Sebastian Meiling
f9a3bdf1a7
Merge pull request #10671 from kb2ma/nanocoap/retry_qty
...
net/nanocoap: fix confirmable retry countdown
2019-01-18 17:49:00 +01:00
Ken Bannister
27ba81eed0
net/nanocoap: improve debug messages
2019-01-18 05:47:43 -05:00
Ken Bannister
0e1c3ebe50
net/gcoap: make options buf macros configurable
2019-01-16 12:41:06 -05:00
Sebastian Meiling
a0e143d09f
Merge pull request #10721 from nmeum/asymcute-out-of-bounds
...
asymcute: check for minimum packet length early
2019-01-16 13:53:49 +01:00
Sören Tempel
2a6354b07d
asymcute: check for minimum packet length early
...
Without this patch _len_get reads one byte beyond the con->rxbuf
if the incoming packet consists only of the byte 0x01.
2019-01-16 10:06:38 +01:00
4b1b0aa84e
sys/net/nanocoap: fix possible option_count overflow
2019-01-14 12:30:06 +01:00
Martine Lenders
894ad29322
sock_dns: remove out-of-place puts() call
2019-01-10 18:07:29 +01:00
Martine Lenders
8ad5e44cba
sock_dns: remove some magic numbers
2019-01-10 18:07:29 +01:00
Martine Lenders
2840b3825e
sock_dns: fix out-of-bound errors
...
Fixes #10739
2019-01-10 18:07:29 +01:00
Ken Bannister
86ff4d3dc5
net/nanocoap: fix request retry countdown
2019-01-10 06:21:47 -05:00
Sören Tempel
d70a94f139
nanocoap: fix sock_udp return value checks
2019-01-08 19:01:39 +01:00
Sebastian Meiling
139b5dba3c
Merge pull request #10501 from kb2ma/gcoap/req_path_null
...
net/gcoap: allow NULL path in gcoap_req_init()
2018-12-21 14:36:04 +01:00
Ken Bannister
bd457aee2b
net/nanocoap: fix includes for nanocoap sock
2018-12-20 00:37:18 -05:00
Ken Bannister
bec94b0b7a
net/gcoap: allow NULL path in gcoap_req_init()
2018-11-28 13:20:22 -05:00
Ken Bannister
8fa6f10f97
cord/ep: Update for gcoap API change
2018-11-24 07:09:25 -05:00
Ken Bannister
424a01ddc1
net/gcoap: remove gcoap attributes from coap_pkt_t
2018-11-24 07:09:25 -05:00
Ken Bannister
034c78d51c
net/gcoap: move macros to implementation file
2018-11-24 07:09:25 -05:00
Ken Bannister
f0b966d65d
net/gcoap: Use nanocoap options API
...
Observe still uses coap_pkt_t attribute.
2018-11-24 07:09:25 -05:00
Ken Bannister
fa5ab4eeb6
net/gcoap: Add format option to nanocoap
2018-11-24 07:09:25 -05:00
Martine Lenders
78164977d8
Merge pull request #10223 from kb2ma/nanocoap/string_opt_first_char
...
net/nanocoap: fix string option separator write handling
2018-11-22 16:43:45 +01:00
Ken Bannister
fa77929cc7
net/nanocoap: fix string option separator handling
...
Assumed initial character was a separator when writing the option,
and skipped over it.
2018-11-22 09:25:05 -05:00
Lasse Lueder
34a6e384c2
net/gcoap: use coap_data_ptr instead of hdr.data
2018-11-02 16:33:29 +01:00
Lasse Lueder
18ae8ef90d
net/nanocoap: use coap_data_ptr instead of hdr.data
2018-11-02 16:33:29 +01:00
afb7d6e1fc
cord/epsim: enable THREAD_CREATE_STACKTEST for thread
2018-10-18 14:17:07 +02:00
be1dc15655
cord/ep: enable THREAD_CREATE_STACKTEST for thread
2018-10-18 14:09:32 +02:00
Hauke Petersen
18cc7ee3ed
net/rdcli: rename to cord_ep
2018-10-17 15:21:49 +02:00
Hauke Petersen
226b9fa383
net/rdcli_simple: rename to cord_epsim
2018-10-17 15:21:49 +02:00
Hauke Petersen
152623577e
net/rdcli_config: rename to cord_config
2018-10-17 09:29:19 +02:00
Hauke Petersen
787524400c
net/rdcli_common: rename to cord_common
2018-10-17 09:29:19 +02:00
Hauke Petersen
f0b0e25254
net/rdcli: new module structure and high-level doc
2018-10-17 09:29:19 +02:00
Ken Bannister
ad38dd9a6f
net/nanocoap: fix non-confirmable response type
2018-10-15 06:42:37 -04:00
726ebf3dad
coap: use COAP_FORMAT style content-format defines
...
Replaces all occurences of COAP_CT_.* with COAP_FORMAT_.*
2018-10-15 09:44:17 +02:00
Ken Bannister
14c9b3062b
Merge pull request #8932 from bergzand/pr/nanocoap/block2
...
nanocoap: add server-side block2 support
2018-10-14 13:03:08 +00:00
551b3513db
nanocoap: Add server-side block2 support
2018-10-14 14:30:29 +02:00
Hauke Petersen
9acce40aad
net: added full RD endpoint implementation
2018-10-12 14:41:40 +02:00
Hauke Petersen
6ba1991a8e
net/rdcli_simple: do not send CF opt in POST msg
2018-10-10 11:07:17 +02:00
Hauke Petersen
f3f673eb45
net/nanocoap: factor out generic CoAP defines
2018-09-26 14:31:57 +02:00
Hauke Petersen
4a59113963
net/nanocoap: use correct type param for _bulid_hdr()
2018-09-26 13:00:39 +02:00
05b6af466c
sys: add missig <string.h> includes
2018-09-20 23:47:40 +02:00
Hauke Petersen
becfce247d
net/nanocoap: allow empty uri/location path option
...
For CoAP, there is actually a difference between
`/some/path` and `/some/path/`. This needs to be reflected
when parsing the URI and location path options from a given
string.
2018-09-11 10:06:57 +02:00
Hauke Petersen
f2b1c5c87d
net/gcoap: use sock_udp_ep_equal()
2018-09-07 12:03:19 +02:00
Hauke Petersen
a3b8c90485
net/gcoap: adjust to nanocoap changes
2018-08-30 10:31:03 +02:00
Hauke Petersen
4c08e77d00
net/nanocoap: improve option handling
...
- add generic string put and get functions
- add location path and location query options
- add dedicated functions for getting and setting
URI query, URI path, location query, and location path
options
2018-08-30 10:31:03 +02:00
Pekka Nikander
8f10d65ad5
net/gcoap: Make references to coap_resource_t const in gcoap
...
A CoAP resource is a primary object between the application
and CoAP library. The Library needs the paths, methods,
and handlers from it, so that it can call the right handler.
However, it never needs to change any of them.
The application also needs the resources. The application
may want to declare the resources as const, since it may
want to store them in flash.
2018-07-30 09:00:21 +03:00
Hauke Petersen
ad20c4f1cc
net: add Asymcute (asynchronous MQTT-SN client)
2018-07-05 15:44:16 +02:00
Martine Lenders
5361c4cfff
sock_dns: return error if DNS server is not set
2018-07-05 11:09:34 +02:00
Martine Lenders
fbf216f864
gnrc_sock_dns: Move DNS server end point to implementation
2018-07-05 11:01:22 +02:00
Hauke Petersen
1bfb3c8534
net/emcute: adapted to changes byteorder functions
2018-07-04 17:41:04 +02:00
ddfc5843bb
Merge pull request #9086 from bergzand/pr/nanocoap_sock/client_split
...
nanocoap_sock: split generic request function of from nanocoap_get
2018-06-20 23:31:05 +02:00
Ken Bannister
4f8c3b7d18
Merge pull request #9310 from miri64/gcoap/enh/clients-without-response-handlers
...
gcoap: don't allocate memo for clients without response handlers
2018-06-15 10:28:30 -04:00
Martine Lenders
b03aa528e8
gcoap: don't allocate memo for clients without response handlers
2018-06-15 09:46:50 +02:00
Martine Lenders
e91e0a7807
Merge pull request #9261 from kb2ma/gcoap/refine_re-register
...
net/gcoap: Refine Observe re-registration
2018-06-13 16:05:40 +02:00
7d013eb2b6
sys: fix doxygen grouping
2018-06-11 19:12:02 +02:00
Ken Bannister
43db2715cd
net/nanocoap: create pkt-based request
...
Includes string and uint options.
2018-06-10 08:44:16 -04:00
Hauke Petersen
36ecaa6e4b
net/emcute: use global byteorder functions
2018-06-07 12:10:58 +02:00
Ken Bannister
2c02ed2093
net/gcoap: refine observe re-registration
...
Fix re-register when using the same token.
Handle edge cases when change token for a resource.
Only set observer and resource on initial registration.
Discuss re-registration in documentation.
2018-06-05 09:23:16 -04:00
Martine Lenders
57d3c4698c
gcoap: don't drop observer on re-register
...
With #9209 gCoAP got the ability to re-register and OBSERVE with a new
token, sadly the `observer` variable wasn't set in that fix, so a
re-registration actually led to the deletion of the observer (because it
is still `NULL` when the old registration is overwritten in l. 317)
2018-05-30 23:05:25 +02:00
Ken Bannister
341debd5e0
Merge pull request #9209 from kb2ma/gcoap/observe_change_token
...
net/gcoap: Observer re-register with new token
2018-05-29 18:06:07 +00:00
Ken Bannister
d7dde2dded
net/gcoap: observer re-register with new token
2018-05-29 13:30:05 -04:00
Hauke Petersen
7f2fb5e0a3
net/emcute: use correct number of retries
...
syncsend() is used also for the initial packet, so resending
while (retries <= EMCUTE_N_RETRY) is the correct behavior.
2018-05-28 11:41:20 +02:00
6bb8a5c145
nanocoap_sock: split request function from get
...
The nanocoap_get function is refactored to split of the request part
into a separate function for reuse by other modules. Support for
retransmissions when the received frame is malformed is dropped as it
was broken anyway.
2018-05-25 09:40:20 +02:00
smlng
b9ca8f466f
gcoap: add asserts for path in gcoap_req_init
2018-05-22 21:28:58 +02:00
smlng
c9e9f72454
gcoap: use const path parameter
2018-05-22 21:28:58 +02:00
Martine Lenders
8a46cf611e
gcoap: make message queue size configurable
2018-05-06 16:41:43 +02:00
8475844213
sys/net/uhcpc: add missing stdio.h include
2018-04-16 23:06:15 +02:00
635e72db23
Merge pull request #8788 from kaspar030/nanocoap_add_serverside_block1
...
nanocoap: add serverside block1 support
2018-04-16 12:49:06 +02:00
4897222e7e
nanocoap: add server-side block1 support
2018-04-16 12:31:56 +02:00
Hauke Petersen
2e6ccfa13f
net/rdcli_simple_standalone: fix error handling
2018-04-12 14:00:32 +02:00
Hauke Petersen
bd25cf5902
net/rdcli_simple: parse RD address from string
...
this makes the configuration of the RD server much simpler, as it
does not require the user to 'binary-code' the RD server's address
anymore.
2018-04-12 14:00:32 +02:00
Hauke Petersen
faab006631
net/rdcli_simple: improved doc and error handling
2018-04-12 13:48:09 +02:00
012c016b74
Merge pull request #8772 from kaspar030/rework_nanocoap_option_handling
...
net/nanocoap: rework option handling
2018-04-10 21:11:18 +02:00
dee793d29f
nanocoap: rework option handling
2018-04-10 20:58:06 +02:00
Hauke Petersen
7dd897c6d7
net/rdcli_common: fix EP name generation
2018-04-10 10:55:03 +02:00
Hauke Petersen
108284670c
net: added RD client for simplified registration
2018-04-09 10:37:10 +02:00
Hauke Petersen
f12d85d032
net/rdcli: added common rdcli module
2018-04-09 10:37:10 +02:00
Martine Lenders
3c93ebc86e
Merge pull request #7699 from nmeum/gcoap-method-not-allowed
...
gcoap: return Method Not Allowed if appropriate
2018-04-06 15:35:05 +02:00
Ken Bannister
3da9145018
net/gcoap: Internalize definition of state struct
2018-03-31 06:46:05 -04:00
Hauke Petersen
a63f92a7a6
net/gcoap: allow to not define a response handler
2018-03-19 11:56:58 +01:00
Ken Bannister
d7004ebcd8
Merge pull request #8513 from kaspar030/nanocoap_add_context_to_resources
...
nanocoap: add context pointer to resources
2018-02-22 18:30:43 +00:00
Ken Bannister
81ecd37a5e
net/gcoap: fix sock send return type
2018-02-17 06:20:38 -05:00
aa52f5334b
sys/net/gcoap: adapt to resource context ptr
2018-02-02 19:01:58 +01:00
0729259390
nanocoap: add context ptr to coap_resource_t
2018-02-02 18:54:29 +01:00
3f990480d1
Merge pull request #7162 from kb2ma/nanocoap/msgid_byte_order
...
nanocoap: fix byte order of request message ID, and add test application
2018-01-17 22:59:07 +01:00
Sebastian Meiling
50f3d6a427
Merge pull request #7337 from kb2ma/gcoap/confirm_piggy_client
...
net/gcoap: Confirmable request with piggybacked ACK response
2018-01-16 20:35:32 +01:00
Sebastian Meiling
0d1f40393f
Merge pull request #8362 from beduino-project/gcoap-check-for-ndebug
...
gcoap: check if NDEBUG is defined
2018-01-16 13:18:41 +01:00
Ken Bannister
4223de6b8b
net/gcoap: automate retries for confirm timeout
2018-01-16 06:37:29 -05:00
Sören Tempel
89edc437d5
gcoap: remove the #ifdef DEVELHELP
...
To make sure the cf variable doesn't trigger an `unsed variable` warning
when compile with `-DNDEBUG`.
2018-01-16 11:06:28 +01:00
Ken Bannister
d5e4da74bf
net/gcoap: improve validation of incoming message
2018-01-15 23:21:05 -05:00
Ken Bannister
4062b1f660
net/gcoap: populate confirm request attributes
...
Also, create resend_bufs array to store PDU for resend.
2018-01-15 23:21:05 -05:00
af991deeb2
sys: net: gcoap: DEBUG fixes
2018-01-15 14:37:04 +01:00
Ken Bannister
c9b6e990f7
net/nanocoap: message ID received in host order
2018-01-12 05:58:52 -05:00
Sören Tempel
35fea645c1
gcoap: return Method Not Allowed if appropriate
2017-12-26 18:17:45 +01:00
Ken Bannister
062bc15f00
net/gcoap: Track remote endpoint for all requests
2017-12-18 06:24:58 -05:00
3367840fa2
sys/net/nanocoap: use submodules
2017-12-01 12:55:45 +01:00
84bc849014
sys: net: nanocoap: ignore Uri-Host option
2017-12-01 12:55:45 +01:00
16bdbe5d32
sys: net: add nanocoap
2017-12-01 12:55:44 +01:00
Ken Bannister
37f272bf2c
net/gcoap: Refactor lookup for outstanding request
...
Add support for a confirmable request and standardize token match.
2017-11-10 06:54:38 -05:00
Ken Bannister
70be8cd5bb
net/gcoap: Update copyright for 2017
2017-11-10 06:54:38 -05:00
Ken Bannister
0e93566814
net/gcoap: Update request memo struct for a confirmable request
2017-11-10 06:54:38 -05:00
e7df513567
gcoap: fix resource separator inserting
2017-09-20 11:33:15 +02:00
Hauke Petersen
8908cebe42
net/gcoap: renamed source folder s/coap/gocap/
2017-08-08 16:39:48 +02:00
Hauke Petersen
8f577eca4c
net/gcoap: add Uri-Query handling for requests
2017-08-08 16:22:05 +02:00
Hauke Petersen
32ab8cf724
net/gcoap: expose creation of resource list to API
...
Creating the resource list is useful outside the /.well-known/core
handler, e.g. for the registration to resource directories.
2017-08-08 16:00:15 +02:00
Hauke Petersen
2290a9f69b
net/gcoap: added remote sock ep to resp handler cb
...
When receiving a response to a request send our earlier, it is in
some cases essential, to know something about who send the reponse.
This is needed for example when sending requests to multicast
addresses to be able to react to different incoming responses.
2017-07-31 11:11:06 +02:00
Hauke Petersen
36322e95b7
net/gcoap: collection of simple fixes ( #7413 )
...
* net/gcoap: fixed request state when getting a resp
The request state should be set to GCOAP_MEMO_RESP before calling
the response handler in case we actually go a response...
* net/gcoap: make test for 0.00 code more efficient
This optimization saves the computation of the code and compares
the raw field to `0`.
2017-07-28 14:15:17 +02:00
Hauke Petersen
91ff52a897
net/emcute: use size_t for length comparisons
2017-06-28 22:52:34 +02:00
Hauke Petersen
ae367e5537
net/emcute: check value of length field before use
2017-06-28 22:51:39 +02:00
Ken Bannister
7c0374b975
Reject incoming empty message type as not handled yet
2017-06-22 12:57:34 -04:00
Ken Bannister
19ba56b96f
net/gcoap: Add server piggybacked ACK response to a CON request
2017-06-21 22:47:08 -04:00
Ken Bannister
aa2f97c80f
net/gcoap: Protect update to open requests with mutex.
2017-06-18 06:29:43 -04:00
Ken Bannister
24b21dbfbc
net/gcoap: Protect message ID state with atomic updates.
...
Also changed semantics for storage of message ID, from last ID to next ID.
This change provides idiomatic use of the return value of the atomic
function, without other side effects on gcoap.
2017-06-18 06:16:15 -04:00
Cenk Gündoğan
935292ce44
gcoap: make stack size configurable
2017-06-07 08:20:35 +02:00
Hauke Petersen
7ba22cfbf8
net/gcoap: added some additional debug output
2017-06-01 11:13:15 +02:00
Hauke Petersen
bb90e293a2
net/gcoap: make input parameters const
2017-05-26 16:34:40 +02:00
Ken Bannister
9d37be2729
gcoap: Add server-side Observe registration and notifications.
2017-05-23 17:55:04 -04:00
Hauke Petersen
ba5635889c
net/gcoap: make gcoap_op_state return count directly
2017-05-22 13:50:59 +02:00
Hauke Petersen
cd4109100f
net/gcoap: fixed coding style issue
2017-05-22 13:47:36 +02:00
Ken Bannister
7c19ad65e2
gcoap: Fix compilation error when client token length macro set to 0.
2017-04-24 22:21:53 -04:00
cfd10c394a
adapt to changed byteorder.h
2017-04-13 11:35:35 +02:00
Martine Lenders
33991832d1
Merge pull request #6694 from kaspar030/add_sock_dns_client
...
sys: net: add sock dns client
2017-03-29 10:14:38 +02:00
7af03ab624
sys: net: introduce simple sock DNS client
2017-03-28 20:49:53 +02:00
Martine Lenders
c513eb1027
sntp: fix for new xtimer API and some bugs
2017-03-06 13:38:25 +01:00
Hauke Petersen
bb71986ecf
net: added emCute - introducing MQTT-SN support
2017-02-28 16:58:29 +01:00
Ken Bannister
af1eca907f
gcoap: Rebase messaging on sock API
2017-01-20 22:00:25 -05:00