More cleanup of monitor.h

Move some more functions into core header + miscellaneous cleanup
This commit is contained in:
Esa Korhonen 2017-01-19 12:38:31 +02:00
parent 02a8f7492e
commit 53c5b475ad
7 changed files with 41 additions and 29 deletions

View File

@ -17,15 +17,17 @@
*/
#include <maxscale/cdefs.h>
#include <mysql.h>
#include <maxscale/server.h>
#include <maxscale/dcb.h>
#include <maxscale/log_manager.h>
#include <maxscale/resultset.h>
#include <maxscale/config.h>
#include <maxscale/dcb.h>
#include <maxscale/externcmd.h>
#include <maxscale/secrets.h>
#include <maxscale/log_manager.h>
#include <maxscale/modinfo.h>
#include <maxscale/resultset.h>
#include <maxscale/secrets.h>
#include <maxscale/server.h>
MXS_BEGIN_DECLS
@ -209,15 +211,6 @@ static const char MXS_MONITOR_EVENT_DEFAULT_VALUE[] = "master_down,master_up,sla
"ndb_down,ndb_up,lost_master,lost_slave,lost_synced,lost_donor,lost_ndb,"
"new_master,new_slave,new_synced,new_donor,new_ndb";
MXS_MONITOR *monitor_find(const char *);
void monitorStop(MXS_MONITOR *);
void monitorStart(MXS_MONITOR *, void*);
void monitorShowAll(DCB *);
void monitorShow(DCB *, MXS_MONITOR *);
void monitorList(DCB *);
RESULTSET *monitorGetList();
bool check_monitor_permissions(MXS_MONITOR* monitor, const char* query);
void monitor_clear_pending_status(MXS_MONITOR_SERVERS *ptr, int bit);

View File

@ -41,9 +41,19 @@ typedef enum
extern MXS_MONITOR *monitor_alloc(char *, char *);
extern void monitor_free(MXS_MONITOR *);
void monitorStart(MXS_MONITOR *, void*);
void monitorStop(MXS_MONITOR *);
extern void monitorStopAll();
extern void monitorStartAll();
MXS_MONITOR *monitor_find(const char *);
void monitorShow(DCB *, MXS_MONITOR *);
void monitorShowAll(DCB *);
void monitorList(DCB *);
RESULTSET *monitorGetList();
extern bool monitorAddServer(MXS_MONITOR *mon, SERVER *server);
extern void monitorRemoveServer(MXS_MONITOR *mon, SERVER *server);
extern void monitorAddUser(MXS_MONITOR *, char *, char *);

View File

@ -12,12 +12,15 @@
*/
#include <maxscale/modulecmd.h>
#include <maxscale/alloc.h>
#include <maxscale/config.h>
#include <maxscale/pcre2.h>
#include <maxscale/platform.h>
#include <maxscale/spinlock.h>
#include "maxscale/filter.h"
#include "maxscale/monitor.h"
/** Size of the error buffer */
#define MODULECMD_ERRBUF_SIZE 512

View File

@ -27,22 +27,25 @@
*
* @endverbatim
*/
#include <maxscale/monitor.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <maxscale/spinlock.h>
#include <maxscale/modules.h>
#include <maxscale/log_manager.h>
#include <maxscale/secrets.h>
#include <maxscale/pcre2.h>
#include <maxscale/externcmd.h>
#include <mysqld_error.h>
#include <maxscale/mysql_utils.h>
#include <maxscale/alloc.h>
#include <maxscale/gwdirs.h>
#include "maxscale/monitor.h"
#include <maxscale/alloc.h>
#include <mysqld_error.h>
#include <maxscale/externcmd.h>
#include <maxscale/gwdirs.h>
#include <maxscale/log_manager.h>
#include <maxscale/modules.h>
#include <maxscale/mysql_utils.h>
#include <maxscale/pcre2.h>
#include <maxscale/secrets.h>
#include <maxscale/spinlock.h>
#include "maxscale/config.h"
#include "maxscale/monitor.h"
static MXS_MONITOR *allMonitors = NULL;
static SPINLOCK monLock = SPINLOCK_INIT;

View File

@ -51,6 +51,9 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <telnetd.h>
#include <sys/syslog.h>
#include <maxscale/alloc.h>
#include <maxscale/service.h>
#include <maxscale/router.h>
@ -65,9 +68,7 @@
#include <maxscale/poll.h>
#include <maxscale/users.h>
#include <maxscale/config.h>
#include <telnetd.h>
#include <maxscale/adminusers.h>
#include <maxscale/monitor.h>
#include <debugcli.h>
#include <maxscale/housekeeper.h>
#include <maxscale/listmanager.h>
@ -75,7 +76,8 @@
#include <maxscale/config_runtime.h>
#include <maxscale/version.h>
#include <maxscale/log_manager.h>
#include <sys/syslog.h>
#include "../../../core/maxscale/monitor.h"
#include "../../../core/maxscale/session.h"

View File

@ -53,6 +53,7 @@
#include <maxscale/users.h>
#include "../../../core/maxscale/session.h"
#include "../../../core/maxscale/monitor.h"
extern char *create_hex_sha1_sha1_passwd(char *passwd);

View File

@ -33,7 +33,6 @@
#include <maxscale/service.h>
#include <maxscale/router.h>
#include <maxscale/modules.h>
#include <maxscale/monitor.h>
#include <maxscale/version.h>
#include <maxscale/modinfo.h>
#include <maxscale/modutil.h>
@ -47,6 +46,7 @@
#include <maxscale/config.h>
#include "../../../core/maxscale/session.h"
#include "../../../core/maxscale/monitor.h"
static void exec_show(DCB *dcb, MAXINFO_TREE *tree);
static void exec_select(DCB *dcb, MAXINFO_TREE *tree);