rippled
Loading...
Searching...
No Matches
Port.h
1#pragma once
2
3#include <xrpl/basics/BasicConfig.h>
4#include <xrpl/beast/net/IPEndpoint.h>
5
6#include <boost/asio/ip/address.hpp>
7#include <boost/asio/ip/network_v4.hpp>
8#include <boost/asio/ip/network_v6.hpp>
9#include <boost/beast/core/string.hpp>
10#include <boost/beast/websocket/option.hpp>
11
12#include <cstdint>
13#include <memory>
14#include <optional>
15#include <set>
16#include <string>
17
18namespace boost {
19namespace asio {
20namespace ssl {
21class context;
22}
23} // namespace asio
24} // namespace boost
25
26namespace xrpl {
27
29struct Port
30{
31 explicit Port() = default;
32
34 boost::asio::ip::address ip;
49 boost::beast::websocket::permessage_deflate pmd_options;
51
52 // How many incoming connections are allowed on this
53 // port in the range [0, 65535] where 0 means unlimited.
54 int limit = 0;
55
56 // Websocket disconnects if send queue exceeds this limit
58
59 // Returns `true` if any websocket protocols are specified
60 bool
61 websockets() const;
62
63 // Returns `true` if any secure protocols are specified
64 bool
65 secure() const;
66
67 // Returns a string containing the list of protocols
69 protocols() const;
70};
71
73operator<<(std::ostream& os, Port const& p);
74
75//------------------------------------------------------------------------------
76
102
103void
104parse_Port(ParsedPort& port, Section const& section, std::ostream& log);
105
106} // 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 parse_Port(ParsedPort &port, Section const &section, std::ostream &log)
Definition Port.cpp:191
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Definition base_uint.h:612
std::set< std::string, boost::beast::iless > protocol
Definition Port.h:82
boost::beast::websocket::permessage_deflate pmd_options
Definition Port.h:91
std::optional< boost::asio::ip::address > ip
Definition Port.h:95
std::vector< boost::asio::ip::network_v6 > secure_gateway_nets_v6
Definition Port.h:100
std::string admin_password
Definition Port.h:86
std::vector< boost::asio::ip::network_v4 > secure_gateway_nets_v4
Definition Port.h:99
std::string ssl_chain
Definition Port.h:89
std::string ssl_key
Definition Port.h:87
std::string name
Definition Port.h:81
std::uint16_t ws_queue_limit
Definition Port.h:93
std::vector< boost::asio::ip::network_v4 > admin_nets_v4
Definition Port.h:97
std::string user
Definition Port.h:83
std::optional< std::uint16_t > port
Definition Port.h:96
ParsedPort()=default
std::string ssl_ciphers
Definition Port.h:90
std::string password
Definition Port.h:84
std::vector< boost::asio::ip::network_v6 > admin_nets_v6
Definition Port.h:98
std::string admin_user
Definition Port.h:85
std::string ssl_cert
Definition Port.h:88
Configuration information for a Server listening port.
Definition Port.h:30
int limit
Definition Port.h:54
std::vector< boost::asio::ip::network_v4 > admin_nets_v4
Definition Port.h:37
std::string admin_password
Definition Port.h:44
std::string protocols() const
Definition Port.cpp:34
std::vector< boost::asio::ip::network_v6 > secure_gateway_nets_v6
Definition Port.h:40
bool websockets() const
Port()=default
std::string ssl_key
Definition Port.h:45
std::string password
Definition Port.h:42
bool secure() const
Definition Port.cpp:27
std::set< std::string, boost::beast::iless > protocol
Definition Port.h:36
std::string ssl_ciphers
Definition Port.h:48
std::string ssl_cert
Definition Port.h:46
std::string ssl_chain
Definition Port.h:47
boost::beast::websocket::permessage_deflate pmd_options
Definition Port.h:49
std::string admin_user
Definition Port.h:43
std::uint16_t ws_queue_limit
Definition Port.h:57
boost::asio::ip::address ip
Definition Port.h:34
std::vector< boost::asio::ip::network_v4 > secure_gateway_nets_v4
Definition Port.h:39
std::string name
Definition Port.h:33
std::vector< boost::asio::ip::network_v6 > admin_nets_v6
Definition Port.h:38
std::shared_ptr< boost::asio::ssl::context > context
Definition Port.h:50
std::string user
Definition Port.h:41
std::uint16_t port
Definition Port.h:35