Index: Makefile
===================================================================
--- Makefile	(revision 9449f151d0ccf3ac755d5f2bd9b4057ae2b03157)
+++ Makefile	(revision 3951c9756a3efcd187a85cb176f326be9678b514)
@@ -23,4 +23,7 @@
 CFLAGS += -Ifreebsd/lib/libmemstat
 CFLAGS += -Ifreebsd/lib/libipsec
+CFLAGS += -ImDNSResponder/mDNSCore
+CFLAGS += -ImDNSResponder/mDNSShared
+CFLAGS += -ImDNSResponder/mDNSPosix
 CFLAGS += -Itestsuite/include
 CFLAGS += -Wall
@@ -1106,4 +1109,26 @@
 	$(CC) $(CPPFLAGS) $(CFLAGS) -DINET6 -c $< -o $@
 
+TEST_FOOBARCLIENT = testsuite/foobarclient/foobarclient.exe
+TEST_FOOBARCLIENT_O_FILES =
+TEST_FOOBARCLIENT_D_FILES =
+TEST_FOOBARCLIENT_O_FILES += testsuite/foobarclient/test_main.o
+TEST_FOOBARCLIENT_D_FILES += testsuite/foobarclient/test_main.d
+$(TEST_FOOBARCLIENT): $(TEST_FOOBARCLIENT_O_FILES) $(LIB)
+	$(LINK.c) -Wl,-Map,testsuite/foobarclient/foobarclient.map $^ -lm -lz -o $@
+NET_TESTS += $(TEST_FOOBARCLIENT)
+O_FILES += $(TEST_FOOBARCLIENT_O_FILES)
+D_FILES += $(TEST_FOOBARCLIENT_D_FILES)
+
+TEST_FOOBARSERVER = testsuite/foobarserver/foobarserver.exe
+TEST_FOOBARSERVER_O_FILES =
+TEST_FOOBARSERVER_D_FILES =
+TEST_FOOBARSERVER_O_FILES += testsuite/foobarserver/test_main.o
+TEST_FOOBARSERVER_D_FILES += testsuite/foobarserver/test_main.d
+$(TEST_FOOBARSERVER): $(TEST_FOOBARSERVER_O_FILES) $(LIB)
+	$(LINK.c) -Wl,-Map,testsuite/foobarserver/foobarserver.map $^ -lm -lz -o $@
+NET_TESTS += $(TEST_FOOBARSERVER)
+O_FILES += $(TEST_FOOBARSERVER_O_FILES)
+D_FILES += $(TEST_FOOBARSERVER_D_FILES)
+
 TEST_DHCPCD01 = testsuite/dhcpcd01/dhcpcd01.exe
 TEST_DHCPCD01_O_FILES =
