1 /* minires.h. Stub synchronous resolver for Cygwin.
3 Written by Pierre A. Humblet <Pierre.Humblet@ieee.org>
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
17 #include <sys/socket.h>
18 #include <netinet/in.h>
19 #include <arpa/inet.h>
24 #include <sys/unistd.h>
25 #define __INSIDE_CYGWIN_NET__
27 #include <arpa/nameser.h>
30 extern in_addr_t
cygwin_inet_addr (const char *);
31 extern int cygwin_socket (int, int, int);
32 extern int cygwin_bind (int, const struct sockaddr
*, socklen_t
);
33 extern int cygwin_connect (int, const struct sockaddr
*, socklen_t
);
34 extern int cygwin_select (int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*);
35 extern int cygwin_sendto (int, const void *, size_t, int,
36 const struct sockaddr
*, socklen_t
);
37 extern int cygwin_recvfrom (int, void *, size_t, int, struct sockaddr
*,
40 /* Number of elements is an array */
41 #define DIM(x) (sizeof(x) / sizeof(*(x)))
43 /* Definitions to parse the messages */
44 #define RD (1<<8) /* Offset in a short */
46 #define QR (1<<7) /* Offsets in a char */
50 /* Type for os specific res_lookup */
51 typedef int (os_query_t
) (res_state
, const char *, int, int, u_char
*, int);
53 /* Special use of state elements */
54 #define sockfd _vcsock
56 #define os_query qhook
59 #define DPRINTF(cond, format...) if (cond) minires_dprintf(format)
61 /* Utility functions */
62 void minires_dprintf(const char * format
, ...);
63 void minires_get_search(char * string
, res_state statp
);
64 void get_dns_info(res_state statp
);