Add new parameter type MXS_MODULE_PARAM_SERVERLIST
This is a list of servers, separated by commas. When queried as a config setting, returns a null-terminated array of SERVER*:s. The commit includes a serverlist parsing function, which should probably be used anywhere a similarly formed string is parsed.
This commit is contained in:
@ -205,6 +205,17 @@ struct service* config_get_service(const MXS_CONFIG_PARAMETER *params, const cha
|
||||
*/
|
||||
struct server* config_get_server(const MXS_CONFIG_PARAMETER *params, const char *key);
|
||||
|
||||
/**
|
||||
* @brief Get an array of servers. The caller should free the returned array, but not
|
||||
* the array elements.
|
||||
*
|
||||
* @param params List of configuration parameters
|
||||
* @param key Parameter name
|
||||
*
|
||||
* @return Pointer to a null-terminated array of servers, or null if none found.
|
||||
*/
|
||||
struct server** config_get_serverlist(const MXS_CONFIG_PARAMETER *params, const char *key);
|
||||
|
||||
/**
|
||||
* @brief Get copy of parameter value if it is defined
|
||||
*
|
||||
|
@ -79,6 +79,7 @@ enum mxs_module_param_type
|
||||
MXS_MODULE_PARAM_PATH, /**< Path to a file or a directory */
|
||||
MXS_MODULE_PARAM_SERVICE, /**< Service name */
|
||||
MXS_MODULE_PARAM_SERVER, /**< Server name */
|
||||
MXS_MODULE_PARAM_SERVERLIST /**< List of server names, separated by ',' */
|
||||
};
|
||||
|
||||
/** Maximum and minimum values for integer types */
|
||||
|
@ -256,6 +256,7 @@ bool server_remove_parameter(SERVER *server, const char *name);
|
||||
|
||||
extern int server_free(SERVER *server);
|
||||
extern SERVER *server_find_by_unique_name(const char *name);
|
||||
extern SERVER** server_find_by_unique_names(char **server_names, int size);
|
||||
extern SERVER *server_find(const char *servname, unsigned short port);
|
||||
extern char *server_status(const SERVER *);
|
||||
extern void server_clear_set_status(SERVER *server, int specified_bits, int bits_to_set);
|
||||
|
Reference in New Issue
Block a user