Index: uspace/srv/net/dnsres/Makefile
===================================================================
--- uspace/srv/net/dnsres/Makefile	(revision d23d9119be96383551c90916c62b0c4d1ef5493c)
+++ uspace/srv/net/dnsres/Makefile	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -31,5 +31,8 @@
 
 SOURCES = \
-	dnsres.c
+	dns_msg.c \
+	dnsres.c \
+	query.c \
+	transport.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/dnsres/dns_msg.c
===================================================================
--- uspace/srv/net/dnsres/dns_msg.c	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
+++ uspace/srv/net/dnsres/dns_msg.c	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <bitops.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <str.h>
+
+#include "dns_msg.h"
+#include "dns_std.h"
+
+#define NAME  "dnsres"
+
+static int dns_name_encode(char *name, uint8_t *buf, size_t buf_size,
+    size_t *act_size)
+{
+	size_t off;
+	wchar_t c;
+	size_t lsize;
+	size_t pi, di;
+
+	pi = 0;
+	di = 1;
+
+	lsize = 0;
+	while (true) {
+		c = str_decode(name, &off, STR_NO_LIMIT);
+		if (c > 127) {
+			/* Non-ASCII character */
+			return EINVAL;
+		}
+
+		if (c == '.' || c == '\0') {
+			/* Empty string, starting with period or two consecutive periods. */
+			if (lsize == 0)
+				return EINVAL;
+
+			if (lsize > DNS_LABEL_MAX_SIZE) {
+				/* Label too long */
+				return EINVAL;
+			}
+
+			if (buf != NULL && pi < buf_size)
+				buf[pi] = (uint8_t)lsize;
+
+			if (c == '\0')
+				break;
+
+			pi = di;
+			++di;
+		} else {
+			if (buf != NULL && di < buf_size)
+				buf[di++] = c;
+		}
+	}
+
+	if (buf != NULL && pi < buf_size)
+		buf[pi] = 0;
+
+	*act_size = di;
+	return EOK;
+}
+
+static void dns_uint16_t_encode(uint16_t w, uint8_t *buf, size_t buf_size)
+{
+	if (buf != NULL && buf_size >= 1)
+		buf[0] = w >> 8;
+
+	if (buf != NULL && buf_size >= 2)
+		buf[1] = w & 0xff;
+}
+
+static int dns_question_encode(dns_question_t *question, uint8_t *buf,
+    size_t buf_size, size_t *act_size)
+{
+	size_t name_size;
+	size_t di;
+	int rc;
+
+	rc = dns_name_encode(question->qname, buf, buf_size, &name_size);
+	if (rc != EOK)
+		return rc;
+
+	*act_size = name_size + sizeof(uint16_t) + sizeof(uint16_t);
+	di = name_size;
+
+	dns_uint16_t_encode(question->qtype, buf + di, buf_size - di);
+	di += sizeof(uint16_t);
+
+	dns_uint16_t_encode(question->qclass, buf + di, buf_size - di);
+	di += sizeof(uint16_t);
+
+	*act_size = di;
+	return EOK;
+}
+
+int dns_message_encode(dns_message_t *msg, void **rdata, size_t *rsize)
+{
+	uint8_t *data;
+	size_t size;
+	dns_header_t hdr;
+	size_t q_size;
+	size_t di;
+	int rc;
+
+	hdr.id = msg->id;
+
+	hdr.opbits =
+	    (msg->qr << OPB_QR) |
+	    (msg->opcode << OPB_OPCODE_l) |
+	    (msg->aa ? BIT_V(uint16_t, OPB_AA) : 0) |
+	    (msg->tc ? BIT_V(uint16_t, OPB_TC) : 0) |
+	    (msg->rd ? BIT_V(uint16_t, OPB_RD) : 0) |
+	    (msg->ra ? BIT_V(uint16_t, OPB_RA) : 0) |
+	    msg->rcode;
+
+	hdr.qd_count = list_count(&msg->question);
+	hdr.an_count = 0;
+	hdr.ns_count = 0;
+	hdr.ar_count = 0;
+
+	size = sizeof(dns_header_t);
+
+	list_foreach(msg->question, link) {
+		dns_question_t *q = list_get_instance(link, dns_question_t, msg);
+		rc = dns_question_encode(q, NULL, 0, &q_size);
+		if (rc != EOK)
+			return rc;
+
+		size += q_size;
+	}
+
+	data = calloc(1, size);
+	if (data == NULL)
+		return ENOMEM;
+
+	memcpy(data, &hdr, sizeof(dns_header_t));
+	di = sizeof(dns_header_t);
+
+	list_foreach(msg->question, link) {
+		dns_question_t *q = list_get_instance(link, dns_question_t, msg);
+		rc = dns_question_encode(q, data + di, size - di, &q_size);
+		assert(rc == EOK);
+
+		di += q_size;
+	}
+
+	*rdata = data;
+	*rsize = size;
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/srv/net/dnsres/dns_msg.h
===================================================================
--- uspace/srv/net/dnsres/dns_msg.h	(revision d23d9119be96383551c90916c62b0c4d1ef5493c)
+++ uspace/srv/net/dnsres/dns_msg.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -41,56 +41,7 @@
 #include <stdint.h>
 #include "dns_std.h"
+#include "dns_type.h"
 
-/** Unencoded DNS message */
-typedef struct {
-	/** Identifier */
-	uint16_t id;
-	/** Query or Response */
-	dns_query_response_t qr;
-	/** Opcode */
-	dns_opcode_t opcode;
-	/** Authoritative Answer */
-	bool aa;
-	/** TrunCation */
-	bool tc;
-	/** Recursion Desired */
-	bool rd;
-	/** Recursion Available */
-	bool ra;
-	/** Response Code */
-	dns_rcode_t rcode;
-
-	list_t question; /* of dns_question_t */
-	list_t answer; /* of dns_rr_t */
-	list_t authority; /* of dns_rr_t */
-	list_t additional; /* of dns_rr_t */
-} dns_message_t;
-
-/** Unencoded DNS message question section */
-typedef struct {
-	/** Domain name in text format (dot notation) */
-	char *qname;
-	/** Query type */
-	dns_qtype_t qtype;
-	/** Query class */
-	dns_qclass_t qclass;
-} dns_question_t;
-
-/** Unencoded DNS resource record */
-typedef struct {
-	/** Domain name */
-	char *name;
-	/** RR type */
-	dns_type_t rtype;
-	/** Class of data */
-	dns_class_t rclass;
-	/** Time to live */
-	uint32_t ttl;
-
-	/** Resource data */
-	void *rdata;
-	/** Number of bytes in @c *rdata */
-	size_t rdata_size;
-} dns_rr_t;
+extern int dns_message_encode(dns_message_t *, void **, size_t *);
 
 #endif
Index: uspace/srv/net/dnsres/dns_std.h
===================================================================
--- uspace/srv/net/dnsres/dns_std.h	(revision d23d9119be96383551c90916c62b0c4d1ef5493c)
+++ uspace/srv/net/dnsres/dns_std.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -85,9 +85,15 @@
 
 typedef struct {
+	/** Identifier assigned by the query originator */
 	uint16_t id;
+	/** QR, Opcode, AA, TC,RD, RA, Z, Rcode */
 	uint16_t opbits;
+	/** Number of entries in query section */
 	uint16_t qd_count;
+	/** Number of RRs in the answer section */
 	uint16_t an_count;
+	/** Number of name server RRs in the authority records section */
 	uint16_t ns_count;
+	/** Number of RRs in the additional records section */
 	uint16_t ar_count;
 } dns_header_t;
@@ -100,14 +106,14 @@
 enum dns_opbits {
 	OPB_QR 		= 15,
-	QPB_OPCODE_h	= 14,
-	QPB_OPCODE_l	= 11,
-	QPB_AA		= 10,
-	QPB_TC		= 9,
-	QPB_RD		= 8,
-	QPB_RA		= 7,
-	QPB_Z_h		= 6,
-	QPB_Z_l		= 4,
-	QPB_RCODE_h	= 3,
-	QPB_RCODE_l	= 0
+	OPB_OPCODE_h	= 14,
+	OPB_OPCODE_l	= 11,
+	OPB_AA		= 10,
+	OPB_TC		= 9,
+	OPB_RD		= 8,
+	OPB_RA		= 7,
+	OPB_Z_h		= 6,
+	OPB_Z_l		= 4,
+	OPB_RCODE_h	= 3,
+	OPB_RCODE_l	= 0
 };
 
Index: uspace/srv/net/dnsres/dns_type.h
===================================================================
--- uspace/srv/net/dnsres/dns_type.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
+++ uspace/srv/net/dnsres/dns_type.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DNS_TYPE_H
+#define DNS_TYPE_H
+
+#include <adt/list.h>
+#include <bool.h>
+#include <stdint.h>
+#include "dns_std.h"
+
+/** Unencoded DNS message */
+typedef struct {
+	/** Identifier */
+	uint16_t id;
+	/** Query or Response */
+	dns_query_response_t qr;
+	/** Opcode */
+	dns_opcode_t opcode;
+	/** Authoritative Answer */
+	bool aa;
+	/** TrunCation */
+	bool tc;
+	/** Recursion Desired */
+	bool rd;
+	/** Recursion Available */
+	bool ra;
+	/** Response Code */
+	dns_rcode_t rcode;
+
+	list_t question; /* of dns_question_t */
+	list_t answer; /* of dns_rr_t */
+	list_t authority; /* of dns_rr_t */
+	list_t additional; /* of dns_rr_t */
+} dns_message_t;
+
+/** Unencoded DNS message question section */
+typedef struct {
+	link_t *msg;
+	/** Domain name in text format (dot notation) */
+	char *qname;
+	/** Query type */
+	dns_qtype_t qtype;
+	/** Query class */
+	dns_qclass_t qclass;
+} dns_question_t;
+
+/** Unencoded DNS resource record */
+typedef struct {
+	/** Domain name */
+	char *name;
+	/** RR type */
+	dns_type_t rtype;
+	/** Class of data */
+	dns_class_t rclass;
+	/** Time to live */
+	uint32_t ttl;
+
+	/** Resource data */
+	void *rdata;
+	/** Number of bytes in @c *rdata */
+	size_t rdata_size;
+} dns_rr_t;
+
+/** Host information */
+typedef struct {
+} dns_host_info_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/net/dnsres/dnsres.c
===================================================================
--- uspace/srv/net/dnsres/dnsres.c	(revision d23d9119be96383551c90916c62b0c4d1ef5493c)
+++ uspace/srv/net/dnsres/dnsres.c	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -27,4 +27,11 @@
  */
 
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
 #include <stdio.h>
 #include <errno.h>
@@ -40,2 +47,5 @@
 	return 0;
 }
