Ryan Tharp 6 years ago
commit 7874567611

@ -45,8 +45,12 @@ add_compile_options(-Wno-cast-function-type)
set(FS_LIB stdc++fs)
endif(WIN32)
if(DEBIAN)
add_definitions(-DDEBIAN)
else()
set(CRYPTO_FLAGS -march=native)
endif()
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
@ -112,20 +116,6 @@ if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
add_compile_options( ${DEBUG_FLAGS} )
endif()
if(NOT DEBIAN)
if(NOT ANDROID)
if(NOT RPI)
if (NOT USE_AVX2)
set(CRYPTO_FLAGS -march=core2 -mtune=native)
set(CMAKE_ASM_FLAGS "-march=core2")
else()
set(CRYPTO_FLAGS -march=haswell -mtune=native)
set(CMAKE_ASM_FLAGS "-march=haswell -mtune=native ${CMAKE_ASM_FLAGS} $ENV{ASFLAGS}")
endif()
endif()
endif()
endif()
if(RPI)
add_definitions(-DRPI)
set(WITH_STATIC ON)

@ -45,17 +45,20 @@ ANDROID_LOCAL_PROPS=$(ANDROID_DIR)/local.properties
GRADLE ?= gradle
JAVA_HOME ?= /usr/lib/jvm/default-java
# features enabled
JSONRPC ?= OFF
AVX2 ?= ON
AVX2 ?= OFF
RPI ?= OFF
STATIC_LINK ?= OFF
NETNS ?= OFF
CLANG ?= OFF
CROSS ?= OFF
CMAKE_GEN ?= Unix Makefiles
BUILD_ROOT = $(REPO)/build
CONFIG_CMD = $(shell /bin/echo -n "cd '$(BUILD_ROOT)' && " ; /bin/echo -n "cmake -G'$(CMAKE_GEN)' -DUSING_CLANG=$(CLANG) -DSTATIC_LINK=$(STATIC_LINK) -DUSE_NETNS=$(NETNS) -DUSE_AVX2=$(AVX2) -DUSE_LIBABYSS=$(JSONRPC) -DRPI=$(RPI) '$(REPO)'")
CONFIG_CMD = $(shell /bin/echo -n "cd '$(BUILD_ROOT)' && " ; /bin/echo -n "cmake -G'$(CMAKE_GEN)' -DCMAKE_CROSSCOMPILING=$(CROSS) -DUSING_CLANG=$(CLANG) -DSTATIC_LINK=$(STATIC_LINK) -DUSE_NETNS=$(NETNS) -DUSE_AVX2=$(AVX2) -DUSE_LIBABYSS=$(JSONRPC) -DRPI=$(RPI) '$(REPO)'")
SCAN_BUILD ?= scan-build
ANALYZE_CONFIG_CMD = $(shell /bin/echo -n "cd '$(BUILD_ROOT)' && " ; /bin/echo -n "$(SCAN_BUILD) cmake -DUSE_LIBABYSS=$(JSONRPC) '$(REPO)'")

@ -17,19 +17,19 @@ namespace llarp
const byte_t*
pq_keypair_to_secret(const byte_t* keypair);
typedef AlignedBuffer< SHAREDKEYSIZE > SharedSecret;
typedef AlignedBuffer< 32 > KeyExchangeNonce;
typedef AlignedBuffer< PUBKEYSIZE > PubKey;
typedef AlignedBuffer< SECKEYSIZE > SecretKey;
typedef AlignedBuffer< SHORTHASHSIZE > ShortHash;
typedef AlignedBuffer< SIGSIZE > Signature;
typedef AlignedBuffer< TUNNONCESIZE > TunnelNonce;
typedef AlignedBuffer< NONCESIZE > SymmNonce;
typedef AlignedBuffer< 32 > SymmKey;
typedef AlignedBuffer< PQ_CIPHERTEXTSIZE + 1 > PQCipherBlock;
typedef AlignedBuffer< PQ_PUBKEYSIZE > PQPubKey;
typedef AlignedBuffer< PQ_KEYPAIRSIZE > PQKeyPair;
using SharedSecret = AlignedBuffer< SHAREDKEYSIZE >;
using KeyExchangeNonce = AlignedBuffer< 32 >;
using PubKey = AlignedBuffer< PUBKEYSIZE >;
using SecretKey = AlignedBuffer< SECKEYSIZE >;
using ShortHash = AlignedBuffer< SHORTHASHSIZE >;
using Signature = AlignedBuffer< SIGSIZE >;
using TunnelNonce = AlignedBuffer< TUNNONCESIZE >;
using SymmNonce = AlignedBuffer< NONCESIZE >;
using SymmKey = AlignedBuffer< 32 >;
using PQCipherBlock = AlignedBuffer< PQ_CIPHERTEXTSIZE + 1 >;
using PQPubKey = AlignedBuffer< PQ_PUBKEYSIZE >;
using PQKeyPair = AlignedBuffer< PQ_KEYPAIRSIZE >;
} // namespace llarp

@ -14,7 +14,7 @@ namespace llarp
template < typename Val_t >
struct Bucket
{
typedef std::map< Key_t, Val_t, XorMetric > BucketStorage_t;
using BucketStorage_t = std::map< Key_t, Val_t, XorMetric >;
Bucket(const Key_t& us) : nodes(XorMetric(us)){};

@ -74,7 +74,7 @@ namespace llarp
Validate(const V& value) const = 0;
void
OnFound(const Key_t& askedPeer, const V& value)
OnFound(const Key_t askedPeer, const V& value)
{
peersAsked.insert(askedPeer);
if(Validate(value))
@ -98,18 +98,26 @@ namespace llarp
Key_t peer;
if(next)
{
peer = *next.get();
// explicit next peer provided
peer = next->data();
}
else
else if(!GetNextPeer(peer, peersAsked))
{
if(!GetNextPeer(peer, peersAsked))
{
// no more peers
SendReply();
return false;
}
// no more peers
llarp::LogInfo("no more peers for request asking for", target);
return false;
}
const Key_t targetKey = target.data();
if((prevPeer ^ targetKey) < (peer ^ targetKey))
{
// next peer is not closer
llarp::LogInfo("next peer ", peer, " is not closer to ", target,
" than ", prevPeer);
return false;
}
else
peersAsked.insert(peer);
DoNextRequest(peer);
return true;
}
@ -118,11 +126,11 @@ namespace llarp
SendReply() = 0;
};
typedef std::function< void(const std::vector< service::IntroSet >&) >
IntroSetLookupHandler;
using IntroSetLookupHandler =
std::function< void(const std::vector< service::IntroSet >&) >;
typedef std::function< void(const std::vector< RouterContact >&) >
RouterLookupHandler;
using RouterLookupHandler =
std::function< void(const std::vector< RouterContact >&) >;
struct Context
{
@ -297,6 +305,7 @@ namespace llarp
{
(void)whoasked;
tx.emplace(askpeer, std::unique_ptr< TX< K, V > >(t));
auto count = waiting.count(k);
waiting.insert(std::make_pair(k, askpeer));
auto itr = timeouts.find(k);
@ -305,7 +314,8 @@ namespace llarp
timeouts.insert(
std::make_pair(k, time_now_ms() + requestTimeoutMS));
}
t->Start(askpeer);
if(count == 0)
t->Start(askpeer);
}
/// mark tx as not fond
@ -316,12 +326,11 @@ namespace llarp
auto txitr = tx.find(from);
if(txitr == tx.end())
return;
if(next)
{
// ask for next peer
if(txitr->second->AskNextPeer(from.node, next))
sendReply = false;
}
// ask for next peer
if(txitr->second->AskNextPeer(from.node, next))
sendReply = false;
llarp::LogWarn("Target key ", txitr->second->target);
Inform(from, txitr->second->target, {}, sendReply, sendReply);
}

