Detect duplicate objects

Creating a monitor or a listener twice is now detected and the proper
error is printed.
This commit is contained in:
Markus Makela
2016-12-03 11:31:18 +02:00
parent be7a315614
commit 9df3f154cf
7 changed files with 71 additions and 39 deletions

View File

@ -242,6 +242,26 @@ SERVICE* service_find(const char *name);
// TODO: Change binlogrouter to use the functions in config_runtime.h
void serviceAddBackend(SERVICE *service, SERVER *server);
/**
* @brief Check if a service uses a server
* @param service Service to check
* @param server Server being used
* @return True if service uses the server
*/
bool serviceHasBackend(SERVICE *service, SERVER *server);
/**
* @brief Check if a service has a listener
*
* @param service Service to check
* @param protocol Listener protocol
* @param address Listener address
* @param port Listener port
* @return True if service has the listener
*/
bool serviceHasListener(SERVICE *service, const char *protocol,
const char* address, unsigned short port);
int serviceGetUser(SERVICE *service, char **user, char **auth);
int serviceSetUser(SERVICE *service, char *user, char *auth);
bool serviceSetFilters(SERVICE *service, char *filters);