2023-07-31 12:42:03 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <llarp/router_contact.hpp>
|
2023-10-24 13:18:03 +00:00
|
|
|
#include <llarp/router_id.hpp>
|
|
|
|
|
2023-09-21 14:20:49 +00:00
|
|
|
#include <quic.hpp>
|
2023-07-31 12:42:03 +00:00
|
|
|
|
|
|
|
namespace llarp::link
|
|
|
|
{
|
2023-08-28 14:56:44 +00:00
|
|
|
struct Connection
|
2023-07-31 12:42:03 +00:00
|
|
|
{
|
|
|
|
std::shared_ptr<oxen::quic::connection_interface> conn;
|
2023-09-21 14:20:49 +00:00
|
|
|
std::shared_ptr<oxen::quic::BTRequestStream> control_stream;
|
2023-11-02 12:30:38 +00:00
|
|
|
RemoteRC remote_rc;
|
2023-07-31 12:42:03 +00:00
|
|
|
|
2023-09-15 14:55:32 +00:00
|
|
|
// one side of a connection will be responsible for some things, e.g. heartbeat
|
|
|
|
bool inbound{false};
|
|
|
|
bool remote_is_relay{true};
|
|
|
|
|
|
|
|
Connection(
|
|
|
|
std::shared_ptr<oxen::quic::connection_interface>& c,
|
2023-09-21 14:20:49 +00:00
|
|
|
std::shared_ptr<oxen::quic::BTRequestStream>& s,
|
2023-11-02 12:30:38 +00:00
|
|
|
const RemoteRC& rc);
|
2023-07-31 12:42:03 +00:00
|
|
|
};
|
|
|
|
} // namespace llarp::link
|
2023-09-21 14:20:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
TODO:
|
|
|
|
- make control_stream a weak pointer?
|
|
|
|
*/
|