Rename GW_AUTHENTICATOR and GW_BITMASK + cleanup

This commit is contained in:
Esa Korhonen
2017-01-20 14:31:16 +02:00
parent 126d9be749
commit 641896872e
21 changed files with 69 additions and 88 deletions

View File

@ -16,22 +16,11 @@
* @file authenticator.h
*
* The authenticator module interface definitions for MaxScale
*
* @verbatim
* Revision History
*
* Date Who Description
* 17/02/16 Martin Brampton Initial implementation
*
* @endverbatim
*/
#include <maxscale/cdefs.h>
#include <maxscale/buffer.h>
#include <openssl/crypto.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/dh.h>
MXS_BEGIN_DECLS
@ -77,7 +66,7 @@ struct servlistener;
*
* @see load_module
*/
typedef struct gw_authenticator
typedef struct mxs_authenticator
{
void* (*initialize)(char **options);
void* (*create)(void* instance);
@ -87,7 +76,7 @@ typedef struct gw_authenticator
void (*free)(struct dcb *);
void (*destroy)(void *);
int (*loadusers)(struct servlistener *);
} GWAUTHENTICATOR;
} MXS_AUTHENTICATOR;
/** Return values for extract and authenticate entry points */
#define MXS_AUTH_SUCCEEDED 0 /**< Authentication was successful */
@ -127,11 +116,11 @@ typedef enum
} mxs_auth_state_t;
/**
* The GWAUTHENTICATOR version data. The following should be updated whenever
* the GWAUTHENTICATOR structure is changed. See the rules defined in modinfo.h
* The MXS_AUTHENTICATOR version data. The following should be updated whenever
* the MXS_AUTHENTICATOR structure is changed. See the rules defined in modinfo.h
* that define how these numbers should change.
*/
#define GWAUTHENTICATOR_VERSION {1, 1, 0}
#define MXS_AUTHENTICATOR_VERSION {1, 1, 0}
bool authenticator_init(void **instance, const char *authenticator, const char *options);

View File

@ -14,20 +14,12 @@
/**
* @file bitmask.h An implementation of an arbitrarily long bitmask
*
* @verbatim
* Revision History
*
* Date Who Description
* 28/06/13 Mark Riddoch Initial implementation
* 17/10/15 Martin Brampton Add bitmask_render_readable
*
* @endverbatim
*/
#include <maxscale/cdefs.h>
#include <maxscale/spinlock.h>
#include <maxscale/limits.h>
#include <maxscale/spinlock.h>
MXS_BEGIN_DECLS
@ -43,18 +35,18 @@ typedef struct
{
SPINLOCK lock; /**< Lock to protect the bitmask */
unsigned char bits[MXS_BITMASK_SIZE]; /**< The bits themselves */
} GWBITMASK;
} MXS_BITMASK;
#define GWBITMASK_INIT {SPINLOCK_INIT}
#define MXS_BITMASK_INIT {SPINLOCK_INIT}
extern void bitmask_init(GWBITMASK *);
extern void bitmask_free(GWBITMASK *);
extern int bitmask_set(GWBITMASK *, int);
extern int bitmask_clear(GWBITMASK *, int);
extern int bitmask_clear_without_spinlock(GWBITMASK *, int);
extern int bitmask_isset(GWBITMASK *, int);
extern int bitmask_isallclear(GWBITMASK *);
extern void bitmask_copy(GWBITMASK *, GWBITMASK *);
extern char *bitmask_render_readable(GWBITMASK *);
void bitmask_init(MXS_BITMASK *);
void bitmask_free(MXS_BITMASK *);
int bitmask_set(MXS_BITMASK *, int);
int bitmask_clear(MXS_BITMASK *, int);
int bitmask_clear_without_spinlock(MXS_BITMASK *, int);
int bitmask_isset(MXS_BITMASK *, int);
int bitmask_isallclear(MXS_BITMASK *);
void bitmask_copy(MXS_BITMASK *, MXS_BITMASK *);
char *bitmask_render_readable(MXS_BITMASK *);
MXS_END_DECLS

View File

@ -130,11 +130,11 @@ typedef struct dcbstats
*/
typedef struct
{
GWBITMASK bitmask; /*< The bitmask of threads */
MXS_BITMASK bitmask; /*< The bitmask of threads */
struct dcb *next; /*< Next pointer for the zombie list */
} DCBMM;
#define DCBMM_INIT {GWBITMASK_INIT}
#define DCBMM_INIT {MXS_BITMASK_INIT}
/* DCB states */
typedef enum
@ -237,7 +237,7 @@ typedef struct dcb
struct session *session; /**< The owning session */
struct servlistener *listener; /**< For a client DCB, the listener data */
MXS_PROTOCOL func; /**< The protocol functions for this descriptor */
GWAUTHENTICATOR authfunc; /**< The authenticator functions for this descriptor */
MXS_AUTHENTICATOR authfunc; /**< The authenticator functions for this descriptor */
int writeqlen; /**< Current number of byes in the write queue */
SPINLOCK writeqlock; /**< Write Queue spinlock */

View File

@ -50,7 +50,7 @@ typedef struct servlistener
char *address; /**< Address to listen with */
char *authenticator; /**< Name of authenticator */
char *auth_options; /**< Authenticator options */
void *auth_instance; /**< Authenticator instance created in GWAUTHENTICATOR::initialize() */
void *auth_instance; /**< Authenticator instance created in MXS_AUTHENTICATOR::initialize() */
SSL_LISTENER *ssl; /**< Structure of SSL data or NULL */
struct dcb *listener; /**< The DCB for the listener */
struct users *users; /**< The user data for this listener */