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)
 
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
 

Detailed Description

RatsPeer struct - comprehensive information about a connected rats peer.

Definition at line 39 of file librats.h.

Member Enumeration Documentation

◆ HandshakeState

Enumerator
PENDING 
SENT 
NOISE_PENDING 
COMPLETED 
FAILED 

Definition at line 49 of file librats.h.

Constructor & Destructor Documentation

◆ RatsPeer() [1/2]

librats::RatsPeer::RatsPeer ( )
inline

Definition at line 68 of file librats.h.

References connected_at, and handshake_start_time.

◆ RatsPeer() [2/2]

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 75 of file librats.h.

References connected_at, and handshake_start_time.

Member Function Documentation

◆ is_handshake_completed()

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

Definition at line 92 of file librats.h.

References COMPLETED, and handshake_state.

◆ is_handshake_failed()

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

Definition at line 93 of file librats.h.

References FAILED, and handshake_state.

◆ is_noise_encrypted()

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

Definition at line 87 of file librats.h.

References noise_handshake_completed, recv_cipher, and send_cipher.

Member Data Documentation

◆ connected_at

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

Definition at line 45 of file librats.h.

Referenced by RatsPeer(), and RatsPeer().

◆ encryption_enabled

bool librats::RatsPeer::encryption_enabled

Definition at line 62 of file librats.h.

◆ handshake_start_time

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

Definition at line 59 of file librats.h.

Referenced by RatsPeer(), and RatsPeer().

◆ handshake_state

HandshakeState librats::RatsPeer::handshake_state

Definition at line 57 of file librats.h.

Referenced by is_handshake_completed(), and is_handshake_failed().

◆ ip

std::string librats::RatsPeer::ip

Definition at line 41 of file librats.h.

◆ is_outgoing

bool librats::RatsPeer::is_outgoing

Definition at line 46 of file librats.h.

◆ noise_handshake_completed

bool librats::RatsPeer::noise_handshake_completed

Definition at line 63 of file librats.h.

Referenced by is_noise_encrypted().

◆ normalized_address

std::string librats::RatsPeer::normalized_address

Definition at line 44 of file librats.h.

◆ peer_id

std::string librats::RatsPeer::peer_id

Definition at line 40 of file librats.h.

◆ port

uint16_t librats::RatsPeer::port

Definition at line 42 of file librats.h.

◆ recv_cipher

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

Definition at line 65 of file librats.h.

Referenced by is_noise_encrypted().

◆ remote_static_key

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

Definition at line 66 of file librats.h.

◆ send_cipher

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

Definition at line 64 of file librats.h.

Referenced by is_noise_encrypted().

◆ socket

socket_t librats::RatsPeer::socket

Definition at line 43 of file librats.h.

◆ version

std::string librats::RatsPeer::version

Definition at line 58 of file librats.h.


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