Add server alteration to config_runtime.h

Moved the alteration of servers done in debugcmd.c to config_runtime.c and
altered them to be better suited as API functions.
This commit is contained in:
Markus Makela
2016-11-22 16:01:43 +02:00
parent 8ef99c9066
commit e75a27e8db
3 changed files with 143 additions and 79 deletions

View File

@ -79,3 +79,30 @@ bool runtime_link_server(SERVER *server, const char *target);
* if no object matching @c target was found
*/
bool runtime_unlink_server(SERVER *server, const char *target);
/**
* @brief Alter server parameters
*
* @param server Server to alter
* @param key Key to modify
* @param value New value
* @return True if @c key was one of the supported parameters
*/
bool runtime_alter_server(SERVER *server, char *key, char *value);
/**
* @brief Enable SSL for a server
*
* The @c key , @c cert and @c ca parameters are required. @c version and @c depth
* are optional.
*
* @param server Server to configure
* @param key Path to SSL private key
* @param cert Path to SSL public certificate
* @param ca Path to certificate authority
* @param version Required SSL Version
* @param depth Certificate verification depth
* @return True if SSL was successfully enabled
*/
bool runtime_enable_server_ssl(SERVER *server, const char *key, const char *cert,
const char *ca, const char *version, const char *depth);