diff --git a/include/maxscale/filter.h b/include/maxscale/filter.h index 42effbed9..fd8ff1988 100644 --- a/include/maxscale/filter.h +++ b/include/maxscale/filter.h @@ -72,8 +72,8 @@ typedef struct mxs_filter_object MXS_FILTER_SESSION *(*newSession)(MXS_FILTER *instance, SESSION *session); void (*closeSession)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession); void (*freeSession)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession); - void (*setDownstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); - void (*setUpstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *downstream); + void (*setDownstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); + void (*setUpstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *downstream); int32_t (*routeQuery)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); int32_t (*clientReply)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); void (*diagnostics)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); diff --git a/include/maxscale/filter.hh b/include/maxscale/filter.hh index e29e9fdef..4f94d2d7a 100644 --- a/include/maxscale/filter.hh +++ b/include/maxscale/filter.hh @@ -46,7 +46,7 @@ public: m_data.routeQuery = NULL; } - Downstream(const DOWNSTREAM& down) + Downstream(const MXS_DOWNSTREAM& down) : m_data(down) {} @@ -63,7 +63,7 @@ public: return m_data.routeQuery(m_data.instance, m_data.session, pPacket); } - DOWNSTREAM m_data; + MXS_DOWNSTREAM m_data; }; class Upstream @@ -81,7 +81,7 @@ public: m_data.clientReply = NULL; } - Upstream(const UPSTREAM& up) + Upstream(const MXS_UPSTREAM& up) : m_data(up) {} @@ -98,7 +98,7 @@ public: return m_data.clientReply(m_data.instance, m_data.session, pPacket); } - UPSTREAM m_data; + MXS_UPSTREAM m_data; }; /** @@ -236,7 +236,7 @@ public: MXS_EXCEPTION_GUARD(delete pFilterSession); } - static void setDownstream(MXS_FILTER*, MXS_FILTER_SESSION* pData, DOWNSTREAM* pDownstream) + static void setDownstream(MXS_FILTER*, MXS_FILTER_SESSION* pData, MXS_DOWNSTREAM* pDownstream) { FilterSessionType* pFilterSession = reinterpret_cast(pData); @@ -245,7 +245,7 @@ public: MXS_EXCEPTION_GUARD(pFilterSession->setDownstream(down)); } - static void setUpstream(MXS_FILTER* pInstance, MXS_FILTER_SESSION* pData, UPSTREAM* pUpstream) + static void setUpstream(MXS_FILTER* pInstance, MXS_FILTER_SESSION* pData, MXS_UPSTREAM* pUpstream) { FilterSessionType* pFilterSession = reinterpret_cast(pData); diff --git a/include/maxscale/session.h b/include/maxscale/session.h index 47a713962..0420c0329 100644 --- a/include/maxscale/session.h +++ b/include/maxscale/session.h @@ -103,28 +103,28 @@ const char* session_trx_state_to_string(session_trx_state_t state); * The downstream element in the filter chain. This may refer to * another filter or to a router. */ -typedef struct +typedef struct mxs_downstream { void *instance; void *session; - int (*routeQuery)(void *instance, void *session, GWBUF *request); -} DOWNSTREAM; + int32_t (*routeQuery)(void *instance, void *session, GWBUF *request); +} MXS_DOWNSTREAM; -#define DOWNSTREAM_INIT {0} +#define MXS_DOWNSTREAM_INIT {0} /** * The upstream element in the filter chain. This may refer to * another filter or to the protocol implementation. */ -typedef struct +typedef struct mxs_upstream { void *instance; void *session; - int (*clientReply)(void *instance, void *session, GWBUF *response); - int (*error)(void *instance, void *session, void *); -} UPSTREAM; + int32_t (*clientReply)(void *instance, void *session, GWBUF *response); + int32_t (*error)(void *instance, void *session, void *); +} MXS_UPSTREAM; -#define UPSTREAM_INIT {0} +#define MXS_UPSTREAM_INIT {0} /** * Structure used to track the filter instances and sessions of the filters @@ -171,8 +171,8 @@ typedef struct session struct service *service; /*< The service this session is using */ int n_filters; /*< Number of filter sessions */ SESSION_FILTER *filters; /*< The filters in use within this session */ - DOWNSTREAM head; /*< Head of the filter chain */ - UPSTREAM tail; /*< The tail of the filter chain */ + MXS_DOWNSTREAM head; /*< Head of the filter chain */ + MXS_UPSTREAM tail; /*< The tail of the filter chain */ int refcount; /*< Reference count on the session */ bool ses_is_child; /*< this is a child session */ session_trx_state_t trx_state; /*< The current transaction state. */ @@ -186,7 +186,7 @@ typedef struct session } SESSION; #define SESSION_INIT {.ses_chk_top = CHK_NUM_SESSION, .ses_lock = SPINLOCK_INIT, \ - .stats = SESSION_STATS_INIT, .head = DOWNSTREAM_INIT, .tail = UPSTREAM_INIT, \ + .stats = SESSION_STATS_INIT, .head = MXS_DOWNSTREAM_INIT, .tail = MXS_UPSTREAM_INIT, \ .state = SESSION_STATE_ALLOC, .ses_chk_tail = CHK_NUM_SESSION} #define SESSION_PROTOCOL(x, type) DCB_PROTOCOL((x)->client_dcb, type) diff --git a/server/core/config.c b/server/core/config.c index 5ffc62904..2f200556d 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -66,6 +66,7 @@ #include #include +#include "maxscale/filter.h" #include "maxscale/service.h" typedef struct duplicate_context diff --git a/server/core/filter.c b/server/core/filter.c index 8996ac72e..59d386487 100644 --- a/server/core/filter.c +++ b/server/core/filter.c @@ -399,12 +399,12 @@ bool filter_load(FILTER_DEF* filter) * @return The downstream component for the next filter or NULL * if the filter could not be created */ -DOWNSTREAM * -filter_apply(FILTER_DEF *filter, SESSION *session, DOWNSTREAM *downstream) +MXS_DOWNSTREAM * +filter_apply(FILTER_DEF *filter, SESSION *session, MXS_DOWNSTREAM *downstream) { - DOWNSTREAM *me; + MXS_DOWNSTREAM *me; - if ((me = (DOWNSTREAM *)MXS_CALLOC(1, sizeof(DOWNSTREAM))) == NULL) + if ((me = (MXS_DOWNSTREAM *)MXS_CALLOC(1, sizeof(MXS_DOWNSTREAM))) == NULL) { return NULL; } @@ -434,10 +434,10 @@ filter_apply(FILTER_DEF *filter, SESSION *session, DOWNSTREAM *downstream) * @param upstream The filter that should be upstream of this filter * @return The upstream component for the next filter */ -UPSTREAM * -filter_upstream(FILTER_DEF *filter, void *fsession, UPSTREAM *upstream) +MXS_UPSTREAM * +filter_upstream(FILTER_DEF *filter, void *fsession, MXS_UPSTREAM *upstream) { - UPSTREAM *me = NULL; + MXS_UPSTREAM *me = NULL; /* * The the filter has no setUpstream entry point then is does @@ -450,7 +450,7 @@ filter_upstream(FILTER_DEF *filter, void *fsession, UPSTREAM *upstream) if (filter->obj->clientReply != NULL) { - if ((me = (UPSTREAM *)MXS_CALLOC(1, sizeof(UPSTREAM))) == NULL) + if ((me = (MXS_UPSTREAM *)MXS_CALLOC(1, sizeof(MXS_UPSTREAM))) == NULL) { return NULL; } diff --git a/server/core/maxscale/filter.h b/server/core/maxscale/filter.h index 1fb0a7079..f683b4f51 100644 --- a/server/core/maxscale/filter.h +++ b/server/core/maxscale/filter.h @@ -23,10 +23,10 @@ MXS_BEGIN_DECLS void filter_add_option(FILTER_DEF *filter_def, const char *option); void filter_add_parameter(FILTER_DEF *filter_def, const char *name, const char *value); FILTER_DEF *filter_alloc(const char *name, const char *module_name); -DOWNSTREAM *filter_apply(FILTER_DEF *filte_def, SESSION *session, DOWNSTREAM *downstream); +MXS_DOWNSTREAM *filter_apply(FILTER_DEF *filter_def, SESSION *session, MXS_DOWNSTREAM *downstream); void filter_free(FILTER_DEF *filter_def); bool filter_load(FILTER_DEF *filter_def); int filter_standard_parameter(const char *name); -UPSTREAM *filter_upstream(FILTER_DEF *filter_def, void *fsession, UPSTREAM *upstream); +MXS_UPSTREAM *filter_upstream(FILTER_DEF *filter_def, void *fsession, MXS_UPSTREAM *upstream); MXS_END_DECLS diff --git a/server/core/session.c b/server/core/session.c index 5ffc00a15..1408f48bd 100644 --- a/server/core/session.c +++ b/server/core/session.c @@ -627,8 +627,8 @@ static int session_setup_filters(SESSION *session) { SERVICE *service = session->service; - DOWNSTREAM *head; - UPSTREAM *tail; + MXS_DOWNSTREAM *head; + MXS_UPSTREAM *tail; int i; if ((session->filters = MXS_CALLOC(service->n_filters, diff --git a/server/modules/filter/ccrfilter/ccrfilter.c b/server/modules/filter/ccrfilter/ccrfilter.c index 8987aeebe..c5adae3bf 100644 --- a/server/modules/filter/ccrfilter/ccrfilter.c +++ b/server/modules/filter/ccrfilter/ccrfilter.c @@ -50,7 +50,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARA static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); static uint64_t getCapabilities(void); @@ -86,9 +86,9 @@ typedef struct */ typedef struct { - DOWNSTREAM down; /*< The downstream filter */ - int hints_left; /*< Number of hints left to add to queries*/ - time_t last_modification; /*< Time of the last data modifying operation */ + MXS_DOWNSTREAM down; /*< The downstream filter */ + int hints_left; /*< Number of hints left to add to queries*/ + time_t last_modification; /*< Time of the last data modifying operation */ } CCR_SESSION; /** @@ -269,7 +269,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { CCR_SESSION *my_session = (CCR_SESSION *)session; diff --git a/server/modules/filter/dbfwfilter/dbfwfilter.c b/server/modules/filter/dbfwfilter/dbfwfilter.c index b596830ad..d3eef595d 100644 --- a/server/modules/filter/dbfwfilter/dbfwfilter.c +++ b/server/modules/filter/dbfwfilter/dbfwfilter.c @@ -98,7 +98,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); static uint64_t getCapabilities(void); @@ -260,11 +260,11 @@ typedef struct */ typedef struct { - SESSION* session; /*< Client session structure */ - char* errmsg; /*< Rule specific error message */ - QUERYSPEED* query_speed; /*< How fast the user has executed queries */ - DOWNSTREAM down; /*< Next object in the downstream chain */ - UPSTREAM up; /*< Next object in the upstream chain */ + SESSION *session; /*< Client session structure */ + char *errmsg; /*< Rule specific error message */ + QUERYSPEED *query_speed; /*< How fast the user has executed queries */ + MXS_DOWNSTREAM down; /*< Next object in the downstream chain */ + MXS_UPSTREAM up; /*< Next object in the upstream chain */ } FW_SESSION; bool parse_at_times(const char** tok, char** saveptr, RULE* ruledef); @@ -1638,7 +1638,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router. */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { FW_SESSION *my_session = (FW_SESSION *) session; my_session->down = *downstream; diff --git a/server/modules/filter/hintfilter/hintfilter.c b/server/modules/filter/hintfilter/hintfilter.c index 083b0c46a..b6dcab47c 100644 --- a/server/modules/filter/hintfilter/hintfilter.c +++ b/server/modules/filter/hintfilter/hintfilter.c @@ -27,7 +27,7 @@ static MXS_FILTER *createInstance(const char* name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); static uint64_t getCapabilities(void); @@ -176,7 +176,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { HINT_SESSION *my_session = (HINT_SESSION *)session; diff --git a/server/modules/filter/hintfilter/mysqlhint.h b/server/modules/filter/hintfilter/mysqlhint.h index 5766e1d38..a95ee7d7c 100644 --- a/server/modules/filter/hintfilter/mysqlhint.h +++ b/server/modules/filter/hintfilter/mysqlhint.h @@ -90,11 +90,11 @@ typedef struct */ typedef struct { - DOWNSTREAM down; - GWBUF *request; - int query_len; - HINTSTACK *stack; - NAMEDHINTS *named_hints; /* The named hints defined in this session */ + MXS_DOWNSTREAM down; + GWBUF *request; + int query_len; + HINTSTACK *stack; + NAMEDHINTS *named_hints; /* The named hints defined in this session */ } HINT_SESSION; /* Some useful macros */ diff --git a/server/modules/filter/maxrows/maxrows.c b/server/modules/filter/maxrows/maxrows.c index a754e1947..8f662bdb7 100644 --- a/server/modules/filter/maxrows/maxrows.c +++ b/server/modules/filter/maxrows/maxrows.c @@ -50,8 +50,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DOWNSTREAM *downstream); -static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, UPSTREAM *upstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_DOWNSTREAM *downstream); +static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_UPSTREAM *upstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, GWBUF *queue); static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, GWBUF *queue); static void diagnostics(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DCB *dcb); @@ -153,14 +153,14 @@ static void maxrows_response_state_reset(MAXROWS_RESPONSE_STATE *state); typedef struct maxrows_session_data { - MAXROWS_INSTANCE *instance; /**< The maxrows instance the session is associated with. */ - DOWNSTREAM down; /**< The previous filter or equivalent. */ - UPSTREAM up; /**< The next filter or equivalent. */ - MAXROWS_RESPONSE_STATE res; /**< The response state. */ - SESSION *session; /**< The session this data is associated with. */ + MAXROWS_INSTANCE *instance; /**< The maxrows instance the session is associated with. */ + MXS_DOWNSTREAM down; /**< The previous filter or equivalent. */ + MXS_UPSTREAM up; /**< The next filter or equivalent. */ + MAXROWS_RESPONSE_STATE res; /**< The response state. */ + SESSION *session; /**< The session this data is associated with. */ maxrows_session_state_t state; - bool large_packet; /**< Large packet (> 16MB)) indicator */ - bool discard_resultset; /**< Discard resultset indicator */ + bool large_packet; /**< Large packet (> 16MB)) indicator */ + bool discard_resultset; /**< Discard resultset indicator */ } MAXROWS_SESSION_DATA; static MAXROWS_SESSION_DATA *maxrows_session_data_create(MAXROWS_INSTANCE *instance, SESSION *session); @@ -252,7 +252,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata) * @param sdata The session data of the session * @param down The downstream filter or router */ -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DOWNSTREAM *down) +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_DOWNSTREAM *down) { MAXROWS_INSTANCE *cinstance = (MAXROWS_INSTANCE*)instance; MAXROWS_SESSION_DATA *csdata = (MAXROWS_SESSION_DATA*)sdata; @@ -267,7 +267,7 @@ static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DOWNS * @param sdata The session data of the session * @param up The upstream filter or router */ -static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, UPSTREAM *up) +static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_UPSTREAM *up) { MAXROWS_INSTANCE *cinstance = (MAXROWS_INSTANCE*)instance; MAXROWS_SESSION_DATA *csdata = (MAXROWS_SESSION_DATA*)sdata; diff --git a/server/modules/filter/mqfilter/mqfilter.c b/server/modules/filter/mqfilter/mqfilter.c index fa9b66e2e..586202b2d 100644 --- a/server/modules/filter/mqfilter/mqfilter.c +++ b/server/modules/filter/mqfilter/mqfilter.c @@ -87,8 +87,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); -static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); +static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); @@ -229,8 +229,8 @@ typedef struct { char* uid; /**Unique identifier used to tag messages*/ char* db; /**The currently active database*/ - DOWNSTREAM down; - UPSTREAM up; + MXS_DOWNSTREAM down; + MXS_UPSTREAM up; SESSION* session; bool was_query; /**True if the previous routeQuery call had valid content*/ } MQ_SESSION; @@ -873,13 +873,13 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router. */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { MQ_SESSION *my_session = (MQ_SESSION *) session; my_session->down = *downstream; } -static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream) +static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream) { MQ_SESSION *my_session = (MQ_SESSION *) session; my_session->up = *upstream; diff --git a/server/modules/filter/namedserverfilter/namedserverfilter.c b/server/modules/filter/namedserverfilter/namedserverfilter.c index 07a07751c..4a5daeebe 100644 --- a/server/modules/filter/namedserverfilter/namedserverfilter.c +++ b/server/modules/filter/namedserverfilter/namedserverfilter.c @@ -44,7 +44,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); static uint64_t getCapabilities(void); @@ -66,7 +66,7 @@ typedef struct */ typedef struct { - DOWNSTREAM down; /* The downstream filter */ + MXS_DOWNSTREAM down; /* The downstream filter */ int n_diverted; /* No. of statements diverted */ int n_undiverted; /* No. of statements not diverted */ int active; /* Is filter active */ @@ -258,7 +258,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { REGEXHINT_SESSION *my_session = (REGEXHINT_SESSION *) session; my_session->down = *downstream; diff --git a/server/modules/filter/qlafilter/qlafilter.c b/server/modules/filter/qlafilter/qlafilter.c index 7c2d6e883..9ad3e37dd 100644 --- a/server/modules/filter/qlafilter/qlafilter.c +++ b/server/modules/filter/qlafilter/qlafilter.c @@ -77,7 +77,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); static uint64_t getCapabilities(void); @@ -121,7 +121,7 @@ typedef struct typedef struct { int active; - DOWNSTREAM down; + MXS_DOWNSTREAM down; char *filename; /* The session-specific log file name */ FILE *fp; /* The session-specific log file */ const char *remote; @@ -483,7 +483,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router. */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { QLA_SESSION *my_session = (QLA_SESSION *) session; diff --git a/server/modules/filter/regexfilter/regexfilter.c b/server/modules/filter/regexfilter/regexfilter.c index 3b28567d7..1a948155a 100644 --- a/server/modules/filter/regexfilter/regexfilter.c +++ b/server/modules/filter/regexfilter/regexfilter.c @@ -44,7 +44,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); static uint64_t getCapabilities(void); @@ -72,7 +72,7 @@ typedef struct */ typedef struct { - DOWNSTREAM down; /* The downstream filter */ + MXS_DOWNSTREAM down; /* The downstream filter */ SPINLOCK lock; int no_change; /* No. of unchanged requests */ int replacements; /* No. of changed requests */ @@ -308,7 +308,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { REGEX_SESSION *my_session = (REGEX_SESSION *) session; my_session->down = *downstream; diff --git a/server/modules/filter/tee/tee.c b/server/modules/filter/tee/tee.c index 1c265b6ea..e3474d358 100644 --- a/server/modules/filter/tee/tee.c +++ b/server/modules/filter/tee/tee.c @@ -101,8 +101,8 @@ static MXS_FILTER *createInstance(const char* name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); -static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); +static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); @@ -133,8 +133,8 @@ typedef struct */ typedef struct { - DOWNSTREAM down; /* The downstream filter */ - UPSTREAM up; /* The upstream filter */ + MXS_DOWNSTREAM down; /* The downstream filter */ + MXS_UPSTREAM up; /* The upstream filter */ int active; /* filter is active? */ bool use_ok; int client_multistatement; @@ -631,7 +631,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router. */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { TEE_SESSION *my_session = (TEE_SESSION *) session; my_session->down = *downstream; @@ -646,7 +646,7 @@ setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *dow * @param downstream The downstream filter or router. */ static void -setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream) +setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream) { TEE_SESSION *my_session = (TEE_SESSION *) session; my_session->up = *upstream; diff --git a/server/modules/filter/testfilter/testfilter.c b/server/modules/filter/testfilter/testfilter.c index e2709620c..f3517b832 100644 --- a/server/modules/filter/testfilter/testfilter.c +++ b/server/modules/filter/testfilter/testfilter.c @@ -34,7 +34,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PAR static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); static uint64_t getCapabilities(void); @@ -57,8 +57,8 @@ typedef struct */ typedef struct { - DOWNSTREAM down; - int count; + MXS_DOWNSTREAM down; + int count; } TEST_SESSION; /** @@ -184,7 +184,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { TEST_SESSION *my_session = (TEST_SESSION *)session; diff --git a/server/modules/filter/topfilter/topfilter.c b/server/modules/filter/topfilter/topfilter.c index 315499f3c..754f51e5d 100644 --- a/server/modules/filter/topfilter/topfilter.c +++ b/server/modules/filter/topfilter/topfilter.c @@ -52,8 +52,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); -static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); +static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); @@ -99,8 +99,8 @@ typedef struct topnq */ typedef struct { - DOWNSTREAM down; - UPSTREAM up; + MXS_DOWNSTREAM down; + MXS_UPSTREAM up; int active; char *clientHost; char *userName; @@ -426,7 +426,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router. */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { TOPN_SESSION *my_session = (TOPN_SESSION *) session; @@ -442,7 +442,7 @@ setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *dow * @param upstream The upstream filter or session. */ static void -setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream) +setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream) { TOPN_SESSION *my_session = (TOPN_SESSION *) session; diff --git a/server/modules/filter/tpmfilter/tpmfilter.c b/server/modules/filter/tpmfilter/tpmfilter.c index 4e9064e19..22dadcbcd 100644 --- a/server/modules/filter/tpmfilter/tpmfilter.c +++ b/server/modules/filter/tpmfilter/tpmfilter.c @@ -79,8 +79,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PAR static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session); static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session); -static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream); -static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream); +static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream); +static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream); static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue); static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb); @@ -116,8 +116,8 @@ typedef struct */ typedef struct { - DOWNSTREAM down; - UPSTREAM up; + MXS_DOWNSTREAM down; + MXS_UPSTREAM up; int active; char *clientHost; char *userName; @@ -392,7 +392,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) * @param downstream The downstream filter or router. */ static void -setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream) +setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream) { TPM_SESSION *my_session = (TPM_SESSION *)session; @@ -408,7 +408,7 @@ setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *dow * @param upstream The upstream filter or session. */ static void -setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream) +setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream) { TPM_SESSION *my_session = (TPM_SESSION *)session;