2018-07-09 17:32:11 +00:00
|
|
|
#ifndef LLARP_PATHBUILDER_HPP_
|
|
|
|
#define LLARP_PATHBUILDER_HPP_
|
2018-06-18 22:03:50 +00:00
|
|
|
#include <llarp/pathbuilder.h>
|
2018-07-09 17:32:11 +00:00
|
|
|
#include <llarp/router.h>
|
2018-08-02 00:48:43 +00:00
|
|
|
#include <llarp/path.hpp>
|
2018-07-09 17:32:11 +00:00
|
|
|
#include <llarp/pathset.hpp>
|
2018-06-18 22:03:50 +00:00
|
|
|
|
2018-06-25 15:12:08 +00:00
|
|
|
struct llarp_pathbuilder_context : public llarp::path::PathSet
|
2018-06-18 22:03:50 +00:00
|
|
|
{
|
|
|
|
struct llarp_router* router;
|
|
|
|
struct llarp_dht_context* dht;
|
2018-08-02 00:48:43 +00:00
|
|
|
llarp::SecretKey enckey;
|
2018-07-19 21:08:11 +00:00
|
|
|
size_t numHops;
|
2018-06-25 15:12:08 +00:00
|
|
|
/// construct
|
2018-06-18 22:03:50 +00:00
|
|
|
llarp_pathbuilder_context(llarp_router* p_router,
|
2018-07-19 21:08:11 +00:00
|
|
|
struct llarp_dht_context* p_dht, size_t numPaths,
|
|
|
|
size_t numHops);
|
2018-06-25 15:12:08 +00:00
|
|
|
|
2018-07-11 16:11:19 +00:00
|
|
|
virtual ~llarp_pathbuilder_context(){};
|
|
|
|
|
2018-07-19 21:08:11 +00:00
|
|
|
virtual bool
|
|
|
|
SelectHop(llarp_nodedb* db, llarp_rc* prev, llarp_rc* cur, size_t hop);
|
|
|
|
|
2018-06-25 15:12:08 +00:00
|
|
|
void
|
|
|
|
BuildOne();
|
2018-08-02 00:48:43 +00:00
|
|
|
|
2018-08-12 17:22:29 +00:00
|
|
|
void
|
|
|
|
ManualRebuild(size_t N);
|
|
|
|
|
2018-08-02 00:48:43 +00:00
|
|
|
virtual byte_t*
|
|
|
|
GetTunnelEncryptionSecretKey();
|
2018-06-18 22:03:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|