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

sys/include/net/sock: move config to separate header

This commit is contained in:
Benjamin Valentin 2024-05-22 13:28:50 +02:00
parent d26a95193a
commit 75641fb4b1
2 changed files with 71 additions and 43 deletions

View File

@ -0,0 +1,70 @@
/*
* Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
* 2018 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 net_sock_util_conf SOCK utility functions compile configurations
* @ingroup net_sock_conf
* @{
*
* @brief sock utility configuration values
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef NET_SOCK_CONFIG_H
#define NET_SOCK_CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief maximum length of the scheme part for sock_urlsplit.
*
* Ensures a hard limit on the string iterator
* */
#ifndef CONFIG_SOCK_SCHEME_MAXLEN
#define CONFIG_SOCK_SCHEME_MAXLEN (16U)
#endif
/**
* @brief maximum length of host:port part for sock_urlsplit()
*/
#ifndef CONFIG_SOCK_HOSTPORT_MAXLEN
#define CONFIG_SOCK_HOSTPORT_MAXLEN (64U)
#endif
/**
* @brief maximum length path for sock_urlsplit()
*/
#ifndef CONFIG_SOCK_URLPATH_MAXLEN
#define CONFIG_SOCK_URLPATH_MAXLEN (64U)
#endif
/**
* @brief Timeout in milliseconds for sock_dtls_establish_session()
*/
#ifndef CONFIG_SOCK_DTLS_TIMEOUT_MS
#define CONFIG_SOCK_DTLS_TIMEOUT_MS (1000U)
#endif
/**
* @brief Number of DTLS handshake retries for sock_dtls_establish_session()
*/
#ifndef CONFIG_SOCK_DTLS_RETRIES
#define CONFIG_SOCK_DTLS_RETRIES (2)
#endif
#ifdef __cplusplus
}
#endif
#endif /* NET_SOCK_CONFIG_H */
/** @} */

View File

@ -30,6 +30,7 @@
#include "net/sock/udp.h"
#include "net/sock/tcp.h"
#include "net/sock/config.h"
#ifdef MODULE_SOCK_DTLS
#include "net/credman.h"
@ -296,49 +297,6 @@ int sock_dtls_establish_session(sock_udp_t *sock_udp, sock_dtls_t *sock_dtls,
void *work_buf, size_t work_buf_len);
#endif
/**
* @defgroup net_sock_util_conf SOCK utility functions compile configurations
* @ingroup net_sock_conf
* @{
*/
/**
* @brief maximum length of the scheme part for sock_urlsplit.
*
* Ensures a hard limit on the string iterator
* */
#ifndef CONFIG_SOCK_SCHEME_MAXLEN
#define CONFIG_SOCK_SCHEME_MAXLEN (16U)
#endif
/**
* @brief maximum length of host:port part for sock_urlsplit()
*/
#ifndef CONFIG_SOCK_HOSTPORT_MAXLEN
#define CONFIG_SOCK_HOSTPORT_MAXLEN (64U)
#endif
/**
* @brief maximum length path for sock_urlsplit()
*/
#ifndef CONFIG_SOCK_URLPATH_MAXLEN
#define CONFIG_SOCK_URLPATH_MAXLEN (64U)
#endif
/** @} */
/**
* @brief Timeout in milliseconds for sock_dtls_establish_session()
*/
#ifndef CONFIG_SOCK_DTLS_TIMEOUT_MS
#define CONFIG_SOCK_DTLS_TIMEOUT_MS (1000U)
#endif
/**
* @brief Number of DTLS handshake retries for sock_dtls_establish_session()
*/
#ifndef CONFIG_SOCK_DTLS_RETRIES
#define CONFIG_SOCK_DTLS_RETRIES (2)
#endif
#ifdef __cplusplus
}
#endif