mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.2 KiB
C++
69 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <router_id.hpp>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
namespace llarp
|
|
{
|
|
|
|
namespace path
|
|
{
|
|
struct Path;
|
|
struct PathHopConfig;
|
|
|
|
struct TransitHop;
|
|
|
|
} // namespace llarp::path
|
|
|
|
} // namespace llarp
|
|
|
|
|
|
namespace tooling
|
|
{
|
|
|
|
struct RouterHive;
|
|
|
|
struct RouterEvent
|
|
{
|
|
RouterEvent(std::string eventType, llarp::RouterID routerID, bool triggered);
|
|
|
|
virtual ~RouterEvent() = default;
|
|
|
|
virtual std::string ToString() const;
|
|
|
|
const std::string eventType;
|
|
|
|
llarp::RouterID routerID;
|
|
|
|
bool triggered = false;
|
|
};
|
|
|
|
using RouterEventPtr = std::unique_ptr<RouterEvent>;
|
|
|
|
|
|
struct PathAttemptEvent : public RouterEvent
|
|
{
|
|
PathAttemptEvent(const llarp::RouterID& routerID, std::shared_ptr<const llarp::path::Path> path);
|
|
|
|
std::string ToString() const override;
|
|
|
|
std::vector<llarp::path::PathHopConfig> hops;
|
|
};
|
|
|
|
struct PathRequestReceivedEvent : public RouterEvent
|
|
{
|
|
PathRequestReceivedEvent(const llarp::RouterID& routerID, std::shared_ptr<const llarp::path::TransitHop> hop);
|
|
|
|
std::string ToString() const override;
|
|
|
|
llarp::RouterID prevHop;
|
|
llarp::RouterID nextHop;
|
|
|
|
bool isEndpoint = false;
|
|
};
|
|
|
|
} // namespace tooling
|