lokinet/llarp/constants/path.hpp

39 lines
1.2 KiB
C++
Raw Normal View History

2019-06-17 23:19:39 +00:00
#ifndef LLARP_CONSTANTS_PATH_HPP
#define LLARP_CONSTANTS_PATH_HPP
2020-02-25 20:52:59 +00:00
#include <chrono>
2019-06-17 23:19:39 +00:00
#include <cstddef>
#include <util/types.hpp>
2020-02-24 19:40:45 +00:00
#include <util/time.hpp>
2019-06-17 23:19:39 +00:00
namespace llarp
{
namespace path
{
/// maximum path length
constexpr std::size_t max_len = 8;
/// default path length
constexpr std::size_t default_len = 4;
/// pad messages to the nearest this many bytes
constexpr std::size_t pad_size = 128;
/// default path lifetime in ms
2020-02-25 20:52:59 +00:00
static constexpr std::chrono::milliseconds default_lifetime = 20min;
/// minimum into lifetime we will advertise
static constexpr std::chrono::milliseconds min_intro_lifetime =
default_lifetime / 2;
/// spacing frequency at which we try to build paths for introductions
static constexpr std::chrono::milliseconds intro_path_spread =
default_lifetime / 4;
2019-06-17 23:19:39 +00:00
/// after this many ms a path build times out
2020-02-24 19:40:45 +00:00
static constexpr auto build_timeout = 30s;
2019-06-17 23:19:39 +00:00
/// measure latency every this interval ms
2020-02-24 19:40:45 +00:00
static constexpr auto latency_interval = 5s;
2019-06-17 23:19:39 +00:00
/// if a path is inactive for this amount of time it's dead
2020-02-24 19:40:45 +00:00
static constexpr auto alive_timeout = 30s;
2019-06-17 23:19:39 +00:00
} // namespace path
} // namespace llarp
#endif