mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
39 lines
921 B
C++
39 lines
921 B
C++
#pragma once
|
|
|
|
#include <router/router.hpp>
|
|
|
|
namespace tooling
|
|
{
|
|
/// HiveRouter is a subclass of Router which overrides specific behavior in
|
|
/// order to perform testing-related functions. It exists largely to prevent
|
|
/// this behavior (which may often be "dangerous") from leaking into release
|
|
/// code.
|
|
struct HiveRouter : public llarp::Router
|
|
{
|
|
HiveRouter(
|
|
llarp_ev_loop_ptr netloop,
|
|
std::shared_ptr<llarp::Logic> logic,
|
|
RouterHive* hive);
|
|
|
|
virtual ~HiveRouter() = default;
|
|
|
|
/// Override logic to prevent base Router class from gossiping its RC.
|
|
virtual bool
|
|
disableGossipingRC_TestingOnly() override;
|
|
|
|
void
|
|
disableGossiping();
|
|
|
|
void
|
|
enableGossiping();
|
|
|
|
protected:
|
|
bool m_disableGossiping = false;
|
|
RouterHive* m_hive = nullptr;
|
|
|
|
virtual void
|
|
HandleRouterEvent(RouterEventPtr event) const override;
|
|
};
|
|
|
|
} // namespace tooling
|