aboutsummaryrefslogtreecommitdiff
path: root/dns.h
diff options
context:
space:
mode:
authorAleksey Veresov <AKVeresov@gmail.com>2020-04-28 01:57:14 +0300
committerGitHub <noreply@github.com>2020-04-28 01:57:14 +0300
commite9f1c6b518a62e3b173c8dfa396bbf18b5dc7cde (patch)
tree3a75964121c7dbd06ef89010bbfbf80651f58428 /dns.h
downloadvsdns-e9f1c6b518a62e3b173c8dfa396bbf18b5dc7cde.tar
vsdns-e9f1c6b518a62e3b173c8dfa396bbf18b5dc7cde.tar.xz
vsdns-e9f1c6b518a62e3b173c8dfa396bbf18b5dc7cde.zip
It's alive
Diffstat (limited to 'dns.h')
-rw-r--r--dns.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/dns.h b/dns.h
new file mode 100644
index 0000000..788618d
--- /dev/null
+++ b/dns.h
@@ -0,0 +1,34 @@
+#ifndef DNS_INCLUDED
+#define DNS_INCLUDED
+
+
+enum { /* Some of DNS types: */
+ dns_type_a = 1,
+ dns_type_cname = 5,
+ dns_type_mx = 15,
+ dns_type_txt = 16
+};
+
+struct dns_answers {
+ struct dns_answers *next;
+ char *host;
+ int type;
+ unsigned int size;
+ void *data;
+};
+
+/* For CNAME & TXT data is just 'char *',
+ * For A data is 'unsigned char *' of size 4. */
+
+int dns_mx_preference(void *data);
+char *dns_mx_server(void *data);
+
+
+/* In case of error result is 0.
+ * It's not the-best-effort attempt to get answer, just simple working one. */
+struct dns_answers *dns_get(const char *server, const char *host, int query);
+
+void dns_free(struct dns_answers *answers);
+
+
+#endif