xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
server
Port.h
1
#pragma once
2
3
#include <boost/asio/ip/address.hpp>
4
#include <boost/asio/ip/network_v4.hpp>
5
#include <boost/asio/ip/network_v6.hpp>
6
#include <boost/beast/core/string.hpp>
7
#include <boost/beast/websocket/option.hpp>
8
9
#include <
cstdint
>
10
#include <
memory
>
11
#include <
optional
>
12
#include <
ostream
>
13
#include <
set
>
14
#include <
string
>
15
#include <
vector
>
16
17
namespace
boost::asio::ssl
{
18
class
context;
// NOLINT(readability-identifier-naming) -- external library name
19
}
// namespace boost::asio::ssl
20
21
namespace
xrpl
{
22
23
class
Section;
24
28
struct
Port
29
{
30
explicit
Port
() =
default
;
31
32
std::string
name
;
33
boost::asio::ip::address
ip
;
34
std::uint16_t
port
= 0;
35
std::set<std::string, boost::beast::iless>
protocol
;
36
std::vector<boost::asio::ip::network_v4>
adminNetsV4
;
37
std::vector<boost::asio::ip::network_v6>
adminNetsV6
;
38
std::vector<boost::asio::ip::network_v4>
secureGatewayNetsV4
;
39
std::vector<boost::asio::ip::network_v6>
secureGatewayNetsV6
;
40
std::string
user
;
41
std::string
password
;
42
std::string
adminUser
;
43
std::string
adminPassword
;
44
std::string
sslKey
;
45
std::string
sslCert
;
46
std::string
sslChain
;
47
std::string
sslCiphers
;
48
boost::beast::websocket::permessage_deflate
pmdOptions
;
49
std::shared_ptr<boost::asio::ssl::context>
context
;
50
51
// How many incoming connections are allowed on this
52
// port in the range [0, 65535] where 0 means unlimited.
53
int
limit
= 0;
54
55
// Websocket disconnects if send queue exceeds this limit
56
std::uint16_t
wsQueueLimit
{};
57
58
// Returns `true` if any websocket protocols are specified
59
[[nodiscard]]
bool
60
websockets
()
const
;
61
62
// Returns `true` if any secure protocols are specified
63
[[nodiscard]]
bool
64
secure
()
const
;
65
66
// Returns a string containing the list of protocols
67
[[nodiscard]]
std::string
68
protocols
()
const
;
69
};
70
71
std::ostream
&
72
operator<<
(
std::ostream
& os,
Port
const
& p);
73
74
//------------------------------------------------------------------------------
75
76
struct
ParsedPort
77
{
78
explicit
ParsedPort
() =
default
;
79
80
std::string
name
;
81
std::set<std::string, boost::beast::iless>
protocol
;
82
std::string
user
;
83
std::string
password
;
84
std::string
adminUser
;
85
std::string
adminPassword
;
86
std::string
sslKey
;
87
std::string
sslCert
;
88
std::string
sslChain
;
89
std::string
sslCiphers
;
90
boost::beast::websocket::permessage_deflate
pmdOptions
;
91
int
limit
= 0;
92
std::uint16_t
wsQueueLimit
{};
93
94
std::optional<boost::asio::ip::address>
ip
;
95
std::optional<std::uint16_t>
port
;
96
std::vector<boost::asio::ip::network_v4>
adminNetsV4
;
97
std::vector<boost::asio::ip::network_v6>
adminNetsV6
;
98
std::vector<boost::asio::ip::network_v4>
secureGatewayNetsV4
;
99
std::vector<boost::asio::ip::network_v6>
secureGatewayNetsV6
;
100
};
101
102
void
103
parsePort
(
ParsedPort
& port,
Section
const
& section,
std::ostream
& log);
104
105
}
// namespace xrpl
std::ostream
std::string
xrpl::Section
Holds a collection of configuration values.
Definition
BasicConfig.h:28
cstdint
std::uint16_t
memory
boost::asio::ssl
Definition
Port.h:17
protocol
Definition
LedgerNodeHelpers.h:9
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::parsePort
void parsePort(ParsedPort &port, Section const §ion, std::ostream &log)
Definition
Port.cpp:195
xrpl::operator<<
std::ostream & operator<<(std::ostream &out, BaseUInt< Bits, Tag > const &u)
Definition
base_uint.h:672
optional
ostream
set
std::shared_ptr
string
xrpl::ParsedPort
Definition
Port.h:77
xrpl::ParsedPort::adminNetsV4
std::vector< boost::asio::ip::network_v4 > adminNetsV4
Definition
Port.h:96
xrpl::ParsedPort::ip
std::optional< boost::asio::ip::address > ip
Definition
Port.h:94
xrpl::ParsedPort::adminNetsV6
std::vector< boost::asio::ip::network_v6 > adminNetsV6
Definition
Port.h:97
xrpl::ParsedPort::limit
int limit
Definition
Port.h:91
xrpl::ParsedPort::sslKey
std::string sslKey
Definition
Port.h:86
xrpl::ParsedPort::secureGatewayNetsV6
std::vector< boost::asio::ip::network_v6 > secureGatewayNetsV6
Definition
Port.h:99
xrpl::ParsedPort::name
std::string name
Definition
Port.h:80
xrpl::ParsedPort::sslCiphers
std::string sslCiphers
Definition
Port.h:89
xrpl::ParsedPort::adminUser
std::string adminUser
Definition
Port.h:84
xrpl::ParsedPort::user
std::string user
Definition
Port.h:82
xrpl::ParsedPort::port
std::optional< std::uint16_t > port
Definition
Port.h:95
xrpl::ParsedPort::secureGatewayNetsV4
std::vector< boost::asio::ip::network_v4 > secureGatewayNetsV4
Definition
Port.h:98
xrpl::ParsedPort::ParsedPort
ParsedPort()=default
xrpl::ParsedPort::sslCert
std::string sslCert
Definition
Port.h:87
xrpl::ParsedPort::password
std::string password
Definition
Port.h:83
xrpl::ParsedPort::wsQueueLimit
std::uint16_t wsQueueLimit
Definition
Port.h:92
xrpl::ParsedPort::pmdOptions
boost::beast::websocket::permessage_deflate pmdOptions
Definition
Port.h:90
xrpl::ParsedPort::adminPassword
std::string adminPassword
Definition
Port.h:85
xrpl::ParsedPort::sslChain
std::string sslChain
Definition
Port.h:88
xrpl::Port
Configuration information for a Server listening port.
Definition
Port.h:29
xrpl::Port::sslCiphers
std::string sslCiphers
Definition
Port.h:47
xrpl::Port::limit
int limit
Definition
Port.h:53
xrpl::Port::sslCert
std::string sslCert
Definition
Port.h:45
xrpl::Port::protocols
std::string protocols() const
Definition
Port.cpp:35
xrpl::Port::websockets
bool websockets() const
xrpl::Port::Port
Port()=default
xrpl::Port::password
std::string password
Definition
Port.h:41
xrpl::Port::adminNetsV6
std::vector< boost::asio::ip::network_v6 > adminNetsV6
Definition
Port.h:37
xrpl::Port::secure
bool secure() const
Definition
Port.cpp:28
xrpl::Port::pmdOptions
boost::beast::websocket::permessage_deflate pmdOptions
Definition
Port.h:48
xrpl::Port::secureGatewayNetsV4
std::vector< boost::asio::ip::network_v4 > secureGatewayNetsV4
Definition
Port.h:38
xrpl::Port::adminNetsV4
std::vector< boost::asio::ip::network_v4 > adminNetsV4
Definition
Port.h:36
xrpl::Port::adminUser
std::string adminUser
Definition
Port.h:42
xrpl::Port::wsQueueLimit
std::uint16_t wsQueueLimit
Definition
Port.h:56
xrpl::Port::secureGatewayNetsV6
std::vector< boost::asio::ip::network_v6 > secureGatewayNetsV6
Definition
Port.h:39
xrpl::Port::sslKey
std::string sslKey
Definition
Port.h:44
xrpl::Port::adminPassword
std::string adminPassword
Definition
Port.h:43
xrpl::Port::ip
boost::asio::ip::address ip
Definition
Port.h:33
xrpl::Port::sslChain
std::string sslChain
Definition
Port.h:46
xrpl::Port::name
std::string name
Definition
Port.h:32
xrpl::Port::context
std::shared_ptr< boost::asio::ssl::context > context
Definition
Port.h:49
xrpl::Port::user
std::string user
Definition
Port.h:40
xrpl::Port::port
std::uint16_t port
Definition
Port.h:34
vector
Generated by
1.17.0