llarp::service
Classes
Types
| Name | |
|---|---|
| enum class uint64_t | AuthResultCode { eAuthAccepted = 0, eAuthRejected = 1, eAuthFailed = 2, eAuthRateLimit = 3, eAuthPaymentRequired = 4} authentication status code |
| enum class | AuthType { eAuthTypeNone, eAuthTypeWhitelist, eAuthTypeLMQ, eAuthTypeFile} what kind of backend to use for auth |
| enum class | AuthFileType { eAuthFilePlain, eAuthFileHashes} how to interpret an file for auth |
| enum class uint64_t | ProtocolType { Control = 0UL, TrafficV4 = 1UL, TrafficV6 = 2UL, Exit = 3UL, Auth = 4UL, QUIC = 5UL} |
| using std::shared_ptr< Endpoint > | Endpoint_ptr |
| using std::shared_ptr< routing::PathTransferMessage > | Msg_ptr |
| using std::pair< Msg_ptr, path::Path_ptr > | SendEvent_t |
| using thread::Queue< SendEvent_t > | SendMessageQueue_t |
| using std::deque< PendingBuffer > | PendingBufferQueue |
| using std::unordered_map< Address, PendingBufferQueue > | PendingTraffic |
| using std::shared_ptr< ProtocolMessage > | ProtocolMessagePtr |
| using thread::Queue< ProtocolMessagePtr > | RecvPacketQueue_t |
| using std::unordered_map< RouterID, RouterLookupJob > | PendingRouters |
| using std::unordered_map< uint64_t, std::unique_ptr< IServiceLookup > > | PendingLookups |
| using std::unordered_multimap< Address, std::shared_ptr< OutboundContext > > | Sessions |
| using std::unordered_map< RouterID, std::shared_ptr< exit::BaseSession > > | SNodeSessions |
| using std::unordered_map< ConvoTag, Session > | ConvoMap |
| using std::unordered_set< Address > | OutboundSessions_t set of outbound addresses to maintain to |
| using std::function< void(Address, OutboundContext *)> | PathEnsureHook |
| using std::unordered_map< std::string, std::pair< Address, llarp_time_t > > | LNSNameCache |
| using std::function< void(const std::vector< EncryptedIntroSet > &)> | EncryptedIntroSetLookupHandler |
| using std::function< void(const std::vector< IntroSet > &)> | IntroSetLookupHandler |
| using AlignedBuffer< 16 > | VanityNonce hidden service address |
Functions
| Name | |
|---|---|
| std::optional< std::variant< Address, RouterID > > | ParseAddress(std::string_view lokinet_addr) |
| uint64_t | AuthResultCodeAsInt(AuthResultCode code) turn an auth result code into an int |
| std::optional< AuthResultCode > | AuthResultCodeFromInt(uint64_t code) may turn an int into an auth result code |
| std::optional< AuthResultCode > | ParseAuthResultCode(std::string data) maybe get auth result from string |
| AuthType | ParseAuthType(std::string arg) get an auth type from a string throws std::invalid_argument if arg is invalid |
| AuthFileType | ParseAuthFileType(std::string arg) get an auth file type from a string throws std::invalid_argument if arg is invalid |
| std::shared_ptr< IAuthPolicy > | MakeFileAuthPolicy(AbstractRouter * , std::set< fs::path > files, AuthFileType fileType) make an IAuthPolicy that reads out of a static file |
| template <typename Endpoint_t > path::Path::UniqueEndpointSet_t |
GetManyPathsWithUniqueEndpoints(Endpoint_t * ep, size_t N, std::optional< dht::Key_t > maybeLocation =std::nullopt, size_t tries =10) |
| bool | operator==(const Identity & lhs, const Identity & rhs) |
| bool | operator<(const IntroSet & lhs, const IntroSet & rhs) |
| bool | operator==(const IntroSet & lhs, const IntroSet & rhs) |
| bool | operator!=(const IntroSet & lhs, const IntroSet & rhs) |
| bool | operator<(const EncryptedIntroSet & lhs, const EncryptedIntroSet & rhs) |
| bool | operator==(const EncryptedIntroSet & lhs, const EncryptedIntroSet & rhs) |
| bool | operator!=(const EncryptedIntroSet & lhs, const EncryptedIntroSet & rhs) |
| bool | NameIsValid(std::string_view name) check if an lns name complies with the registration rules |
| constexpr std::string_view | ToString(ProtocolType t) |
Attributes
| Name | |
|---|---|
| constexpr auto | IntrosetPublishInterval minimum interval for publishing introsets |
| constexpr auto | IntrosetPublishRetryCooldown how agressively should we retry publishing introset on failure |
| constexpr auto | IntrosetLookupCooldown how aggressively should we retry looking up introsets |
| constexpr size_t | MIN_ENDPOINTS_FOR_LNS_LOOKUP number of unique snodes we want to talk to do to ons lookups |
| constexpr auto | IntrosetLookupGraceInterval interval for which we will add to lookup timeout interval |
| constexpr std::size_t | MAX_INTROSET_SIZE |
| constexpr llarp_time_t | MAX_INTROSET_TIME_DELTA |
| constexpr size_t | MaxConcurrentLookups |
| constexpr std::size_t | MAX_PROTOCOL_MESSAGE_SIZE |
| constexpr auto | SessionLifetime |
Types Documentation
enum AuthResultCode
| Enumerator | Value | Description |
|---|---|---|
| eAuthAccepted | 0 | explicitly accepted |
| eAuthRejected | 1 | explicitly rejected |
| eAuthFailed | 2 | attempt failed |
| eAuthRateLimit | 3 | attempt rate limited |
| eAuthPaymentRequired | 4 | need mo munny |
authentication status code
enum AuthType
| Enumerator | Value | Description |
|---|---|---|
| eAuthTypeNone | no authentication | |
| eAuthTypeWhitelist | manual whitelist | |
| eAuthTypeLMQ | LMQ server. | |
| eAuthTypeFile | static file |
what kind of backend to use for auth
enum AuthFileType
| Enumerator | Value | Description |
|---|---|---|
| eAuthFilePlain | ||
| eAuthFileHashes |
how to interpret an file for auth
enum ProtocolType
| Enumerator | Value | Description |
|---|---|---|
| Control | 0UL | |
| TrafficV4 | 1UL | |
| TrafficV6 | 2UL | |
| Exit | 3UL | |
| Auth | 4UL | |
| QUIC | 5UL |
using Endpoint_ptr
using llarp::service::Endpoint_ptr = typedef std::shared_ptr<Endpoint>;
using Msg_ptr
using llarp::service::Msg_ptr = typedef std::shared_ptr<routing::PathTransferMessage>;
using SendEvent_t
using llarp::service::SendEvent_t = typedef std::pair<Msg_ptr, path::Path_ptr>;
using SendMessageQueue_t
using llarp::service::SendMessageQueue_t = typedef thread::Queue<SendEvent_t>;
using PendingBufferQueue
using llarp::service::PendingBufferQueue = typedef std::deque<PendingBuffer>;
using PendingTraffic
using llarp::service::PendingTraffic = typedef std::unordered_map<Address, PendingBufferQueue>;
using ProtocolMessagePtr
using llarp::service::ProtocolMessagePtr = typedef std::shared_ptr<ProtocolMessage>;
using RecvPacketQueue_t
using llarp::service::RecvPacketQueue_t = typedef thread::Queue<ProtocolMessagePtr>;
using PendingRouters
using llarp::service::PendingRouters = typedef std::unordered_map<RouterID, RouterLookupJob>;
using PendingLookups
using llarp::service::PendingLookups = typedef std::unordered_map<uint64_t, std::unique_ptr<IServiceLookup> >;
using Sessions
using llarp::service::Sessions = typedef std::unordered_multimap<Address, std::shared_ptr<OutboundContext> >;
using SNodeSessions
using llarp::service::SNodeSessions = typedef std::unordered_map<RouterID, std::shared_ptr<exit::BaseSession> >;
using ConvoMap
using llarp::service::ConvoMap = typedef std::unordered_map<ConvoTag, Session>;
using OutboundSessions_t
using llarp::service::OutboundSessions_t = typedef std::unordered_set<Address>;
set of outbound addresses to maintain to
using PathEnsureHook
using llarp::service::PathEnsureHook = typedef std::function<void(Address, OutboundContext*)>;
using LNSNameCache
using llarp::service::LNSNameCache = typedef std::unordered_map<std::string, std::pair<Address, llarp_time_t> >;
using EncryptedIntroSetLookupHandler
using llarp::service::EncryptedIntroSetLookupHandler = typedef std::function<void(const std::vector<EncryptedIntroSet>&)>;
using IntroSetLookupHandler
using llarp::service::IntroSetLookupHandler = typedef std::function<void(const std::vector<IntroSet>&)>;
using VanityNonce
using llarp::service::VanityNonce = typedef AlignedBuffer<16>;
hidden service address
Functions Documentation
function ParseAddress
std::optional< std::variant< Address, RouterID > > ParseAddress(
std::string_view lokinet_addr
)
function AuthResultCodeAsInt
uint64_t AuthResultCodeAsInt(
AuthResultCode code
)
turn an auth result code into an int
function AuthResultCodeFromInt
std::optional< AuthResultCode > AuthResultCodeFromInt(
uint64_t code
)
may turn an int into an auth result code
function ParseAuthResultCode
std::optional< AuthResultCode > ParseAuthResultCode(
std::string data
)
maybe get auth result from string
function ParseAuthType
AuthType ParseAuthType(
std::string arg
)
get an auth type from a string throws std::invalid_argument if arg is invalid
function ParseAuthFileType
AuthFileType ParseAuthFileType(
std::string arg
)
get an auth file type from a string throws std::invalid_argument if arg is invalid
function MakeFileAuthPolicy
std::shared_ptr< IAuthPolicy > MakeFileAuthPolicy(
AbstractRouter * ,
std::set< fs::path > files,
AuthFileType fileType
)
make an IAuthPolicy that reads out of a static file
function GetManyPathsWithUniqueEndpoints
template <typename Endpoint_t >
static path::Path::UniqueEndpointSet_t GetManyPathsWithUniqueEndpoints(
Endpoint_t * ep,
size_t N,
std::optional< dht::Key_t > maybeLocation =std::nullopt,
size_t tries =10
)
function operator==
inline bool operator==(
const Identity & lhs,
const Identity & rhs
)
function operator<
inline bool operator<(
const IntroSet & lhs,
const IntroSet & rhs
)
function operator==
inline bool operator==(
const IntroSet & lhs,
const IntroSet & rhs
)
function operator!=
inline bool operator!=(
const IntroSet & lhs,
const IntroSet & rhs
)
function operator<
inline bool operator<(
const EncryptedIntroSet & lhs,
const EncryptedIntroSet & rhs
)
function operator==
inline bool operator==(
const EncryptedIntroSet & lhs,
const EncryptedIntroSet & rhs
)
function operator!=
inline bool operator!=(
const EncryptedIntroSet & lhs,
const EncryptedIntroSet & rhs
)
function NameIsValid
bool NameIsValid(
std::string_view name
)
check if an lns name complies with the registration rules
function ToString
constexpr std::string_view ToString(
ProtocolType t
)
Attributes Documentation
variable IntrosetPublishInterval
constexpr auto IntrosetPublishInterval = path::intro_path_spread / 2;
minimum interval for publishing introsets
variable IntrosetPublishRetryCooldown
constexpr auto IntrosetPublishRetryCooldown = 1s;
how agressively should we retry publishing introset on failure
variable IntrosetLookupCooldown
constexpr auto IntrosetLookupCooldown = 250ms;
how aggressively should we retry looking up introsets
variable MIN_ENDPOINTS_FOR_LNS_LOOKUP
constexpr size_t MIN_ENDPOINTS_FOR_LNS_LOOKUP = 2;
number of unique snodes we want to talk to do to ons lookups
variable IntrosetLookupGraceInterval
constexpr auto IntrosetLookupGraceInterval = 20s;
interval for which we will add to lookup timeout interval
variable MAX_INTROSET_SIZE
constexpr std::size_t MAX_INTROSET_SIZE = 4096;
variable MAX_INTROSET_TIME_DELTA
constexpr llarp_time_t MAX_INTROSET_TIME_DELTA = 10s;
variable MaxConcurrentLookups
constexpr size_t MaxConcurrentLookups = size_t(16);
variable MAX_PROTOCOL_MESSAGE_SIZE
constexpr std::size_t MAX_PROTOCOL_MESSAGE_SIZE = 2048 * 2;
variable SessionLifetime
static constexpr auto SessionLifetime = path::default_lifetime * 2;
Updated on 2026-01-10 at 22:49:45 +0000