llarp::exit::SNodeSession
Inherits from llarp::exit::BaseSession, llarp::path::Builder, std::enable_shared_from_this< BaseSession >, llarp::path::PathSet
Public Functions
| Name | |
|---|---|
| SNodeSession(const llarp::RouterID & snodeRouter, std::function< bool(const llarp_buffer_t &)> writepkt, AbstractRouter * r, size_t numpaths, size_t hoplen, bool useRouterSNodeKey, EndpointBase * parent) | |
| ~SNodeSession() override =default | |
| virtual std::string | Name() const override get the "name" of this pathset |
| virtual void | SendPacketToRemote(const llarp_buffer_t & pkt, service::ProtocolType t) override |
Protected Functions
| Name | |
|---|---|
| virtual void | PopulateRequest(llarp::routing::ObtainExitMessage & msg) const override |
Additional inherited members
Public Functions inherited from llarp::exit::BaseSession
| Name | |
|---|---|
| BaseSession(const llarp::RouterID & exitRouter, std::function< bool(const llarp_buffer_t &)> writepkt, AbstractRouter * r, size_t numpaths, size_t hoplen, EndpointBase * parent) | |
| ~BaseSession() override | |
| virtual std::shared_ptr< path::PathSet > | GetSelf() override get a shared_ptr of ourself |
| virtual std::weak_ptr< path::PathSet > | GetWeak() override get a weak_ptr of ourself |
| virtual void | BlacklistSNode(const RouterID snode) override |
| virtual bool | ShouldBundleRC() const override should we bundle RCs in builds? |
| virtual void | ResetInternalState() override reset all cooldown timers |
| virtual bool | UrgentBuild(llarp_time_t ) const override |
| virtual void | HandlePathDied(llarp::path::Path_ptr path) override a path died now what? |
| bool | CheckPathDead(path::Path_ptr p, llarp_time_t dlt) |
| virtual std::optional< std::vector< RouterContact > > | GetHopsForBuild() override |
| virtual bool | ShouldBuildMore(llarp_time_t now) const override return true if we should build another path |
| virtual void | HandlePathBuilt(llarp::path::Path_ptr p) override |
| bool | QueueUpstreamTraffic(llarp::net::IPPacket pkt, const size_t packSize, service::ProtocolType t) |
| bool | FlushUpstream() flush upstream to exit via paths |
| void | FlushDownstream() flush downstream to user via tun |
| virtual path::PathRole | GetRoles() const override get roles for this path builder |
| virtual bool | Stop() override send close and stop session |
| bool | IsReady() const |
| const llarp::RouterID | Endpoint() const |
| std::optional< PathID_t > | CurrentPath() const |
| bool | IsExpired(llarp_time_t now) const |
| bool | LoadIdentityFromFile(const char * fname) |
| void | AddReadyHook(SessionReadyFunc func) |
Protected Functions inherited from llarp::exit::BaseSession
| Name | |
|---|---|
| bool | HandleTrafficDrop(llarp::path::Path_ptr p, const llarp::PathID_t & path, uint64_t s) |
| bool | HandleGotExit(llarp::path::Path_ptr p, llarp_time_t b) |
| bool | HandleTraffic(llarp::path::Path_ptr p, const llarp_buffer_t & buf, uint64_t seqno, service::ProtocolType t) |
Public Attributes inherited from llarp::exit::BaseSession
| Name | |
|---|---|
| constexpr size_t | MaxUpstreamQueueLength |
Protected Attributes inherited from llarp::exit::BaseSession
| Name | |
|---|---|
| llarp::RouterID | m_ExitRouter |
| llarp::SecretKey | m_ExitIdentity |
| std::function< bool(const llarp_buffer_t &)> | m_WritePacket |
Public Functions inherited from llarp::path::Builder
| Name | |
|---|---|
| Builder(AbstractRouter * p_router, size_t numDesiredPaths, size_t numHops) construct |
|
| virtual | ~Builder() =default |
| virtual bool | ShouldBuildMore(llarp_time_t now) const override return true if we should build another path |
| virtual bool | ShouldBundleRC() const =0 should we bundle RCs in builds? |
| virtual void | ResetInternalState() override reset all cooldown timers |
| bool | BuildCooldownHit(llarp_time_t now) const return true if we hit our soft limit for building paths too fast |
| virtual PathRole | GetRoles() const get roles for this path builder |
| BuildStats | CurrentBuildStats() const |
| virtual bool | Stop() override stop this pathset and mark it as to be removed |
| virtual bool | IsStopped() const override return true if we are stopped |
| virtual bool | ShouldRemove() const override return true if we can and should remove this pathset and underlying resources from its parent context |
| virtual llarp_time_t | Now() const override get time from event loop |
| virtual void | Tick(llarp_time_t now) override tick owned paths |
| virtual void | BuildOne(PathRole roles =ePathRoleAny) override |
| virtual bool | BuildOneAlignedTo(const RouterID endpoint) override |
| std::optional< std::vector< RouterContact > > | GetHopsAlignedToForBuild(RouterID endpoint, const std::set< RouterID > & exclude ={}) |
| virtual void | Build(std::vector< RouterContact > hops, PathRole roles =ePathRoleAny) override manual build on these hops |
| std::optional< RouterContact > | SelectFirstHop(const std::set< RouterID > & exclude ={}) const pick a first hop |
| virtual std::optional< std::vector< RouterContact > > | GetHopsForBuild() override |
| void | ManualRebuild(size_t N, PathRole roles =ePathRoleAny) |
| virtual const SecretKey & | GetTunnelEncryptionSecretKey() const |
| virtual void | HandlePathBuilt(Path_ptr p) override |
| virtual void | HandlePathBuildTimeout(Path_ptr p) override |
| virtual void | HandlePathBuildFailedAt(Path_ptr p, RouterID hop) override |
Protected Functions inherited from llarp::path::Builder
| Name | |
|---|---|
| virtual bool | UrgentBuild(llarp_time_t now) const |
| bool | BuildCooldownHit(RouterID edge) const return true if we hit our soft limit for building paths too fast on a first hop |
Public Attributes inherited from llarp::path::Builder
| Name | |
|---|---|
| AbstractRouter *const | m_router |
| SecretKey | enckey |
| size_t | numHops |
| llarp_time_t | lastBuild |
| llarp_time_t | buildIntervalLimit |
Protected Attributes inherited from llarp::path::Builder
| Name | |
|---|---|
| std::atomic< bool > | _run flag for PathSet::Stop() |
Protected Types inherited from llarp::path::PathSet
| Name | |
|---|---|
| using util::NullMutex | Mtx_t |
| using util::NullLock | Lock_t |
| using std::unordered_map< std::pair< RouterID, PathID_t >, Path_ptr > | PathMap_t |
Public Functions inherited from llarp::path::PathSet
| Name | |
|---|---|
| PathSet(size_t numDesiredPaths) construct @params numDesiredPaths the number of paths to maintain |
|
| virtual PathSet_ptr | GetSelf() =0 get a shared_ptr of ourself |
| virtual std::weak_ptr< PathSet > | GetWeak() =0 get a weak_ptr of ourself |
| virtual void | BuildOne(PathRole roles =ePathRoleAny) =0 |
| virtual void | Build(std::vector< RouterContact > hops, PathRole roles =ePathRoleAny) =0 manual build on these hops |
| virtual void | Tick(llarp_time_t now) tick owned paths |
| size_t | NumPathsExistingAt(llarp_time_t futureTime) const count the number of paths that will exist at this timestamp in future |
| virtual void | HandlePathBuilt(Path_ptr path) =0 |
| virtual void | HandlePathBuildTimeout(Path_ptr path) |
| virtual void | HandlePathBuildFailedAt(Path_ptr path, RouterID hop) |
| virtual void | PathBuildStarted(Path_ptr path) |
| virtual void | HandlePathDied(Path_ptr path) a path died now what? |
| bool | GetNewestIntro(service::Introduction & intro) const |
| void | AddPath(Path_ptr path) |
| Path_ptr | GetByUpstream(RouterID remote, PathID_t rxid) const |
| void | ExpirePaths(llarp_time_t now, AbstractRouter * router) |
| size_t | NumInStatus(PathStatus st) const get the number of paths in this status |
| size_t | AvailablePaths(PathRole role) const get the number of paths that match the role that are available |
| virtual llarp_time_t | Now() const =0 get time from event loop |
| virtual bool | Stop() =0 stop this pathset and mark it as to be removed |
| virtual bool | IsStopped() const =0 return true if we are stopped |
| virtual bool | ShouldRemove() const =0 return true if we can and should remove this pathset and underlying resources from its parent context |
| virtual bool | ShouldBuildMore(llarp_time_t now) const return true if we should build another path |
| virtual bool | ShouldBuildMoreForRoles(llarp_time_t now, PathRole roles) const return true if we need another path with the given path roles |
| virtual size_t | MinRequiredForRoles(PathRole roles) const return the minimum number of paths we want for given roles |
| virtual bool | ShouldPublishDescriptors(llarp_time_t now) const return true if we should publish a new hidden service descriptor |
| virtual void | BlacklistSNode(const RouterID ) =0 |
| virtual bool | HandleGotIntroMessage(std::shared_ptr< const dht::GotIntroMessage > ) override me in subtype |
| virtual bool | HandleGotRouterMessage(std::shared_ptr< const dht::GotRouterMessage > ) override me in subtype |
| virtual bool | HandleGotNameMessage(std::shared_ptr< const dht::GotNameMessage > ) override me in subtype |
| virtual routing::IMessageHandler * | GetDHTHandler() |
| Path_ptr | GetEstablishedPathClosestTo(RouterID router, std::unordered_set< RouterID > excluding ={}, PathRole roles =ePathRoleAny) const |
| Path_ptr | PickEstablishedPath(PathRole roles =ePathRoleAny) const |
| Path_ptr | PickRandomEstablishedPath(PathRole roles =ePathRoleAny) const |
| Path_ptr | GetPathByRouter(RouterID router, PathRole roles =ePathRoleAny) const |
| Path_ptr | GetNewestPathByRouter(RouterID router, PathRole roles =ePathRoleAny) const |
| Path_ptr | GetRandomPathByRouter(RouterID router, PathRole roles =ePathRoleAny) const |
| Path_ptr | GetPathByID(PathID_t id) const |
| Path_ptr | GetByEndpointWithID(RouterID router, PathID_t id) const |
| std::optional< std::set< service::Introduction > > | GetCurrentIntroductionsWithFilter(std::function< bool(const service::Introduction &)> filter) const |
| virtual bool | PublishIntroSet(const service::EncryptedIntroSet & , AbstractRouter * ) |
| virtual void | ResetInternalState() =0 reset all cooldown timers |
| virtual bool | BuildOneAlignedTo(const RouterID endpoint) =0 |
| virtual std::optional< std::vector< RouterContact > > | GetHopsForBuild() =0 |
| void | ForEachPath(std::function< void(const Path_ptr &)> visit) const |
| void | UpstreamFlush(AbstractRouter * r) |
| void | DownstreamFlush(AbstractRouter * r) |
Protected Functions inherited from llarp::path::PathSet
| Name | |
|---|---|
| void | TickPaths(AbstractRouter * r) |
Public Attributes inherited from llarp::path::PathSet
| Name | |
|---|---|
| constexpr size_t | max_paths maximum number of paths a path set can maintain |
| size_t | numDesiredPaths |
Protected Attributes inherited from llarp::path::PathSet
| Name | |
|---|---|
| BuildStats | m_BuildStats |
| Mtx_t | m_PathsMutex |
| PathMap_t | m_Paths |
Public Functions Documentation
function SNodeSession
SNodeSession(
const llarp::RouterID & snodeRouter,
std::function< bool(const llarp_buffer_t &)> writepkt,
AbstractRouter * r,
size_t numpaths,
size_t hoplen,
bool useRouterSNodeKey,
EndpointBase * parent
)
function ~SNodeSession
~SNodeSession() override =default
function Name
virtual std::string Name() const override
get the "name" of this pathset
Reimplements: llarp::path::PathSet::Name
function SendPacketToRemote
virtual void SendPacketToRemote(
const llarp_buffer_t & pkt,
service::ProtocolType t
) override
Reimplements: llarp::path::PathSet::SendPacketToRemote
Protected Functions Documentation
function PopulateRequest
inline virtual void PopulateRequest(
llarp::routing::ObtainExitMessage & msg
) const override
Reimplements: llarp::exit::BaseSession::PopulateRequest
Updated on 2026-01-10 at 22:49:45 +0000