diff options
author | David Härdeman <david@hardeman.nu> | 2020-06-09 12:11:06 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-06-09 12:11:06 +0200 |
commit | 88bd9dab5fce9e85972818400a827701caacd467 (patch) | |
tree | 9738a7aaed2b9a213923df7418dc85e92960746d /server.h | |
parent | 8fb2a95981deb64065a8593c9c33b3f930aadc3c (diff) |
Add config parameters for stop and start methods
Diffstat (limited to 'server.h')
-rw-r--r-- | server.h | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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); |