/[svn]/hopm/branches/1.1.x/src/firedns.h
ViewVC logotype

Contents of /hopm/branches/1.1.x/src/firedns.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8154 - (show annotations)
Fri Apr 7 18:10:08 2017 UTC (5 years, 5 months ago) by michael
File MIME type: text/x-csrc
File size: 2446 byte(s)
- firedns.c, firedns.h: minor cleanups

1 /*
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 #define FDNS_CONFIG_PREF HOPM_ETCDIR "/firedns.conf"
30 /* 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 extern int firedns_errno;
65
66 struct firedns_result
67 {
68 char text[1024];
69 char lookup[256];
70 void *info;
71 };
72
73 /* non-blocking functions */
74 extern int firedns_getip(int, const char *const, void *);
75 extern struct firedns_result *firedns_getresult(const int);
76
77 /* low-timeout blocking functions */
78 extern void *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
82 extern void firedns_init(void);
83 extern void firedns_cycle(void);
84 extern const char *firedns_strerror(int);
85
86 #endif

Properties

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

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28