+
+/** @}
+ */
Index: uspace/srv/net/dnsres/query.c
===================================================================
--- uspace/srv/net/dnsres/query.c	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
+++ uspace/srv/net/dnsres/query.c	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <errno.h>
+
+#include "dns_std.h"
+#include "dns_type.h"
+#include "query.h"
+
+static uint16_t msg_id;
+
+int dns_name2host(char *name, dns_host_info_t *info)
+{
+	dns_message_t msg;
+	dns_question_t question;
+
+	question.qname = name;
+	question.qtype = DTYPE_A;
+	question.qclass = DC_IN;
+
+	list_initialize(&msg.question);
+	list_append(question.msg, &msg.question);
+
+	msg.id = msg_id++;
+	msg.qr = QR_QUERY;
+	msg.opcode = OPC_QUERY;
+	msg.aa = false;
+	msg.tc = false;
+	msg.rd = true;
+	msg.ra = false;
+
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/srv/net/dnsres/query.h
===================================================================
--- uspace/srv/net/dnsres/query.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
+++ uspace/srv/net/dnsres/query.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef QUERY_H
+#define QUERY_H
+
+#include "dns_type.h"
+
+extern int dns_name2host(char *, dns_host_info_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/net/dnsres/transport.c
===================================================================
--- uspace/srv/net/dnsres/transport.c	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
+++ uspace/srv/net/dnsres/transport.c	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <errno.h>
+
+#include "dns_msg.h"
+#include "dns_type.h"
+#include "transport.h"
+
+int dns_request(dns_message_t *req, dns_message_t **rresp)
+{
+	dns_message_t *resp;
+	int rc;
+	void *req_data;
+	size_t req_size;
+
+	rc = dns_message_encode(req, &req_data, &req_size);
+	if (rc != EOK)
+		return rc;
+
+	resp = NULL;
+	*rresp = resp;
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/srv/net/dnsres/transport.h
===================================================================
--- uspace/srv/net/dnsres/transport.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
+++ uspace/srv/net/dnsres/transport.h	(revision adae30d157eccbfb5a591563206c4d262cc3e0e3)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef TRANSPORT_H
+#define TRANSPORT_H
+
+#include "dns_type.h"
+
+extern int dns_request(dns_message_t *, dns_message_t **);
+
+#endif
+
+/** @}
+ */
