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

sys: new sock submodule for DTLS #11909

Merged
merged 2 commits into from Aug 27, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile.dep
Expand Up @@ -888,6 +888,16 @@ ifneq (,$(filter irq_handler,$(USEMODULE)))
USEMODULE += event
endif

ifneq (,$(filter tinydtls_sock_dtls, $(USEMODULE)))
USEPKG += tinydtls
USEMODULE += sock_dtls
endif

ifneq (,$(filter sock_dtls, $(USEMODULE)))
USEMODULE += credman
USEMODULE += sock_udp
pokgak marked this conversation as resolved.
Show resolved Hide resolved
endif

# Enable periph_gpio when periph_gpio_irq is enabled
ifneq (,$(filter periph_gpio_irq,$(USEMODULE)))
FEATURES_REQUIRED += periph_gpio
Expand Down
1 change: 1 addition & 0 deletions makefiles/pseudomodules.inc.mk
Expand Up @@ -78,6 +78,7 @@ PSEUDOMODULES += sock_udp
PSEUDOMODULES += stdin
PSEUDOMODULES += stdio_ethos
PSEUDOMODULES += stdio_uart_rx
PSEUDOMODULES += sock_dtls

# print ascii representation in function od_hex_dump()
PSEUDOMODULES += od_string
Expand Down
2 changes: 1 addition & 1 deletion pkg/tinydtls/doc.txt
@@ -1,7 +1,7 @@
/**
* @defgroup pkg_tinydtls TinyDTLS for RIOT
* @ingroup pkg
* @ingroup net
* @ingroup net net_dtls
miri64 marked this conversation as resolved.
Show resolved Hide resolved
* @brief Provides the Eclipse TinyDTLS to RIOT
* @see https://projects.eclipse.org/projects/iot.tinydtls
*/
8 changes: 8 additions & 0 deletions sys/auto_init/auto_init.c
Expand Up @@ -88,6 +88,10 @@
#include "net/asymcute.h"
#endif

#ifdef MODULE_SOCK_DTLS
#include "net/sock/dtls.h"
#endif

#define ENABLE_DEBUG (0)
#include "debug.h"

Expand Down Expand Up @@ -181,6 +185,10 @@ void auto_init(void)
extern void auto_init_loramac(void);
auto_init_loramac();
#endif
#ifdef MODULE_SOCK_DTLS
DEBUG("Auto init sock_dtls\n");
sock_dtls_init();
#endif

/* initialize USB devices */
#ifdef MODULE_AUTO_INIT_USBUS
Expand Down
2 changes: 1 addition & 1 deletion sys/include/net/credman.h
Expand Up @@ -8,7 +8,7 @@

/**
* @defgroup net_credman (D)TLS Credential Manager
* @ingroup net
* @ingroup net net_dtls
* @brief Credentials management module for (D)TLS
*
* @{
Expand Down
47 changes: 47 additions & 0 deletions sys/include/net/dtls.h
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2019 HAW Hamburg
*
* 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 net_dtls DTLS
* @ingroup net
* @brief DTLS support in RIOT
* @see <a href="https://tools.ietf.org/html/rfc6347">
* RFC 6347
* </a>
*
* There are two ways of using DTLS in RIOT. First is directly using
* the third party libraries available offering DTLS implementation
* with the pkg system. Supported DTLS implementations are:
*
* - @ref pkg_tinydtls "TinyDTLS"
*
* The other way of using DTLS is through the @ref net_sock_dtls
* "DTLS sock API".
*
* For further instructions, please refer to the corresponding page.
*
* @{
*
* @file
* @brief DTLS
*
* @author Aiman Ismail <muhammadaimanbin.ismail@haw-hamburg.de>
*/
#ifndef NET_DTLS_H
#define NET_DTLS_H

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

#endif /* NET_DTLS_H */
/** @} */
1 change: 1 addition & 0 deletions sys/include/net/sock.h
Expand Up @@ -50,6 +50,7 @@
* * @ref sock_ip_t (net/sock/ip.h): raw IP sock
* * @ref sock_tcp_t (net/sock/tcp.h): TCP sock
* * @ref sock_udp_t (net/sock/udp.h): UDP sock
* * @ref sock_dtls_t (net/sock/dtls.h): DTLS sock
*
* Note that there might be no relation between the different `sock` types.
* So casting e.g. `sock_ip_t` to `sock_udp_t` might not be as straight forward,
Expand Down