1 /* dircproxy
2  * Copyright (C) 2000-2003 Scott James Remnant <scott at netsplit dot com>
3  *
4  * Copyright (C) 2004-2008 Francois Harvey <contact at francoisharvey dot ca>
5  *
6  * Copyright (C) 2008-2009 Noel Shrum <noel dot w8tvi at gmail dot com>
7  *                         Francois Harvey <contact at francoisharvey dot ca>
8  *
9  *
10  * dns.h
11  * --
12  * @(#) $Id: dns.h,v 1.7 2002/12/29 21:30:11 scott Exp $
13  *
14  * This file is distributed according to the GNU General Public
15  * License.  For full details, read the top of 'main.c' or the
16  * file called COPYING that was distributed with this code.
17  */
18 
19 #ifndef __DIRCPROXY_DNS_H
20 #define __DIRCPROXY_DNS_H
21 
22 /* required includes */
23 #include <sys/types.h>
24 #include <netinet/in.h>
25 #include <arpa/inet.h>
26 
27 #include "net.h"
28 
29 /* handy defines */
30 #define DNS_MAX_HOSTLEN 256
31 
32 typedef void (*dns_fun_t)(void *, void *, const char *, const char *);
33 
34 /* functions */
35 extern int dns_endrequest(pid_t, int);
36 extern int dns_delall(void *);
37 extern void dns_flush(void);
38 extern int dns_addrfromhost(void *, void *, const char *, dns_fun_t);
39 extern int dns_hostfromaddr(void *, void *, const char *, dns_fun_t);
40 extern int dns_filladdr(void *, const char *, const char *,
41                         SOCKADDR *, dns_fun_t);
42 extern int dns_portfromserv(const char *);
43 extern char *dns_servfromport(int);
44 
45 extern int dns_getip(const char *, char *);
46 extern int dns_getname(const char *, char *, int);
47 #endif /* __DIRCPROXY_DNS_H */
48