summaryrefslogtreecommitdiff
path: root/src/core/remote_control.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/remote_control.h')
-rw-r--r--src/core/remote_control.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/core/remote_control.h b/src/core/remote_control.h
new file mode 100644
index 0000000..0600a28
--- /dev/null
+++ b/src/core/remote_control.h
@@ -0,0 +1,36 @@
+/* BSD-2-Clause license
+ *
+ * Copyright (c) 2018-2023 NST <www.newinfosec.ru>, sss <sss at dark-alexandr dot net>.
+ *
+ */
+
+#pragma once
+
+#include <openssl/ssl.h>
+
+typedef enum
+{
+ ctl_session_ssl_handshake = 0,
+ ctl_session_connected
+} ctl_session_state;
+
+typedef struct ctl_session_s
+{
+ ev_io ev_con_fd_r, ev_con_fd_w;
+ int connection_fd;
+ SSL *ssl;
+ ctl_session_state state;
+
+ char *read_buf;
+ uint32_t cmd_size, read_size;
+ bool cmd_size_known;
+} ctl_session;
+
+#include "ctl_task.h"
+
+int ctl_server_init_tcp();
+int ctl_server_init_unix();
+void init_remote_control();
+ctl_task_info *ctl_create_task(int connection_fd);
+bool ctl_server_handle_data(void *taskdata);
+void ctl_destroy_task(wrdp_thpool_task *task);