24#ifndef XCOM_NETWORK_PROVIDER_H
25#define XCOM_NETWORK_PROVIDER_H
30#include <condition_variable>
61 std::pair<bool, int>
start()
override;
62 std::pair<bool, int>
stop()
override;
83#ifndef XCOM_WITHOUT_OPENSSL
84 bool const successful =
105 const std::string &address,
const unsigned short port,
Base class for External Network Providers.
Definition: network_provider.h:295
static constexpr int default_connection_timeout()
Definition: network_provider.h:457
static int xcom_init_ssl(const char *server_key_file, const char *server_cert_file, const char *client_key_file, const char *client_cert_file, const char *ca_file, const char *ca_path, const char *crl_file, const char *crl_path, const char *cipher, const char *tls_version, const char *tls_ciphersuites)
Definition: xcom_network_provider_ssl_native_lib.cc:477
Definition: xcom_network_provider.h:40
Xcom_network_provider()
Construct a new Xcom_network_provider object.
Definition: xcom_network_provider.h:49
std::unique_ptr< Network_connection > open_connection(const std::string &address, const unsigned short port, const Network_security_credentials &security_credentials, int connection_timeout=Network_provider::default_connection_timeout(), network_provider_dynamic_log_level log_level=network_provider_dynamic_log_level::PROVIDED) override
Opens a new connection to another XCom endpoint served by the same Network provider.
Definition: xcom_network_provider.cc:189
bool configure(const Network_configuration_parameters ¶ms) override
Configures this network provider.
Definition: xcom_network_provider.h:75
virtual ~Xcom_network_provider() override
Definition: xcom_network_provider.h:56
bool finalize_secure_connections_context() override
Definition: xcom_network_provider.cc:162
result m_open_server_socket
Definition: xcom_network_provider.h:158
enum_transport_protocol get_communication_stack() const override
Get the communication stack implemented by this provider.
Definition: xcom_network_provider.h:63
bool configure_secure_connections(const Network_configuration_parameters ¶ms) override
Configures the active provider with all things needed to establish SSL connections.
Definition: xcom_network_provider.h:81
bool m_init_error
Definition: xcom_network_provider.h:152
bool m_initialized
Definition: xcom_network_provider.h:151
result get_open_server_socket() const
Definition: xcom_network_provider.h:142
xcom_port get_port() const
Definition: xcom_network_provider.h:129
bool m_shutdown_tcp_server
Definition: xcom_network_provider.h:156
Xcom_network_provider(Xcom_network_provider &¶m)
Definition: xcom_network_provider.h:43
std::condition_variable m_init_cond_var
Definition: xcom_network_provider.h:154
void notify_provider_ready(bool init_error=false)
Notify that the provider is ready.
Definition: xcom_network_provider.cc:377
bool is_provider_initialized() const
Definition: xcom_network_provider.h:132
Xcom_network_provider(Xcom_network_provider ¶m)=delete
void set_shutdown_tcp_server(bool shutdown_tcp_server)
Definition: xcom_network_provider.h:138
int close_connection(const Network_connection &connection) override
Closes an open connection to another XCom endpoint served by the same Network provider.
Definition: xcom_network_provider.cc:170
bool wait_for_provider_ready()
Waits for the provider to become ready.
Definition: xcom_network_provider.cc:363
bool should_shutdown_tcp_server() const
Definition: xcom_network_provider.h:137
std::thread m_network_provider_tcp_server
Definition: xcom_network_provider.h:149
std::mutex m_init_lock
Definition: xcom_network_provider.h:153
void cleanup_secure_connections_context() override
Definition: xcom_network_provider.cc:156
void set_port(xcom_port port)
Definition: xcom_network_provider.h:130
void set_open_server_socket(result open_socket)
Definition: xcom_network_provider.h:143
std::pair< bool, int > start() override
Inherited methods from Gcs_network_provider.
Definition: xcom_network_provider.cc:384
std::pair< bool, int > stop() override
Stops the network provider.
Definition: xcom_network_provider.cc:412
xcom_port m_port
Definition: xcom_network_provider.h:148
static loglevel log_level(const Sql_condition *condition)
Definition: histogram.cc:1644
Definition: gcs_xcom_synode.h:64
enum_transport_protocol
Enum that describes the available XCom Communication Stacks.
Definition: network_provider.h:45
@ XCOM_PROTOCOL
Definition: network_provider.h:47
network_provider_dynamic_log_level
Dynamic log level enum values.
Definition: network_provider.h:103
int init_error(const PFS_global_param *param)
Definition: pfs_error.cc:66
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
Possible configuration parameters.
Definition: network_provider.h:191
struct ssl_parameters ssl_params
Definition: network_provider.h:194
struct tls_parameters tls_params
Definition: network_provider.h:195
unsigned short port
Definition: network_provider.h:192
Represents an open connection.
Definition: network_provider.h:201
Security credentials to establish a connection.
Definition: network_provider.h:134
const char * server_key_file
Definition: network_provider.h:173
const char * client_key_file
Definition: network_provider.h:175
const char * ca_path
Definition: network_provider.h:178
const char * cipher
Definition: network_provider.h:181
const char * crl_file
Definition: network_provider.h:179
const char * client_cert_file
Definition: network_provider.h:176
const char * crl_path
Definition: network_provider.h:180
const char * server_cert_file
Definition: network_provider.h:174
const char * ca_file
Definition: network_provider.h:177
const char * tls_ciphersuites
Definition: network_provider.h:185
const char * tls_version
Definition: network_provider.h:184
unsigned short xcom_port
Definition: xcom_common.h:46