MySQL 8.4.2
Source Code Documentation
|
#include "xcom/server_struct.h"
#include "xcom/site_struct.h"
#include "xcom/xcom_common.h"
#include "xdr_gen/xcom_vp.h"
Go to the source code of this file.
Classes | |
struct | envelope |
Macros | |
#define | XDR_INT_SIZE 4 |
#define | MSG_HDR_SIZE (3 * XDR_INT_SIZE) |
#define | SERIALIZED_BUFLEN(x) ((x) + MSG_HDR_SIZE) |
#define | VERS_PTR(buf) (buf) |
#define | LENGTH_PTR(buf) &((buf)[XDR_INT_SIZE]) |
#define | X_TYPE (2 * XDR_INT_SIZE) |
#define | X_TAG (X_TYPE + 1) |
#define | X_TAG_PTR(buf) &((buf)[X_TAG]) |
#define | MSG_PTR(buf) &((buf)[MSG_HDR_SIZE]) |
#define | IP_MAX_SIZE 512 |
#define | INITIAL_CONNECT_WAIT 0.1 |
#define | MAX_CONNECT_WAIT 10.0 |
#define | CONNECT_WAIT_INCREASE 1.0 |
Typedefs | |
typedef enum x_msg_type | x_msg_type |
typedef struct envelope | envelope |
Enumerations | |
enum | x_msg_type { x_normal = 0 , x_version_req = 1 , x_version_reply = 2 } |
Functions | |
int | check_protoversion (xcom_proto x_proto, xcom_proto negotiated) |
int | flush_srv_buf (server *s, int64_t *ret) |
int | buffered_read_msg (connection_descriptor *rfd, srv_buf *buf, pax_msg *p, server *s, int64_t *ret) |
Reads message from connection rfd with buffering reads. More... | |
int | read_msg (connection_descriptor *rfd, pax_msg *p, server *s, int64_t *ret) |
Reads message from connection rfd without buffering reads. More... | |
int | send_to_acceptors (pax_msg *p, const char *dbg) |
int | send_to_all (pax_msg *p, const char *dbg) |
int | send_to_all_site (site_def const *s, pax_msg *p, const char *dbg) |
int | send_to_others (site_def const *s, pax_msg *p, const char *dbg) |
int | send_to_someone (site_def const *s, pax_msg *p, const char *dbg) |
int | send_to_self_site (site_def const *s, pax_msg *p) |
int | send_to_all_except_self (site_def const *s, pax_msg *p, const char *dbg) |
void | wakeup_sender () |
int | sender_task (task_arg arg) |
int | local_sender_task (task_arg arg) |
int | shutdown_servers () |
int | srv_ref (server *s) |
int | srv_unref (server *s) |
int | tcp_reaper_task (task_arg arg) |
int | tcp_reconnection_task (task_arg arg) |
int | incoming_connection_task (task_arg arg) |
uint32_t | crc32c_hash (char *buf, char *end) |
int | apply_xdr (void *buff, uint32_t bufflen, xdrproc_t xdrfunc, void *xdrdata, enum xdr_op op) |
void | init_crc32c () |
void | init_xcom_transport (xcom_port listen_port) |
void | reset_srv_buf (srv_buf *sb) |
char * | xcom_get_name (char *a) |
xcom_port | xcom_get_port (char *a) |
int | send_server_msg (site_def const *s, node_no i, pax_msg *p) |
double | server_active (site_def const *s, node_no i) |
void | update_servers (site_def *s, cargo_type operation) |
void | garbage_collect_servers () |
int | send_msg (server *s, node_no from, node_no to, uint32_t group_id, pax_msg *p) |
void | server_detected (server *s) |
Updates timestamp of server. More... | |
void | invalidate_servers (const site_def *old_site_def, const site_def *new_site_def) |
void | shutdown_connection (connection_descriptor *con) |
void | reset_connection (connection_descriptor *con) |
void | close_connection (connection_descriptor *con) |
int | close_open_connection (connection_descriptor *conn) |
connection_descriptor * | open_new_connection (const char *server, xcom_port port, int connection_timeout=Network_provider::default_connection_timeout(), network_provider_dynamic_log_level log_level=network_provider_dynamic_log_level::PROVIDED) |
connection_descriptor * | open_new_local_connection (const char *server, xcom_port port) |
bool | is_able_to_connect_to_node (const char *server, const xcom_port port) |
Tests connectivity to another node under the current configuration setup. More... | |
void | ssl_free_con (connection_descriptor *con) |
char const * | xcom_proto_name (xcom_proto proto_vers) |
xcom_proto | negotiate_protocol (xcom_proto proto_vers) |
void | get_header_1_0 (unsigned char header_buf[], uint32_t *msgsize, x_msg_type *x_type, unsigned int *tag) |
void | put_header_1_0 (unsigned char header_buf[], uint32_t msgsize, x_msg_type x_type, unsigned int tag) |
int | send_proto (connection_descriptor *con, xcom_proto x_proto, x_msg_type x_type, unsigned int tag, int64_t *ret) |
int | recv_proto (connection_descriptor const *rfd, xcom_proto *x_proto, x_msg_type *x_type, unsigned int *tag, int64_t *ret) |
void | write_protoversion (unsigned char *buf, xcom_proto proto_vers) |
xcom_proto | read_protoversion (unsigned char *p) |
int | serialize_msg (pax_msg *p, xcom_proto x_proto, uint32_t *buflen, char **buf) |
int | deserialize_msg (pax_msg *p, xcom_proto x_proto, char *buf, uint32_t buflen) |
xcom_proto | common_xcom_version (site_def const *site) |
xcom_proto | get_latest_common_proto () |
xcom_proto | set_latest_common_proto (xcom_proto x_proto) |
int | connect_tcp (char *server, xcom_port port, int *ret) |
xcom_proto | minimum_ipv6_version () |
Returns the version from which nodes are able to speak IPv6. More... | |
int | get_ip_and_port (char const *address, char ip[IP_MAX_SIZE], xcom_port *port) |
Get the ip and port object from a given address in the authorized input format. More... | |
int | is_new_node_eligible_for_ipv6 (xcom_proto incoming_proto, const site_def *current_site_def) |
Checks if an incoming node is eligible to enter the group. More... | |
Variables | |
xcom_proto const | my_min_xcom_version |
xcom_proto const | my_xcom_version |
linkage | connect_wait |
#define CONNECT_WAIT_INCREASE 1.0 |
#define INITIAL_CONNECT_WAIT 0.1 |
#define IP_MAX_SIZE 512 |
#define LENGTH_PTR | ( | buf | ) | &((buf)[XDR_INT_SIZE]) |
#define MAX_CONNECT_WAIT 10.0 |
#define MSG_HDR_SIZE (3 * XDR_INT_SIZE) |
#define MSG_PTR | ( | buf | ) | &((buf)[MSG_HDR_SIZE]) |
#define SERIALIZED_BUFLEN | ( | x | ) | ((x) + MSG_HDR_SIZE) |
#define X_TAG (X_TYPE + 1) |
#define X_TYPE (2 * XDR_INT_SIZE) |
#define XDR_INT_SIZE 4 |
typedef enum x_msg_type x_msg_type |
enum x_msg_type |
int buffered_read_msg | ( | connection_descriptor * | rfd, |
srv_buf * | buf, | ||
pax_msg * | p, | ||
server * | s, | ||
int64_t * | ret | ||
) |
Reads message from connection rfd with buffering reads.
[in] | rfd | Pointer to open connection. |
[in,out] | buf | Used for buffering reads. |
[out] | p | Output buffer. |
[out] | s | Pointer to server. Server timestamp updated if not 0. |
[out] | ret | Number of bytes read, or -1 if failure. |
0 | if task should terminate. |
1 | if it should continue. |
int check_protoversion | ( | xcom_proto | x_proto, |
xcom_proto | negotiated | ||
) |
void close_connection | ( | connection_descriptor * | con | ) |
int close_open_connection | ( | connection_descriptor * | conn | ) |
xcom_proto common_xcom_version | ( | site_def const * | site | ) |
int connect_tcp | ( | char * | server, |
xcom_port | port, | ||
int * | ret | ||
) |
uint32_t crc32c_hash | ( | char * | buf, |
char * | end | ||
) |
int deserialize_msg | ( | pax_msg * | p, |
xcom_proto | x_proto, | ||
char * | buf, | ||
uint32_t | buflen | ||
) |
int flush_srv_buf | ( | server * | s, |
int64_t * | ret | ||
) |
void garbage_collect_servers | ( | ) |
void get_header_1_0 | ( | unsigned char | header_buf[], |
uint32_t * | msgsize, | ||
x_msg_type * | x_type, | ||
unsigned int * | tag | ||
) |
int get_ip_and_port | ( | char const * | address, |
char | ip[IP_MAX_SIZE], | ||
xcom_port * | port | ||
) |
Get the ip and port object from a given address in the authorized input format.
For IP v4 is IP (or) NAME:PORT and for IPv6 is [IP (or) NAME]:PORT
address | input address to parse |
ip | the resulting IP or Name |
port | the resulting port |
xcom_proto get_latest_common_proto | ( | ) |
int incoming_connection_task | ( | task_arg | arg | ) |
void init_crc32c | ( | ) |
void init_xcom_transport | ( | xcom_port | listen_port | ) |
bool is_able_to_connect_to_node | ( | const char * | server, |
const xcom_port | port | ||
) |
Tests connectivity to another node under the current configuration setup.
This function verifies that this node is able to successfully reach to the other node. It is used to do a sanity check at when a new member is about to be added to the list of participants and to check local node connectivity, in order to validate configurations.
int is_new_node_eligible_for_ipv6 | ( | xcom_proto | incoming_proto, |
const site_def * | current_site_def | ||
) |
Checks if an incoming node is eligible to enter the group.
This function checks if a new node entering the group is able to be part of it. This is needed duw to downgrade procedures to server versions that do not speak IPv6. One will check if:
If all of the above hold true we are able to proceed and add the node. Else, we must fail.
1 | in case of success. |
int local_sender_task | ( | task_arg | arg | ) |
xcom_proto minimum_ipv6_version | ( | ) |
Returns the version from which nodes are able to speak IPv6.
xcom_proto negotiate_protocol | ( | xcom_proto | proto_vers | ) |
connection_descriptor * open_new_connection | ( | const char * | server, |
xcom_port | port, | ||
int | connection_timeout = Network_provider::default_connection_timeout() , |
||
network_provider_dynamic_log_level | log_level = network_provider_dynamic_log_level::PROVIDED |
||
) |
connection_descriptor * open_new_local_connection | ( | const char * | server, |
xcom_port | port | ||
) |
void put_header_1_0 | ( | unsigned char | header_buf[], |
uint32_t | msgsize, | ||
x_msg_type | x_type, | ||
unsigned int | tag | ||
) |
int read_msg | ( | connection_descriptor * | rfd, |
pax_msg * | p, | ||
server * | s, | ||
int64_t * | ret | ||
) |
Reads message from connection rfd without buffering reads.
[in] | rfd | Pointer to open connection. |
[out] | p | Output buffer. |
[in,out] | s | Pointer to server. Server timestamp updated if not 0. |
[in,out] | ret | Number of bytes read, or -1 if failure. |
0 | if task should terminate. |
1 | if it should continue. |
xcom_proto read_protoversion | ( | unsigned char * | p | ) |
int recv_proto | ( | connection_descriptor const * | rfd, |
xcom_proto * | x_proto, | ||
x_msg_type * | x_type, | ||
unsigned int * | tag, | ||
int64_t * | ret | ||
) |
void reset_connection | ( | connection_descriptor * | con | ) |
void reset_srv_buf | ( | srv_buf * | sb | ) |
int send_proto | ( | connection_descriptor * | con, |
xcom_proto | x_proto, | ||
x_msg_type | x_type, | ||
unsigned int | tag, | ||
int64_t * | ret | ||
) |
int send_to_acceptors | ( | pax_msg * | p, |
const char * | dbg | ||
) |
int send_to_all | ( | pax_msg * | p, |
const char * | dbg | ||
) |
int sender_task | ( | task_arg | arg | ) |
int serialize_msg | ( | pax_msg * | p, |
xcom_proto | x_proto, | ||
uint32_t * | buflen, | ||
char ** | buf | ||
) |
double server_active | ( | site_def const * | s, |
node_no | i | ||
) |
void server_detected | ( | server * | s | ) |
Updates timestamp of server.
[in] | s | Pointer to server. |
xcom_proto set_latest_common_proto | ( | xcom_proto | x_proto | ) |
void shutdown_connection | ( | connection_descriptor * | con | ) |
int shutdown_servers | ( | ) |
int srv_ref | ( | server * | s | ) |
int srv_unref | ( | server * | s | ) |
void ssl_free_con | ( | connection_descriptor * | con | ) |
int tcp_reaper_task | ( | task_arg | arg | ) |
int tcp_reconnection_task | ( | task_arg | arg | ) |
void update_servers | ( | site_def * | s, |
cargo_type | operation | ||
) |
void wakeup_sender | ( | ) |
void write_protoversion | ( | unsigned char * | buf, |
xcom_proto | proto_vers | ||
) |
char * xcom_get_name | ( | char * | a | ) |
xcom_port xcom_get_port | ( | char * | a | ) |
char const * xcom_proto_name | ( | xcom_proto | proto_vers | ) |
|
extern |
|
extern |
|
extern |