2019-04-30 01:06:20 +00:00
|
|
|
#ifndef LLARP_SERVICE_ENDPOINT_UTIL_HPP
|
|
|
|
#define LLARP_SERVICE_ENDPOINT_UTIL_HPP
|
|
|
|
|
2019-07-15 09:15:51 +00:00
|
|
|
#include <service/endpoint_types.hpp>
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace service
|
|
|
|
{
|
|
|
|
struct EndpointUtil
|
|
|
|
{
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
ExpireSNodeSessions(llarp_time_t now, SNodeSessions& sessions);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
ExpirePendingTx(llarp_time_t now, PendingLookups& lookups);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
ExpirePendingRouterLookups(llarp_time_t now, PendingRouters& routers);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
DeregisterDeadSessions(llarp_time_t now, Sessions& sessions);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
TickRemoteSessions(llarp_time_t now, Sessions& remoteSessions,
|
|
|
|
Sessions& deadSessions);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
ExpireConvoSessions(llarp_time_t now, ConvoMap& sessions);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
StopRemoteSessions(Sessions& remoteSessions);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static void
|
2019-07-15 09:15:51 +00:00
|
|
|
StopSnodeSessions(SNodeSessions& sessions);
|
2019-04-30 01:06:20 +00:00
|
|
|
|
|
|
|
static bool
|
2019-07-15 09:15:51 +00:00
|
|
|
HasPathToService(const Address& addr, const Sessions& remoteSessions);
|
2019-05-07 08:29:47 +00:00
|
|
|
|
|
|
|
static bool
|
2019-07-15 09:15:51 +00:00
|
|
|
GetConvoTagsForService(const ConvoMap& sessions, const Address& addr,
|
|
|
|
std::set< ConvoTag >& tags);
|
2019-04-30 01:06:20 +00:00
|
|
|
};
|
|
|
|
} // namespace service
|
|
|
|
|
|
|
|
} // namespace llarp
|
|
|
|
|
|
|
|
#endif
|