From 45bfbbdd9e54106b6e9ced9a8c139e5f7903c095 Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Tue, 15 Jan 2019 17:26:26 +0200 Subject: [PATCH] Convert maxscale/protocol.h to .hh --- include/maxscale/dcb.hh | 2 +- include/maxscale/listener.hh | 2 +- include/maxscale/{protocol.h => protocol.hh} | 21 ++++++++----------- include/maxscale/service.hh | 2 +- include/maxscale/ssl.hh | 2 +- server/core/listener.cc | 2 +- server/core/load_utils.cc | 2 +- server/core/service.cc | 2 +- server/modules/protocol/CDC/cdc.cc | 2 +- server/modules/protocol/HTTPD/httpd.cc | 2 +- .../MySQL/mariadbbackend/mysql_backend.cc | 2 +- .../MySQL/mariadbclient/mysql_client.cc | 2 +- .../modules/protocol/maxscaled/maxscaled.cc | 2 +- server/modules/protocol/telnetd/telnetd.cc | 2 +- 14 files changed, 22 insertions(+), 25 deletions(-) rename include/maxscale/{protocol.h => protocol.hh} (92%) diff --git a/include/maxscale/dcb.hh b/include/maxscale/dcb.hh index 21be8a0a9..f79563668 100644 --- a/include/maxscale/dcb.hh +++ b/include/maxscale/dcb.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/maxscale/listener.hh b/include/maxscale/listener.hh index 52bac51c3..05067bf8b 100644 --- a/include/maxscale/listener.hh +++ b/include/maxscale/listener.hh @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/maxscale/protocol.h b/include/maxscale/protocol.hh similarity index 92% rename from include/maxscale/protocol.h rename to include/maxscale/protocol.hh index 82e1a26a8..762f17a91 100644 --- a/include/maxscale/protocol.h +++ b/include/maxscale/protocol.hh @@ -13,7 +13,7 @@ #pragma once /** - * @file protocol.h + * @file protocol.hh * * The protocol module interface definition. */ @@ -21,18 +21,17 @@ #include #include -#include +#include -MXS_BEGIN_DECLS struct DCB; -struct SERVER; +class SERVER; struct MXS_SESSION; /** * Protocol module API */ -typedef struct mxs_protocol +struct MXS_PROTOCOL { /** * EPOLLIN handler, used to read available data from network socket @@ -106,7 +105,7 @@ typedef struct mxs_protocol * * @return The opened file descriptor or DCBFD_CLOSED on error */ - int32_t (* connect)(DCB* dcb, struct SERVER* server, MXS_SESSION* session); + int32_t (* connect)(DCB* dcb, SERVER* server, MXS_SESSION* session); /** * Free protocol data allocated in the connect handler @@ -131,7 +130,7 @@ typedef struct mxs_protocol * * @note Currently the return value is ignored */ - int32_t (* auth)(DCB* dcb, struct SERVER* server, MXS_SESSION* session, GWBUF* buffer); + int32_t (* auth)(DCB* dcb, SERVER* server, MXS_SESSION* session, GWBUF* buffer); /** * Returns the name of the default authenticator module for this protocol @@ -169,7 +168,7 @@ typedef struct mxs_protocol * @return JSON representation of the DCB */ json_t* (*diagnostics_json)(DCB * dcb); -} MXS_PROTOCOL; +}; /** * The MXS_PROTOCOL version data. The following should be updated whenever @@ -186,9 +185,7 @@ typedef struct mxs_protocol * @note The values of the capabilities here *must* be between 0x010000000000 * and 0x800000000000, that is, bits 40 to 47. */ -typedef enum protocol_capability +enum protocol_capability_t { PCAP_TYPE_NONE = 0x0 // TODO: remove once protocol capabilities are defined -} protocol_capability_t; - -MXS_END_DECLS +}; diff --git a/include/maxscale/service.hh b/include/maxscale/service.hh index bbd43b970..63951df44 100644 --- a/include/maxscale/service.hh +++ b/include/maxscale/service.hh @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/maxscale/ssl.hh b/include/maxscale/ssl.hh index a20a3da3a..5412be978 100644 --- a/include/maxscale/ssl.hh +++ b/include/maxscale/ssl.hh @@ -19,7 +19,7 @@ */ #include -#include +#include #include #include #include diff --git a/server/core/listener.cc b/server/core/listener.cc index f9f30e302..e92099c19 100644 --- a/server/core/listener.cc +++ b/server/core/listener.cc @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/server/core/load_utils.cc b/server/core/load_utils.cc index d1d66092a..46c83df48 100644 --- a/server/core/load_utils.cc +++ b/server/core/load_utils.cc @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/server/core/service.cc b/server/core/service.cc index 561936a8f..6af6559d2 100644 --- a/server/core/service.cc +++ b/server/core/service.cc @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/server/modules/protocol/CDC/cdc.cc b/server/modules/protocol/CDC/cdc.cc index edbd693e2..153a18ea4 100644 --- a/server/modules/protocol/CDC/cdc.cc +++ b/server/modules/protocol/CDC/cdc.cc @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/server/modules/protocol/HTTPD/httpd.cc b/server/modules/protocol/HTTPD/httpd.cc index 932d9f7f0..01c76a36d 100644 --- a/server/modules/protocol/HTTPD/httpd.cc +++ b/server/modules/protocol/HTTPD/httpd.cc @@ -37,7 +37,7 @@ #include "httpd.hh" #include #include -#include +#include #include #include diff --git a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc index 347c4f2d1..1f16db2ec 100644 --- a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc +++ b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc index 8f5d7b717..27c31fea9 100644 --- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc +++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/server/modules/protocol/maxscaled/maxscaled.cc b/server/modules/protocol/maxscaled/maxscaled.cc index 1f5bad8ab..97ea23ada 100644 --- a/server/modules/protocol/maxscaled/maxscaled.cc +++ b/server/modules/protocol/maxscaled/maxscaled.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/server/modules/protocol/telnetd/telnetd.cc b/server/modules/protocol/telnetd/telnetd.cc index 36706e0d1..97c9a1ddc 100644 --- a/server/modules/protocol/telnetd/telnetd.cc +++ b/server/modules/protocol/telnetd/telnetd.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include