summaryrefslogtreecommitdiff
path: root/src/resolve/dns-type.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2016-01-25 20:28:38 +0100
committerTom Gundersen <teg@jklm.no>2016-01-25 20:28:38 +0100
commitf49ce89edf37a20abed923782dd8176d6c0e7166 (patch)
tree5174563e958ef5be22eebd7d9b848d37e724a911 /src/resolve/dns-type.c
parent164228707d7785a27316e2f28be7068044127016 (diff)
parent6c1e69f9456d022f14dd00737126cfa4d9cca10c (diff)
Merge pull request #2392 from poettering/dnssec18
eightteenth dnssec patch
Diffstat (limited to 'src/resolve/dns-type.c')
-rw-r--r--src/resolve/dns-type.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/resolve/dns-type.c b/src/resolve/dns-type.c
index 058d14009a..56720646ca 100644
--- a/src/resolve/dns-type.c
+++ b/src/resolve/dns-type.c
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <sys/socket.h>
+
#include "dns-type.h"
#include "string-util.h"
@@ -183,6 +185,23 @@ bool dns_type_is_obsolete(uint16_t type) {
DNS_TYPE_NULL);
}
+int dns_type_to_af(uint16_t t) {
+ switch (t) {
+
+ case DNS_TYPE_A:
+ return AF_INET;
+
+ case DNS_TYPE_AAAA:
+ return AF_INET6;
+
+ case DNS_TYPE_ANY:
+ return AF_UNSPEC;
+
+ default:
+ return -EINVAL;
+ }
+}
+
const char *dns_class_to_string(uint16_t class) {
switch (class) {