summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/libc/minires.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-12-11 19:59:06 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-12-11 19:59:06 +0000
commit0c365c631fc11ec4c1c6fbbeeb194a3609b59b93 (patch)
tree231a49044d876f9088bbb2e632b02ac9c48d047d /winsup/cygwin/libc/minires.h
parent12cb181da7dffe5baba2c6ff78f7d35191273b07 (diff)
downloadcygnal-0c365c631fc11ec4c1c6fbbeeb194a3609b59b93.tar.gz
cygnal-0c365c631fc11ec4c1c6fbbeeb194a3609b59b93.tar.bz2
cygnal-0c365c631fc11ec4c1c6fbbeeb194a3609b59b93.zip
* Makefile.in (DLL_OFILES): Add minires-os-if.o and minires.o.
(SUBLIBS): Add libresolv.a. Add rule for libresolv.a. * autoload.cc: Fix return code handling for IP Helper API in case of being unable to load iphlpapi.dll. (DnsQuery_A): Define. (DnsRecordListFree): Define. * cygwin.din: Export resolver functions. * include/resolv.h: New header. * include/arpa/nameser.h: New header. * include/arpa/nameser_compat.h: New header. * include/cygwin/version.h: Bump API minor number. * libc/minires-os-if.c: New file. * libc/minires.c: New file. * libc/minires.h: New file.
Diffstat (limited to 'winsup/cygwin/libc/minires.h')
-rw-r--r--winsup/cygwin/libc/minires.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/winsup/cygwin/libc/minires.h b/winsup/cygwin/libc/minires.h
new file mode 100644
index 000000000..ce063d16f
--- /dev/null
+++ b/winsup/cygwin/libc/minires.h
@@ -0,0 +1,68 @@
+/* minires.h. Stub synchronous resolver for Cygwin.
+
+ Copyright 2006 Red Hat, Inc.
+
+ Written by Pierre A. Humblet <Pierre.Humblet@ieee.org>
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#define __INSIDE_CYGWIN_NET__
+
+#include "winsup.h"
+#include <string.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <sys/unistd.h>
+#include <netdb.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+
+extern in_addr_t cygwin_inet_addr (const char *);
+extern int cygwin_socket (int, int, int);
+extern int cygwin_bind (int, const struct sockaddr *, socklen_t);
+extern int cygwin_connect (int, const struct sockaddr *, socklen_t);
+extern int cygwin_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
+extern int cygwin_sendto (int, const void *, size_t, int,
+ const struct sockaddr *, socklen_t);
+extern int cygwin_recvfrom (int, void *, size_t, int, struct sockaddr *,
+ socklen_t *);
+
+/* Number of elements is an array */
+#define DIM(x) (sizeof(x) / sizeof(*(x)))
+
+/* Definitions to parse the messages */
+#define RD (1<<8) /* Offset in a short */
+#define RA (1<<7)
+#define QR (1<<7) /* Offsets in a char */
+#define TC (1<<1)
+#define ERR_MASK 0xF
+
+/* Type for os specific res_lookup */
+typedef int (os_query_t) (res_state, const char *, int, int, u_char *, int);
+
+/* Special use of state elements */
+#define sockfd _vcsock
+#define mypid _flags
+#define os_query qhook
+#define use_os pfcode
+
+#define DPRINTF(cond, format...) if (cond) minires_dprintf(format)
+
+/* Utility functions */
+void minires_dprintf(const char * format, ...);
+void minires_get_search(char * string, res_state statp);
+void get_dns_info(res_state statp);