@ -5,8 +5,8 @@
#include "dnsd.hpp"
typedef bool (*map_address_hook_func)(const llarp::service::Address &addr,
uint32_t ip);
using map_address_hook_func =
std::function< bool(const llarp::service::Address &addr, uint32_t ip) >;
/// dotLokiLookup context/config
struct dotLokiLookup

@ -14,8 +14,9 @@
struct dnsd_context;
/// sendto hook functor
typedef ssize_t (*sendto_dns_hook_func)(void *sock, const struct sockaddr *from,
const void *buffer, size_t length);
using sendto_dns_hook_func =
std::function< ssize_t(void *sock, const struct sockaddr *from,
const void *buffer, size_t length) >;
// FIXME: llarp::Addr
/// DNS server query request
@ -88,8 +89,8 @@ writesend_dnss_revresponse(std::string reverse, dnsd_question_request *request);
//
/// intercept query hook functor
typedef dnsd_query_hook_response *(*intercept_query_hook)(
std::string name, struct dnsd_question_request *request);
using intercept_query_hook = std::function< dnsd_query_hook_response *(
std::string name, struct dnsd_question_request *request) >;
// FIXME: llarp::Addr
/// DNS Server context

@ -50,7 +50,7 @@ namespace llarp
template < typename User >
struct AsyncFrameEncrypter
{
typedef void (*EncryptHandler)(EncryptedFrame*, User*);
using EncryptHandler = std::function< void(EncryptedFrame*, User*) >;
static void
Encrypt(void* user)
@ -96,7 +96,7 @@ namespace llarp
template < typename User >
struct AsyncFrameDecrypter
{
typedef void (*DecryptHandler)(llarp_buffer_t*, User*);
using DecryptHandler = std::function< void(llarp_buffer_t*, User*) >;
static void
Decrypt(void* user)

@ -64,7 +64,7 @@ namespace llarp
return out;
out << std::string("/");
#if defined(ANDROID) || defined(RPI)
snprintf(tmp, sizeof(tmp), "%lu",
snprintf(tmp, sizeof(tmp), "%zu",
llarp::bits::count_array_bits(xi.netmask.s6_addr));
return out << tmp;
#else

@ -119,10 +119,9 @@ namespace llarp
ObtainIPForAddr(const byte_t* addr);
protected:
typedef llarp::util::CoDelQueue<
using PacketQueue_t = llarp::util::CoDelQueue<
net::IPv4Packet, net::IPv4Packet::GetTime, net::IPv4Packet::PutTime,
net::IPv4Packet::CompareOrder, net::IPv4Packet::GetNow >
PacketQueue_t;
net::IPv4Packet::CompareOrder, net::IPv4Packet::GetNow >;
/// queue for sending packets over the network from us
PacketQueue_t m_UserToNetworkPktQueue;
/// queue for sending packets to user from network

@ -133,8 +133,8 @@ namespace llarp
uint32_t tick_id;
protected:
typedef util::NullLock Lock;
typedef util::NullMutex Mutex;
using Lock = util::NullLock;
using Mutex = util::NullMutex;
void
PutSession(ILinkSession* s);

@ -14,7 +14,7 @@ namespace llarp
{
struct ILinkSession;
typedef std::queue< ILinkMessage* > SendQueue;
using SendQueue = std::queue< ILinkMessage* >;
/// parsed link layer message
struct ILinkMessage : public IBEncodeMessage

@ -83,7 +83,8 @@ llarp_nodedb_del_rc(struct llarp_nodedb *n, const llarp::RouterID &pk);
/// struct for async rc verification
struct llarp_async_verify_rc;
typedef void (*llarp_async_verify_rc_hook_func)(struct llarp_async_verify_rc *);
using llarp_async_verify_rc_hook_func =
std::function< void(struct llarp_async_verify_rc *) >;
/// verify rc request
struct llarp_async_verify_rc
@ -118,7 +119,8 @@ llarp_nodedb_async_verify(struct llarp_async_verify_rc *job);
struct llarp_async_load_rc;
typedef void (*llarp_async_load_rc_hook_func)(struct llarp_async_load_rc *);
using llarp_async_load_rc_hook_func =
std::function< void(struct llarp_async_load_rc *) >;
struct llarp_async_load_rc
{

@ -280,19 +280,19 @@ namespace llarp
/// A path we made
struct Path : public IHopHandler, public llarp::routing::IMessageHandler
{
typedef std::function< void(Path*) > BuildResultHookFunc;
typedef std::function< bool(Path*, llarp_time_t) > CheckForDeadFunc;
typedef std::function< bool(Path*, const PathID_t&, uint64_t) >
DropHandlerFunc;
typedef std::vector< PathHopConfig > HopList;
typedef std::function< bool(Path*, const service::ProtocolFrame*) >
DataHandlerFunc;
typedef std::function< bool(Path*) > ExitUpdatedFunc;
typedef std::function< bool(Path*) > ExitClosedFunc;
typedef std::function< bool(Path*, llarp_buffer_t) >
ExitTrafficHandlerFunc;
using BuildResultHookFunc = std::function< void(Path*) >;
using CheckForDeadFunc = std::function< bool(Path*, llarp_time_t) >;
using DropHandlerFunc =
std::function< bool(Path*, const PathID_t&, uint64_t) >;
using HopList = std::vector< PathHopConfig >;
using DataHandlerFunc =
std::function< bool(Path*, const service::ProtocolFrame*) >;
using ExitUpdatedFunc = std::function< bool(Path*) >;
using ExitClosedFunc = std::function< bool(Path*) >;
using ExitTrafficHandlerFunc =
std::function< bool(Path*, llarp_buffer_t) >;
/// (path, backoff) backoff is 0 on success
typedef std::function< bool(Path*, llarp_time_t) > ObtainedExitHandler;
using ObtainedExitHandler = std::function< bool(Path*, llarp_time_t) >;
HopList hops;
@ -612,15 +612,15 @@ namespace llarp
void
RemovePathSet(PathSet* set);
typedef std::multimap< PathID_t, std::shared_ptr< TransitHop > >
TransitHopsMap_t;
using TransitHopsMap_t =
std::multimap< PathID_t, std::shared_ptr< TransitHop > >;
typedef std::pair< util::Mutex, TransitHopsMap_t > SyncTransitMap_t;
using SyncTransitMap_t = std::pair< util::Mutex, TransitHopsMap_t >;
// maps path id -> pathset owner of path
typedef std::map< PathID_t, PathSet* > OwnedPathsMap_t;
using OwnedPathsMap_t = std::map< PathID_t, PathSet* >;
typedef std::pair< util::Mutex, OwnedPathsMap_t > SyncOwnedPathsMap_t;
using SyncOwnedPathsMap_t = std::pair< util::Mutex, OwnedPathsMap_t >;
llarp_threadpool*
Worker();

@ -6,7 +6,7 @@
namespace llarp
{
typedef AlignedBuffer< PATHIDSIZE > PathID_t;
using PathID_t = AlignedBuffer< PATHIDSIZE >;
}
#endif
#endif

@ -60,6 +60,10 @@ namespace llarp
void
Tick(llarp_time_t now, llarp_router* r);
/// count the number of paths that will exist at this timestamp in future
size_t
NumPathsExistingAt(llarp_time_t futureTime) const;
void
RemovePath(Path* path);
@ -176,7 +180,7 @@ namespace llarp
size_t m_NumPaths;
private:
typedef std::pair< RouterID, PathID_t > PathInfo_t;
using PathInfo_t = std::pair< RouterID, PathID_t >;
struct PathInfoHash
{
@ -187,7 +191,7 @@ namespace llarp
}
};
typedef std::unordered_map< PathInfo_t, Path*, PathInfoHash > PathMap_t;
using PathMap_t = std::unordered_map< PathInfo_t, Path*, PathInfoHash >;
PathMap_t m_Paths;
};

@ -69,8 +69,8 @@ namespace llarp
MarkPathSuccess(path::Path* p);
private:
typedef llarp::util::Lock lock_t;
typedef llarp::util::Mutex mtx_t;
using lock_t = llarp::util::Lock;
using mtx_t = llarp::util::Mutex;
mtx_t m_ProfilesMutex;
std::map< RouterID, RouterProfile > m_Profiles;
};

@ -5,7 +5,7 @@
namespace llarp
{
typedef AlignedBuffer< 32 > RouterID;
using RouterID = AlignedBuffer< 32 >;
}
#endif
#endif

@ -6,7 +6,7 @@
namespace llarp
{
typedef AlignedBuffer< 32 > RoutingEndpoint_t;
using RoutingEndpoint_t = AlignedBuffer< 32 >;
/// Interface for end to end crypto between endpoints
struct IRoutingEndpoint
@ -15,4 +15,4 @@ namespace llarp
};
} // namespace llarp
#endif
#endif

@ -9,9 +9,9 @@ namespace llarp
{
struct Config
{
typedef std::list< std::pair< std::string, std::string > >
section_values_t;
typedef std::pair< std::string, section_values_t > section_t;
using section_values_t =
std::list< std::pair< std::string, std::string > >;
using section_t = std::pair< std::string, section_values_t >;
std::list< section_t > services;
@ -20,4 +20,4 @@ namespace llarp
};
} // namespace service
} // namespace llarp
#endif
#endif

@ -72,9 +72,8 @@ namespace llarp
llarp::Addr &localPrivateIpAddr);
bool
AddDefaultEndpoint(const std::string &ifaddr, const std::string &ifname,
const std::string &remoteResovler,
const std::string &localResolver);
AddDefaultEndpoint(
const std::unordered_multimap< std::string, std::string > &opts);
bool
AddEndpoint(const Config::section_t &conf, bool autostart = false);

