diff options
author | sss <sss@dark-alexandr.net> | 2023-01-17 00:38:19 +0300 |
---|---|---|
committer | sss <sss@dark-alexandr.net> | 2023-01-17 00:38:19 +0300 |
commit | cc3f33db7a8d3c4ad373e646b199808e01bc5d9b (patch) | |
tree | ec09d690c7656ab5f2cc72607e05fb359c24d8b2 /src/core/globals.h |
added webrdp public code
Diffstat (limited to 'src/core/globals.h')
-rw-r--r-- | src/core/globals.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/core/globals.h b/src/core/globals.h new file mode 100644 index 0000000..5d12d64 --- /dev/null +++ b/src/core/globals.h @@ -0,0 +1,82 @@ +/* BSD-2-Clause license + * + * Copyright (c) 2018-2023 NST <www.newinfosec.ru>, sss <sss at dark-alexandr dot net>. + * + */ + +#pragma once + +#include <limits.h> +#include <stdbool.h> + +#include <sys/queue.h> + +#include "webrdp_core_api.h" +#include "webrdp_module_api.h" +#include "wrdp_thpool.h" + +#define PROG_NAME "webrdp" + +#include "ws_session.h" +#include "task.h" + +typedef struct +{ + /* set worker thread count and max tasks per thread for thread pool */ + int32_t thread_count, tasks_per_thread; + + /* set core log level to one of "wrdp_log_level_e" */ + uint8_t log_level; + + /* set true to run in background (daemon mode) */ + bool daemon; + + /* global session settings defaults */ + ws_session_settings ws_session_defaults; + + /* websocket server settings: + */ + + /* port for http(s)/ws server */ + int32_t ws_port, ctl_port; + + /* unix socket path */ + char *ws_socket_path, *ctl_socket_path; + + /* url of external auth server */ + char *auth_server_url; + + /* 512bit key used for hmac + * used additional 2 bytes in buffer + * required for base64decode + */ + char secret_key_verify[66], secret_key_sign[66]; + + /* paths to cafile and/or cafile dir */ + char *ctl_ssl_cafile, *ctl_ssl_capath, *ctl_ssl_cert, *ctl_ssl_key; + +} global_settings; + +struct task_s +{ + task_info *task; + LIST_ENTRY(task_s) entries; +}; + +struct backend_s +{ + wrdp_backend_module *backend; + LIST_ENTRY(backend_s) entries; +}; + +typedef struct +{ + global_settings settings; + wrdp_thpool *thpool; + wrdp_core_exports *exports; + LIST_HEAD(backend_head_, backend_s) backends_head; +} globals; + +extern globals g_globals; + +void shutdown_core(); |