Back to Site
Loading...
Searching...
No Matches
librats::RatsPeer Struct Reference

RatsPeer struct - comprehensive information about a connected rats peer. More...

#include <librats.h>

Collaboration diagram for librats::RatsPeer:
[legend]

Public Types

enum class  HandshakeState {
  PENDING , SENT , NOISE_PENDING , COMPLETED ,
  FAILED
}
 

Public Member Functions

 RatsPeer ()
 
 RatsPeer (const std::string &id, const std::string &peer_ip, uint16_t peer_port, socket_t sock, const std::string &norm_addr, bool outgoing)
 
 RatsPeer (const RatsPeer &o)
 
RatsPeeroperator= (const RatsPeer &o)
 
 RatsPeer (RatsPeer &&)=default
 
RatsPeeroperator= (RatsPeer &&)=default
 
bool is_noise_encrypted () const
 
bool is_handshake_completed () const
 
bool is_handshake_failed () const
 

Public Attributes

std::string peer_id
 
std::string ip
 
uint16_t port
 
socket_t socket
 
std::string normalized_address
 
std::chrono::steady_clock::time_point connected_at
 
bool is_outgoing
 
HandshakeState handshake_state
 
std::string version
 
std::chrono::steady_clock::time_point handshake_start_time
 
bool encryption_enabled
 
bool noise_handshake_completed
 
std::shared_ptr< rats::NoiseCipherState > send_cipher
 
std::shared_ptr< rats::NoiseCipherState > recv_cipher
 
std::vector< uint8_t > remote_static_key
 
PeerIOContext io_
 

Detailed Description

RatsPeer struct - comprehensive information about a connected rats peer.

Definition at line 60 of file librats.h.

Member Enumeration Documentation

◆ HandshakeState

Enumerator
PENDING 
SENT 
NOISE_PENDING 
COMPLETED 
FAILED 

Definition at line 70 of file librats.h.

Constructor & Destructor Documentation

◆ RatsPeer() [1/4]

librats::RatsPeer::RatsPeer ( )
inline

Definition at line 92 of file librats.h.

References connected_at, and handshake_start_time.

◆ RatsPeer() [2/4]

librats::RatsPeer::RatsPeer ( const std::string &  id,
const std::string &  peer_ip,
uint16_t  peer_port,
socket_t  sock,
const std::string &  norm_addr,
bool  outgoing 
)
inline

Definition at line 99 of file librats.h.

References connected_at, and handshake_start_time.

◆ RatsPeer() [3/4]

librats::RatsPeer::RatsPeer ( const RatsPeer o)
inline

Definition at line 112 of file librats.h.

◆ RatsPeer() [4/4]

librats::RatsPeer::RatsPeer ( RatsPeer &&  )
default

Member Function Documentation

◆ is_handshake_completed()

bool librats::RatsPeer::is_handshake_completed ( ) const
inline

Definition at line 155 of file librats.h.

References COMPLETED, and handshake_state.

◆ is_handshake_failed()

bool librats::RatsPeer::is_handshake_failed ( ) const
inline

Definition at line 156 of file librats.h.

References FAILED, and handshake_state.

◆ is_noise_encrypted()

bool librats::RatsPeer::is_noise_encrypted ( ) const
inline

Definition at line 150 of file librats.h.

References noise_handshake_completed, recv_cipher, and send_cipher.

◆ operator=() [1/2]

◆ operator=() [2/2]

RatsPeer & librats::RatsPeer::operator= ( RatsPeer &&  )
default

Member Data Documentation

◆ connected_at

std::chrono::steady_clock::time_point librats::RatsPeer::connected_at

Definition at line 66 of file librats.h.

Referenced by RatsPeer(), RatsPeer(), and operator=().

◆ encryption_enabled

bool librats::RatsPeer::encryption_enabled

Definition at line 83 of file librats.h.

Referenced by operator=().

◆ handshake_start_time

std::chrono::steady_clock::time_point librats::RatsPeer::handshake_start_time

Definition at line 80 of file librats.h.

Referenced by RatsPeer(), RatsPeer(), and operator=().

◆ handshake_state

HandshakeState librats::RatsPeer::handshake_state

Definition at line 78 of file librats.h.

Referenced by is_handshake_completed(), is_handshake_failed(), and operator=().

◆ io_

PeerIOContext librats::RatsPeer::io_

Definition at line 90 of file librats.h.

◆ ip

std::string librats::RatsPeer::ip

Definition at line 62 of file librats.h.

Referenced by operator=().

◆ is_outgoing

bool librats::RatsPeer::is_outgoing

Definition at line 67 of file librats.h.

Referenced by operator=().

◆ noise_handshake_completed

bool librats::RatsPeer::noise_handshake_completed

Definition at line 84 of file librats.h.

Referenced by is_noise_encrypted(), and operator=().

◆ normalized_address

std::string librats::RatsPeer::normalized_address

Definition at line 65 of file librats.h.

Referenced by operator=().

◆ peer_id

std::string librats::RatsPeer::peer_id

Definition at line 61 of file librats.h.

Referenced by operator=().

◆ port

uint16_t librats::RatsPeer::port

Definition at line 63 of file librats.h.

Referenced by operator=().

◆ recv_cipher

std::shared_ptr<rats::NoiseCipherState> librats::RatsPeer::recv_cipher

Definition at line 86 of file librats.h.

Referenced by is_noise_encrypted(), and operator=().

◆ remote_static_key

std::vector<uint8_t> librats::RatsPeer::remote_static_key

Definition at line 87 of file librats.h.

Referenced by operator=().

◆ send_cipher

std::shared_ptr<rats::NoiseCipherState> librats::RatsPeer::send_cipher

Definition at line 85 of file librats.h.

Referenced by is_noise_encrypted(), and operator=().

◆ socket

socket_t librats::RatsPeer::socket

Definition at line 64 of file librats.h.

Referenced by operator=().

◆ version

std::string librats::RatsPeer::version

Definition at line 79 of file librats.h.

Referenced by operator=().


The documentation for this struct was generated from the following file: