1 /* 2 Copyright (c) 2013, 2021, Oracle and/or its affiliates. 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2.0, 6 as published by the Free Software Foundation. 7 8 This program is also distributed with certain software (including 9 but not limited to OpenSSL) that is licensed under separate terms, 10 as designated in a particular file or component or in included license 11 documentation. The authors of MySQL hereby grant you an additional 12 permission to link the program and your derivative works with the 13 separately licensed software that they have included with MySQL. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License, version 2.0, for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 23 24 25 #ifndef TABLE_REPLICATION_CONFIGURATION_H 26 #define TABLE_REPLICATION_CONFIGURATION_H 27 28 /** 29 @file storage/perfschema/table_replication_connection_configuration.h 30 Table replication_connection_configuration (declarations). 31 */ 32 33 #include "pfs_column_types.h" 34 #include "pfs_engine_table.h" 35 #include "rpl_mi.h" 36 #include "mysql_com.h" 37 #include "rpl_msr.h" 38 #include "rpl_info.h" /* CHANNEL_NAME_LENGTH*/ 39 40 class Master_info; 41 42 /** 43 @addtogroup Performance_schema_tables 44 @{ 45 */ 46 47 #ifndef ENUM_RPL_YES_NO 48 #define ENUM_RPL_YES_NO 49 enum enum_rpl_yes_no { 50 PS_RPL_YES= 1, 51 PS_RPL_NO 52 }; 53 #endif 54 55 /** enum values for SSL_Allowed*/ 56 enum enum_ssl_allowed { 57 PS_SSL_ALLOWED_YES= 1, 58 PS_SSL_ALLOWED_NO, 59 PS_SSL_ALLOWED_IGNORED 60 }; 61 62 /** 63 A row in the table. The fields with string values have an additional 64 length field denoted by <field_name>_length. 65 */ 66 struct st_row_connect_config { 67 char channel_name[CHANNEL_NAME_LENGTH]; 68 uint channel_name_length; 69 char host[HOSTNAME_LENGTH]; 70 uint host_length; 71 uint port; 72 char user[USERNAME_LENGTH]; 73 uint user_length; 74 char network_interface[HOSTNAME_LENGTH]; 75 uint network_interface_length; 76 enum_rpl_yes_no auto_position; 77 enum_ssl_allowed ssl_allowed; 78 char ssl_ca_file[FN_REFLEN]; 79 uint ssl_ca_file_length; 80 char ssl_ca_path[FN_REFLEN]; 81 uint ssl_ca_path_length; 82 char ssl_certificate[FN_REFLEN]; 83 uint ssl_certificate_length; 84 char ssl_cipher[FN_REFLEN]; 85 uint ssl_cipher_length; 86 char ssl_key[FN_REFLEN]; 87 uint ssl_key_length; 88 enum_rpl_yes_no ssl_verify_server_certificate; 89 char ssl_crl_file[FN_REFLEN]; 90 uint ssl_crl_file_length; 91 char ssl_crl_path[FN_REFLEN]; 92 uint ssl_crl_path_length; 93 uint connection_retry_interval; 94 ulong connection_retry_count; 95 double heartbeat_interval; 96 char tls_version[FN_REFLEN]; 97 uint tls_version_length; 98 }; 99 100 /** Table PERFORMANCE_SCHEMA.TABLE_REPLICATION_CONNECTION_CONFIGURATION. */ 101 class table_replication_connection_configuration: public PFS_engine_table 102 { 103 typedef PFS_simple_index pos_t; 104 105 private: 106 void make_row(Master_info *); 107 108 /** Table share lock. */ 109 static THR_LOCK m_table_lock; 110 /** Fields definition. */ 111 static TABLE_FIELD_DEF m_field_def; 112 /** True if the current row exists. */ 113 bool m_row_exists; 114 /** Current row */ 115 st_row_connect_config m_row; 116 /** Current position. */ 117 pos_t m_pos; 118 /** Next position. */ 119 pos_t m_next_pos; 120 121 protected: 122 /** 123 Read the current row values. 124 @param table Table handle 125 @param buf row buffer 126 @param fields Table fields 127 @param read_all true if all columns are read. 128 */ 129 130 virtual int read_row_values(TABLE *table, 131 unsigned char *buf, 132 Field **fields, 133 bool read_all); 134 135 table_replication_connection_configuration(); 136 137 public: 138 ~table_replication_connection_configuration(); 139 140 /** Table share. */ 141 static PFS_engine_table_share m_share; 142 static PFS_engine_table* create(); 143 static ha_rows get_row_count(); 144 virtual int rnd_next(); 145 virtual int rnd_pos(const void *pos); 146 virtual void reset_position(void); 147 148 }; 149 150 /** @} */ 151 #endif 152