aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/wg-quick/android/dnsresolver.h
diff options
context:
space:
mode:
authorNicolas Douma <nicolas@serveur.io>2019-10-02 21:10:51 +0200
committerNicolas Douma <nicolas@serveur.io>2019-10-12 05:32:53 +0200
commit0ea1df3c192beccad9a5f04d7d6b8d3b4e34a85f (patch)
tree18b2503d500d89470966f9874ca01a60ea9f4505 /src/tools/wg-quick/android/dnsresolver.h
parentwg-quick: android: add addresses after bringing interface up (diff)
downloadwireguard-monolithic-historical-0ea1df3c192beccad9a5f04d7d6b8d3b4e34a85f.tar.xz
wireguard-monolithic-historical-0ea1df3c192beccad9a5f04d7d6b8d3b4e34a85f.zip
wg-quick: android: use Binder for setting DNS on Android 10nd/android-10-dns
Signed-off-by: Nicolas Douma <nicolas@serveur.io>
Diffstat (limited to 'src/tools/wg-quick/android/dnsresolver.h')
-rw-r--r--src/tools/wg-quick/android/dnsresolver.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/tools/wg-quick/android/dnsresolver.h b/src/tools/wg-quick/android/dnsresolver.h
new file mode 100644
index 0000000..09519af
--- /dev/null
+++ b/src/tools/wg-quick/android/dnsresolver.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#define _cleanup_dnsresolver_ __attribute__((__cleanup__(cleanup_dnsresolver)))
+
+struct resolver_params {
+ int32_t netid;
+ int32_t sample_validity_seconds;
+ int32_t success_threshold;
+ int32_t min_samples;
+ int32_t max_samples;
+ int32_t base_timeout_msec;
+ int32_t retry_count;
+ char **servers; /* NULL terminated array of zero-terminated UTF-8 strings */
+ char **domains; /* NULL terminated array of zero-terminated UTF-8 strings */
+ char *tls_name; /* zero-terminated UTF-8 string */
+ char **tls_servers; /* NULL terminated array of zero-terminated UTF-8 strings */
+ char **tls_fingerprints; /* NULL terminated array of zero-terminated UTF-8 strings */
+};
+
+/*
+ * the int32_t return codes below are 0 if there is no error,
+ * see binder_status_t in binder_ndk.h for the meaning of other values
+ */
+void *dnsresolver_get_handle(void) __attribute__((__warn_unused_result__));
+void dnsresolver_dec_ref(void *handle);
+int32_t dnsresolver_set_resolver_configuration(void *handle, const struct resolver_params *params);
+int32_t dnsresolver_create_network_cache(void *handle, int32_t netid);
+int32_t dnsresolver_destroy_network_cache(void *handle, int32_t netid);
+
+int32_t dnsresolver_is_alive(void *handle, bool *result);
+int32_t dnsresolver_set_log_severity(void *handle, int32_t log_severity);
+void dnsresolver_dump(void *handle, int fd);
+int32_t dnsresolver_ping(void *handle);
+
+void cleanup_dnsresolver(void **handle);