49#include "librats/core/types.h"
51#include "librats/peer/peer_table.h"
52#include "librats/transport/link.h"
53#include "librats/transport/relay_link.h"
80 std::unique_ptr<Link> link,
81 ConnRole role,
bool connected) = 0;
102 ForwardedCircuit circuit) = 0;
107 ForwardedCircuit circuit) = 0;
115 std::shared_ptr<std::atomic<uint64_t>> bytes, uint64_t rate,
virtual void stop_forwarding(uint64_t cid)=0
virtual std::optional< PeerRoute > adopt_circuit(const PeerId &carrier, std::unique_ptr< Link > link, ConnRole role, bool connected)=0
Adopt link as a connection carried by the peer carrier, on the reactor that owns the carrier's own co...
virtual std::optional< PeerRoute > expect_relayed(const PeerId &carrier, uint64_t cid, ForwardedCircuit circuit)=0
Accept the dial that will come through carrier, the relay, as an Inbound connection — under the same ...
virtual void wake_circuit(PeerRoute route, uint32_t events)=0
Deliver poll-equivalent events (PollIn / PollOut / PollErr, see core/io_poller.h) to a circuit connec...
virtual std::optional< PeerRoute > dial_relayed(const PeerId &carrier, uint64_t cid, ForwardedCircuit circuit)=0
Dial the far end through carrier, the relay. The connection is Outbound.
virtual ~CircuitService()=default
virtual bool forward_datagrams(const PeerId &dialer, const PeerId &responder, uint64_t cid, std::shared_ptr< std::atomic< uint64_t > > bytes, uint64_t rate, uint64_t burst)=0
As the relay: forward the packets of cid between dialer and responder, counting their bytes into byte...
virtual void close_circuit(PeerRoute route, CloseReason reason)=0
Tear a circuit connection down.
Self-certifying peer identity.