Rename GWPROTOCOL to MXS_PROTOCOL

This commit is contained in:
Johan Wikman
2017-01-05 10:28:24 +02:00
parent 19ce28a43a
commit 2abe956056
12 changed files with 30 additions and 39 deletions

View File

@ -236,7 +236,7 @@ typedef struct dcb
size_t protocol_bytes_processed; /**< How many bytes of a packet have been read */
struct session *session; /**< The owning session */
struct servlistener *listener; /**< For a client DCB, the listener data */
GWPROTOCOL func; /**< The protocol functions for this descriptor */
MXS_PROTOCOL func; /**< The protocol functions for this descriptor */
GWAUTHENTICATOR authfunc; /**< The authenticator functions for this descriptor */
int writeqlen; /**< Current number of byes in the write queue */

View File

@ -15,16 +15,7 @@
/**
* @file protocol.h
*
* The listener definitions for MaxScale
*
* @verbatim
* Revision History
*
* Date Who Description
* 22/01/16 Martin Brampton Initial implementation
* 31/05/16 Martin Brampton Add API entry for connection limit
*
* @endverbatim
* The protocol module interface definition.
*/
#include <maxscale/cdefs.h>
@ -59,7 +50,7 @@ struct session;
*
* @see load_module
*/
typedef struct gw_protocol
typedef struct mxs_protocol
{
int (*read)(struct dcb *);
int (*write)(struct dcb *, GWBUF *);
@ -74,13 +65,13 @@ typedef struct gw_protocol
int (*session)(struct dcb *, void *);
char *(*auth_default)();
int (*connlimit)(struct dcb *, int limit);
} GWPROTOCOL;
} MXS_PROTOCOL;
/**
* The GWPROTOCOL version data. The following should be updated whenever
* the GWPROTOCOL structure is changed. See the rules defined in modinfo.h
* The MXS_PROTOCOL version data. The following should be updated whenever
* the MXS_PROTOCOL structure is changed. See the rules defined in modinfo.h
* that define how these numbers should change.
*/
#define GWPROTOCOL_VERSION {1, 1, 0}
#define MXS_PROTOCOL_VERSION {1, 1, 0}
MXS_END_DECLS

View File

