24#ifndef XCOM_NETWORK_PROVIDER_NATIVE_LIB_H
25#define XCOM_NETWORK_PROVIDER_NATIVE_LIB_H
30#ifndef XCOM_WITHOUT_OPENSSL
37#include <openssl/err.h>
38#include <openssl/ssl.h>
41#define SYS_STRERROR_SIZE 512
50 socklen_t sock_size,
int timeout);
52 socklen_t sock_size,
int timeout);
92#ifndef XCOM_WITHOUT_OPENSSL
127 const char *server_cert_file,
128 const char *client_key_file,
129 const char *client_cert_file,
const char *ca_file,
130 const char *ca_path,
const char *crl_file,
131 const char *crl_path,
const char *cipher,
132 const char *tls_version,
133 const char *tls_ciphersuites);
Definition: xcom_network_provider_native_lib.h:43
static bool verify_poll_errors(int fd, int sysret, struct pollfd &fds)
After a poll call, this method will check for any errors that might have been returned from the poll ...
Definition: xcom_network_provider_native_lib.cc:384
static result create_server_socket()
Definition: xcom_network_provider_native_lib.cc:126
static result announce_tcp(xcom_port port)
Definition: xcom_network_provider_native_lib.cc:207
static int timed_connect(int fd, struct sockaddr *sock_addr, socklen_t sock_size)
Definition: xcom_network_provider_native_lib.cc:469
static int timed_connect_msec(int fd, struct sockaddr *sock_addr, socklen_t sock_size, int timeout)
Definition: xcom_network_provider_native_lib.cc:419
static struct addrinfo * does_node_have_v4_address(struct addrinfo *retrieved)
Retrieves a node IPv4 address, if it exists.
Definition: xcom_network_provider_native_lib.cc:526
static void gcs_shutdown_socket(int *sock)
Definition: xcom_network_provider_native_lib.cc:312
static int timed_connect_sec(int fd, struct sockaddr *sock_addr, socklen_t sock_size, int timeout)
Definition: xcom_network_provider_native_lib.cc:476
static result gcs_close_socket(int *sock)
Definition: xcom_network_provider_native_lib.cc:318
static result checked_create_socket(int domain, int type, int protocol)
Definition: xcom_network_provider_native_lib.cc:484
static bool poll_for_timed_connects(int fd, int timeout)
Auxiliary method used in Synchronous connects in order to poll a connection for input,...
Definition: xcom_network_provider_native_lib.cc:342
static result xcom_checked_socket(int domain, int type, int protocol)
Wrapper function which retries and checks errors from socket.
Definition: xcom_network_provider_native_lib.cc:111
static int allowlist_socket_accept(int fd, site_def const *xcom_config)
Definition: xcom_network_provider_native_lib.cc:286
static result create_server_socket_v4()
Definition: xcom_network_provider_native_lib.cc:177
static result gcs_shut_close_socket(int *sock)
Definition: xcom_network_provider_native_lib.cc:329
static void init_server_addr(struct sockaddr **sock_addr, socklen_t *sock_len, xcom_port port, int family)
Initializes a sockaddr prepared to be used in bind()
Definition: xcom_network_provider_native_lib.cc:77
Definition: xcom_network_provider_native_lib.h:99
static void xcom_cleanup_ssl()
Definition: xcom_network_provider_ssl_native_lib.cc:555
static std::pair< SSL *, int > timed_connect_ssl_msec(int fd, SSL_CTX *client_ctx, const std::string &hostname, int timeout)
Establishes an SSL connection to a node that already has a connection in place.
Definition: xcom_network_provider_ssl_native_lib.cc:703
static int ssl_verify_server_cert(SSL *ssl, const char *server_hostname)
Definition: xcom_network_provider_ssl_native_lib.cc:588
static void xcom_destroy_ssl()
Definition: xcom_network_provider_ssl_native_lib.cc:561
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
static MYSQL * sock
Definition: mysqlcheck.cc:57
constexpr value_type ssl
Definition: classic_protocol_constants.h:49
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
required string type
Definition: replication_group_member_actions.proto:34
struct sockaddr sockaddr
Definition: sock_probe_win32.h:63
Definition: site_struct.h:43
struct pollfd pollfd
Definition: task_os.h:114
unsigned short xcom_port
Definition: xcom_common.h:46
SSL_CTX * client_ctx
Definition: xcom_network_provider_ssl_native_lib.cc:173
SSL_CTX * server_ctx
Definition: xcom_network_provider_ssl_native_lib.cc:172