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.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
4 years ago
|
#pragma once
|
||
|
|
||
|
#include "router_event.hpp"
|
||
|
|
||
|
namespace tooling
|
||
|
{
|
||
|
struct LinkSessionEstablishedEvent : public RouterEvent
|
||
|
{
|
||
|
llarp::RouterID remoteId;
|
||
|
bool inbound = false;
|
||
|
|
||
|
LinkSessionEstablishedEvent(
|
||
|
const llarp::RouterID& ourRouterId, const llarp::RouterID& remoteId_, bool inbound_)
|
||
|
: RouterEvent("Link: LinkSessionEstablishedEvent", ourRouterId, false)
|
||
|
, remoteId(remoteId_)
|
||
|
, inbound(inbound_)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
std::string
|
||
|
ToString() const
|
||
|
{
|
||
|
return RouterEvent::ToString() + (inbound ? "inbound" : "outbound")
|
||
|
+ " : LinkSessionEstablished with " + remoteId.ToString();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
struct ConnectionAttemptEvent : public RouterEvent
|
||
|
{
|
||
|
llarp::RouterID remoteId;
|
||
|
|
||
|
ConnectionAttemptEvent(const llarp::RouterID& ourRouterId, const llarp::RouterID& remoteId_)
|
||
|
: RouterEvent("Link: ConnectionAttemptEvent", ourRouterId, false), remoteId(remoteId_)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
std::string
|
||
|
ToString() const
|
||
|
{
|
||
|
return RouterEvent::ToString() + " : LinkSessionEstablished with " + remoteId.ToString();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
} // namespace tooling
|