diff options
| author | 2019-04-07 00:14:13 -0400 | |
|---|---|---|
| committer | 2019-04-07 00:14:13 -0400 | |
| commit | 5140318f8f758141b4e350871db1fe869eb858dc (patch) | |
| tree | 3cf26f4845b2c4674af81f108fbdbf47a996dcff /src/firedns.h | |
Import Upstream version 1.1.5upstream/1.1.5
Diffstat (limited to 'src/firedns.h')
| -rw-r--r-- | src/firedns.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/firedns.h b/src/firedns.h new file mode 100644 index 0000000..e48e263 --- /dev/null +++ b/src/firedns.h @@ -0,0 +1,86 @@ +/* +firedns.h - firedns library declarations +Copyright (C) 2002 Ian Gulliver + +This file has been edited for use in BOPM - see the real library at +http://ares.penguinhosting.net/~ian/ before you judge firedns based +on this.. + +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _FIREDNS_H +#define _FIREDNS_H + +/* max number of nameservers used */ +#define FDNS_MAX 8 +/* preferred firedns config file */ +#define FDNS_CONFIG_PREF HOPM_ETCDIR "/firedns.conf" +/* fallback config file */ +#define FDNS_CONFIG_FBCK "/etc/resolv.conf" +/* DNS well known port */ +#define FDNS_PORT 53 +/* name to IPv4 address */ +#define FDNS_QRY_A 1 +/* name to IPv6 address */ +#define FDNS_QRY_AAAA 28 + +/* Success */ +#define FDNS_ERR_NONE 0 +/* Format error */ +#define FDNS_ERR_FORMAT 1 +/* Server failure */ +#define FDNS_ERR_SERVFAIL 2 +/* Name error */ +#define FDNS_ERR_NXDOMAIN 3 +/* Not implemented */ +#define FDNS_ERR_NOIMPT 4 +/* Refused */ +#define FDNS_ERR_REFUSED 5 + +/* Local error codes */ + +/* Timeout */ +#define FDNS_ERR_TIMEOUT 6 +/* Network error */ +#define FDNS_ERR_NETWORK 7 +/* FD Limit reached */ +#define FDNS_ERR_FDLIMIT 8 +/* Other error */ +#define FDNS_ERR_OTHER 9 + +/* Used with the above error values */ +extern int firedns_errno; + +struct firedns_result +{ + char text[1024]; + char lookup[256]; + void *info; +}; + +/* non-blocking functions */ +extern int firedns_getip(int, const char *const, void *); +extern struct firedns_result *firedns_getresult(const int); + +/* low-timeout blocking functions */ +extern void *firedns_resolveip(int, const char *const); +extern struct in_addr *firedns_resolveip4(const char *const); +extern struct in6_addr *firedns_resolveip6(const char *const); + +extern void firedns_init(void); +extern void firedns_cycle(void); +extern const char *firedns_strerror(int); + +#endif |