@@ -1391,4 +1416,16 @@
 	$(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@
 LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-shell-dhcpcd.c
+LIB_C_FILES += mDNSResponder/mDNSCore/anonymous.c
+LIB_C_FILES += mDNSResponder/mDNSCore/CryptoAlg.c
+LIB_C_FILES += mDNSResponder/mDNSCore/DNSCommon.c
+LIB_C_FILES += mDNSResponder/mDNSCore/DNSDigest.c
+LIB_C_FILES += mDNSResponder/mDNSCore/mDNS.c
+LIB_C_FILES += mDNSResponder/mDNSCore/uDNS.c
+LIB_C_FILES += mDNSResponder/mDNSShared/dnssd_clientshim.c
+LIB_C_FILES += mDNSResponder/mDNSShared/mDNSDebug.c
+LIB_C_FILES += mDNSResponder/mDNSShared/PlatformCommon.c
+LIB_C_FILES += mDNSResponder/mDNSShared/GenLinkedList.c
+LIB_C_FILES += mDNSResponder/mDNSPosix/mDNSPosix.c
+LIB_C_FILES += mDNSResponder/mDNSPosix/mDNSUNP.c
 
 ifeq ($(NEED_DUMMY_PIC_IRQ),yes)
@@ -1441,4 +1478,8 @@
 	  install -d $(INCLUDE_DIR)/$$i ; \
 	  install -m 644 freebsd/sys/$$i/*.h $(INCLUDE_DIR)/$$i ; done
+	install -m 644 mDNSResponder/mDNSCore/mDNSDebug.h $(INCLUDE_DIR)
+	install -m 644 mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h $(INCLUDE_DIR)
+	install -m 644 mDNSResponder/mDNSShared/dns_sd.h $(INCLUDE_DIR)
+	install -m 644 mDNSResponder/mDNSPosix/mDNSPosix.h $(INCLUDE_DIR)
 
 clean:
Index: freebsd-to-rtems.py
===================================================================
--- freebsd-to-rtems.py	(revision 9449f151d0ccf3ac755d5f2bd9b4057ae2b03157)
+++ freebsd-to-rtems.py	(revision 3951c9756a3efcd187a85cb176f326be9678b514)
@@ -429,4 +429,7 @@
 			'CFLAGS += -Ifreebsd/lib/libmemstat\n' \
 			'CFLAGS += -Ifreebsd/lib/libipsec\n' \
+			'CFLAGS += -ImDNSResponder/mDNSCore\n' \
+			'CFLAGS += -ImDNSResponder/mDNSShared\n' \
+			'CFLAGS += -ImDNSResponder/mDNSPosix\n' \
 			'CFLAGS += -Itestsuite/include\n' \
 			'CFLAGS += -Wall\n' \
@@ -515,4 +518,8 @@
 			'\t  install -d $(INCLUDE_DIR)/$$i ; \\\n' \
 			'\t  install -m 644 freebsd/sys/$$i/*.h $(INCLUDE_DIR)/$$i ; done\n' \
+			'\tinstall -m 644 mDNSResponder/mDNSCore/mDNSDebug.h $(INCLUDE_DIR)\n' \
+			'\tinstall -m 644 mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h $(INCLUDE_DIR)\n' \
+			'\tinstall -m 644 mDNSResponder/mDNSShared/dns_sd.h $(INCLUDE_DIR)\n' \
+			'\tinstall -m 644 mDNSResponder/mDNSPosix/mDNSPosix.h $(INCLUDE_DIR)\n' \
 			'\n' \
 			'clean:\n' \
@@ -2430,4 +2437,6 @@
 
 tests = Module('tests')
+tests.addTest('foobarclient', ['test_main'], runTest = False, netTest = True)
+tests.addTest('foobarserver', ['test_main'], runTest = False, netTest = True)
 tests.addTest('dhcpcd01', ['test_main'], runTest = False, netTest = True)
 tests.addTest('dhcpcd02', ['test_main'], runTest = False, netTest = True)
@@ -2483,4 +2492,22 @@
 )
 
+mdnsresponder = Module('mdnsresponder')
+mdnsresponder.addSourceFiles(
+	[
+		'mDNSResponder/mDNSCore/anonymous.c',
+		'mDNSResponder/mDNSCore/CryptoAlg.c',
+		'mDNSResponder/mDNSCore/DNSCommon.c',
+		'mDNSResponder/mDNSCore/DNSDigest.c',
+		'mDNSResponder/mDNSCore/mDNS.c',
+		'mDNSResponder/mDNSCore/uDNS.c',
+		'mDNSResponder/mDNSShared/dnssd_clientshim.c',
+		'mDNSResponder/mDNSShared/mDNSDebug.c',
+		'mDNSResponder/mDNSShared/PlatformCommon.c',
+		'mDNSResponder/mDNSShared/GenLinkedList.c',
+		'mDNSResponder/mDNSPosix/mDNSPosix.c',
+		'mDNSResponder/mDNSPosix/mDNSUNP.c',
+	]
+)
+
 # Register all the Module instances with the Module Manager
 mm.addModule(rtems)
@@ -2526,4 +2553,5 @@
 mm.addModule(tests)
 mm.addModule(dhcpcd)
+mm.addModule(mdnsresponder)
 
 # XXX TODO Check that no file is also listed in empty
Index: testsuite/foobarclient/test_main.c
===================================================================
--- testsuite/foobarclient/test_main.c	(revision 3951c9756a3efcd187a85cb176f326be9678b514)
+++ testsuite/foobarclient/test_main.c	(revision 3951c9756a3efcd187a85cb176f326be9678b514)
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ */
+
+#include <mDNSEmbeddedAPI.h>
+#include <mDNSPosix.h>
+
+#include <sys/select.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <netdb.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define TEST_NAME "LIBBSD FOOBAR CLIENT"
+
+static mDNS mDNSStorage;
+
+static mDNS_PlatformSupport PlatformStorage;
+
+static CacheEntity rr_cache[64];
+
+static const char * const qc_results[] = {
+	"rmv",
+	"add",
+	"addnocache",
+	"forceresponse",
+	"dnssec",
+	"nodnssec",
+	"suppressed"
+};
+
+typedef struct service_info_query {
+	struct service_info_query *next;
+	ServiceInfoQuery query;
+	ServiceInfo info;
+} service_info_query;
+
+static service_info_query *service_info_query_list;
+
+static mDNSBool
+eval_service_name(const domainname *fqdn, domainlabel *name)
+{
+	domainname type;
+	domainname domain;
+	mDNSBool ok = DeconstructServiceName(fqdn, name, &type, &domain);
+
+	if (ok) {
+		char name_str[MAX_DOMAIN_LABEL + 1];
+		char type_str[MAX_ESCAPED_DOMAIN_NAME];
+		char domain_str[MAX_ESCAPED_DOMAIN_NAME];
+
+		ConvertDomainLabelToCString_unescaped(name, name_str);
+		ConvertDomainNameToCString(&type, type_str);
+		ConvertDomainNameToCString(&domain, domain_str);
+
+		printf("name = '%s', type = '%s', domain = '%s'",
+		    name_str, type_str, domain_str);
+	} else {
+		printf("?");
+	}
+
+	return ok;
+}
+
+static void
+foobar_action(const struct sockaddr_storage *addr)
+{
+	static const char foobar[] = "FooBar!";
+
+	int sd;
+	int rv;
+
+	sd = socket(addr->ss_family, SOCK_STREAM, 0);
+	assert(sd >= 0);
+
+	rv = connect(sd, (struct sockaddr *) addr, addr->ss_len);
+	if (rv == 0) {
+		char buf[sizeof(foobar)];
+		ssize_t n;
+
+		n = read(sd, &buf[0], sizeof(buf));
+		if (n == (ssize_t) sizeof(buf)) {
+			assert(memcmp(&buf[0], &foobar[0], sizeof(buf)) == 0);
+			printf("foobar client: read: %s\n", &buf[0]);
+		} else if (n >= 0) {
+			printf("foobar client: partial read: %zi\n", n);
+		} else {
+			printf("foobar client: read error: %s\n",
+			    strerror(errno));
+		}
+	} else {
+		printf("foobar client: connect error: %s\n", strerror(errno));
+	}
+
+	rv = close(sd);
+	assert(rv == 0);
+}
+
+static void
+foobar_service_info(mDNS *const m, ServiceInfoQuery *query)
+{
+	const ServiceInfo *i = query->info;
+	struct sockaddr_storage addr;
+	char host[NI_MAXHOST];
+	domainlabel name;
+	int rv;
+
+	memset(&addr, 0, sizeof(addr));
+
+	if (i->ip.type == mDNSAddrType_IPv4) {
+		struct sockaddr_in *s = (struct sockaddr_in *) &addr;
+
+		s->sin_len = sizeof(*s);
+		s->sin_family = AF_INET;
+		s->sin_port = i->port.NotAnInteger;
+		s->sin_addr.s_addr = i->ip.ip.v4.NotAnInteger;
+	} else {
+		struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &addr;
+
+		sin6->sin6_len = sizeof(*sin6);
+		sin6->sin6_family = AF_INET6;
+		sin6->sin6_port = i->port.NotAnInteger;
+		sin6->sin6_addr = *(struct in6_addr *) &i->ip.ip.v6;
+	}
+
+	rv = getnameinfo((struct sockaddr *) &addr, addr.ss_len, host,
+	    sizeof(host), NULL, 0, NI_NUMERICHOST);
+	assert(rv == 0);
+
+	printf("foobar client: service info: ");
+	eval_service_name(&i->name, &name);
+	printf(", addr = %s, port = %i\n", &host[0], mDNSVal16(i->port));
+
+	foobar_action(&addr);
+}
+
+static void
+foobar_manage_service(mDNS *m, const ResourceRecord *answer,
+    const domainlabel *name, bool add)
+{
+	if (add) {
+		mStatus status;
+		service_info_query *siq =
+		    calloc(1, sizeof(*siq));
+
+		assert(siq != NULL);
+
+		siq->next = service_info_query_list;
+		service_info_query_list = siq;
+
+		siq->info.name = answer->rdata->u.name;
+		siq->info.InterfaceID = answer->InterfaceID;
+
+		status = mDNS_StartResolveService(m, &siq->query, &siq->info,
+		    foobar_service_info, NULL);
+		assert(status == mStatus_NoError);
+	} else {
+		service_info_query *cur = service_info_query_list;
+		service_info_query *prev = cur;
+
+		while (cur != NULL && !SameDomainLabel(&name->c[0],
+		    &cur->info.name.c[0])) {
+			prev = cur;
+			cur = cur->next;
+		}
+
+		if (cur != NULL) {
+			if (prev != cur) {
+				prev->next = cur->next;
+			} else {
+				service_info_query_list = cur->next;
+			}
+
+			mDNS_StopResolveService(m, &cur->query);
+			free(cur);
+		}
+	}
+}
+
+static void
+foobar_browse(mDNS *m, DNSQuestion *question,
+    const ResourceRecord *answer, QC_result res)
+{
+	(void) question;
+
+	printf("foobar client: %s: ", qc_results[res]);
+
+	if (answer->rrtype == kDNSType_PTR &&
+	    (res == QC_rmv || res == QC_add)) {
+		domainlabel name;
+		mDNSBool ok = eval_service_name(&answer->rdata->u.name, &name);
+
+		if (ok) {
+			foobar_manage_service(m, answer, &name, res == QC_add);
+		}
+
+		printf("\n");
+	}
+}
+
+static void
+foobar_register(DNSQuestion *question)
+{
+	mStatus status;
+	domainname type;
+	domainname domain;
+
+	MakeDomainNameFromDNSNameString(&type, "_foobar._tcp");
+	MakeDomainNameFromDNSNameString(&domain, "local.");
+
+	status = mDNS_StartBrowse(&mDNSStorage, question, &type, &domain,
+	    mDNSNULL, mDNSInterface_Any, 0, mDNSfalse, mDNSfalse,
+	    foobar_browse, NULL);
+	assert(status == mStatus_NoError);
+}
+
+static void
+test_main(void)
+{
+	mStatus status;
+	DNSQuestion question;
+
+	status = mDNS_Init(&mDNSStorage, &PlatformStorage, &rr_cache[0],
+	    sizeof(rr_cache) / sizeof(rr_cache[0]),
+	    mDNS_Init_DontAdvertiseLocalAddresses, mDNS_Init_NoInitCallback,
+	    mDNS_Init_NoInitCallbackContext);
+	assert(status == mStatus_NoError);
+
+	foobar_register(&question);
+
+	while (1) {
+		struct timeval timeout = { .tv_sec = 0x3fffffff, .tv_usec = 0 };
+		sigset_t signals;
+		mDNSBool got_something;
+
+		mDNSPosixRunEventLoopOnce(&mDNSStorage, &timeout, &signals, &got_something);
+	}
+}
+
+#define DEFAULT_NETWORK_DHCPCD_ENABLE
+#define DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY
+#define DEFAULT_NETWORK_SHELL
+
+#include <rtems/bsd/test/default-network-init.h>
Index: testsuite/foobarserver/test_main.c
===================================================================
--- testsuite/foobarserver/test_main.c	(revision 3951c9756a3efcd187a85cb176f326be9678b514)
+++ testsuite/foobarserver/test_main.c	(revision 3951c9756a3efcd187a85cb176f326be9678b514)
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ */
+
+#include <mDNSEmbeddedAPI.h>
+#include <mDNSPosix.h>
+
+#include <sys/select.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#define TEST_NAME "LIBBSD FOOBAR SERVER"
+
+#define FOOBAR_PORT_BEGIN 10815
+
+#define FOOBAR_PORT_END 20815
+
+static mDNS mDNSStorage;
+
+static mDNS_PlatformSupport PlatformStorage;
+
+static void
+foobar_callback(mDNS *m, ServiceRecordSet *srs, mStatus status)
+{
+	const mDNSu8 *name = srs->RR_SRV.resrec.name->c;
+
+	switch (status) {
+	case mStatus_NoError:
+		printf("foobar server: name registered: %s\n", name);
+		break;
+	case mStatus_NameConflict:
+		printf("foobar server: name conflict: %s\n", name);
+		status = mDNS_RenameAndReregisterService(m, srs, mDNSNULL);
+		assert(status == mStatus_NoError);
+		break;
+	case mStatus_MemFree:
+		printf("foobar server: free: %s\n", name);
+		free(srs);
+		break;
+	default:
+		printf("foobar server: unexpected status: %s\n", name);
+		break;
+	}
+}
+
+static ServiceRecordSet *
+foobar_register(mDNSu16 port)
+{
+	ServiceRecordSet *srs;
+	mStatus status;
+	domainlabel name;
+	domainname type;
+	domainname domain;
+
+	srs = calloc(1, sizeof(*srs));
+	assert(srs != NULL);
+
+	MakeDomainLabelFromLiteralString(&name, "foobar");
+	MakeDomainNameFromDNSNameString(&type, "_foobar._tcp");
+	MakeDomainNameFromDNSNameString(&domain, "local.");
+
+	status = mDNS_RegisterService(&mDNSStorage, srs, &name, &type, &domain,
+	    NULL, mDNSOpaque16fromIntVal(port), NULL, 0, NULL, 0,
+	    mDNSInterface_Any, foobar_callback, srs, 0);
+	assert(status == mStatus_NoError);
+
+	return srs;
+}
+
+static void
+foobar_deregister(ServiceRecordSet *srs)
+{
+	mStatus status;
+
+	status = mDNS_DeregisterService(&mDNSStorage, srs);
+	assert(status == mStatus_NoError);
+}
+
+static void *
+foobar_thread(void *arg)
+{
+	static const char foobar[] = "FooBar!";
+
+	mDNSu16 port = FOOBAR_PORT_BEGIN;
+
+	while (1) {
+		ServiceRecordSet *srs;
+		struct sockaddr_in addr;
+		struct sockaddr_in addr2;
+		socklen_t addr2_len;
+		int sd;
+		int sd2;
+		int rv;
+		ssize_t n;
+
+		sd = socket(PF_INET, SOCK_STREAM, 0);
+		assert(sd >= 0);
+
+		memset(&addr, 0, sizeof(addr));
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(port);
+		addr.sin_addr.s_addr = htonl(INADDR_ANY);
+
+		rv = bind(sd, (const struct sockaddr *) &addr, sizeof(addr));
+		assert(rv == 0);
+
+		rv = listen(sd, 0);
+		assert(rv == 0);
+
+		srs = foobar_register(port);
+
+		addr2_len = sizeof(addr2);
+		sd2 = accept(sd, (struct sockaddr *) &addr2, &addr2_len);
+		assert(sd2 >= 0);
+
+		n = write(sd2, &foobar[0], sizeof(foobar));
+		assert(n == (ssize_t) sizeof(foobar));
+
+		foobar_deregister(srs);
+
+		rv = close(sd2);
+		assert(rv == 0);
+
+		rv = close(sd);
+		assert(rv == 0);
+
+		if (port < FOOBAR_PORT_END) {
+			++port;
+		} else {
+			port = FOOBAR_PORT_BEGIN;
+		}
+	}
+
+	return NULL;
+}
+
+static void
+foobar_create_thread(void)
+{
+	int eno;
+	pthread_t t;
+
+	eno = pthread_create(&t, NULL, foobar_thread, NULL);
+	assert(eno == 0);
+}
+
+static void
+test_main(void)
+{
+	mStatus status;
+
+	status = mDNS_Init(&mDNSStorage, &PlatformStorage, mDNS_Init_NoCache,
+	    mDNS_Init_ZeroCacheSize, mDNS_Init_AdvertiseLocalAddresses,
+	    mDNS_Init_NoInitCallback, mDNS_Init_NoInitCallbackContext);
+	assert(status == mStatus_NoError);
+
+	foobar_create_thread();
+
+	while (1) {
+		struct timeval timeout = { .tv_sec = 0x3fffffff, .tv_usec = 0 };
+		sigset_t signals;
+		mDNSBool got_something;
+
+		mDNSPosixRunEventLoopOnce(&mDNSStorage, &timeout, &signals, &got_something);
+	}
+}
+
+#define DEFAULT_NETWORK_DHCPCD_ENABLE
+#define DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY
+#define DEFAULT_NETWORK_SHELL
+
+#include <rtems/bsd/test/default-network-init.h>
