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