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