ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/src/firedns.h
Revision: 6200
Committed: Thu Jun 25 15:56:16 2015 UTC (10 years, 2 months ago) by michael
Content type: text/x-chdr
File size: 2446 byte(s)
Log Message:
- Added options::dns_timeout configuration option which allows to specify the amount of time the
  resolver waits until a response is received from a name server

File Contents

# User Rev Content
1 michael 5052 /*
2     firedns.h - firedns library declarations
3     Copyright (C) 2002 Ian Gulliver
4    
5     This file has been edited for use in BOPM - see the real library at
6     http://ares.penguinhosting.net/~ian/ before you judge firedns based
7     on this..
8    
9     This program is free software; you can redistribute it and/or modify
10     it under the terms of version 2 of the GNU General Public License as
11     published by the Free Software Foundation.
12    
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     GNU General Public License for more details.
17    
18     You should have received a copy of the GNU General Public License
19     along with this program; if not, write to the Free Software
20     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21     */
22    
23     #ifndef _FIREDNS_H
24     #define _FIREDNS_H
25    
26     /* max number of nameservers used */
27     #define FDNS_MAX 8
28     /* preferred firedns config file */
29 michael 5069 #define FDNS_CONFIG_PREF HOPM_ETCDIR "/firedns.conf"
30 michael 5052 /* fallback config file */
31     #define FDNS_CONFIG_FBCK "/etc/resolv.conf"
32     /* DNS well known port */
33     #define FDNS_PORT 53
34     /* name to IPv4 address */
35     #define FDNS_QRY_A 1
36     /* name to IPv6 address */
37     #define FDNS_QRY_AAAA 28
38    
39     /* Success */
40     #define FDNS_ERR_NONE 0
41     /* Format error */
42     #define FDNS_ERR_FORMAT 1
43     /* Server failure */
44     #define FDNS_ERR_SERVFAIL 2
45     /* Name error */
46     #define FDNS_ERR_NXDOMAIN 3
47     /* Not implemented */
48     #define FDNS_ERR_NOIMPT 4
49     /* Refused */
50     #define FDNS_ERR_REFUSED 5
51    
52     /* Local error codes */
53    
54     /* Timeout */
55     #define FDNS_ERR_TIMEOUT 6
56     /* Network error */
57     #define FDNS_ERR_NETWORK 7
58     /* FD Limit reached */
59     #define FDNS_ERR_FDLIMIT 8
60     /* Other error */
61     #define FDNS_ERR_OTHER 9
62    
63     /* Used with the above error values */
64 michael 5390 extern int firedns_errno;
65 michael 5052
66 michael 5380 struct firedns_result
67     {
68     char text[1024];
69     char lookup[256];
70     void *info;
71 michael 5052 };
72    
73     /* non-blocking functions */
74 michael 6057 extern int firedns_getip(int, const char *const, void *);
75     extern struct firedns_result *firedns_getresult(const int);
76 michael 5052
77     /* low-timeout blocking functions */
78 michael 6057 extern char *firedns_resolveip(int, const char *const);
79     extern struct in_addr *firedns_resolveip4(const char *const);
80     extern struct in6_addr *firedns_resolveip6(const char *const);
81 michael 5052
82 michael 5380 extern void firedns_init(void);
83     extern void firedns_cycle(void);
84 michael 5072 extern const char *firedns_strerror(int);
85 michael 5052
86     #endif

Properties

Name Value
svn:eol-style native
svn:keywords Id