@ -137,8 +137,13 @@ namespace llarp
HandleDataMessage(const PathID_t&, ProtocolMessage* msg);
virtual bool
ProcessDataMessage(__attribute__((unused)) ProtocolMessage* msg)
ProcessDataMessage(ProtocolMessage* msg)
{
#ifdef TESTNET
llarp::LogInfo("Got message from ", msg->sender.Addr());
#else
(void)msg;
#endif
return true;
}
@ -188,7 +193,7 @@ namespace llarp
bool
CheckPathIsDead(path::Path* p, llarp_time_t latency);
typedef std::queue< PendingBuffer > PendingBufferQueue;
using PendingBufferQueue = std::queue< PendingBuffer >;
struct SendContext
{
@ -326,7 +331,7 @@ namespace llarp
// passed a sendto context when we have a path established otherwise
// nullptr if the path was not made before the timeout
typedef std::function< void(Address, OutboundContext*) > PathEnsureHook;
using PathEnsureHook = std::function< void(Address, OutboundContext*) >;
/// return false if we have already called this function before for this
/// address

@ -9,7 +9,7 @@ namespace llarp
{
namespace service
{
typedef llarp::AlignedBuffer< 16 > ConvoTag;
using ConvoTag = llarp::AlignedBuffer< 16 >;
struct ProtocolMessage;
struct IDataHandler

@ -17,7 +17,7 @@ namespace llarp
{
constexpr std::size_t MAX_PROTOCOL_MESSAGE_SIZE = 2048 * 2;
typedef uint64_t ProtocolType;
using ProtocolType = uint64_t;
constexpr ProtocolType eProtocolText = 0UL;
constexpr ProtocolType eProtocolTraffic = 1UL;

@ -8,7 +8,7 @@ namespace llarp
{
/// hidden service address
typedef llarp::AlignedBuffer< 16 > VanityNonce;
using VanityNonce = llarp::AlignedBuffer< 16 >;
} // namespace service
} // namespace llarp
#endif
#endif

@ -6,7 +6,7 @@
#include <string>
namespace llarp
{
typedef std::string_view string_view;
using string_view = std::string_view;
static std::string
string_view_string(const string_view& v)
{
@ -17,7 +17,7 @@ namespace llarp
#include <string>
namespace llarp
{
typedef std::string string_view;
using string_view = std::string;
static std::string
string_view_string(const string_view& v)
@ -26,4 +26,4 @@ namespace llarp
};
} // namespace llarp
#endif
#endif
#endif

@ -34,9 +34,9 @@ namespace llarp
}
};
typedef std::mutex mtx_t;
typedef std::unique_lock< std::mutex > lock_t;
typedef std::condition_variable cond_t;
using mtx_t = std::mutex;
using lock_t = std::unique_lock< std::mutex >;
using cond_t = std::condition_variable;
struct Mutex
{

@ -5,8 +5,11 @@
#include <llarp/threadpool.h>
#include <llarp/time.hpp>
#include <functional>
/** called with userptr, original timeout, left */
typedef void (*llarp_timer_handler_func)(void *, uint64_t, uint64_t);
using llarp_timer_handler_func =
std::function< void(void *, uint64_t, uint64_t) >;
struct llarp_timeout_job
{

@ -478,7 +478,8 @@ namespace tl
struct optional_storage_base
{
TL_OPTIONAL_11_CONSTEXPR
optional_storage_base() noexcept : m_dummy(), m_has_value(false)
optional_storage_base() noexcept
: m_dummy(), m_has_value(false)
{
}
@ -514,7 +515,8 @@ namespace tl
struct optional_storage_base< T, true >
{
TL_OPTIONAL_11_CONSTEXPR
optional_storage_base() noexcept : m_dummy(), m_has_value(false)
optional_storage_base() noexcept
: m_dummy(), m_has_value(false)
{
}

@ -14,10 +14,10 @@ namespace abyss
{
namespace http
{
typedef std::string RPC_Method_t;
typedef json::Value RPC_Params;
typedef json::Document RPC_Response;
typedef std::unordered_multimap< std::string, std::string > Headers_t;
using RPC_Method_t = std::string;
using RPC_Params = json::Value;
using RPC_Response = json::Document;
using Headers_t = std::unordered_multimap< std::string, std::string >;
struct ConnImpl;
/// jsonrpc response handler for client
@ -55,7 +55,7 @@ namespace abyss
/// jsonrpc client
struct JSONRPC
{
typedef std::function< IRPCClientHandler*(ConnImpl*) > HandlerFactory;
using HandlerFactory = std::function< IRPCClientHandler*(ConnImpl*) >;
JSONRPC();
~JSONRPC();
@ -115,4 +115,4 @@ namespace abyss
} // namespace http
} // namespace abyss
#endif
#endif

@ -11,7 +11,7 @@ namespace abyss
{
struct RequestHeader
{
typedef std::unordered_multimap< std::string, std::string > Headers_t;
using Headers_t = std::unordered_multimap< std::string, std::string >;
Headers_t Headers;
std::string Method;
std::string Path;
@ -33,4 +33,4 @@ namespace abyss
} // namespace http
} // namespace abyss
#endif
#endif

@ -10,7 +10,7 @@ namespace abyss
{
namespace json
{
typedef std::unordered_map< std::string, std::any > Object;
using Object = std::unordered_map< std::string, std::any >;
}
} // namespace abyss
#else
@ -19,17 +19,17 @@ namespace abyss
{
namespace json
{
typedef rapidjson::Document Document;
typedef rapidjson::Value Value;
using Document = rapidjson::Document;
using Value = rapidjson::Value;
} // namespace json
} // namespace abyss
#endif
namespace abyss
{
#if __cplusplus >= 201703L
typedef std::string_view string_view;
using string_view = std::string_view;
#else
typedef std::string string_view;
using string_view = std::string;
#endif
namespace json
{

@ -19,9 +19,9 @@ namespace abyss
struct IRPCHandler
{
typedef std::string Method_t;
typedef json::Value Params;
typedef json::Document Response;
using Method_t = std::string;
using Params = json::Value;
using Response = json::Document;
IRPCHandler(ConnImpl* impl);

@ -9,7 +9,7 @@ namespace llarp
{
struct Config
{
typedef std::list< std::pair< std::string, std::string > > section_t;
using section_t = std::list< std::pair< std::string, std::string > >;
section_t router;
section_t network;

@ -47,32 +47,32 @@ namespace llarp
}
bool
Validate(const RouterID &) const
Validate(const RouterID &) const override
{
// TODO: check with lokid
return true;
}
void
Start(const TXOwner &peer)
Start(const TXOwner &peer) override
{
parent->DHTSendTo(peer.node,
new FindRouterMessage(parent->OurKey(), peer.txid));
}
bool
GetNextPeer(Key_t &, const std::set< Key_t > &)
GetNextPeer(Key_t &, const std::set< Key_t > &) override
{
return false;
}
void
DoNextRequest(const Key_t &)
DoNextRequest(const Key_t &) override
{
}
void
SendReply()
SendReply() override
{
llarp::LogInfo("got ", valuesFound.size(), " routers from exploration");
for(const auto &pk : valuesFound)
@ -324,7 +324,7 @@ namespace llarp
}
bool
Validate(const service::IntroSet &value) const
Validate(const service::IntroSet &value) const override
{
if(!value.Verify(parent->Crypto(), parent->Now()))
{
@ -339,52 +339,33 @@ namespace llarp
return true;
}
void
DoNextRequest(const Key_t &nextPeer)
{
// iterate to next peer
parent->LookupIntroSetIterative(
target, whoasked.node, whoasked.txid, nextPeer,
std::bind(&ServiceAddressLookup::HandleNextRequestResult, this,
std::placeholders::_1));
}
void
HandleNextRequestResult(const std::vector< service::IntroSet > &results)
{
// merge results
std::set< service::IntroSet > found;
for(const auto &introset : valuesFound)
found.insert(introset);
for(const auto &introset : results)
found.insert(introset);
valuesFound.clear();
for(const auto &introset : found)
valuesFound.push_back(introset);
// send reply
SendReply();
}
bool
GetNextPeer(Key_t &next, const std::set< Key_t > &exclude)
GetNextPeer(Key_t &next, const std::set< Key_t > &exclude) override
{
Key_t k = target.data();
return parent->nodes->FindCloseExcluding(k, next, exclude);
}
void
Start(const TXOwner &peer)
Start(const TXOwner &peer) override
{
parent->DHTSendTo(peer.node,
new FindIntroMessage(peer.txid, target, R));
}
void
DoNextRequest(const Key_t &ask) override
{
if(R)
parent->LookupIntroSetRecursive(target, whoasked.node, whoasked.txid,
ask, R - 1);
else
parent->LookupIntroSetIterative(target, whoasked.node, whoasked.txid,
ask);
}
virtual void
SendReply()
SendReply() override
{
if(handleResult)
handleResult(valuesFound);
@ -408,7 +389,7 @@ namespace llarp
}
void
SendReply()
SendReply() override
{
auto path =
parent->router->paths.GetByUpstream(parent->OurKey(), localPath);
@ -461,7 +442,7 @@ namespace llarp
}
bool
Validate(const service::IntroSet &introset) const
Validate(const service::IntroSet &introset) const override
{
if(I.A != introset.A)
{
@ -473,7 +454,7 @@ namespace llarp
}
void
Start(const TXOwner &peer)
Start(const TXOwner &peer) override
{
std::vector< Key_t > exclude;
for(const auto &router : dontTell)
@ -483,18 +464,18 @@ namespace llarp
}
bool
GetNextPeer(Key_t &, const std::set< Key_t > &)
GetNextPeer(Key_t &, const std::set< Key_t > &) override
{
return false;
}
void
DoNextRequest(const Key_t &)
DoNextRequest(const Key_t &) override
{
}
void
SendReply()
SendReply() override
{
// don't need this
}
@ -550,7 +531,7 @@ namespace llarp
}
bool
Validate(const service::IntroSet &introset) const
Validate(const service::IntroSet &introset) const override
{
if(!introset.Verify(parent->Crypto(), parent->Now()))
{
@ -566,26 +547,25 @@ namespace llarp
}
void
Start(const TXOwner &peer)
Start(const TXOwner &peer) override
{
parent->DHTSendTo(peer.node,
new FindIntroMessage(target, peer.txid, R));
}
bool
GetNextPeer(__attribute__((unused)) Key_t &nextpeer,
__attribute__((unused)) const std::set< Key_t > &exclude)
GetNextPeer(Key_t &, const std::set< Key_t > &) override
{
return false;
}
void
DoNextRequest(__attribute__((unused)) const Key_t &nextPeer)
DoNextRequest(const Key_t &) override
{
}
void
SendReply()
SendReply() override
{
std::set< service::IntroSet > found;
for(const auto &remoteTag : valuesFound)
@ -636,7 +616,7 @@ namespace llarp
}
void
SendReply()
SendReply() override
{
auto path =
parent->router->paths.GetByUpstream(parent->OurKey(), localPath);
@ -717,7 +697,7 @@ namespace llarp
}
bool
Validate(const RouterContact &rc) const
Validate(const RouterContact &rc) const override
{
if(!rc.Verify(parent->Crypto()))
{
@ -728,20 +708,18 @@ namespace llarp
}
bool
GetNextPeer(__attribute__((unused)) Key_t &next,
__attribute__((unused)) const std::set< Key_t > &exclude)
GetNextPeer(Key_t &, const std::set< Key_t > &) override
{
// TODO: implement iterative (?)
return false;
}
void
DoNextRequest(__attribute__((unused)) const Key_t &next)
DoNextRequest(const Key_t &) override
{
}
void
Start(const TXOwner &peer)
Start(const TXOwner &peer) override
{
parent->DHTSendTo(
peer.node,
@ -749,7 +727,7 @@ namespace llarp
}
virtual void
SendReply()
SendReply() override
{
if(resultHandler)
{
@ -777,7 +755,7 @@ namespace llarp
}
void
SendReply()
SendReply() override
{
auto path =
parent->router->paths.GetByUpstream(parent->OurKey(), localPath);

@ -317,6 +317,7 @@ generic_handle_dnsc_recvfrom(dnsc_answer_request *request,
llarp::LogDebug("Read an addl RR for ",
request->question.name, " at ", std::to_string(pos));
*/
// castBuf += answer->name.length() + 4 + 4 + 4 + answer->rdLen;
if((size_t)pos > sz)
{
llarp::LogWarn("Would read past end of dns packet. for ",

@ -83,13 +83,13 @@ namespace llarp
};
};
typedef llarp::util::CoDelQueue< WriteBuffer, WriteBuffer::GetTime,
WriteBuffer::PutTime, WriteBuffer::Compare,
llarp::util::NullMutex,
llarp::util::NullLock, 5, 100, 128 >
LossyWriteQueue_t;
using LossyWriteQueue_t =
llarp::util::CoDelQueue< WriteBuffer, WriteBuffer::GetTime,
WriteBuffer::PutTime, WriteBuffer::Compare,
llarp::util::NullMutex, llarp::util::NullLock,
5, 100, 128 >;
typedef std::deque< WriteBuffer > LosslessWriteQueue_t;
using LosslessWriteQueue_t = std::deque< WriteBuffer >;
// on windows, tcp/udp event loops are socket fds
// and TUN device is a plain old fd
@ -319,13 +319,13 @@ namespace llarp
};
};
typedef llarp::util::CoDelQueue<
WriteBuffer, WriteBuffer::GetTime, WriteBuffer::PutTime,
WriteBuffer::Compare, WriteBuffer::GetNow, llarp::util::NullMutex,
llarp::util::NullLock, 5, 100, 1024 >
LossyWriteQueue_t;
using LossyWriteQueue_t =
llarp::util::CoDelQueue< WriteBuffer, WriteBuffer::GetTime,
WriteBuffer::PutTime, WriteBuffer::Compare,
WriteBuffer::GetNow, llarp::util::NullMutex,
llarp::util::NullLock, 5, 100, 1024 >;
typedef std::deque< WriteBuffer > LosslessWriteQueue_t;
using LosslessWriteQueue_t = std::deque< WriteBuffer >;
int fd;
int flags = 0;

@ -22,8 +22,12 @@ namespace llarp
bool
BaseSession::ShouldBuildMore(llarp_time_t now) const
{
return AvailablePaths(llarp::path::ePathRoleExit) == 0
|| path::Builder::ShouldBuildMore(now);
const size_t expect = (1 + (m_NumPaths / 2));
if(NumPathsExistingAt(now + (10 * 1000)) < expect)
return true;
if(AvailablePaths(llarp::path::ePathRoleExit) < expect)
return true;
return false;
}
bool

@ -22,8 +22,8 @@ namespace llarp
{
namespace util
{
typedef std::function< bool(const fs::path &) > PathVisitor;
typedef std::function< void(const fs::path &, PathVisitor) > PathIter;
using PathVisitor = std::function< bool(const fs::path &) >;
using PathIter = std::function< void(const fs::path &, PathVisitor) >;
static PathIter IterDir = [](const fs::path &path, PathVisitor visit) {
DIR *d = opendir(path.string().c_str());

@ -300,7 +300,7 @@ namespace llarp
return false;
huint32_t ip = GetIPForIdent(pk);
m_ActiveExits.insert(
std::make_pair((llarp::PubKey)pk,
std::make_pair(pk,
std::make_unique< llarp::exit::Endpoint >(
pk, path, !wantInternet, ip, this)));
m_Paths[path] = pk;

@ -335,7 +335,7 @@ namespace llarp
TunEndpoint::Tick(llarp_time_t now)
{
// call tun code in endpoint logic in case of network isolation
llarp_logic_queue_job(EndpointLogic(), {this, handleTickTun});
//llarp_logic_queue_job(EndpointLogic(), {this, handleTickTun});
FlushSend();
Endpoint::Tick(now);
}

@ -48,9 +48,9 @@ namespace ini
{
}
typedef std::list< std::pair< std::string, std::string > > value_map_t;
typedef std::map< std::string, Level > section_map_t;
typedef std::list< section_map_t::const_iterator > sections_t;
using value_map_t = std::list< std::pair< std::string, std::string > >;
using section_map_t = std::map< std::string, Level >;
using sections_t = std::list< section_map_t::const_iterator >;
value_map_t values;
section_map_t sections;
sections_t ordered_sections;

@ -378,7 +378,7 @@ _llarp_nt_getadaptersaddresses(struct llarp_nt_ifaddrs_t** ifap)
/* default IPv6 route */
if(AF_INET6 == lpSockaddr->sa_family && 0 == prefix->PrefixLength
&& IN6_IS_ADDR_UNSPECIFIED(
&((struct sockaddr_in6*)(lpSockaddr))->sin6_addr))
&((struct sockaddr_in6*)(lpSockaddr))->sin6_addr))
{
#ifdef DEBUG
fprintf(stderr,

@ -41,6 +41,18 @@ namespace llarp
return 0;
}
size_t
PathSet::NumPathsExistingAt(llarp_time_t futureTime) const
{
size_t num = 0;
for(const auto & item : m_Paths)
{
if(!item.second->Expired(futureTime))
++num;
}
return num;
}
void
PathSet::Tick(llarp_time_t now, llarp_router* r)
{

@ -163,13 +163,7 @@ llarp_router::PersistSessionUntil(const llarp::RouterID &remote,
llarp_time_t until)
{
llarp::LogDebug("persist session to ", remote, " until ", until);
if(m_PersistingSessions.find(remote) == m_PersistingSessions.end())
m_PersistingSessions[remote] = until;
else
{
if(m_PersistingSessions[remote] < until)
m_PersistingSessions[remote] = until;
}
m_PersistingSessions[remote] = std::max(until, m_PersistingSessions[remote]);
}
constexpr size_t MaxPendingSendQueueSize = 8;
@ -369,7 +363,7 @@ llarp_router::on_verify_client_rc(llarp_async_verify_rc *job)
llarp::PubKey pk(job->rc.pubkey);
router->FlushOutboundFor(pk, router->GetLinkWithSessionByPubkey(pk));
delete ctx;
delete job;
router->pendingVerifyRC.erase(pk);
}
void
@ -387,8 +381,9 @@ llarp_router::on_verify_server_rc(llarp_async_verify_rc *job)
ctx->establish_job->Failed();
}
delete ctx;
delete job;
router->DiscardOutboundFor(pk);
router->pendingVerifyRC.erase(pk);
return;
}
// we're valid, which means it's already been committed to the nodedb
@ -418,7 +413,7 @@ llarp_router::on_verify_server_rc(llarp_async_verify_rc *job)
else
router->FlushOutboundFor(pk, router->GetLinkWithSessionByPubkey(pk));
delete ctx;
delete job;
router->pendingVerifyRC.erase(pk);
}
void
@ -616,19 +611,21 @@ llarp_router::GetLinkWithSessionByPubkey(const llarp::RouterID &pubkey)
}
void
llarp_router::FlushOutboundFor(const llarp::RouterID remote,
llarp_router::FlushOutboundFor(llarp::RouterID remote,
llarp::ILinkLayer *chosen)
{
llarp::LogDebug("Flush outbound for ", remote);
pendingEstablishJobs.erase(remote);
auto itr = outboundMessageQueue.find(remote);
if(itr == outboundMessageQueue.end())
{
pendingEstablishJobs.erase(remote);
return;
}
if(!chosen)
{
DiscardOutboundFor(remote);
pendingEstablishJobs.erase(remote);
return;
}
while(itr->second.size())
@ -640,6 +637,7 @@ llarp_router::FlushOutboundFor(const llarp::RouterID remote,
itr->second.pop();
}
pendingEstablishJobs.erase(remote);
}
void
@ -667,7 +665,18 @@ void
llarp_router::async_verify_RC(const llarp::RouterContact &rc,
llarp::ILinkLayer *link)
{
llarp_async_verify_rc *job = new llarp_async_verify_rc();
if(pendingVerifyRC.count(rc.pubkey))
return;
if(rc.IsPublicRouter() && whitelistRouters)
{
if(lokinetRouters.find(rc.pubkey) == lokinetRouters.end())
{
llarp::LogInfo(rc.pubkey, " is NOT a valid service node, rejecting");
link->CloseSessionTo(rc.pubkey);
return;
}
}
llarp_async_verify_rc *job = &pendingVerifyRC[rc.pubkey];
llarp::async_verify_context *ctx = new llarp::async_verify_context();
ctx->router = this;
ctx->establish_job = nullptr;
@ -690,17 +699,7 @@ llarp_router::async_verify_RC(const llarp::RouterContact &rc,
job->hook = &llarp_router::on_verify_server_rc;
else
job->hook = &llarp_router::on_verify_client_rc;
if(rc.IsPublicRouter() && whitelistRouters)
{
if(lokinetRouters.find(rc.pubkey) == lokinetRouters.end())
{
llarp::LogInfo(rc.pubkey, " is NOT a valid service node, rejecting");
link->CloseSessionTo(rc.pubkey);
job->valid = false;
job->hook(job);
return;
}
}
llarp_nodedb_async_verify(job);
}
@ -838,24 +837,17 @@ llarp_router::Run()
llarp::LogWarn("Link ", link->Name(), " failed to start");
}
llarp::LogInfo("starting hidden service context...");
if(!hiddenServiceContext.StartAll())
{
llarp::LogError("Failed to start hidden service context");
return;
}
uint64_t delay = ((llarp_randint() % 10) * 500) + 500;
if(IBLinksStarted > 0)
{
// initialize as service node
if(!InitServiceNode())
{
llarp::LogError("Failed to initialize service node");
Close();
return;
}
// immediate connect all for service node
uint64_t delay = llarp_randint() % 100;
llarp_logic_call_later(logic, {delay, this, &ConnectAll});
delay = llarp_randint() % 50;
}
else
{
@ -868,75 +860,32 @@ llarp_router::Run()
if(!_rc.Sign(&crypto, identity))
{
llarp::LogError("failed to regenerate keys and sign RC");
Close();
return;
}
// don't create default if we already have some defined
if(this->ShouldCreateDefaultHiddenService())
// generate default hidden service
llarp::LogInfo("setting up default network endpoint");
if(!CreateDefaultHiddenService())
{
// generate default hidden service
if(!CreateDefaultHiddenService())
return;
llarp::LogError("failed to set up default network endpoint");
Close();
return;
}
// delayed connect all for clients
uint64_t delay = ((llarp_randint() % 10) * 500) + 500;
llarp_logic_call_later(logic, {delay, this, &ConnectAll});
}
llarp::LogInfo("starting hidden service context...");
if(!hiddenServiceContext.StartAll())
{
llarp::LogError("Failed to start hidden service context");
Close();
return;
}
llarp::PubKey ourPubkey = pubkey();
llarp::LogInfo("starting dht context as ", ourPubkey);
llarp_dht_context_start(dht, ourPubkey);
ScheduleTicker(1000);
}
bool
llarp_router::ShouldCreateDefaultHiddenService()
{
// llarp::LogInfo("IfName: ", this->defaultIfName, " defaultIfName: ",
// this->defaultIfName);
if(this->defaultIfName == "auto" || this->defaultIfName == "auto")
{
// auto detect if we have any pre-defined endpoints
// no if we have a endpoints
if(hiddenServiceContext.hasEndpoints())
{
llarp::LogInfo("Auto mode detected and we have endpoints");
return false;
}
// we don't have any endpoints, auto configure settings
// set a default IP range
this->defaultIfAddr = llarp::findFreePrivateRange();
if(this->defaultIfAddr == "")
{
llarp::LogError(
"Could not find any free lokitun interface names, can't auto set up "
"default HS context for client");
this->defaultIfAddr = "no";
return false;
}
// pick an ifName
this->defaultIfName = llarp::findFreeLokiTunIfName();
if(this->defaultIfName == "")
{
llarp::LogError(
"Could not find any free private ip ranges, can't auto set up "
"default HS context for client");
this->defaultIfName = "no";
return false;
}
// auto config'd, go ahead and create it
return true;
}
// not auto mode then just check to make sure it's explicitly disabled
if(this->defaultIfAddr != "" && this->defaultIfAddr != "no"
&& this->defaultIfName != "" && this->defaultIfName != "no")
{
return true;
}
return false;
// delayed connect all
llarp_logic_call_later(logic, {delay, this, &ConnectAll});
}
bool
@ -945,8 +894,7 @@ llarp_router::InitServiceNode()
llarp::LogInfo("accepting transit traffic");
paths.AllowTransit();
llarp_dht_allow_transit(dht);
exitContext.AddExitEndpoint("default-connectivity", exitConf);
return true;
return exitContext.AddExitEndpoint("default-connectivity", netConfig);
}
void
@ -1028,14 +976,26 @@ llarp_router::InitOutboundLink()
bool
llarp_router::CreateDefaultHiddenService()
{
if(upstreamResolvers.size())
return hiddenServiceContext.AddDefaultEndpoint(defaultIfAddr, defaultIfName,
upstreamResolvers.front(),
resolverBindAddr);
else
return hiddenServiceContext.AddDefaultEndpoint(defaultIfAddr, defaultIfName,
defaultUpstreamResolver,
resolverBindAddr);
// fallback defaults
static const std::unordered_map< std::string,
std::function< std::string(void) > >
netConfigDefaults = {
{"ifname", llarp::findFreeLokiTunIfName},
{"ifaddr", llarp::findFreePrivateRange},
{"local-dns", []() -> std::string { return "127.0.0.1:53"; }},
{"upstream-dns", []() -> std::string { return "1.1.1.1:53"; }}};
// populate with fallback defaults if values not present
auto itr = netConfigDefaults.begin();
while(itr != netConfigDefaults.end())
{
if(netConfig.count(itr->first) == 0)
{
netConfig.emplace(std::make_pair(itr->first, itr->second()));
}
++itr;
}
// add endpoint
return hiddenServiceContext.AddDefaultEndpoint(netConfig);
}
bool
@ -1242,14 +1202,6 @@ namespace llarp
}
else if(StrEq(section, "network"))
{
if(StrEq(key, "ifaddr"))
{
self->defaultIfAddr = val;
}
if(StrEq(key, "ifname"))
{
self->defaultIfName = val;
}
if(StrEq(key, "profiles"))
{
self->routerProfilesFile = val;
@ -1258,7 +1210,7 @@ namespace llarp
}
else
{
self->exitConf.insert(std::make_pair(key, val));
self->netConfig.insert(std::make_pair(key, val));
}
}
else if(StrEq(section, "api"))
@ -1303,12 +1255,12 @@ namespace llarp
if(StrEq(key, "upstream"))
{
llarp::LogInfo("add upstream resolver ", val);
self->upstreamResolvers.push_back(val);
self->netConfig.emplace(std::make_pair("upstream-dns", val));
}
if(StrEq(key, "bind"))
{
llarp::LogInfo("set local dns to ", val);
self->resolverBindAddr = val;
self->netConfig.emplace(std::make_pair("local-dns", val));
}
}
else if(StrEq(section, "connect"))

@ -100,17 +100,17 @@ struct llarp_router
llarp::service::Context hiddenServiceContext;
std::string defaultIfAddr = "auto";
std::string defaultIfName = "auto";
using NetConfig_t = std::unordered_multimap< std::string, std::string >;
/// default exit config
llarp::exit::Context::Config_t exitConf;
/// default network config for default network interface
NetConfig_t netConfig;
bool
ExitEnabled() const
{
auto itr = exitConf.find("exit");
if(itr == exitConf.end())
// TODO: use equal_range ?
auto itr = netConfig.find("exit");
if(itr == netConfig.end())
return false;
return llarp::IsTrueValue(itr->second.c_str());
}
@ -118,9 +118,6 @@ struct llarp_router
bool
CreateDefaultHiddenService();
bool
ShouldCreateDefaultHiddenService();
const std::string DefaultRPCBindAddr = "127.0.0.1:1190";
bool enableRPCServer = true;
std::unique_ptr< llarp::rpc::Server > rpcServer;
@ -137,7 +134,7 @@ struct llarp_router
llarp::Profiling routerProfiling;
std::string routerProfilesFile = "profiles.dat";
typedef std::queue< std::vector< byte_t > > MessageQueue;
using MessageQueue = std::queue< std::vector< byte_t > >;
/// outbound message queue
std::unordered_map< llarp::RouterID, MessageQueue, llarp::RouterID::Hash >
@ -153,6 +150,11 @@ struct llarp_router
llarp::RouterID::Hash >
pendingEstablishJobs;
// pending RCs to be verified by pubkey
std::unordered_map< llarp::RouterID, llarp_async_verify_rc,
llarp::RouterID::Hash >
pendingVerifyRC;
// sessions to persist -> timestamp to end persist at
std::unordered_map< llarp::RouterID, llarp_time_t, llarp::RouterID::Hash >
m_PersistingSessions;
@ -162,11 +164,6 @@ struct llarp_router
std::unordered_map< llarp::PubKey, llarp_time_t, llarp::PubKey::Hash >
lokinetRouters;
// TODO: change me if needed
const std::string defaultUpstreamResolver = "1.1.1.1:53";
std::list< std::string > upstreamResolvers;
std::string resolverBindAddr = "127.0.0.1:53";
llarp_router();
~llarp_router();
@ -254,8 +251,7 @@ struct llarp_router
/// manually flush outbound message queue for just 1 router
void
FlushOutboundFor(const llarp::RouterID remote,
llarp::ILinkLayer *chosen = nullptr);
FlushOutboundFor(llarp::RouterID remote, llarp::ILinkLayer *chosen = nullptr);
/// manually discard all pending messages to remote router
void
@ -336,10 +332,8 @@ struct llarp_router
void
mergeHiddenServiceConfig(const Config &in, Config &out)
{
for(const auto &resolver : upstreamResolvers)
out.push_back({"upstream-dns", resolver});
out.push_back({"local-dns", resolverBindAddr});
for(const auto &item : netConfig)
out.push_back({item.first, item.second});
for(const auto &item : in)
out.push_back({item.first, item.second});
}

@ -207,18 +207,20 @@ namespace llarp
}
bool
Context::AddDefaultEndpoint(const std::string &ifaddr,
const std::string &ifname,
const std::string &remoteResolver,
const std::string &localResolver)
Context::AddDefaultEndpoint(
const std::unordered_multimap< std::string, std::string > &opts)
{
return AddEndpoint({"default",
{{"type", "tun"},
{"ifaddr", ifaddr},
{"ifname", ifname},
{"local-dns", localResolver},
{"upstream-dns", remoteResolver}}},
true);
Config::section_values_t configOpts;
configOpts.push_back({"type", "tun"});
{
auto itr = opts.begin();
while(itr != opts.end())
{
configOpts.push_back({itr->first, itr->second});
++itr;
}
}
return AddEndpoint({"default", configOpts});
}
bool

@ -94,7 +94,7 @@ namespace llarp
llarp::LogWarn("could not publish descriptors for endpoint ", Name(),
" because we couldn't get enough valid introductions");
if(ShouldBuildMore(now) || forceRebuild)
ManualRebuild(1, llarp::path::ePathRoleInboundHS);
ManualRebuild(1);
return;
}
m_IntroSet.I.clear();
@ -197,7 +197,7 @@ namespace llarp
continue;
byte_t tmp[1024] = {0};
auto buf = StackBuffer< decltype(tmp) >(tmp);
if(!SendToOrQueue(introset.A.Addr(), buf, eProtocolText))
if(!SendToOrQueue(introset.A.Addr().data(), buf, eProtocolText))
{
llarp::LogWarn(Name(), " failed to send/queue data to ",
introset.A.Addr(), " for tag ", tag.ToString());
@ -1113,9 +1113,12 @@ namespace llarp
}
}
// no converstation
EnsurePathToService(remote, [](Address, OutboundContext*) {}, 5000,
false);
return false;
return EnsurePathToService(remote,
[](Address, OutboundContext* c) {
if(c)
c->UpdateIntroSet(true);
},
5000, false);
}
bool
@ -1159,7 +1162,7 @@ namespace llarp
}
return false;
}
Build(hops, llarp::path::ePathRoleOutboundHS);
Build(hops);
return true;
}
@ -1529,8 +1532,7 @@ namespace llarp
}
}
(void)roles;
return path::Builder::SelectHop(db, prev, cur, hop,
llarp::path::ePathRoleOutboundHS);
return path::Builder::SelectHop(db, prev, cur, hop, roles);
}
uint64_t
@ -1547,8 +1549,7 @@ namespace llarp
{
if(markedBad)
return false;
bool should = path::Builder::ShouldBuildMoreForRoles(
now, llarp::path::ePathRoleOutboundHS);
bool should = path::Builder::ShouldBuildMore(now);
// determinte newest intro
Introduction intro;
if(!GetNewestIntro(intro))

@ -10,8 +10,8 @@ namespace llarp
{
namespace thread
{
typedef util::Mutex mtx_t;
typedef util::Lock lock_t;
using mtx_t = util::Mutex;
using lock_t = util::Lock;
using Pool = ThreadPool;

Loading…
Cancel
Save