llarp::ILinkSession

Inherited by llarp::iwp::Session

Public Types

Name
enum class DeliveryStatus { eDeliverySuccess = 0, eDeliveryDropped = 1}
delivery status of a message
using std::function< void(DeliveryStatus)> CompletionHandler
message delivery result hook function
using std::vector< byte_t > Packet_t
using std::vector< byte_t > Message_t

Public Functions

Name
virtual ~ILinkSession() =default
virtual void OnLinkEstablished(ILinkLayer * )
hook for utp for when we have established a connection
virtual void Pump() =0
called during pumping
virtual void Tick(llarp_time_t ) =0
called every timer tick
virtual bool SendMessageBuffer(Message_t , CompletionHandler handler, uint16_t priority) =0
send a message buffer to the remote endpoint
virtual void Start() =0
start the connection
virtual void Close() =0
virtual bool Recv_LL(Packet_t )
recv packet on low layer not used by utp
virtual bool SendKeepAlive() =0
send a keepalive to the remote endpoint
virtual bool IsEstablished() const =0
return true if we are established
virtual bool TimedOut(llarp_time_t now) const =0
return true if this session has timed out
virtual PubKey GetPubKey() const =0
get remote public identity key
virtual bool IsInbound() const =0
is an inbound session or not
virtual const SockAddr & GetRemoteEndpoint() const =0
get remote address
virtual RouterContact GetRemoteRC() const =0
bool IsRelay() const
is this session a session to a relay?
virtual size_t SendQueueBacklog() const =0
send queue current blacklog
virtual ILinkLayer * GetLinkLayer() const =0
get parent link layer
virtual bool RenegotiateSession() =0
renegotiate session when we have a new RC locally
virtual bool ShouldPing() const =0
return true if we should send an explicit keepalive message
virtual SessionStats GetSessionStats() const =0
return the current stats for this session
virtual void HandlePlaintext() =0

Public Attributes

Name
std::function< bool(const LinkIntroMessage *msg)> GotLIM
handle a valid LIM

Public Types Documentation

enum DeliveryStatus

Enumerator Value Description
eDeliverySuccess 0
eDeliveryDropped 1

delivery status of a message

using CompletionHandler

using llarp::ILinkSession::CompletionHandler =  std::function<void(DeliveryStatus)>;

message delivery result hook function

using Packet_t

using llarp::ILinkSession::Packet_t =  std::vector<byte_t>;

using Message_t

using llarp::ILinkSession::Message_t =  std::vector<byte_t>;

Public Functions Documentation

function ~ILinkSession

virtual ~ILinkSession() =default

function OnLinkEstablished

inline virtual void OnLinkEstablished(
    ILinkLayer * 
)

hook for utp for when we have established a connection

function Pump

virtual void Pump() =0

called during pumping

Reimplemented by: llarp::iwp::Session::Pump

function Tick

virtual void Tick(
    llarp_time_t 
) =0

called every timer tick

Reimplemented by: llarp::iwp::Session::Tick

function SendMessageBuffer

virtual bool SendMessageBuffer(
    Message_t ,
    CompletionHandler handler,
    uint16_t priority
) =0

send a message buffer to the remote endpoint

Reimplemented by: llarp::iwp::Session::SendMessageBuffer

function Start

virtual void Start() =0

start the connection

Reimplemented by: llarp::iwp::Session::Start

function Close

virtual void Close() =0

Reimplemented by: llarp::iwp::Session::Close

function Recv_LL

inline virtual bool Recv_LL(
    Packet_t 
)

recv packet on low layer not used by utp

Reimplemented by: llarp::iwp::Session::Recv_LL

function SendKeepAlive

virtual bool SendKeepAlive() =0

send a keepalive to the remote endpoint

Reimplemented by: llarp::iwp::Session::SendKeepAlive

function IsEstablished

virtual bool IsEstablished() const =0

return true if we are established

Reimplemented by: llarp::iwp::Session::IsEstablished

function TimedOut

virtual bool TimedOut(
    llarp_time_t now
) const =0

return true if this session has timed out

Reimplemented by: llarp::iwp::Session::TimedOut

function GetPubKey

virtual PubKey GetPubKey() const =0

get remote public identity key

Reimplemented by: llarp::iwp::Session::GetPubKey

function IsInbound

virtual bool IsInbound() const =0

is an inbound session or not

Reimplemented by: llarp::iwp::Session::IsInbound

function GetRemoteEndpoint

virtual const SockAddr & GetRemoteEndpoint() const =0

get remote address

Reimplemented by: llarp::iwp::Session::GetRemoteEndpoint

function GetRemoteRC

virtual RouterContact GetRemoteRC() const =0

Reimplemented by: llarp::iwp::Session::GetRemoteRC

function IsRelay

bool IsRelay() const

is this session a session to a relay?

function SendQueueBacklog

virtual size_t SendQueueBacklog() const =0

send queue current blacklog

Reimplemented by: llarp::iwp::Session::SendQueueBacklog

function GetLinkLayer

virtual ILinkLayer * GetLinkLayer() const =0

get parent link layer

Reimplemented by: llarp::iwp::Session::GetLinkLayer

function RenegotiateSession

virtual bool RenegotiateSession() =0

renegotiate session when we have a new RC locally

Reimplemented by: llarp::iwp::Session::RenegotiateSession

function ShouldPing

virtual bool ShouldPing() const =0

return true if we should send an explicit keepalive message

Reimplemented by: llarp::iwp::Session::ShouldPing

function GetSessionStats

virtual SessionStats GetSessionStats() const =0

return the current stats for this session

Reimplemented by: llarp::iwp::Session::GetSessionStats

function HandlePlaintext

virtual void HandlePlaintext() =0

Reimplemented by: llarp::iwp::Session::HandlePlaintext

Public Attributes Documentation

variable GotLIM

std::function< bool(const LinkIntroMessage *msg)> GotLIM;

handle a valid LIM


Updated on 2026-01-10 at 22:49:45 +0000