xrpld
Loading...
Searching...
No Matches
xrpl::PeerFinder Namespace Reference

Namespaces

namespace  detail
namespace  Tuning
 Heuristically tuned constants.

Classes

class  Livecache_test
class  PeerFinder_test
class  Bootcache
 Stores IP addresses useful for gaining initial connections. More...
class  Checker
 Tests remote listening sockets to make sure they are connectable. More...
class  Counts
 Manages the count of available connections for the various slots. More...
class  Fixed
 Metadata for a Fixed slot. More...
class  RedirectHandouts
 Receives handouts for redirecting a connection. More...
class  SlotHandouts
 Receives endpoints for a slot during periodic handouts. More...
class  ConnectHandouts
 Receives handouts for making automatic connections. More...
class  Livecache
 The Livecache holds the short-lived relayed Endpoint messages. More...
class  Logic
 The Logic for maintaining the list of Slot addresses. More...
class  ManagerImp
class  SlotImp
class  Source
 A static or dynamic source of peer addresses. More...
class  SourceStringsImp
class  SourceStrings
 Provides addresses from a static set of strings. More...
class  Store
 Abstract persistence for PeerFinder data. More...
class  StoreSqdb
 Database persistence for PeerFinder using SQLite. More...
struct  Config
 PeerFinder configuration settings. More...
struct  Endpoint
 Describes a connectable peer address along with some metadata. More...
class  Manager
 Maintains a set of IP addresses used for getting into the network. More...
class  Slot
 Properties and state associated with a peer to peer overlay connection. More...

Typedefs

using clock_type = beast::AbstractClock<std::chrono::steady_clock>
using IPAddresses = std::vector<beast::IP::Endpoint>
 Represents a set of addresses.
using Endpoints = std::vector<Endpoint>
 A set of Endpoint used for connecting.

Enumerations

enum class  CountAdjustment : int { Decrement = -1 , Increment = 1 }
 Direction of a slot count adjustment. More...
enum class  Result {
  InboundDisabled , DuplicatePeer , IpLimitExceeded , Full ,
  Success
}
 Possible results from activating a slot. More...

Functions

bool operator== (Endpoint const &a, Endpoint const &b)
 BEAST_DEFINE_TESTSUITE (Livecache, peerfinder, xrpl)
 BEAST_DEFINE_TESTSUITE (PeerFinder, peerfinder, xrpl)
template<class TargetFwdIter, class SeqFwdIter>
void handout (TargetFwdIter first, TargetFwdIter last, SeqFwdIter seqFirst, SeqFwdIter seqLast)
 Distributes objects to targets according to business rules.
std::unique_ptr< ManagermakeManager (boost::asio::io_context &ioContext, clock_type &clock, beast::Journal journal, BasicConfig const &config, beast::insight::Collector::ptr const &collector)
 Create a new Manager.
bool operator< (Endpoint const &lhs, Endpoint const &rhs)
std::string_view to_string (Result result) noexcept
 Converts a Result enum value to its string representation.

Typedef Documentation

◆ clock_type

◆ IPAddresses

Represents a set of addresses.

Definition at line 19 of file PeerfinderManager.h.

◆ Endpoints

A set of Endpoint used for connecting.

Definition at line 123 of file PeerfinderManager.h.

Enumeration Type Documentation

◆ CountAdjustment

enum class xrpl::PeerFinder::CountAdjustment : int
strong

Direction of a slot count adjustment.

Enumerator
Decrement 
Increment 

Definition at line 12 of file Counts.h.

◆ Result

enum class xrpl::PeerFinder::Result
strong

Possible results from activating a slot.

Enumerator
InboundDisabled 
DuplicatePeer 
IpLimitExceeded 
Full 
Success 

Definition at line 128 of file PeerfinderManager.h.

Function Documentation

◆ operator==()

bool xrpl::PeerFinder::operator== ( Endpoint const & a,
Endpoint const & b )

Definition at line 28 of file Livecache_test.cpp.

◆ BEAST_DEFINE_TESTSUITE() [1/2]

xrpl::PeerFinder::BEAST_DEFINE_TESTSUITE ( Livecache ,
peerfinder ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [2/2]

xrpl::PeerFinder::BEAST_DEFINE_TESTSUITE ( PeerFinder ,
peerfinder ,
xrpl  )

◆ handout()

template<class TargetFwdIter, class SeqFwdIter>
void xrpl::PeerFinder::handout ( TargetFwdIter first,
TargetFwdIter last,
SeqFwdIter seqFirst,
SeqFwdIter seqLast )

Distributes objects to targets according to business rules.

A best effort is made to evenly distribute items in the sequence container list into the target sequence list.

Definition at line 47 of file Handouts.h.

◆ makeManager()

std::unique_ptr< Manager > xrpl::PeerFinder::makeManager ( boost::asio::io_context & ioContext,
clock_type & clock,
beast::Journal journal,
BasicConfig const & config,
beast::insight::Collector::ptr const & collector )

Create a new Manager.

Definition at line 261 of file PeerfinderManager.cpp.

◆ operator<()

bool xrpl::PeerFinder::operator< ( Endpoint const & lhs,
Endpoint const & rhs )

Definition at line 116 of file PeerfinderManager.h.

◆ to_string()

std::string_view xrpl::PeerFinder::to_string ( Result result)
noexcept

Converts a Result enum value to its string representation.

This function provides a human-readable string for a given Result enum, which is useful for logging, debugging, or displaying status messages.

Parameters
resultThe Result enum value to convert.
Returns
A std::string_view representing the enum value. Returns "unknown" if the enum value is not explicitly handled.
Note
This function returns a std::string_view for performance. A std::string would need to allocate memory on the heap and copy the string literal into it every time the function is called.

Definition at line 145 of file PeerfinderManager.h.