Format authenticator and protocol modules

This commit is contained in:
Markus Mäkelä
2019-05-09 10:47:55 +03:00
parent 0d13e694e4
commit 6625c1296b
22 changed files with 609 additions and 610 deletions

View File

@ -71,45 +71,45 @@ extern "C"
*
* @return The module object
*/
MXS_MODULE* MXS_CREATE_MODULE()
MXS_MODULE* MXS_CREATE_MODULE()
{
static MXS_PROTOCOL MyObject =
{
static MXS_PROTOCOL MyObject =
{
cdc_read_event, /* Read - EPOLLIN handler */
cdc_write, /* Write - data from gateway */
cdc_write_event, /* WriteReady - EPOLLOUT handler */
cdc_error, /* Error - EPOLLERR handler */
cdc_hangup, /* HangUp - EPOLLHUP handler */
cdc_accept, /* Accept */
NULL, /* Connect */
cdc_close, /* Close */
NULL, /* Authentication */
cdc_default_auth, /* default authentication */
NULL,
NULL,
NULL,
};
cdc_read_event, /* Read - EPOLLIN handler */
cdc_write, /* Write - data from gateway */
cdc_write_event, /* WriteReady - EPOLLOUT handler */
cdc_error, /* Error - EPOLLERR handler */
cdc_hangup, /* HangUp - EPOLLHUP handler */
cdc_accept, /* Accept */
NULL, /* Connect */
cdc_close, /* Close */
NULL, /* Authentication */
cdc_default_auth, /* default authentication */
NULL,
NULL,
NULL,
};
static MXS_MODULE info =
static MXS_MODULE info =
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_IN_DEVELOPMENT,
MXS_PROTOCOL_VERSION,
"A Change Data Capture Listener implementation for use in binlog events retrieval",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_IN_DEVELOPMENT,
MXS_PROTOCOL_VERSION,
"A Change Data Capture Listener implementation for use in binlog events retrieval",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
{MXS_END_MODULE_PARAMS}
}
};
{MXS_END_MODULE_PARAMS}
}
};
return &info;
}
return &info;
}
}
/**

View File

@ -65,45 +65,45 @@ extern "C"
*
* @return The module object
*/
MXS_MODULE* MXS_CREATE_MODULE()
MXS_MODULE* MXS_CREATE_MODULE()
{
static MXS_PROTOCOL MyObject =
{
static MXS_PROTOCOL MyObject =
{
httpd_read_event, /**< Read - EPOLLIN handler */
httpd_write, /**< Write - data from gateway */
httpd_write_event, /**< WriteReady - EPOLLOUT handler */
httpd_error, /**< Error - EPOLLERR handler */
httpd_hangup, /**< HangUp - EPOLLHUP handler */
httpd_accept, /**< Accept */
NULL, /**< Connect */
httpd_close, /**< Close */
NULL, /**< Authentication */
httpd_default_auth, /**< Default authenticator */
NULL, /**< Connection limit reached */
NULL,
NULL,
};
httpd_read_event, /**< Read - EPOLLIN handler */
httpd_write, /**< Write - data from gateway */
httpd_write_event, /**< WriteReady - EPOLLOUT handler */
httpd_error, /**< Error - EPOLLERR handler */
httpd_hangup, /**< HangUp - EPOLLHUP handler */
httpd_accept, /**< Accept */
NULL, /**< Connect */
httpd_close, /**< Close */
NULL, /**< Authentication */
httpd_default_auth, /**< Default authenticator */
NULL, /**< Connection limit reached */
NULL,
NULL,
};
static MXS_MODULE info =
static MXS_MODULE info =
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_IN_DEVELOPMENT,
MXS_PROTOCOL_VERSION,
"An experimental HTTPD implementation for use in administration",
"V1.2.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_IN_DEVELOPMENT,
MXS_PROTOCOL_VERSION,
"An experimental HTTPD implementation for use in administration",
"V1.2.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
{MXS_END_MODULE_PARAMS}
}
};
{MXS_END_MODULE_PARAMS}
}
};
return &info;
}
return &info;
}
}
/*lint +e14 */

View File

