Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libschc: initial import as package #18515

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
/drivers/include/periph/ptp.h @maribu

/pkg/cryptoauthlib/ @Einhornhool @PeterKietzmann
/pkg/libschc/ @bartmoons @miri64
/pkg/lua/ @jcarrano
/pkg/lwip/ @miri64
/pkg/gecko_sdk/ @basilfx
Expand Down Expand Up @@ -145,6 +146,7 @@
/tests/driver_dht/ @wosym
/tests/gnrc* @miri64
/tests/lwip* @miri64
/tests/pkg_libschc/ @miri64
/tests/slip/ @miri64
/tests/unittests @miri64
/tests/*/tests/*.py @miri64
Expand Down
1 change: 1 addition & 0 deletions pkg/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ rsource "libb2/Kconfig"
rsource "libcose/Kconfig"
rsource "libfixmath/Kconfig"
rsource "libhydrogen/Kconfig"
rsource "libschc/Kconfig"
rsource "littlefs2/Kconfig"
rsource "lorabasics/Kconfig"
rsource "lora-serialization/Kconfig"
Expand Down
39 changes: 39 additions & 0 deletions pkg/libschc/Kconfig
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
9 changes: 9 additions & 0 deletions pkg/libschc/Makefile
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
9 changes: 9 additions & 0 deletions pkg/libschc/Makefile.dep
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
12 changes: 12 additions & 0 deletions pkg/libschc/Makefile.include
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
11 changes: 11 additions & 0 deletions pkg/libschc/doc.txt
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
*/
72 changes: 72 additions & 0 deletions pkg/libschc/include/libschc/config.h
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 */
/** @} */
37 changes: 37 additions & 0 deletions pkg/libschc/include/rules/rule_config.h
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 */
Loading