2017-07-25 15:12:39 +02:00
|
|
|
/*
|
2018-04-10 14:43:35 +02:00
|
|
|
* Copyright (C) 2017-2018 Freie Universität Berlin
|
2017-07-25 15:12:39 +02:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2021-09-04 23:52:47 +02:00
|
|
|
* @defgroup net_cord_config CoRE RD Configuration
|
2018-10-15 10:19:08 +02:00
|
|
|
* @ingroup net_cord
|
2021-09-05 10:23:06 +02:00
|
|
|
* @ingroup config
|
2018-10-15 10:19:08 +02:00
|
|
|
* @brief Configuration options for CoRE RD endpoints and lookup clients
|
2017-07-25 15:12:39 +02:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2018-10-15 10:19:08 +02:00
|
|
|
* @brief (Default) configuration values for CoRE RD endpoints and lookup
|
|
|
|
* clients
|
2017-07-25 15:12:39 +02:00
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
2018-10-15 10:19:08 +02:00
|
|
|
#ifndef NET_CORD_CONFIG_H
|
|
|
|
#define NET_CORD_CONFIG_H
|
2017-07-25 15:12:39 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-07-24 17:42:26 +02:00
|
|
|
/**
|
|
|
|
* @brief Default lifetime in seconds (the default is 1 day)
|
|
|
|
*/
|
2020-06-17 16:44:36 +02:00
|
|
|
#ifndef CONFIG_CORD_LT
|
|
|
|
#define CONFIG_CORD_LT (86400UL)
|
2017-07-24 17:42:26 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2020-09-01 11:25:09 +02:00
|
|
|
* @brief Default client update interval (default is 3/4 the lifetime)
|
2017-07-24 17:42:26 +02:00
|
|
|
*/
|
2020-09-01 11:25:09 +02:00
|
|
|
#ifndef CONFIG_CORD_UPDATE_INTERVAL
|
|
|
|
#define CONFIG_CORD_UPDATE_INTERVAL ((CONFIG_CORD_LT / 4) * 3)
|
2017-07-24 17:42:26 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2020-09-01 11:25:09 +02:00
|
|
|
* @brief Delay until the RD client starts to try registering (in seconds)
|
2017-07-24 17:42:26 +02:00
|
|
|
*/
|
2020-09-01 11:25:09 +02:00
|
|
|
#ifndef CORD_STARTUP_DELAY
|
|
|
|
#define CORD_STARTUP_DELAY (3U)
|
2017-07-24 17:42:26 +02:00
|
|
|
#endif
|
|
|
|
|
2017-07-25 15:12:39 +02:00
|
|
|
/**
|
|
|
|
* @name Endpoint ID definition
|
|
|
|
*
|
|
|
|
* Per default, the endpoint ID (ep) is generated by concatenation of a user
|
2020-09-01 11:25:09 +02:00
|
|
|
* defined prefix @ref CORD_EP_PREFIX and a locally unique ID (luid) encoded in
|
2017-07-25 15:12:39 +02:00
|
|
|
* hexadecimal formatting with the given length of characters
|
2020-09-01 11:25:09 +02:00
|
|
|
* @ref CORD_EP_SUFFIX_LEN.
|
2017-07-25 15:12:39 +02:00
|
|
|
*
|
|
|
|
* Alternatively, the endpoint ID value can be defined at compile time by
|
2020-09-01 11:25:09 +02:00
|
|
|
* assigning a string value to the @ref CONFIG_CORD_EP macro.
|
2017-07-25 15:12:39 +02:00
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
2020-09-01 11:07:07 +02:00
|
|
|
#ifndef CONFIG_CORD_EP
|
2020-09-01 11:25:09 +02:00
|
|
|
#ifdef DOXYGEN
|
|
|
|
/**
|
|
|
|
* @brief Endpoint ID definition
|
|
|
|
*/
|
|
|
|
#define CONFIG_CORD_EP "MyNewEpName" //defined for doxygen documentation only
|
|
|
|
#endif
|
|
|
|
|
2017-07-25 15:12:39 +02:00
|
|
|
/**
|
|
|
|
* @brief Number of generated hexadecimal characters added to the ep
|
2018-04-10 11:36:28 +02:00
|
|
|
*
|
|
|
|
* @note Must be an even number
|
2017-07-25 15:12:39 +02:00
|
|
|
*/
|
2018-10-15 10:19:08 +02:00
|
|
|
#define CORD_EP_SUFFIX_LEN (16)
|
2017-07-25 15:12:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Default static prefix used for the generated ep
|
|
|
|
*/
|
2018-10-15 10:19:08 +02:00
|
|
|
#define CORD_EP_PREFIX "RIOT-"
|
2017-07-25 15:12:39 +02:00
|
|
|
#endif
|
|
|
|
/** @} */
|
|
|
|
|
2021-03-01 12:21:45 +01:00
|
|
|
/**
|
|
|
|
* @brief Extra query parameters added during registration
|
|
|
|
*
|
2021-09-05 10:36:40 +02:00
|
|
|
* Must be suitable for constructing a static array out of them. Each item of
|
|
|
|
* the array is turned as a Uri-Query option. The [IANA RD Parameters subregistry]
|
|
|
|
* contains usable keys and their descriptions in entries that have an "R" in
|
|
|
|
* their "Use" column. Other keys can be used with known RD implementations.
|
|
|
|
*
|
|
|
|
* The `ep` and `lt` parameters are *not* to be set through this mechanism, but
|
|
|
|
* through @ref CONFIG_CORD_EP and @ref CONFIG_CORD_LT, respectively.
|
|
|
|
*
|
|
|
|
* [IANA RD Parameters subregistry]: https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#rd-parameters
|
2021-03-01 12:21:45 +01:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
* CFLAGS += '-DCONFIG_CORD_EXTRAARGS="proxy=on","et=tag:riot-os.org,2020:board"'
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
#ifdef DOXYGEN
|
|
|
|
#define CONFIG_CORD_EXTRAARGS
|
|
|
|
#endif
|
|
|
|
|
2017-07-25 15:12:39 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-10-15 10:19:08 +02:00
|
|
|
#endif /* NET_CORD_CONFIG_H */
|
2017-07-25 15:12:39 +02:00
|
|
|
/** @} */
|