From 88bd9dab5fce9e85972818400a827701caacd467 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Tue, 9 Jun 2020 12:11:06 +0200 Subject: Add config parameters for stop and start methods --- server.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'server.h') 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); -- cgit v1.2.3