lokinet/include/llarp/pathbuilder.hpp

42 lines
852 B
C++
Raw Normal View History

2018-07-09 17:32:11 +00:00
#ifndef LLARP_PATHBUILDER_HPP_
#define LLARP_PATHBUILDER_HPP_
2018-08-30 18:48:43 +00:00
2018-07-09 17:32:11 +00:00
#include <llarp/pathset.hpp>
2018-06-18 22:03:50 +00:00
2018-08-30 18:48:43 +00:00
namespace llarp
2018-06-18 22:03:50 +00:00
{
2018-08-30 18:48:43 +00:00
namespace path
{
struct Builder : public PathSet
{
struct llarp_router* router;
struct llarp_dht_context* dht;
llarp::SecretKey enckey;
size_t numHops;
/// construct
Builder(llarp_router* p_router, struct llarp_dht_context* p_dht,
size_t numPaths, size_t numHops);
virtual ~Builder();
virtual bool
SelectHop(llarp_nodedb* db, const RouterContact& prev, RouterContact& cur,
size_t hop);
virtual bool
ShouldBuildMore() const;
void
BuildOne();
void
ManualRebuild(size_t N);
virtual const byte_t*
GetTunnelEncryptionSecretKey() const;
};
} // namespace path
} // namespace llarp
2018-06-18 22:03:50 +00:00
#endif