24#ifndef NETWORK_PROVIDER_H
25#define NETWORK_PROVIDER_H
27#ifndef XCOM_WITHOUT_OPENSSL
32#include <openssl/err.h>
33#include <openssl/ssl.h>
122 static std::vector<const char *> m_running_protocol_to_string = {
"XCom",
126 ? m_running_protocol_to_string[protocol]
127 :
"Invalid Protocol";
204#ifndef XCOM_WITHOUT_OPENSSL
214#ifndef XCOM_WITHOUT_OPENSSL
215 ssl_fd(static_cast<SSL *>(parameter_ssl_fd)),
221#ifndef XCOM_WITHOUT_OPENSSL
222 SSL *parameter_ssl_fd,
224 bool parameter_has_error)
226#ifndef XCOM_WITHOUT_OPENSSL
233#ifndef XCOM_WITHOUT_OPENSSL
321 virtual std::pair<bool, int>
start() = 0;
336 virtual std::pair<bool, int>
stop() = 0;
372 std::function<void()> retval = []() {
373#ifndef XCOM_WITHOUT_OPENSSL
374#if OPENSSL_VERSION_NUMBER < 0x10100000L
375 ERR_remove_thread_state(
nullptr);
400 const std::string &address,
const unsigned short port,
426 null_desired_value =
nullptr;
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
This class is a helper to translate a Communication Stack to a string.
Definition: network_provider.h:119
static const char * to_string(enum_transport_protocol protocol)
Definition: network_provider.h:121
Class that provides Network Namespace services.
Definition: network_provider.h:242
virtual bool set_network_namespace(const std::string &network_namespace)=0
Set active network namespace specified by a name.
virtual ~Network_namespace_manager()
Definition: network_provider.h:244
virtual bool restore_original_network_namespace()=0
Restore original network namespace used to be active before a new network namespace has been set.
virtual int channel_get_network_namespace(std::string &net_ns)=0
Method to get the network namespace configured for a channel.
Base class for External Network Providers.
Definition: network_provider.h:295
void reset_new_connection()
Definition: network_provider.h:447
virtual int close_connection(const Network_connection &connection)=0
Closes an open connection to another XCom endpoint served by the same Network provider.
virtual bool finalize_secure_connections_context()=0
Network_connection * get_new_connection()
Get the new connection object.
Definition: network_provider.h:437
virtual std::function< void()> get_secure_connections_context_cleaner()
Definition: network_provider.h:371
virtual std::pair< bool, int > start()=0
Starts the network provider.
virtual std::pair< bool, int > stop()=0
Stops the network provider.
static constexpr int default_connection_timeout()
Definition: network_provider.h:457
Network_provider()
Definition: network_provider.h:297
virtual bool configure_secure_connections(const Network_configuration_parameters ¶ms)=0
Configures the active provider with all things needed to establish SSL connections.
std::atomic< Network_connection * > m_shared_connection
Definition: network_provider.h:460
virtual ~Network_provider()
Definition: network_provider.h:306
Network_provider & operator=(Network_provider ¶m)=delete
virtual enum_transport_protocol get_communication_stack() const =0
Get the communication stack implemented by this provider.
virtual void cleanup_secure_connections_context()=0
virtual bool configure(const Network_configuration_parameters ¶ms)=0
Configures a network provider.
void set_new_connection(Network_connection *connection)
Lock-free Set connection.
Definition: network_provider.h:423
Network_provider(Network_provider &¶m)
Definition: network_provider.h:300
Network_provider(Network_provider ¶m)=delete
virtual std::unique_ptr< Network_connection > open_connection(const std::string &address, const unsigned short port, const Network_security_credentials &security_credentials, int connection_timeout=default_connection_timeout(), network_provider_dynamic_log_level log_level=network_provider_dynamic_log_level::PROVIDED)=0
Opens a new connection to another XCom endpoint served by the same Network provider.
bool load(THD *, const dd::String_type &fname, dd::String_type *buf)
Read an sdi file from disk and store in a buffer.
Definition: sdi_file.cc:308
static loglevel log_level(const Sql_condition *condition)
Definition: histogram.cc:1644
ssl_enum_fips_mode_options
Definition: network_provider.h:69
@ INVALID_SSL_FIPS_MODE
Definition: network_provider.h:70
@ FIPS_MODE_ON
Definition: network_provider.h:72
@ FIPS_MODE_OFF
Definition: network_provider.h:71
@ FIPS_MODE_STRICT
Definition: network_provider.h:73
@ LAST_SSL_FIPS_MODE
Definition: network_provider.h:74
enum_transport_protocol
Enum that describes the available XCom Communication Stacks.
Definition: network_provider.h:45
@ INVALID_PROTOCOL
Definition: network_provider.h:46
@ MYSQL_PROTOCOL
Definition: network_provider.h:48
@ XCOM_PROTOCOL
Definition: network_provider.h:47
ssl_enum_mode_options
Definition: network_provider.h:55
@ LAST_SSL_MODE
Definition: network_provider.h:62
@ SSL_VERIFY_CA
Definition: network_provider.h:60
@ SSL_VERIFY_IDENTITY
Definition: network_provider.h:61
@ SSL_REQUIRED
Definition: network_provider.h:59
@ SSL_PREFERRED
Definition: network_provider.h:58
@ INVALID_SSL_MODE
Definition: network_provider.h:56
@ SSL_DISABLED
Definition: network_provider.h:57
network_provider_dynamic_log_level
Dynamic log level enum values.
Definition: network_provider.h:103
@ LAST_NETWORK_PROVIDER_DYNAMIC_LOG_LEVEL
static connection_descriptor * new_connection(int fd, SSL *ssl_fd)
Definition: node_connection.h:61
required string network_namespace
Definition: replication_asynchronous_connection_failover.proto:34
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
Network_connection(int parameter_fd, SSL *parameter_ssl_fd, bool parameter_has_error)
Definition: network_provider.h:220
int fd
Definition: network_provider.h:232
Network_connection(int parameter_fd, void *parameter_ssl_fd)
Definition: network_provider.h:212
Network_connection(int parameter_fd)
Definition: network_provider.h:202
SSL * ssl_fd
Definition: network_provider.h:234
bool has_error
Definition: network_provider.h:236
Security credentials to establish a connection.
Definition: network_provider.h:134
std::string user
Definition: network_provider.h:135
bool use_ssl
Definition: network_provider.h:137
std::string pass
Definition: network_provider.h:136
Definition: network_provider.h:171
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
int ssl_mode
Definition: network_provider.h:172
const char * server_cert_file
Definition: network_provider.h:174
const char * ca_file
Definition: network_provider.h:177
Definition: network_provider.h:183
const char * tls_ciphersuites
Definition: network_provider.h:185
const char * tls_version
Definition: network_provider.h:184