xrpld
Loading...
Searching...
No Matches
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
18class context; // NOLINT(readability-identifier-naming) -- external library name
19} // namespace boost::asio::ssl
20
21namespace xrpl {
22
23class Section;
24
28struct Port
29{
30 explicit Port() = default;
31
33 boost::asio::ip::address ip;
48 boost::beast::websocket::permessage_deflate pmdOptions;
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
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
72operator<<(std::ostream& os, Port const& p);
73
74//------------------------------------------------------------------------------
75
101
102void
103parsePort(ParsedPort& port, Section const& section, std::ostream& log);
104
105} // namespace xrpl
Holds a collection of configuration values.
Definition BasicConfig.h:29
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:666
std::vector< boost::asio::ip::network_v4 > adminNetsV4
Definition Port.h:96
std::optional< boost::asio::ip::address > ip
Definition Port.h:94
std::vector< boost::asio::ip::network_v6 > adminNetsV6
Definition Port.h:97
std::string sslKey
Definition Port.h:86
std::vector< boost::asio::ip::network_v6 > secureGatewayNetsV6
Definition Port.h:99
std::string name
Definition Port.h:80
std::string sslCiphers
Definition Port.h:89
std::string adminUser
Definition Port.h:84
std::string user
Definition Port.h:82
std::optional< std::uint16_t > port
Definition Port.h:95
std::vector< boost::asio::ip::network_v4 > secureGatewayNetsV4
Definition Port.h:98
ParsedPort()=default
std::string sslCert
Definition Port.h:87
std::string password
Definition Port.h:83
std::uint16_t wsQueueLimit
Definition Port.h:92
boost::beast::websocket::permessage_deflate pmdOptions
Definition Port.h:90
std::string adminPassword
Definition Port.h:85
std::string sslChain
Definition Port.h:88
Configuration information for a Server listening port.
Definition Port.h:29
std::string sslCiphers
Definition Port.h:47
int limit
Definition Port.h:53
std::string sslCert
Definition Port.h:45
std::string protocols() const
Definition Port.cpp:35
bool websockets() const
Port()=default
std::string password
Definition Port.h:41
std::vector< boost::asio::ip::network_v6 > adminNetsV6
Definition Port.h:37
bool secure() const
Definition Port.cpp:28
boost::beast::websocket::permessage_deflate pmdOptions
Definition Port.h:48
std::vector< boost::asio::ip::network_v4 > secureGatewayNetsV4
Definition Port.h:38
std::vector< boost::asio::ip::network_v4 > adminNetsV4
Definition Port.h:36
std::string adminUser
Definition Port.h:42
std::uint16_t wsQueueLimit
Definition Port.h:56
std::vector< boost::asio::ip::network_v6 > secureGatewayNetsV6
Definition Port.h:39
std::string sslKey
Definition Port.h:44
std::string adminPassword
Definition Port.h:43
boost::asio::ip::address ip
Definition Port.h:33
std::string sslChain
Definition Port.h:46
std::string name
Definition Port.h:32
std::shared_ptr< boost::asio::ssl::context > context
Definition Port.h:49
std::string user
Definition Port.h:40
std::uint16_t port
Definition Port.h:34