DNS query functions.
More...
#include <qdns.h>
#include <libowfatconn.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
|
int | ask_dnsmx (const char *name, struct ips **result) |
| get info out of the DNS More...
|
|
int | ask_dnsaaaa (const char *name, struct in6_addr **result) |
| get AAAA record from of the DNS More...
|
|
int | ask_dnsa (const char *name, struct in6_addr **result) |
| get A record from of the DNS More...
|
|
int | ask_dnsname (const struct in6_addr *ip, char **result) |
| get host name for IP address More...
|
|
int ask_dnsa |
( |
const char * |
name, |
|
|
struct in6_addr ** |
result |
|
) |
| |
get A record from of the DNS
- Parameters
-
name | the name to look up |
result | first element of a list of results will be placed, or NULL if only return code is of interest |
- Returns
- if records have been found
- Return values
-
0 | no entries found |
>0 | how many entries were returned in result |
DNS_ERROR_LOCAL | on error (errno is set) |
DNS_ERROR_TEMP | temporary DNS error |
DNS_ERROR_PERM | permanent DNS error |
int ask_dnsaaaa |
( |
const char * |
name, |
|
|
struct in6_addr ** |
result |
|
) |
| |
get AAAA record from of the DNS
- Parameters
-
name | the name to look up |
result | first element of a list of results will be placed |
- Return values
-
0 | no entries found |
>0 | how many entries were returned in result |
DNS_ERROR_TEMP | if temporary DNS error |
DNS_ERROR_PERM | if permanent DNS error |
DNS_ERROR_LOCAL | on error (errno is set) |
int ask_dnsmx |
( |
const char * |
name, |
|
|
struct ips ** |
result |
|
) |
| |
get info out of the DNS
- Parameters
-
name | the name to look up |
result | first element of a list of results will be placed |
- Return values
-
0 | on success |
1 | if host is not existent |
DNS_ERROR_TEMP | if temporary DNS error |
DNS_ERROR_PERM | if permanent DNS error |
DNS_ERROR_LOCAL | on error (errno is set) |
int ask_dnsname |
( |
const struct in6_addr * |
ip, |
|
|
char ** |
result |
|
) |
| |
get host name for IP address
- Parameters
-
ip | the IP to look up |
result | name will be stored here |
- Returns
- how many names were found, negative on error
- Return values
-
0 | host not found |
DNS_ERROR_LOCAL | local error (errno is set) |
DNS_ERROR_TEMP | temporary DNS error |
DNS_ERROR_PERM | permanent DNS error |