summaryrefslogtreecommitdiff
path: root/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'server.h')
-rw-r--r--server.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/server.h b/server.h
index 3c32844..e8e6ba8 100644
--- a/server.h
+++ b/server.h
@@ -7,6 +7,16 @@ enum server_type {
SERVER_TYPE_PROXY
};
+enum server_stop_method {
+ SERVER_STOP_METHOD_UNDEFINED,
+ SERVER_STOP_METHOD_EXEC
+};
+
+enum server_start_method {
+ SERVER_START_METHOD_UNDEFINED,
+ SERVER_START_METHOD_EXEC
+};
+
struct server {
enum server_type type;
char *name;
@@ -17,6 +27,11 @@ struct server {
struct list_head proxys;
bool running;
+ enum server_stop_method stop_method;
+ enum server_start_method start_method;
+ char *stop_exec;
+ char *start_exec;
+
/* For config files */
char buf[4096];
size_t len;
@@ -49,6 +64,16 @@ bool server_add_remote(struct cfg *cfg, struct server *scfg,
bool server_add_local(struct cfg *cfg, struct server *scfg,
struct sockaddr_in46 *local);
+bool server_set_stop_method(struct cfg *cfg, struct server *scfg,
+ enum server_stop_method stop_method);
+
+bool server_set_start_method(struct cfg *cfg, struct server *scfg,
+ enum server_start_method start_method);
+
+bool server_set_stop_exec(struct cfg *cfg, struct server *scfg, const char *cmd);
+
+bool server_set_start_exec(struct cfg *cfg, struct server *scfg, const char *cmd);
+
bool server_set_idle_timeout(struct cfg *cfg, struct server *scfg, uint16_t timeout);
bool server_set_port(struct cfg *cfg, struct server *scfg, uint16_t port);