lokinet/llarp/service/endpoint_state.hpp
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
2021-03-09 19:01:41 -05:00

77 lines
1.9 KiB
C++

#pragma once
#include <llarp/hook/ihook.hpp>
#include <llarp/router_id.hpp>
#include "address.hpp"
#include "pendingbuffer.hpp"
#include "router_lookup_job.hpp"
#include "session.hpp"
#include "endpoint_types.hpp"
#include <llarp/util/compare_ptr.hpp>
#include <llarp/util/decaying_hashtable.hpp>
#include <llarp/util/status.hpp>
#include <memory>
#include <queue>
#include <set>
#include <unordered_map>
namespace llarp
{
namespace service
{
struct EndpointState
{
hooks::Backend_ptr m_OnUp;
hooks::Backend_ptr m_OnDown;
hooks::Backend_ptr m_OnReady;
std::set<RouterID> m_SnodeBlacklist;
AbstractRouter* m_Router;
std::string m_Keyfile;
std::string m_Name;
std::string m_NetNS;
bool m_ExitEnabled = false;
PendingTraffic m_PendingTraffic;
Sessions m_RemoteSessions;
Sessions m_DeadSessions;
std::set<ConvoTag> m_InboundConvos;
SNodeSessions m_SNodeSessions;
std::unordered_multimap<Address, PathEnsureHook, Address::Hash> m_PendingServiceLookups;
std::unordered_map<Address, llarp_time_t, Address::Hash> m_LastServiceLookupTimes;
std::unordered_map<RouterID, uint32_t, RouterID::Hash> m_ServiceLookupFails;
PendingRouters m_PendingRouters;
llarp_time_t m_LastPublish = 0s;
llarp_time_t m_LastPublishAttempt = 0s;
/// our introset
IntroSet m_IntroSet;
/// pending remote service lookups by id
PendingLookups m_PendingLookups;
/// on initialize functions
std::list<std::function<bool(void)>> m_OnInit;
/// conversations
ConvoMap m_Sessions;
OutboundSessions_t m_OutboundSessions;
util::DecayingHashTable<std::string, Address, std::hash<std::string>> nameCache;
bool
Configure(const NetworkConfig& conf);
util::StatusObject
ExtractStatus(util::StatusObject& obj) const;
};
} // namespace service
} // namespace llarp