23#ifndef NETWORK_PROVIDER_H
24#define NETWORK_PROVIDER_H
26#ifndef XCOM_WITHOUT_OPENSSL
31#include <openssl/err.h>
32#include <openssl/ssl.h>
84 static std::vector<const char *> m_running_protocol_to_string = {
"XCom",
88 ? m_running_protocol_to_string[protocol]
166#ifndef XCOM_WITHOUT_OPENSSL
175#ifndef XCOM_WITHOUT_OPENSSL
177 SSL *parameter_ssl_fd
181#ifndef XCOM_WITHOUT_OPENSSL
190#ifndef XCOM_WITHOUT_OPENSSL
192 SSL *parameter_ssl_fd
195 bool parameter_has_error)
197#ifndef XCOM_WITHOUT_OPENSSL
206#ifndef XCOM_WITHOUT_OPENSSL
294 virtual std::pair<bool, int>
start() = 0;
309 virtual std::pair<bool, int>
stop() = 0;
345 std::function<void()> retval = []() {
346#if OPENSSL_VERSION_NUMBER < 0x10100000L
347 ERR_remove_thread_state(
nullptr);
369 const std::string &address,
const unsigned short port,
393 null_desired_value =
nullptr;
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:250
This class is a helper to translate a Communication Stack to a string.
Definition: network_provider.h:81
static const char * to_string(enum_transport_protocol protocol)
Definition: network_provider.h:83
Class that provides Network Namespace services.
Definition: network_provider.h:215
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:217
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:268
void reset_new_connection()
Definition: network_provider.h:414
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:404
virtual std::function< void()> get_secure_connections_context_cleaner()
Definition: network_provider.h:344
virtual std::pair< bool, int > start()=0
Starts the network provider.
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())=0
Opens a new connection to another XCom endpoint served by the same Network provider.
virtual std::pair< bool, int > stop()=0
Stops the network provider.
static constexpr int default_connection_timeout()
Definition: network_provider.h:424
Network_provider()
Definition: network_provider.h:270
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:427
virtual ~Network_provider()
Definition: network_provider.h:279
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:390
Network_provider(Network_provider &¶m)
Definition: network_provider.h:273
Network_provider(Network_provider ¶m)=delete
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:307
ssl_enum_fips_mode_options
Definition: network_provider.h:68
@ INVALID_SSL_FIPS_MODE
Definition: network_provider.h:69
@ FIPS_MODE_ON
Definition: network_provider.h:71
@ FIPS_MODE_OFF
Definition: network_provider.h:70
@ FIPS_MODE_STRICT
Definition: network_provider.h:72
@ LAST_SSL_FIPS_MODE
Definition: network_provider.h:73
enum_transport_protocol
Enum that describes the available XCom Communication Stacks.
Definition: network_provider.h:44
@ INVALID_PROTOCOL
Definition: network_provider.h:45
@ MYSQL_PROTOCOL
Definition: network_provider.h:47
@ XCOM_PROTOCOL
Definition: network_provider.h:46
ssl_enum_mode_options
Definition: network_provider.h:54
@ LAST_SSL_MODE
Definition: network_provider.h:61
@ SSL_VERIFY_CA
Definition: network_provider.h:59
@ SSL_VERIFY_IDENTITY
Definition: network_provider.h:60
@ SSL_REQUIRED
Definition: network_provider.h:58
@ SSL_PREFERRED
Definition: network_provider.h:57
@ INVALID_SSL_MODE
Definition: network_provider.h:55
@ SSL_DISABLED
Definition: network_provider.h:56
static connection_descriptor * new_connection(int fd, SSL *ssl_fd)
Definition: node_connection.h:60
required string network_namespace
Definition: replication_asynchronous_connection_failover.proto:33
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:32
Possible configuration parameters.
Definition: network_provider.h:153
struct ssl_parameters ssl_params
Definition: network_provider.h:156
struct tls_parameters tls_params
Definition: network_provider.h:157
unsigned short port
Definition: network_provider.h:154
Represents an open connection.
Definition: network_provider.h:163
Network_connection(int parameter_fd, SSL *parameter_ssl_fd, bool parameter_has_error)
Definition: network_provider.h:189
Network_connection(int parameter_fd, SSL *parameter_ssl_fd)
Definition: network_provider.h:174
int fd
Definition: network_provider.h:205
Network_connection(int parameter_fd)
Definition: network_provider.h:164
SSL * ssl_fd
Definition: network_provider.h:207
bool has_error
Definition: network_provider.h:209
Security credentials to establish a connection.
Definition: network_provider.h:96
std::string user
Definition: network_provider.h:97
bool use_ssl
Definition: network_provider.h:99
std::string pass
Definition: network_provider.h:98
Definition: network_provider.h:133
const char * server_key_file
Definition: network_provider.h:135
const char * client_key_file
Definition: network_provider.h:137
const char * ca_path
Definition: network_provider.h:140
const char * cipher
Definition: network_provider.h:143
const char * crl_file
Definition: network_provider.h:141
const char * client_cert_file
Definition: network_provider.h:138
const char * crl_path
Definition: network_provider.h:142
int ssl_mode
Definition: network_provider.h:134
const char * server_cert_file
Definition: network_provider.h:136
const char * ca_file
Definition: network_provider.h:139
Definition: network_provider.h:145
const char * tls_ciphersuites
Definition: network_provider.h:147
const char * tls_version
Definition: network_provider.h:146