rippled
Loading...
Searching...
No Matches
peerfinder/Slot.h
1#ifndef XRPL_PEERFINDER_SLOT_H_INCLUDED
2#define XRPL_PEERFINDER_SLOT_H_INCLUDED
3
4#include <xrpl/beast/net/IPEndpoint.h>
5#include <xrpl/protocol/PublicKey.h>
6
7#include <optional>
8
9namespace ripple {
10namespace PeerFinder {
11
13class Slot
14{
15public:
17
19
20 virtual ~Slot() = 0;
21
23 virtual bool
24 inbound() const = 0;
25
30 virtual bool
31 fixed() const = 0;
32
37 virtual bool
38 reserved() const = 0;
39
41 virtual State
42 state() const = 0;
43
45 virtual beast::IP::Endpoint const&
46 remote_endpoint() const = 0;
47
50 local_endpoint() const = 0;
51
53 listening_port() const = 0;
54
58 virtual std::optional<PublicKey> const&
59 public_key() const = 0;
60};
61
62} // namespace PeerFinder
63} // namespace ripple
64
65#endif
A version-independent IP address and port combination.
Definition IPEndpoint.h:19
Properties and state associated with a peer to peer overlay connection.
virtual bool inbound() const =0
Returns true if this is an inbound connection.
virtual beast::IP::Endpoint const & remote_endpoint() const =0
The remote endpoint of socket.
virtual bool fixed() const =0
Returns true if this is a fixed connection.
virtual std::optional< std::uint16_t > listening_port() const =0
virtual State state() const =0
Returns the state of the connection.
virtual bool reserved() const =0
Returns true if this is a reserved connection.
virtual std::optional< PublicKey > const & public_key() const =0
The peer's public key, when known.
virtual std::optional< beast::IP::Endpoint > const & local_endpoint() const =0
The local endpoint of the socket, when known.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6