@ -92,7 +92,7 @@ bool authenticator_init(void** dest, const char *authenticator, const char *opti
const char* get_default_authenticator(const char *protocol)
{
char *rval = NULL;
GWPROTOCOL *protofuncs = (GWPROTOCOL*)load_module(protocol, MODULE_PROTOCOL);
MXS_PROTOCOL *protofuncs = (MXS_PROTOCOL*)load_module(protocol, MODULE_PROTOCOL);
if (protofuncs && protofuncs->auth_default)
{

View File

@ -637,7 +637,7 @@ DCB *
dcb_connect(SERVER *server, SESSION *session, const char *protocol)
{
DCB *dcb;
GWPROTOCOL *funcs;
MXS_PROTOCOL *funcs;
int fd;
int rc;
const char *user;
@ -679,7 +679,7 @@ dcb_connect(SERVER *server, SESSION *session, const char *protocol)
return NULL;
}
if ((funcs = (GWPROTOCOL *)load_module(protocol,
if ((funcs = (MXS_PROTOCOL *)load_module(protocol,
MODULE_PROTOCOL)) == NULL)
{
dcb->state = DCB_STATE_DISCONNECTED;
@ -689,7 +689,7 @@ dcb_connect(SERVER *server, SESSION *session, const char *protocol)
dcb);
return NULL;
}
memcpy(&(dcb->func), funcs, sizeof(GWPROTOCOL));
memcpy(&(dcb->func), funcs, sizeof(MXS_PROTOCOL));
dcb->protoname = MXS_STRDUP_A(protocol);
const char *authenticator = server->authenticator ?
@ -2915,7 +2915,7 @@ DCB *
dcb_accept(DCB *listener)
{
DCB *client_dcb = NULL;
GWPROTOCOL *protocol_funcs = &listener->func;
MXS_PROTOCOL *protocol_funcs = &listener->func;
int c_sock;
int sendbuf;
struct sockaddr_storage client_conn;
@ -2987,7 +2987,7 @@ dcb_accept(DCB *listener)
INET_ADDRSTRLEN);
}
}
memcpy(&client_dcb->func, protocol_funcs, sizeof(GWPROTOCOL));
memcpy(&client_dcb->func, protocol_funcs, sizeof(MXS_PROTOCOL));
if (listener->listener->authenticator)
{
authenticator_name = listener->listener->authenticator;

View File

@ -237,7 +237,7 @@ serviceStartPort(SERVICE *service, SERV_LISTENER *port)
size_t config_bind_len =
(port->address ? strlen(port->address) : ANY_IPV4_ADDRESS_LEN) + 1 + UINTLEN(port->port);
char config_bind[config_bind_len + 1]; // +1 for NULL
GWPROTOCOL *funcs;
MXS_PROTOCOL *funcs;
if (service == NULL || service->router == NULL || service->router_instance == NULL)
{
@ -264,7 +264,7 @@ serviceStartPort(SERVICE *service, SERV_LISTENER *port)
listener_init_SSL(port->ssl);
}
if ((funcs = (GWPROTOCOL *)load_module(port->protocol, MODULE_PROTOCOL)) == NULL)
if ((funcs = (MXS_PROTOCOL *)load_module(port->protocol, MODULE_PROTOCOL)) == NULL)
{
MXS_ERROR("Unable to load protocol module %s. Listener for service %s not started.",
port->protocol, service->name);
@ -272,7 +272,7 @@ serviceStartPort(SERVICE *service, SERV_LISTENER *port)
return 0;
}
memcpy(&(port->listener->func), funcs, sizeof(GWPROTOCOL));
memcpy(&(port->listener->func), funcs, sizeof(MXS_PROTOCOL));
const char *authenticator_name = "NullAuthDeny";

View File

@ -70,7 +70,7 @@ static char* cdc_default_auth()
*/
MXS_MODULE* MXS_CREATE_MODULE()
{
static GWPROTOCOL MyObject =
static MXS_PROTOCOL MyObject =
{
cdc_read_event, /* Read - EPOLLIN handler */
cdc_write, /* Write - data from gateway */
@ -90,7 +90,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
MXS_PROTOCOL_VERSION,
"A Change Data Capture Listener implementation for use in binlog events retrieval",
"V1.0.0"
};

View File

@ -65,7 +65,7 @@ static char *httpd_default_auth();
*/
MXS_MODULE* MXS_CREATE_MODULE()
{
static GWPROTOCOL MyObject =
static MXS_PROTOCOL MyObject =
{
httpd_read_event, /**< Read - EPOLLIN handler */
httpd_write, /**< Write - data from gateway */
@ -86,7 +86,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
MXS_PROTOCOL_VERSION,
"An experimental HTTPD implementation for use in administration",
"V1.2.0",
&MyObject

View File

@ -87,7 +87,7 @@ static int gw_send_change_user_to_backend(char *dbname,
*/
MXS_MODULE* MXS_CREATE_MODULE()
{
static GWPROTOCOL MyObject =
static MXS_PROTOCOL MyObject =
{
gw_read_backend_event, /* Read - EPOLLIN handler */
gw_MySQLWrite_backend, /* Write - data from gateway */
@ -108,7 +108,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
GWPROTOCOL_VERSION,
MXS_PROTOCOL_VERSION,
"The MySQL to backend server protocol",
"V2.0.0",
&MyObject

View File

@ -95,7 +95,7 @@ static void gw_process_one_new_client(DCB *client_dcb);
*/
MXS_MODULE* MXS_CREATE_MODULE()
{
static GWPROTOCOL MyObject =
static MXS_PROTOCOL MyObject =
{
gw_read_client_event, /* Read - EPOLLIN handler */
gw_MySQLWrite_client, /* Write - data from gateway */
@ -116,7 +116,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
GWPROTOCOL_VERSION,
MXS_PROTOCOL_VERSION,
"The client to MaxScale MySQL protocol implementation",
"V1.1.0",
&MyObject

View File

@ -168,7 +168,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_INFO("Initialise MaxScaled Protocol module.");
static GWPROTOCOL MyObject =
static MXS_PROTOCOL MyObject =
{
maxscaled_read_event, /**< Read - EPOLLIN handler */
maxscaled_write, /**< Write - data from gateway */
@ -189,7 +189,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
GWPROTOCOL_VERSION,
MXS_PROTOCOL_VERSION,
"A maxscale protocol for the administration interface",
"V2.0.0",
&MyObject

View File

@ -85,7 +85,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_INFO("Initialise Telnetd Protocol module.");
static GWPROTOCOL MyObject =
static MXS_PROTOCOL MyObject =
{
telnetd_read_event, /**< Read - EPOLLIN handler */
telnetd_write, /**< Write - data from gateway */
@ -106,7 +106,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_GA,
GWPROTOCOL_VERSION,
MXS_PROTOCOL_VERSION,
"A telnet deamon protocol for simple administration interface",
"V1.1.1",
&MyObject

View File

@ -54,7 +54,7 @@ static int test_connection_limit(DCB *dcb, int limit){return 0;}
*/
MXS_MODULE* MXS_CREATE_MODULE()
{
static GWPROTOCOL MyObject =
static MXS_PROTOCOL MyObject =
{
test_read, /**< Read - EPOLLIN handler */
test_write, /**< Write - data from gateway */
@ -75,7 +75,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_MODULE_API_PROTOCOL,
MXS_MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
MXS_PROTOCOL_VERSION,
"Test protocol",
"V1.1.0",
&MyObject