Merge branch 'develop' into MXS-329-develop-20151111

This commit is contained in:
Markus Makela
2015-11-13 07:44:23 +02:00
66 changed files with 4807 additions and 4056 deletions

View File

@ -6,15 +6,21 @@
#include <errno.h>
#include <skygw_utils.h>
#include <log_manager.h>
#include <maxscale_pcre2.h>
#define MAXSCALE_EXTCMD_ARG_MAX 256
typedef struct extern_cmd_t{
char* parameters[MAXSCALE_EXTCMD_ARG_MAX]; /*< Command arguments */
char** argv; /*< Argument vector for the command, first being the actual command
* being executed. */
int n_exec; /*< Number of times executed */
pid_t child; /*< PID of the child process */
}EXTERNCMD;
char* externcmd_extract_command(const char* argstr);
EXTERNCMD* externcmd_allocate(char* argstr);
void externcmd_free(EXTERNCMD* cmd);
int externcmd_execute(EXTERNCMD* cmd);
bool externcmd_substitute_arg(EXTERNCMD* cmd, const char* re, const char* replace);
bool externcmd_can_execute(const char* argstr);
#endif

View File

@ -85,6 +85,7 @@ typedef struct hashtable {
int n_readers; /**< Number of clients reading the table */
int writelock; /**< The table is locked by a writer */
bool ht_isflat; /**< Indicates whether hashtable is in stack or heap */
int n_elements; /*< Number of added elements */
#if defined(SS_DEBUG)
skygw_chk_t ht_chk_tail;
#endif
@ -130,4 +131,5 @@ extern HASHITERATOR *hashtable_iterator(HASHTABLE *);
extern void *hashtable_next(HASHITERATOR *);
/**< Return the key of the hash table iterator */
extern void hashtable_iterator_free(HASHITERATOR *);
extern int hashtable_size(HASHTABLE *table);
#endif

View File

@ -120,6 +120,7 @@ extern unsigned int config_pollsleep();
CONFIG_PARAMETER* config_get_param(CONFIG_PARAMETER* params, const char* name);
config_param_type_t config_get_paramtype(CONFIG_PARAMETER* param);
CONFIG_PARAMETER* config_clone_param(CONFIG_PARAMETER* param);
void free_config_parameter(CONFIG_PARAMETER* p1);
extern int config_truth_value(char *);
extern double config_percentage_value(char *str);
bool config_set_qualified_param(

View File

@ -21,6 +21,7 @@
#include <server.h>
#include <dcb.h>
#include <resultset.h>
#include <maxconfig.h>
/**
* @file monitor.h The interface to the monitor module
@ -140,6 +141,7 @@ typedef struct monitor {
char* user; /*< Monitor username */
char* password; /*< Monitor password */
SPINLOCK lock;
CONFIG_PARAMETER* parameters; /*< configuration parameters */
MONITOR_SERVERS* databases; /*< List of databases the monitor monitors */
monitor_state_t state; /**< The state of the monitor */
int connect_timeout; /**< Connect timeout in seconds for mysql_real_connect */
@ -160,9 +162,11 @@ extern void monitor_free(MONITOR *);
extern MONITOR *monitor_find(char *);
extern void monitorAddServer(MONITOR *, SERVER *);
extern void monitorAddUser(MONITOR *, char *, char *);
extern void monitorAddParameters(MONITOR *monitor, CONFIG_PARAMETER *params);
extern void monitorStop(MONITOR *);
extern void monitorStart(MONITOR *, void*);
extern void monitorStopAll();
extern void monitorStartAll();
extern void monitorShowAll(DCB *);
extern void monitorShow(DCB *, MONITOR *);
extern void monitorList(DCB *);
@ -170,4 +174,5 @@ extern void monitorSetInterval (MONITOR *, unsigned long);
extern void monitorSetNetworkTimeout(MONITOR *, int, int);
extern RESULTSET *monitorGetList();
bool check_monitor_permissions(MONITOR* monitor);
#endif

View File

@ -24,8 +24,8 @@
* @verbatim
* Revision History
*
* Date Who Description
* 23/06/2013 Massimiliano Pinto Initial implementation
* Date Who Description
* 23/06/2013 Massimiliano Pinto Initial implementation
*
* @endverbatim
*/
@ -40,18 +40,19 @@
#include <openssl/aes.h>
#define MAXSCALE_KEYLEN 32
#define MAXSCALE_IV_LEN 16
#define MAXSCALE_KEYLEN 32
#define MAXSCALE_IV_LEN 16
/**
* The key structure held in the secrets file
*/
typedef struct maxkeys {
unsigned char enckey[MAXSCALE_KEYLEN];
unsigned char initvector[MAXSCALE_IV_LEN];
typedef struct maxkeys
{
unsigned char enckey[MAXSCALE_KEYLEN];
unsigned char initvector[MAXSCALE_IV_LEN];
} MAXKEYS;
extern int secrets_writeKeys(char *filename);
extern char *decryptPassword(char *);
extern char *encryptPassword(char*,char *);
extern int secrets_writeKeys(const char *filename);
extern char *decryptPassword(const char *);
extern char *encryptPassword(const char*, const char *);
#endif

View File

@ -49,6 +49,8 @@
* @endverbatim
*/
#define MAX_SERVER_NAME_LEN 1024
/**
* The server parameters used for weighting routing decissions
*
@ -81,6 +83,7 @@ typedef struct server {
#if defined(SS_DEBUG)
skygw_chk_t server_chk_top;
#endif
SPINLOCK lock; /**< Common access lock */
char *unique_name; /**< Unique name for the server */
char *name; /**< Server name/IP address*/
unsigned short port; /**< Port to listen on */
@ -208,4 +211,6 @@ extern DCB *server_get_persistent(SERVER *, char *, const char *);
extern void server_update_address(SERVER *, char *);
extern void server_update_port(SERVER *, unsigned short);
extern RESULTSET *serverGetList();
extern unsigned int server_map_status(char *str);
extern bool server_set_version_string(SERVER* server, const char* string);
#endif

View File

@ -12,15 +12,7 @@ void init_test_env(char *path)
const char* logdir = path ? path : TEST_LOG_DIR;
char* argv[] =
{
"log_manager",
"-l",
"LOGFILE_ERROR",
NULL
};
skygw_logmanager_init(logdir, argc, argv);
mxs_log_init(NULL, logdir, LOG_TARGET_DEFAULT);
poll_init();
hkinit();
}