@ -57,7 +57,7 @@ static int gw_send_change_user_to_backend(char* dbname,
static void gw_send_proxy_protocol_header(DCB* backend_dcb);
static bool get_ip_string_and_port(struct sockaddr_storage* sa,
char* ip,
int iplen,
int iplen,
in_port_t* port_out);
static bool gw_connection_established(DCB* dcb);
json_t* gw_json_diagnostics(DCB* dcb);
@ -72,45 +72,45 @@ extern "C"
*
* @return The module object
*/
MXS_MODULE* MXS_CREATE_MODULE()
MXS_MODULE* MXS_CREATE_MODULE()
{
static MXS_PROTOCOL MyObject =
{
static MXS_PROTOCOL MyObject =
{
gw_read_backend_event, /* Read - EPOLLIN handler */
gw_MySQLWrite_backend, /* Write - data from gateway */
gw_write_backend_event, /* WriteReady - EPOLLOUT handler */
gw_error_backend_event, /* Error - EPOLLERR handler */
gw_backend_hangup, /* HangUp - EPOLLHUP handler */
NULL, /* Accept */
gw_create_backend_connection, /* Connect */
gw_backend_close, /* Close */
gw_change_user, /* Authentication */
gw_backend_default_auth, /* Default authenticator */
NULL, /* Connection limit reached */
gw_connection_established,
gw_json_diagnostics,
};
gw_read_backend_event, /* Read - EPOLLIN handler */
gw_MySQLWrite_backend, /* Write - data from gateway */
gw_write_backend_event, /* WriteReady - EPOLLOUT handler */
gw_error_backend_event, /* Error - EPOLLERR handler */
gw_backend_hangup, /* HangUp - EPOLLHUP handler */
NULL, /* Accept */
gw_create_backend_connection, /* Connect */
gw_backend_close, /* Close */
gw_change_user, /* Authentication */
gw_backend_default_auth, /* Default authenticator */
NULL, /* Connection limit reached */
gw_connection_established,
gw_json_diagnostics,
};
static MXS_MODULE info =
static MXS_MODULE info =
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
MXS_PROTOCOL_VERSION,
"The MySQL to backend server protocol",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
MXS_PROTOCOL_VERSION,
"The MySQL to backend server protocol",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
{MXS_END_MODULE_PARAMS}
}
};
{MXS_END_MODULE_PARAMS}
}
};
return &info;
}
return &info;
}
}
/**
@ -1976,7 +1976,7 @@ static void gw_send_proxy_protocol_header(DCB* backend_dcb)
*/
static bool get_ip_string_and_port(struct sockaddr_storage* sa,
char* ip,
int iplen,
int iplen,
in_port_t* port_out)
{
bool success = false;

View File

@ -155,7 +155,7 @@ GWBUF* mysql_create_com_quit(GWBUF* bufparam,
}
int mysql_send_com_quit(DCB* dcb,
int packet_number,
int packet_number,
GWBUF* bufparam)
{
GWBUF* buf;
@ -330,8 +330,8 @@ GWBUF* mysql_create_standard_error(int packet_number,
* @return 0 on failure, 1 on success
*/
int mysql_send_standard_error(DCB* dcb,
int packet_number,
int error_number,
int packet_number,
int error_number,
const char* error_message)
{
GWBUF* buf;
@ -353,8 +353,8 @@ int mysql_send_standard_error(DCB* dcb,
*
*/
int mysql_send_custom_error(DCB* dcb,
int packet_number,
int in_affected_rows,
int packet_number,
int in_affected_rows,
const char* mysql_message)
{
GWBUF* buf;
@ -377,8 +377,8 @@ int mysql_send_custom_error(DCB* dcb,
*
*/
int mysql_send_auth_error(DCB* dcb,
int packet_number,
int in_affected_rows,
int packet_number,
int in_affected_rows,
const char* mysql_message)
{
uint8_t* outbuf = NULL;
@ -454,7 +454,7 @@ int mysql_send_auth_error(DCB* dcb,
}
char* create_auth_failed_msg(GWBUF* readbuf,
char* hostaddr,
char* hostaddr,
uint8_t* sha1)
{
char* errstr;
@ -485,9 +485,9 @@ char* create_auth_failed_msg(GWBUF* readbuf,
*/
char* create_auth_fail_str(char* username,
char* hostaddr,
bool password,
bool password,
char* db,
int errcode)
int errcode)
{
char* errstr;
const char* ferrstr;

View File

@ -166,47 +166,47 @@ extern "C"
*
* @return The module object
*/
MXS_MODULE* MXS_CREATE_MODULE()
MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_INFO("Initialise MaxScaled Protocol module.");
static MXS_PROTOCOL MyObject =
{
MXS_INFO("Initialise MaxScaled Protocol module.");
maxscaled_read_event, /**< Read - EPOLLIN handler */
maxscaled_write, /**< Write - data from gateway */
maxscaled_write_event, /**< WriteReady - EPOLLOUT handler */
maxscaled_error, /**< Error - EPOLLERR handler */
maxscaled_hangup, /**< HangUp - EPOLLHUP handler */
maxscaled_accept, /**< Accept */
NULL, /**< Connect */
maxscaled_close, /**< Close */
NULL, /**< Authentication */
mxsd_default_auth, /**< Default authenticator */
NULL, /**< Connection limit reached */
NULL,
NULL,
};
static MXS_PROTOCOL MyObject =
static MXS_MODULE info =
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
MXS_PROTOCOL_VERSION,
"A maxscale protocol for the administration interface",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
maxscaled_read_event, /**< Read - EPOLLIN handler */
maxscaled_write, /**< Write - data from gateway */
maxscaled_write_event, /**< WriteReady - EPOLLOUT handler */
maxscaled_error, /**< Error - EPOLLERR handler */
maxscaled_hangup, /**< HangUp - EPOLLHUP handler */
maxscaled_accept, /**< Accept */
NULL, /**< Connect */
maxscaled_close, /**< Close */
NULL, /**< Authentication */
mxsd_default_auth, /**< Default authenticator */
NULL, /**< Connection limit reached */
NULL,
NULL,
};
{MXS_END_MODULE_PARAMS}
}
};
static MXS_MODULE info =
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
MXS_PROTOCOL_VERSION,
"A maxscale protocol for the administration interface",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
{MXS_END_MODULE_PARAMS}
}
};
return &info;
}
return &info;
}
}
/*lint +e14 */

View File

@ -85,46 +85,46 @@ extern "C"
*
* @return The module object
*/
MXS_MODULE* MXS_CREATE_MODULE()
MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_INFO("Initialise Telnetd Protocol module.");
static MXS_PROTOCOL MyObject =
{
MXS_INFO("Initialise Telnetd Protocol module.");
telnetd_read_event, /**< Read - EPOLLIN handler */
telnetd_write, /**< Write - data from gateway */
telnetd_write_event, /**< WriteReady - EPOLLOUT handler */
telnetd_error, /**< Error - EPOLLERR handler */
telnetd_hangup, /**< HangUp - EPOLLHUP handler */
telnetd_accept, /**< Accept */
NULL, /**< Connect */
telnetd_close, /**< Close */
NULL, /**< Authentication */
telnetd_default_auth, /**< Default authenticator */
NULL, /**< Connection limit reached */
NULL,
NULL,
};
static MXS_PROTOCOL MyObject =
static MXS_MODULE info =
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
MXS_PROTOCOL_VERSION,
"A telnet deamon protocol for simple administration interface",
"V1.1.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
telnetd_read_event, /**< Read - EPOLLIN handler */
telnetd_write, /**< Write - data from gateway */
telnetd_write_event, /**< WriteReady - EPOLLOUT handler */
telnetd_error, /**< Error - EPOLLERR handler */
telnetd_hangup, /**< HangUp - EPOLLHUP handler */
telnetd_accept, /**< Accept */
NULL, /**< Connect */
telnetd_close, /**< Close */
NULL, /**< Authentication */
telnetd_default_auth, /**< Default authenticator */
NULL, /**< Connection limit reached */
NULL,
NULL,
};
static MXS_MODULE info =
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
MXS_PROTOCOL_VERSION,
"A telnet deamon protocol for simple administration interface",
"V1.1.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */
NULL, /* Thread init. */
NULL, /* Thread finish. */
{
{MXS_END_MODULE_PARAMS}
}
};
return &info;
}
{MXS_END_MODULE_PARAMS}
}
};
return &info;
}
}
/*lint +e14 */