aboutsummaryrefslogtreecommitdiff
path: root/src/dns.h
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-11-02 16:38:44 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-11-02 16:38:44 +0100
commit73ede020c76126e81325fcd8d3e186132db21198 (patch)
tree24850bdbecced0aff461000f9fc545c8576d1e72 /src/dns.h
parent0ef067ee3c394a296a8e091e8b365e29036df085 (diff)
downloaddns-73ede020c76126e81325fcd8d3e186132db21198.tar.gz
Added fqdn to qname
Diffstat (limited to 'src/dns.h')
-rw-r--r--src/dns.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/dns.h b/src/dns.h
new file mode 100644
index 0000000..9f66367
--- /dev/null
+++ b/src/dns.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include <stdint.h>
+
+/**
+ * Convert a null terminated string containing a
+ * fqdn (eg server.example.com) to the binary format used by DNS records
+ * ( [6]server[7]example[3]com[0] )
+ * returns: length of string in _sink, < 0 on failure
+ * _sink might not be terminated on error.
+ * */
+int fqdn_to_qname( char* _source, int _sourcelen, char* _sink, int _sinklen );
+
+/**
+ * Opposite of fqdn_to_qname()
+ * */
+int qname_to_fqdn( char* _source, int _sourcelen, char* _sink, int _sinklen );