summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2014-03-26 18:13:16 +0000
committerEric Faurot <eric@cvs.openbsd.org>2014-03-26 18:13:16 +0000
commitd904b0af22db9828c09c6d48db2c1c10fc52eccb (patch)
treefd00f8bc3fbea0a41d8eb6fba55b367527ecb664
parentcd4bf1c574b0f5ca4e0dd98a50497c523cbfc65d (diff)
Make the asr API public. Install asr.h to /usr/include.h and manpages.
Include tweaks suggested by mpi@ ok deraadt@
-rw-r--r--include/Makefile4
-rw-r--r--include/asr.h (renamed from lib/libc/asr/asr.h)6
-rw-r--r--lib/libc/asr/Makefile.inc34
-rw-r--r--lib/libc/asr/asr.c7
-rw-r--r--lib/libc/asr/asr_debug.c5
-rw-r--r--lib/libc/asr/asr_run.35
-rw-r--r--lib/libc/asr/asr_utils.c5
-rw-r--r--lib/libc/asr/getaddrinfo.c7
-rw-r--r--lib/libc/asr/getaddrinfo_async.c6
-rw-r--r--lib/libc/asr/gethostnamadr.c7
-rw-r--r--lib/libc/asr/gethostnamadr_async.c5
-rw-r--r--lib/libc/asr/getnameinfo.c7
-rw-r--r--lib/libc/asr/getnameinfo_async.c5
-rw-r--r--lib/libc/asr/getnetnamadr.c7
-rw-r--r--lib/libc/asr/getnetnamadr_async.c5
-rw-r--r--lib/libc/asr/getrrsetbyname.c7
-rw-r--r--lib/libc/asr/getrrsetbyname_async.c9
-rw-r--r--lib/libc/asr/res_init.c6
-rw-r--r--lib/libc/asr/res_mkquery.c6
-rw-r--r--lib/libc/asr/res_query.c7
-rw-r--r--lib/libc/asr/res_search_async.c6
-rw-r--r--lib/libc/asr/res_send.c7
-rw-r--r--lib/libc/asr/res_send_async.c6
23 files changed, 96 insertions, 73 deletions
diff --git a/include/Makefile b/include/Makefile
index a9dc5afb807..aa31db296cc 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.185 2014/03/24 19:09:14 kettenis Exp $
+# $OpenBSD: Makefile,v 1.186 2014/03/26 18:13:15 eric Exp $
# $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
@@ -9,7 +9,7 @@
.include <bsd.own.mk>
-FILES= a.out.h ar.h assert.h bitstring.h blf.h bsd_auth.h \
+FILES= a.out.h ar.h asr.h assert.h bitstring.h blf.h bsd_auth.h \
complex.h cpio.h ctype.h curses.h db.h dbm.h des.h dirent.h disktab.h \
dlfcn.h elf_abi.h err.h errno.h fenv.h float.h fnmatch.h fstab.h fts.h \
ftw.h getopt.h glob.h grp.h ifaddrs.h inttypes.h iso646.h kvm.h \
diff --git a/lib/libc/asr/asr.h b/include/asr.h
index 9a1d792220a..0ceb0f5a604 100644
--- a/lib/libc/asr/asr.h
+++ b/include/asr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.h,v 1.8 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: asr.h,v 1.1 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012-2014 Eric Faurot <eric@openbsd.org>
*
@@ -15,10 +15,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
/*
* Expected fd conditions
*/
diff --git a/lib/libc/asr/Makefile.inc b/lib/libc/asr/Makefile.inc
index ffb3f3f0bd9..813ce2ed483 100644
--- a/lib/libc/asr/Makefile.inc
+++ b/lib/libc/asr/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.6 2013/08/08 06:55:42 jmc Exp $
+# $OpenBSD: Makefile.inc,v 1.7 2014/03/26 18:13:15 eric Exp $
# asr sources
.PATH: ${LIBCSRCDIR}/asr
@@ -8,19 +8,19 @@ SRCS+= asr.c asr_debug.c asr_utils.c \
gethostnamadr_async.c getnetnamadr_async.c \
getaddrinfo_async.c getnameinfo_async.c
-MLINKS+ = \
- asr_resolver.3 asr_resolver_done.3 \
- asr_resolver.3 asr_async_run.3 \
- asr_resolver.3 asr_async_run_sync.3 \
- asr_resolver.3 asr_async_abort.3 \
- asr_resolver.3 res_send_async.3 \
- asr_resolver.3 res_query_async.3 \
- asr_resolver.3 res_search_async.3 \
- asr_resolver.3 getrrsetbyname_async.3 \
- asr_resolver.3 gethostbyname_async.3 \
- asr_resolver.3 gethostbyname2_async.3 \
- asr_resolver.3 gethostbyaddr_async.3 \
- asr_resolver.3 getnetbyname_async.3 \
- asr_resolver.3 getnetbyaddr_async.3 \
- asr_resolver.3 getaddrinfo_async.3 \
- asr_resolver.3 getnameinfo_async.3
+MAN+= asr_run.3
+
+MLINKS+= \
+ asr_run.3 asr_run_sync.3 \
+ asr_run.3 asr_abort.3 \
+ asr_run.3 res_send_async.3 \
+ asr_run.3 res_query_async.3 \
+ asr_run.3 res_search_async.3 \
+ asr_run.3 getrrsetbyname_async.3 \
+ asr_run.3 gethostbyname_async.3 \
+ asr_run.3 gethostbyname2_async.3 \
+ asr_run.3 gethostbyaddr_async.3 \
+ asr_run.3 getnetbyname_async.3 \
+ asr_run.3 getnetbyaddr_async.3 \
+ asr_run.3 getaddrinfo_async.3 \
+ asr_run.3 getnameinfo_async.3
diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c
index 8edbf10a6d2..eceec10804f 100644
--- a/lib/libc/asr/asr.c
+++ b/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.32 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: asr.c,v 1.33 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,15 +16,17 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <netdb.h>
#include <resolv.h>
#include <poll.h>
#include <stdio.h>
@@ -32,7 +34,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#ifndef ASR_OPT_THREADSAFE
diff --git a/lib/libc/asr/asr_debug.c b/lib/libc/asr/asr_debug.c
index cfab567704e..46d7310e880 100644
--- a/lib/libc/asr/asr_debug.c
+++ b/lib/libc/asr/asr_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr_debug.c,v 1.16 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: asr_debug.c,v 1.17 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -20,10 +20,11 @@
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <arpa/inet.h>
+#include <netdb.h>
+#include <asr.h>
#include <resolv.h>
-#include "asr.h"
#include "asr_private.h"
static const char *rcodetostr(uint16_t);
diff --git a/lib/libc/asr/asr_run.3 b/lib/libc/asr/asr_run.3
index 1327b36cae9..6f0f314c690 100644
--- a/lib/libc/asr/asr_run.3
+++ b/lib/libc/asr/asr_run.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: asr_run.3,v 1.1 2014/03/26 10:57:19 eric Exp $
+.\" $OpenBSD: asr_run.3,v 1.2 2014/03/26 18:13:15 eric Exp $
.\"
.\" Copyright (c) 2012-2014, Eric Faurot <eric@openbsd.org>
.\"
@@ -34,6 +34,9 @@
.Nm getnameinfo_async
.Nd asynchronous resolver functions
.Sh SYNOPSIS
+.In sys/types.h
+.In sys/socket.h
+.In netdb.h
.In asr.h
.Ft int
.Fn asr_run "struct asr_query *aq" "struct asr_result *ar"
diff --git a/lib/libc/asr/asr_utils.c b/lib/libc/asr/asr_utils.c
index 7a9d15663f7..2d90f1c8fb4 100644
--- a/lib/libc/asr/asr_utils.c
+++ b/lib/libc/asr/asr_utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr_utils.c,v 1.11 2014/03/14 11:07:33 eric Exp $ */
+/* $OpenBSD: asr_utils.c,v 1.12 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2009-2012 Eric Faurot <eric@faurot.net>
*
@@ -21,7 +21,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <ctype.h>
#include <errno.h>
#include <stdint.h>
@@ -30,7 +32,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int dname_check_label(const char *, size_t);
diff --git a/lib/libc/asr/getaddrinfo.c b/lib/libc/asr/getaddrinfo.c
index 074a824c1be..f5080572163 100644
--- a/lib/libc/asr/getaddrinfo.c
+++ b/lib/libc/asr/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.4 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,13 +16,14 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
-#include "asr.h"
-
int
getaddrinfo(const char *hostname, const char *servname,
const struct addrinfo *hints, struct addrinfo **res)
diff --git a/lib/libc/asr/getaddrinfo_async.c b/lib/libc/asr/getaddrinfo_async.c
index bf7328803a5..1f1d19c74df 100644
--- a/lib/libc/asr/getaddrinfo_async.c
+++ b/lib/libc/asr/getaddrinfo_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo_async.c,v 1.25 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getaddrinfo_async.c,v 1.26 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,6 +16,7 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -26,7 +27,9 @@
#include <rpcsvc/ypclnt.h>
#include "ypinternal.h"
#endif
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <resolv.h> /* for res_hnok */
@@ -34,7 +37,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
struct match {
diff --git a/lib/libc/asr/gethostnamadr.c b/lib/libc/asr/gethostnamadr.c
index a7561f132e3..e07abadb443 100644
--- a/lib/libc/asr/gethostnamadr.c
+++ b/lib/libc/asr/gethostnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr.c,v 1.10 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: gethostnamadr.c,v 1.11 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012,2013 Eric Faurot <eric@openbsd.org>
*
@@ -16,16 +16,17 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include "asr.h"
-
static int _gethostbyname(const char *, int, struct hostent *, char *, size_t,
int *);
static int _fillhostent(const struct hostent *, struct hostent *, char *,
diff --git a/lib/libc/asr/gethostnamadr_async.c b/lib/libc/asr/gethostnamadr_async.c
index 7d27be9eedb..674bcb476a9 100644
--- a/lib/libc/asr/gethostnamadr_async.c
+++ b/lib/libc/asr/gethostnamadr_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr_async.c,v 1.27 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: gethostnamadr_async.c,v 1.28 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -26,7 +26,9 @@
#include <rpcsvc/ypclnt.h>
#include "ypinternal.h"
#endif
+#include <netdb.h>
+#include <asr.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
@@ -35,7 +37,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#define MAXALIASES 16
diff --git a/lib/libc/asr/getnameinfo.c b/lib/libc/asr/getnameinfo.c
index 4ca82dae098..60b5b17ceb6 100644
--- a/lib/libc/asr/getnameinfo.c
+++ b/lib/libc/asr/getnameinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo.c,v 1.4 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnameinfo.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,13 +16,14 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
-#include "asr.h"
-
int
getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags)
diff --git a/lib/libc/asr/getnameinfo_async.c b/lib/libc/asr/getnameinfo_async.c
index 6f8965c0b7c..50d65fc38bc 100644
--- a/lib/libc/asr/getnameinfo_async.c
+++ b/lib/libc/asr/getnameinfo_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo_async.c,v 1.8 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnameinfo_async.c,v 1.9 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -21,14 +21,15 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int getnameinfo_async_run(struct asr_query *, struct asr_result *);
diff --git a/lib/libc/asr/getnetnamadr.c b/lib/libc/asr/getnetnamadr.c
index 07ed822d02d..f3b552ab059 100644
--- a/lib/libc/asr/getnetnamadr.c
+++ b/lib/libc/asr/getnetnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetnamadr.c,v 1.7 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnetnamadr.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,15 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <stdlib.h>
#include <string.h>
-#include "asr.h"
-
static void _fillnetent(const struct netent *, struct netent *, char *buf,
size_t);
diff --git a/lib/libc/asr/getnetnamadr_async.c b/lib/libc/asr/getnetnamadr_async.c
index 6a948a52cb5..ce3e8cf0526 100644
--- a/lib/libc/asr/getnetnamadr_async.c
+++ b/lib/libc/asr/getnetnamadr_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetnamadr_async.c,v 1.13 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnetnamadr_async.c,v 1.14 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -20,7 +20,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <resolv.h> /* for res_hnok */
@@ -28,7 +30,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#define MAXALIASES 16
diff --git a/lib/libc/asr/getrrsetbyname.c b/lib/libc/asr/getrrsetbyname.c
index 359f1dd416b..424725ec30b 100644
--- a/lib/libc/asr/getrrsetbyname.c
+++ b/lib/libc/asr/getrrsetbyname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrrsetbyname.c,v 1.4 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getrrsetbyname.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,14 +16,15 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <stdlib.h>
-#include "asr.h"
-
int
getrrsetbyname(const char *name, unsigned int class, unsigned int type,
unsigned int flags, struct rrsetinfo **res)
diff --git a/lib/libc/asr/getrrsetbyname_async.c b/lib/libc/asr/getrrsetbyname_async.c
index 3f23d7bf3cd..8bc81e628c0 100644
--- a/lib/libc/asr/getrrsetbyname_async.c
+++ b/lib/libc/asr/getrrsetbyname_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrrsetbyname_async.c,v 1.6 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getrrsetbyname_async.c,v 1.7 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,19 +16,20 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
-#include <netdb.h>
#include <resolv.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int getrrsetbyname_async_run(struct asr_query *, struct asr_result *);
@@ -169,7 +170,7 @@ getrrsetbyname_async_run(struct asr_query *as, struct asr_result *ar)
/* The rest of this file is taken from the orignal implementation. */
-/* $OpenBSD: getrrsetbyname_async.c,v 1.6 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getrrsetbyname_async.c,v 1.7 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2001 Jakob Schlyter. All rights reserved.
diff --git a/lib/libc/asr/res_init.c b/lib/libc/asr/res_init.c
index 9fa0529baab..309f779aac1 100644
--- a/lib/libc/asr/res_init.c
+++ b/lib/libc/asr/res_init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_init.c,v 1.3 2014/01/15 02:25:34 sthen Exp $ */
+/* $OpenBSD: res_init.c,v 1.4 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,13 +16,15 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <arpa/nameser.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <resolv.h>
#include <string.h>
-#include "asr.h"
#include "asr_private.h"
#include "thread_private.h"
diff --git a/lib/libc/asr/res_mkquery.c b/lib/libc/asr/res_mkquery.c
index 9f2aa0de883..27ed21e4d4a 100644
--- a/lib/libc/asr/res_mkquery.c
+++ b/lib/libc/asr/res_mkquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_mkquery.c,v 1.7 2014/03/14 11:07:33 eric Exp $ */
+/* $OpenBSD: res_mkquery.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,14 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h> /* for MAXDNAME */
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <string.h>
-#include "asr.h"
#include "asr_private.h"
/* This function is apparently needed by some ports. */
diff --git a/lib/libc/asr/res_query.c b/lib/libc/asr/res_query.c
index 2c6b198e464..3cdec90b944 100644
--- a/lib/libc/asr/res_query.c
+++ b/lib/libc/asr/res_query.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_query.c,v 1.7 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_query.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,15 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <string.h>
#include <stdlib.h>
-#include "asr.h"
-
int
res_query(const char *name, int class, int type, u_char *ans, int anslen)
{
diff --git a/lib/libc/asr/res_search_async.c b/lib/libc/asr/res_search_async.c
index f08557db527..d040655bc28 100644
--- a/lib/libc/asr/res_search_async.c
+++ b/lib/libc/asr/res_search_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_search_async.c,v 1.12 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_search_async.c,v 1.13 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,16 +16,18 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int res_search_async_run(struct asr_query *, struct asr_result *);
diff --git a/lib/libc/asr/res_send.c b/lib/libc/asr/res_send.c
index b00510c4943..32c940815af 100644
--- a/lib/libc/asr/res_send.c
+++ b/lib/libc/asr/res_send.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_send.c,v 1.7 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_send.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,15 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <string.h>
#include <stdlib.h>
-#include "asr.h"
-
int
res_send(const u_char *buf, int buflen, u_char *ans, int anslen)
{
diff --git a/lib/libc/asr/res_send_async.c b/lib/libc/asr/res_send_async.c
index a9d4f696b11..9afc8d06363 100644
--- a/lib/libc/asr/res_send_async.c
+++ b/lib/libc/asr/res_send_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_send_async.c,v 1.21 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_send_async.c,v 1.22 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,10 +16,13 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
@@ -29,7 +32,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#define OP_QUERY (0)