@ -27,503 +27,503 @@
# ifndef MIN_SHIFT_INTERVAL
# define MIN_SHIFT_INTERVAL 5s
# endif
namespace llarp : : quic
{
class TunnelManager ;
}
namespace llarp
namespace llarp : : service
{
namespace quic
{
class TunnelManager ;
}
struct AsyncKeyExchange ;
namespace service
{
struct AsyncKeyExchange ;
struct Context ;
struct EndpointState ;
struct OutboundContext ;
struct Context ;
struct EndpointState ;
struct OutboundContext ;
/// minimum interval for publishing introsets
inline constexpr auto IntrosetPublishInterval = path : : INTRO_PATH_SPREAD / 2 ;
/// minimum interval for publishing introsets
inline constexpr auto IntrosetPublish Interval = path : : INTRO_PATH_SPREAD / 2 ;
/// how agressively should we retry publishing introset on failure
inline constexpr auto IntrosetPublish RetryCooldown = 1 s ;
/// how agressively should we retry publishing introset on failure
inline constexpr auto Introset PublishRetryCooldown = 1 s;
/// how aggressively should we retry looking up introsets
inline constexpr auto Introset LookupCooldown = 250 m s;
/// how aggressively should we retry looking up introset s
inline constexpr auto IntrosetLookupCooldown = 250 ms ;
/// number of unique snodes we want to talk to do to ons lookup s
inline constexpr size_t MIN_ONS_LOOKUP_ENDPOINTS = 2 ;
/// number of unique snodes we want to talk to do to ons lookups
inline constexpr size_t MIN_ONS_LOOKUP_ENDPOINTS = 2 ;
inline constexpr size_t MAX_ONS_LOOKUP_ENDPOINTS = 7 ;
inline constexpr size_t MAX_ONS_LOOKUP_ENDPOINTS = 7 ;
// TODO: delete this, it is copied from the late llarp/service/handler.hpp
struct RecvDataEvent
{
std : : shared_ptr < path : : Path > fromPath ;
PathID_t pathid ;
std : : shared_ptr < ProtocolMessage > msg ;
} ;
// TODO: delete this, it is copied from the late llarp/service/handler.hpp
struct RecvDataEvent
{
path : : Path_ptr fromPath ;
PathID_t pathid ;
std : : shared_ptr < ProtocolMessage > msg ;
} ;
struct Endpoint : public path : : PathBuilder , public EndpointBase
// public std::enable_shared_from_this<Endpoint>
{
Endpoint ( Router * r , Context * parent ) ;
~ Endpoint ( ) override ;
struct Endpoint : public path : : Builder , public EndpointBase
// public std::enable_shared_from_this<Endpoint>
{
Endpoint ( Router * r , Context * parent ) ;
~ Endpoint ( ) override ;
/// return true if we are ready to recv packets from the void.
// / really should be ReadyForInboundTraffic() but the diff is HUGE and we need to rewrite this
/// component anyways.
bool
is_ready ( ) const ;
/// return true if we are ready to recv packets from the void.
/// really should be ReadyForInboundTraffic() but the diff is HUGE and we need to rewrite this
/// component anyways.
bool
is_ready ( ) const ;
void
QueueRecvData ( RecvDataEvent ev ) ;
void
QueueRecvData ( RecvDataEvent ev ) ;
/// return true if our introset has expired intros
bool
IntrosetIsStale ( ) const ;
/// return true if our introset has expired intros
bool
IntrosetIsStale ( ) const ;
/// construct parameters for notify hooks
virtual std : : unordered_map < std : : string , std : : string >
NotifyParams ( ) const ;
virtual util : : StatusObject
ExtractStatus ( ) const ;
/// construct parameters for notify hooks
virtual std : : unordered_map < std : : string , std : : string >
NotifyParams ( ) const ;
virtual bool
Configure ( const NetworkConfig & conf , const DnsConfig & dnsConf ) ;
virtual util : : StatusObject
ExtractStatus ( ) const ;
void
Tick ( llarp_time_t now ) override ;
virtual bool
Configure ( const NetworkConfig & conf , const DnsConfig & dnsConf ) ;
/// return true if we have a resolvable ip address
virtual bool
HasIfAddr ( ) const
{
return false ;
}
void
Tick ( llarp_time_t now ) override ;
virtual std : : string
GetIfName ( ) const = 0 ;
/// return true if we have a resolvable ip address
virtual bool
HasIfAddr ( ) const
{
return false ;
}
std : : optional < ConvoTag >
GetBestConvoTagFor ( std : : variant < Address , RouterID > addr ) const override ;
virtual std : : string
GetIfName ( ) const = 0 ;
/// get our ifaddr if it is set
virtual huint128_t
GetIfAddr ( ) const
{
return { 0 } ;
}
std : : optional < ConvoTag >
GetBestConvoTagFor ( std : : variant < Address , RouterID > addr ) const override ;
/// get the exit policy for our exit if we have one
/// override me
virtual std : : optional < net : : TrafficPolicy >
GetExitPolicy ( ) const
{
return std : : nullopt ;
} ;
/// get our ifaddr if it is set
virtual huint128_t
GetIfAddr ( ) const
{
return { 0 } ;
}
/// get the ip ranges we claim to own
/// override me
virtual std : : set < IPRange >
GetOwnedRanges ( ) const
{
return { } ;
} ;
/// get the exit policy for our exit if we have one
/// override me
virtual std : : optional < net : : TrafficPolicy >
GetExitPolicy ( ) const
{
return std : : nullopt ;
} ;
virtual void
Thaw ( ) { } ;
/// get the ip ranges we claim to own
/// override me
virtual std : : set < IPRange >
GetOwnedRanges ( ) const
{
return { } ;
} ;
void
ResetInternalState ( ) override ;
virtual void
Thaw ( ) { } ;
/// loop (via router)
/// use when sending any data on a path
const EventLoop_ptr &
Loop ( ) override ;
void
ResetInternalState ( ) override ;
Router *
router ( ) ;
/// loop (via router)
/// use when sending any data on a path
const EventLoop_ptr &
Loop ( ) override ;
virtual bool
LoadKeyFile ( ) ;
Router *
router ( ) ;
virtual bool
Start ( ) ;
std : : string
Name ( ) const override ;
AddressVariant_t
LocalAddress ( ) const override ;
virtual bool
LoadKeyFile ( ) ;
std : : optional < SendStat >
Get StatFo r( AddressVariant_t remote ) const override ;
virtual bool
Start ( ) ;
std : : unordered_set < AddressVariant_t >
AllRemoteEndpoints ( ) const override ;
std : : string
Name ( ) const override ;
bool
ShouldPublishDescriptors ( llarp_time_t now ) const override ;
void
SRVRecordsChanged ( ) override ;
AddressVariant_t
LocalAddress ( ) const override ;
void
HandlePathDied ( path : : Path_ptr p ) override ;
std : : optional < SendStat >
GetStatFor ( AddressVariant_t remote ) const override ;
virtual vpn : : EgresPacketRouter *
EgresPacketRouter ( )
{
return nullptr ;
}
std : : unordered_set < AddressVariant_t >
AllRemoteEndpoints ( ) const override ;
virtual vpn : : NetworkInterface *
GetVPNInterface ( )
{
return nullptr ;
}
bool
ShouldPublishDescriptors ( llarp_time_t now ) const override ;
bool
publish_introset ( const EncryptedIntroSet & i ) ;
void
SRVRecordsChanged ( ) override ;
bool
HandleHiddenServiceFrame ( path : : Path_ptr p , const service : : ProtocolFrameMessage & msg ) ;
void
HandlePathDied ( std : : shared_ptr < path : : Path > p ) override ;
void
SetEndpointAuth ( std : : shared_ptr < IAuthPolicy > policy ) ;
virtual vpn : : EgresPacketRouter *
EgresPacketRouter ( )
{
return nullptr ;
}
/// sets how we authenticate with remote address
void
SetAuthInfoForEndpoint ( Address remote , AuthInfo info ) ;
virtual vpn : : NetworkInterface *
GetVPNInterface ( )
{
return nullptr ;
}
virtual huint128_t ObtainIPForAddr ( std : : variant < Address , RouterID > ) = 0 ;
bool
publish_introset ( const EncryptedIntroSet & i ) ;
/// get a key for ip address
virtual std : : optional < std : : variant < service : : Address , RouterID > >
ObtainAddrForIP ( huint128_t ip ) const = 0 ;
bool
HandleHiddenServiceFrame (
std : : shared_ptr < path : : Path > p , const service : : ProtocolFrameMessage & msg ) ;
// virtual bool
// HasServiceAddress(const AlignedBuffer< 32 >& addr) const = 0;
void
SetEndpointAuth ( std : : shared_ptr < IAuthPolicy > policy ) ;
/// return true if we have a pending job to build to a hidden service but
/// it's not done yet
bool
HasPendingPathToService ( const Address & remote ) const ;
/// sets how we authenticate with remote address
void
SetAuthInfoForEndpoint ( Address remote , AuthInfo info ) ;
bool
HandleDataMessage (
path : : Path_ptr path , const PathID_t from , std : : shared_ptr < ProtocolMessage > msg ) ;
virtual huint128_t ObtainIPForAddr ( std : : variant < Address , RouterID > ) = 0 ;
/// handle packet io from service node or hidden service to frontend
virtual bool
HandleInboundPacket (
const ConvoTag tag , const llarp_buffer_t & pkt , ProtocolType t , uint64_t seqno ) = 0 ;
/// get a key for ip address
virtual std : : optional < std : : variant < service : : Address , RouterID > >
ObtainAddrForIP ( huint128_t ip ) const = 0 ;
// virtual bool
// HandleWriteIPPacket(const llarp_buffer_t& pkt,
// std::function< huint128_t(void) > getFromIP) = 0;
// virtual bool
// HasServiceAddress(const AlignedBuffer< 32 >& addr) const = 0;
bool
ProcessDataMessage ( std : : shared_ptr < ProtocolMessage > msg ) ;
/// return true if we have a pending job to build to a hidden service but
/// it's not done yet
bool
HasPendingPathToService ( const Address & remote ) const ;
// "find name"
void
lookup_name ( std : : string name , std : : function < void ( std : : string , bool ) > func = nullptr ) override ;
bool
HandleDataMessage (
std : : shared_ptr < path : : Path > path ,
const PathID_t from ,
std : : shared_ptr < ProtocolMessage > msg ) ;
// "find introset?"
void
LookupServiceAsync (
std : : string name ,
std : : string service ,
std : : function < void ( std : : vector < dns : : SRVData > ) > resultHandler ) override ;
/// handle packet io from service node or hidden service to frontend
virtual bool
HandleInboundPacket (
const ConvoTag tag , const llarp_buffer_t & pkt , ProtocolType t , uint64_t seqno ) = 0 ;
/// called on event loop pump
virtual void
Pump ( llarp_time_t now ) ;
// virtual bool
// HandleWriteIPPacket(const llarp_buffer_t& pkt,
// std::function< huint128_t(void) > getFromIP) = 0;
/// stop this endpoint
bool
Stop ( ) override ;
bool
ProcessDataMessage ( std : : shared_ptr < ProtocolMessage > msg ) ;
const Identity &
GetIdentity ( ) const
{
return _identity ;
}
// "find name"
void
lookup_name ( std : : string name , std : : function < void ( std : : string , bool ) > func = nullptr ) override ;
void
MapExitRange ( IPRange range , service : : Address exit ) ;
// "find introset?"
void
LookupServiceAsync (
std : : string name ,
std : : string service ,
std : : function < void ( std : : vector < dns : : SRVData > ) > resultHandler ) override ;
void
UnmapExitRange ( IPRange range ) ;
/// called on event loop pump
virtual void
Pump ( llarp_time_t now ) ;
void
UnmapRangeByExit ( IPRange range , std : : string exit ) ;
/// stop this endpoint
bool
Stop ( ) override ;
void
map_exit (
std : : string name ,
std : : string token ,
std : : vector < IPRange > ranges ,
std : : function < void ( bool , std : : string ) > result ) ;
const Identity &
GetIdentity ( ) const
{
return _identity ;
}
void
HandlePathBuilt ( path : : Path_ptr path ) override ;
void
MapExitRange ( IPRange range , service : : Address exit ) ;
bool
HandleDataDrop ( path : : Path_ptr p , const PathID_t & dst , uint64_t s ) ;
void
UnmapExitRange ( IPRange range ) ;
bool
CheckPathIsDead ( path : : Path_ptr p , llarp_time_t latency ) ;
void
UnmapRangeByExit ( IPRange range , std : : string exit ) ;
using PendingBufferQueue = std : : deque < PendingBuffer > ;
void
map_exit (
std : : string name ,
std : : string token ,
std : : vector < IPRange > ranges ,
std : : function < void ( bool , std : : string ) > result ) ;
size_t
RemoveAllConvoTagsFor ( service : : Address remote ) ;
void
HandlePathBuilt ( std : : shared_ptr < path : : Path > path ) override ;
bool
WantsOutboundSession ( const Address & ) const ;
bool
HandleDataDrop ( std : : shared_ptr < path : : Path > p , const PathID_t & dst , uint64_t s ) ;
/// this MUST be called if you want to call EnsurePathTo on the given address
void MarkAddressOutbound ( service : : Address ) override ;
bool
CheckPathIsDead ( std : : shared_ptr < path : : Path > p , llarp_time_t latency ) ;
void
BlacklistSNode ( const RouterID snode ) override ;
using PendingBufferQueue = std : : deque < PendingBuffer > ;
/// maybe get an endpoint variant given its convo tag
std : : optional < std : : variant < Address , RouterID > >
GetEndpointWithConvoTag ( ConvoTag t ) const override ;
size_t
RemoveAllConvoTagsFor ( service : : Address remote ) ;
bool
HasConvoTag ( const ConvoTag & t ) const ;
bool
WantsOutboundSession ( const Address & ) const ;
bool
ShouldBuildMore ( llarp_time_t now ) const override ;
/// this MUST be called if you want to call EnsurePathTo on the given address
void MarkAddressOutbound ( service : : Address ) override ;
virtual llarp_time_t
PathAlignmentTimeout ( ) const
{
constexpr auto DefaultPathAlignmentTimeout = 30 s ;
return DefaultPathAlignmentTimeout ;
}
void
BlacklistSNode ( const RouterID snode ) override ;
bool
EnsurePathTo (
std : : variant < Address , RouterID > addr ,
std : : function < void ( std : : optional < ConvoTag > ) > hook ,
llarp_time_t timeout ) override ;
/// maybe get an endpoint variant given its convo tag
std : : optional < std : : variant < Address , RouterID > >
GetEndpointWithConvoTag ( ConvoTag t ) const override ;
static constexpr auto DefaultPathEnsureTimeout = 2 s ;
bool
HasConvoTag ( const ConvoTag & t ) const ;
/// return false if we have already called this function before for this
/// address
bool
EnsurePathToService (
const Address remote ,
std : : function < void ( Address , OutboundContext * ) > h ,
llarp_time_t timeoutMS = DefaultPathEnsureTimeout ) ;
bool
ShouldBuildMore ( llarp_time_t now ) const override ;
void
InformPathToService ( const Address remote , OutboundContext * ctx ) ;
virtual llarp_time_t
PathAlignmentTimeout ( ) const
{
constexpr auto DefaultPathAlignmentTimeout = 30 s ;
return DefaultPathAlignmentTimeout ;
}
/// ensure a path to a service node by public key
bool
EnsurePathToSNode (
const RouterID remote ,
std : : function < void ( const RouterID , exit : : BaseSession_ptr , ConvoTag ) > h ) ;
bool
EnsurePathTo (
std : : variant < Address , RouterID > addr ,
std : : function < void ( std : : optional < ConvoTag > ) > hook ,
llarp_time_t timeout ) override ;
/// return true if this endpoint is trying to lookup this router right now
bool
HasPendingRouterLookup ( const RouterID remote ) const ;
static constexpr auto DefaultPathEnsureTimeout = 2 s ;
bool
HasPathToSNode ( const RouterID remote ) const ;
/// return false if we have already called this function before for this
/// address
bool
EnsurePathToService (
const Address remote ,
std : : function < void ( Address , OutboundContext * ) > h ,
llarp_time_t timeoutMS = DefaultPathEnsureTimeout ) ;
bool
HasFlowToService ( const Address remote ) const ;
void
InformPathToService ( const Address remote , OutboundContext * ctx ) ;
void
PutSenderFor ( const ConvoTag & tag , const ServiceInfo & info , bool inbound ) ;
/// ensure a path to a service node by public key
bool
EnsurePathToSNode (
const RouterID remote ,
std : : function < void ( const RouterID , std : : shared_ptr < exit : : BaseSession > , ConvoTag ) > h ) ;
bool
HasInboundConvo ( const Address & addr ) const ;
/// return true if this endpoint is trying to lookup this router right now
bool
HasPendingRouterLookup ( const RouterID remote ) const ;
bool
HasOutboundConvo ( const Address & addr ) const ;
bool
HasPathToSNode ( const RouterID remote ) const ;
bool
GetCachedSessionKeyFor ( const ConvoTag & remote , SharedSecret & secret ) const ;
bool
HasFlowToService ( const Address remote ) const ;
void
PutCachedSessionKeyFor ( const ConvoTag & remote , const SharedSecret & secret ) ;
void
PutSenderFor ( const ConvoTag & tag , const ServiceInfo & info , bool inbound ) ;
bool
GetSenderFor ( const ConvoTag & remote , ServiceInfo & si ) const ;
bool
HasInboundConvo ( const Address & addr ) const ;
void
PutIntroFor ( const ConvoTag & remote , const Introduction & intro ) ;
bool
HasOutboundConvo ( const Address & addr ) const ;
bool
GetIntroFor ( const ConvoTag & remote , Introduction & intro ) const ;
bool
GetCachedSessionKeyFor ( const ConvoTag & remote , SharedSecret & secret ) const ;
void
RemoveConvoTag ( const ConvoTag & remote ) ;
void
PutCachedSessionKeyFor ( const ConvoTag & remote , const SharedSecret & secret ) ;
void
ConvoTagTX ( const ConvoTag & remote );
bool
GetSenderFor ( const ConvoTag & remote , ServiceInfo & si ) const ;
void
ConvoTagRX ( const ConvoTag & remote ) ;
void
PutIntroFor ( const ConvoTag & remote , const Introduction & intro ) ;
void
PutReply IntroFor( const ConvoTag & remote , const Introduction & intro ) ;
bool
Get IntroFor( const ConvoTag & remote , Introduction & intro ) const ;
bool
GetReplyIntroFor ( const ConvoTag & remote , Introduction & intro ) const ;
void
RemoveConvoTag ( const ConvoTag & remote );
bool
GetConvoTagsForService ( const Address & si , std : : set < ConvoTag > & tag ) const ;
void
ConvoTagTX ( const ConvoTag & remote ) ;
void
PutNewOutboundContext ( const IntroSet & introset , llarp_time_t timeLeftToAlign ) ;
void
ConvoTagRX ( const ConvoTag & remote ) ;
std : : optional < uint64_t >
GetSeqNoForConvo ( const ConvoTag & tag ) ;
void
PutReplyIntroFor ( const ConvoTag & remote , const Introduction & intro ) ;
/// count unique endpoints we are talking to
size_t
UniqueEndpoints ( ) const ;
bool
GetReplyIntroFor ( const ConvoTag & remote , Introduction & intro ) const ;
bool
HasExit ( ) const ;
bool
GetConvoTagsForService ( const Address & si , std : : set < ConvoTag > & tag ) const ;
std : : optional < std : : vector < RemoteRC > >
GetHopsForBuild ( ) override ;
void
PutNewOutboundContext ( const IntroSet & introset , llarp_time_t timeLeftToAlign ) ;
std : : optional < std : : vector < RemoteRC > >
GetHopsForBuildWithEndpoint ( RouterID endpoint ) ;
std : : optional < uint64_t >
GetSeqNoForConvo ( const ConvoTag & tag ) ;
void
AsyncProcessAuthMessage (
std : : shared_ptr < ProtocolMessage > msg , std : : function < void ( std : : string , bool ) > hook ) ;
/// count unique endpoints we are talking to
size_t
UniqueEndpoints ( ) const ;
void
SendAuthResult (
path : : Path_ptr path , PathID_t replyPath , ConvoTag tag , std : : string result , bool success ) ;
bool
HasExit ( ) const ;
uint64_t
GenTXID ( ) ;
std : : optional < std : : vector < RemoteRC > >
GetHopsForBuild ( ) override ;
void
ResetConvoTag ( ConvoTag tag , path : : Path_ptr path , PathID_t from ) ;
std : : optional < std : : vector < RemoteRC > >
GetHopsForBuildWithEndpoint ( RouterID endpoint ) ;
const std : : set < RouterID > &
SnodeBlacklist ( ) const ;
void
AsyncProcessAuthMessage (
std : : shared_ptr < ProtocolMessage > msg , std : : function < void ( std : : string , bool ) > hook ) ;
// Looks up the ConvoTag and, if it exists, calls SendToOrQueue to send it to a remote client
// or a snode (or nothing, if the convo tag is unknown).
bool
send_to ( ConvoTag tag , std : : string payload ) override ;
void
SendAuthResult (
std : : shared_ptr < path : : Path > path ,
PathID_t replyPath ,
ConvoTag tag ,
std : : string result ,
bool success ) ;
std : : optional < AuthInfo >
MaybeGetAuthInfoForEndpoint ( service : : Address addr ) ;
uint64_t
GenTXID ( ) ;
/// Returns a pointer to the quic::Tunnel object handling quic connections for this endpoint.
/// Returns nullptr if quic is not supported.
link : : TunnelManager *
GetQUICTunnel ( ) override ;
void
ResetConvoTag ( ConvoTag tag , std : : shared_ptr < path : : Path > path , PathID_t from ) ;
protected :
/// parent context that owns this endpoint
Context * const context ;
const std : : set < RouterID > &
SnodeBlacklist ( ) const ;
virtual bool
SupportsV6 ( ) const = 0 ;
// Looks up the ConvoTag and, if it exists, calls SendToOrQueue to send it to a remote client
// or a snode (or nothing, if the convo tag is unknown).
bool
send_to ( ConvoTag tag , std : : string payload ) override ;
void
regen_and_publish_introset ( ) ;
std : : optional < AuthInfo >
MaybeGetAuthInfoForEndpoint ( service : : Address addr ) ;
IServiceLookup *
GenerateLookupByTag ( const Tag & tag ) ;
/// Returns a pointer to the quic::Tunnel object handling quic connections for this endpoint.
/// Returns nullptr if quic is not supported.
link : : TunnelManager *
GetQUICTunnel ( ) override ;
void
PrefetchServicesByTag ( const Tag & tag ) ;
protected :
/// parent context that owns this endpoint
Context * const context ;
private :
bool
DoNetworkIsolation ( bool failed ) ;
virtual bool
SupportsV6 ( ) const = 0 ;
virtual bool
SetupNetworking ( )
{
// XXX: override me
return true ;
}
void
regen_and_publish_introset ( ) ;
virtual bool
IsolationFailed ( )
{
// XXX: override me
return false ;
}
IServiceLookup *
GenerateLookupByTag ( const Tag & tag ) ;
/// return true if we are ready to do outbound and inbound traffic
bool
ReadyForNetwork ( ) const ;
void
PrefetchServicesByTag ( const Tag & tag ) ;
protected :
bool
ReadyToDoLookup ( size_t num_paths ) const ;
private :
bool
DoNetworkIsolation ( bool failed ) ;
auto
GetUniqueEndpointsForLookup ( ) const ;
virtual bool
SetupNetworking ( )
{
// XXX: override me
return true ;
}
Identity _identity ;
net : : IPRangeMap < service : : Address > _exit_map ;
bool _publish_introset = true ;
std : : unique_ptr < EndpointState > _state ;
std : : shared_ptr < IAuthPolicy > _auth_policy ;
std : : unordered_map < Address , AuthInfo > _remote_auth_infos ;
std : : unique_ptr < link : : TunnelManager > _tunnel_manager ;
virtual bool
IsolationFailed ( )
{
// XXX: override me
return false ;
}
/// (ons name, optional exit range, optional auth info) for looking up on startup
std : : unordered_map < std : : string , std : : pair < std : : optional < IPRange > , std : : optional < AuthInfo > > >
_startup_ons_mappings ;
/// return true if we are ready to do outbound and inbound traffic
bool
ReadyForNetwork ( ) const ;
RecvPacketQueue_t _inbound_queue ;
protected :
bool
ReadyToDoLookup ( size_t num_paths ) const ;
public :
SendMessageEventQueue _send_queue ;
auto
GetUniqueEndpointsForLookup ( ) const ;
private :
llarp_time_t _last_introset_regen_attempt = 0 s ;
Identity _identity ;
net : : IPRangeMap < service : : Address > _exit_map ;
bool _publish_introset = true ;
std : : unique_ptr < EndpointState > _state ;
std : : shared_ptr < IAuthPolicy > _auth_policy ;
std : : unordered_map < Address , AuthInfo > _remote_auth_infos ;
std : : unique_ptr < link : : TunnelManager > _tunnel_manager ;
protected :
void
FlushRecvData ( ) ;
/// (ons name, optional exit range, optional auth info) for looking up on startup
std : : unordered_map < std : : string , std : : pair < std : : optional < IPRange > , std : : optional < AuthInfo > > >
_startup_ons_mappings ;
friend struct EndpointUtil ;
RecvPacketQueue_t _inbound_queue ;
const IntroSet &
intro_set ( ) const ;
IntroSet &
intro_set ( ) ;
public :
SendMessageEventQueue _send_queue ;
const std : : unordered_map < ConvoTag , Session > &
Sessions ( ) const ;
std : : unordered_map < ConvoTag , Session > &
Sessions ( ) ;
private :
llarp_time_t _last_introset_regen_attempt = 0 s ;
thread : : Queue < RecvDataEvent > _recv_event_queue ;
protected :
void
FlushRecvData ( ) ;
/// for rate limiting introset lookups
util : : DecayingHashSet < Address > _introset_lookup_filter ;
} ;
friend struct EndpointUtil ;
const IntroSet &
intro_set ( ) const ;
IntroSet &
intro_set ( ) ;
const std : : unordered_map < ConvoTag , Session > &
Sessions ( ) const ;
std : : unordered_map < ConvoTag , Session > &
Sessions ( ) ;
using Endpoint_ptr = std : : shared_ptr < Endpoint > ;
thread : : Queue < RecvDataEvent > _recv_event_queue ;
} // namespace service
} // namespace llarp
/// for rate limiting introset lookups
util : : DecayingHashSet < Address > _introset_lookup_filter ;
} ;
} // namespace llarp::service