-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18515: libschc: initial import as package r=miri64 a=miri64 19331: pkg/tinydtls: Adjust defaults r=miri64 a=chrysn ### Contribution description This adjusts two defaults in tinydtls: * Default verbosity is set to warning. At the info level, this module produces way more output (several lines per new connection, and even per message) than is common in RIOT. * If gcoap is used, the buffer size is adjusted to the gcoap buffer size plus overhead. Otherwise, CoAP-over-DTLS works fine until one happens to request larger resources. ### Testing procedure * Run examples/gcoap_dtls * Send a CoAP request from outside, eg. with `aiocoap-client 'coaps://[fe80::3c63:beff:fe85:ca96%tapbr0]/.well-known/core' --credentials testserver.json` (where testserver.json is `{"coaps://[fe80::3c63:beff:fe85:ca96%tapbr0]/*": {"dtls": {"psk": {"ascii": "secretPSK"}, "client-identity": {"ascii": "Client_identity"}}}}`). Before, there are messages shown for every request; now there are none. Modify `examples/gcoap/server.c` as follows: ```patch diff --git a/examples/gcoap/server.c b/examples/gcoap/server.c index bf2315cd01..28e1faac27 100644 --- a/examples/gcoap/server.c +++ b/examples/gcoap/server.c `@@` -68,7 +68,7 `@@` static const coap_resource_t _resources[] = { }; static const char *_link_params[] = { - ";ct=0;rt=\"count\";obs", + ";ct=0;rt=\"count\";obs;looooooooooooooooooooooong-attribute=\"loooooooooooooooooooooooooooooong\"", NULL }; ``` The request passes; without this patch, it is stuck in retransmissions until "Network error: Retransmissions exceeded". ### Issues/PRs references This contributes to making #19289 usable with a minimum level of security. (That module fills up the gcoap buffer to the brim). While the module handles the verbosity as well as it can (occasionally admitting that it lost bytes of output), the previous verbosity produces an infinite stream of stdout data. (But the default should be quiet immaterial of that particular PR). Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de> Co-authored-by: chrysn <chrysn@fsfe.org>
- Loading branch information
Showing
20 changed files
with
2,390 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2022 Freie Universität Berlin | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
# | ||
menuconfig KCONFIG_USEPKG_LIBSCHC | ||
bool "Configure libSCHC" | ||
depends on USEPKG_LIBSCHC | ||
help | ||
Configure libSCHC package via Kconfig. | ||
|
||
if KCONFIG_USEPKG_LIBSCHC | ||
|
||
config LIBSCHC_STATIC_MEMBUF_LEN | ||
int "Static memory allocation buffer length" | ||
default 1024 | ||
help | ||
Length of the static memory buffer for fragment data allocation in reassembly buffer in | ||
bytes. | ||
|
||
config LIBSCHC_MBUF_POOL_SIZE | ||
int "Maximum number of mbuf pool entries" | ||
default 64 | ||
help | ||
Maximum number of entries in the mbuf used for fragment reassembly. | ||
|
||
config LIBSCHC_MAX_RX_CONNS | ||
int "Maximum number of incoming connections" | ||
default 1 | ||
|
||
config LIBSCHC_MAX_MTU_LEN | ||
int "Maximum transfer unit of the underlying technology" | ||
default 242 | ||
|
||
config LIBSCHC_DEBUG | ||
bool "Enable debug output" | ||
|
||
endif # KCONFIG_USEPKG_LIBSCHC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PKG_NAME=libschc | ||
PKG_URL=https://github.com/imec-idlab/libschc | ||
PKG_VERSION=303e9f15bf69da5a68cda76796c76de353f44a88 | ||
PKG_LICENSE=GPL-v3.0 | ||
|
||
include $(RIOTBASE)/pkg/pkg.mk | ||
|
||
all: | ||
+$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR) -f $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ifneq (,$(filter libschc_%,$(USEMODULE))) | ||
USEPKG += libschc | ||
endif | ||
|
||
ifneq (,$(filter libschc,$(USEPKG))) | ||
USEMODULE += libschc_udpv6 | ||
endif | ||
|
||
FEATURES_BLACKLIST += arch_8bit arch_16bit arch_esp8266 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CFLAGS += -Wno-enum-conversion | ||
CFLAGS += -Wno-old-style-definition | ||
CFLAGS += -Wno-sign-compare | ||
CFLAGS += -Wno-strict-prototypes | ||
CFLAGS += -Wno-unused-parameter | ||
CFLAGS += -Wno-unused-variable | ||
|
||
INCLUDES += -I$(RIOTBASE)/pkg/libschc/include | ||
INCLUDES += -I$(PKGDIRBASE)/libschc | ||
|
||
PSEUDOMODULES += libschc_coap | ||
PSEUDOMODULES += libschc_udpv6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* @defgroup pkg_libschc libSCHC | ||
* @ingroup pkg | ||
* @brief Provides support for Static Context Header Compression and Fragmentation (SCHC) | ||
* @see https://github.com/imec-idlab/libschc | ||
* @see [RFC 8724](https://datatracker.ietf.org/doc/html/rfc8724) | ||
* @experimental | ||
* | ||
* libSCHC is a C implementation of Static Context Header Compression and | ||
Fragmentation | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright (C) 2022 Freie Universität Berlin | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @defgroup pkg_libschc_config libSCHC compile-time configuration | ||
* @ingroup pkg_libschc | ||
* @ingroup config | ||
* @brief Compile-time configuration for libSCHC | ||
* @{ | ||
* | ||
* @file | ||
* @brief RIOT-side compile-time configuration for libSCHC | ||
* | ||
* @author Martine S. Lenders <m.lenders@fu-berlin.de> | ||
*/ | ||
#ifndef LIBSCHC_CONFIG_H | ||
#define LIBSCHC_CONFIG_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Static memory buffer length | ||
* | ||
* Length of the static memory buffer for fragmentation in bytes. | ||
*/ | ||
#ifndef CONFIG_LIBSCHC_STATIC_MEMBUF_LEN | ||
#define CONFIG_LIBSCHC_STATIC_MEMBUF_LEN 1024 | ||
#endif | ||
|
||
/** | ||
* @brief Maximum number of mbuf pool entries | ||
* | ||
* Maximum number of entries in the mbuf used for fragment reassembly. | ||
*/ | ||
#ifndef CONFIG_LIBSCHC_MBUF_POOL_SIZE | ||
#define CONFIG_LIBSCHC_MBUF_POOL_SIZE 64 | ||
#endif | ||
|
||
/** | ||
* @brief Maximum number of incoming connections | ||
*/ | ||
#ifndef CONFIG_LIBSCHC_MAX_RX_CONNS | ||
#define CONFIG_LIBSCHC_MAX_RX_CONNS 1 | ||
#endif | ||
|
||
/** | ||
* @brief Maximum transfer unit of the underlying technology | ||
*/ | ||
#ifndef CONFIG_LIBSCHC_MAX_MTU_LEN | ||
#define CONFIG_LIBSCHC_MAX_MTU_LEN 242 | ||
#endif | ||
|
||
/** | ||
* @brief Enable debug output | ||
*/ | ||
#ifndef CONFIG_LIBSCHC_DEBUG | ||
#define CONFIG_LIBSCHC_DEBUG | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* LIBSCHC_CONFIG_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (C) 2018 imec IDLab | ||
* Copyright (C) 2022 Freie Universität Berlin | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* @internal | ||
* @author boortmans <bart.moons@gmail.com> | ||
* @author Martine S. Lenders <m.lenders@fu-berlin.de> | ||
*/ | ||
#ifndef RULES_RULE_CONFIG_H | ||
#define RULES_RULE_CONFIG_H | ||
|
||
#include "rules.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* RULES_RULE_CONFIG_H */ |
Oops, something went wrong.