23 |
|
#ifndef _FIREDNS_H |
24 |
|
#define _FIREDNS_H |
25 |
|
|
26 |
– |
#include <sys/types.h> |
27 |
– |
#include <sys/socket.h> |
28 |
– |
#include <netinet/in.h> |
29 |
– |
|
30 |
– |
#ifndef AF_INET6 |
31 |
– |
struct in6_addr { |
32 |
– |
unsigned char s6_addr[16]; |
33 |
– |
}; |
34 |
– |
#endif |
35 |
– |
|
26 |
|
/* max number of nameservers used */ |
27 |
|
#define FDNS_MAX 8 |
28 |
|
/* preferred firedns config file */ |
29 |
< |
#define FDNS_CONFIG_PREF BOPM_ETCDIR "/firedns.conf" |
29 |
> |
#define FDNS_CONFIG_PREF HOPM_ETCDIR "/firedns.conf" |
30 |
|
/* fallback config file */ |
31 |
|
#define FDNS_CONFIG_FBCK "/etc/resolv.conf" |
32 |
|
/* Number of seconds to wait for a reply */ |
63 |
|
#define FDNS_ERR_OTHER 9 |
64 |
|
|
65 |
|
/* Used with the above error values */ |
66 |
< |
extern int fdns_errno; |
77 |
< |
extern unsigned int fdns_fdinuse; |
66 |
> |
extern int firedns_errno; |
67 |
|
|
68 |
< |
void firedns_init(void); |
69 |
< |
|
70 |
< |
struct firedns_result { |
71 |
< |
char text[1024]; |
72 |
< |
char lookup[256]; |
84 |
< |
void *info; |
68 |
> |
struct firedns_result |
69 |
> |
{ |
70 |
> |
char text[1024]; |
71 |
> |
char lookup[256]; |
72 |
> |
void *info; |
73 |
|
}; |
74 |
|
|
75 |
|
/* non-blocking functions */ |
76 |
< |
int firedns_getip(int type, const char * const name, void *info); |
77 |
< |
struct firedns_result *firedns_getresult(const int fd); |
76 |
> |
extern int firedns_getip(int, const char *const, void *); |
77 |
> |
extern struct firedns_result *firedns_getresult(const int); |
78 |
|
|
79 |
|
/* low-timeout blocking functions */ |
80 |
< |
char *firedns_resolveip(int type, const char * const name); |
81 |
< |
struct in_addr *firedns_resolveip4(const char * const name); |
82 |
< |
struct in6_addr *firedns_resolveip6(const char * const name); |
83 |
< |
|
84 |
< |
void firedns_cycle(void); |
85 |
< |
char *firedns_strerror(int); |
80 |
> |
extern char *firedns_resolveip(int, const char *const); |
81 |
> |
extern struct in_addr *firedns_resolveip4(const char *const); |
82 |
> |
extern struct in6_addr *firedns_resolveip6(const char *const); |
83 |
> |
|
84 |
> |
extern void firedns_init(void); |
85 |
> |
extern void firedns_cycle(void); |
86 |
> |
extern const char *firedns_strerror(int); |
87 |
|
|
88 |
|
#endif |