resolve: Domain name resolution functions

## Macros

#define | RESOLVE_OK 0
#define | RESOLVE_NOTFOUND 1
#define | RESOLVE_NOADDR 2
#define | RESOLVE_NSERROR 3
#define | RESOLVE_TEMPFAIL 4
#define | resolve_ipv4name(N, A)
#define | resolve_error()

## Functions

const char * | resolve_ipv4addr (const ipv4addr *addr)
int | resolve_ipv4name_n (const char *name, ipv4addr *addr, int maxaddrs)
int | resolve_calldns (int(*dnsfn)(struct dns_result *, const void *), struct dns_result *out, const void *param)
int | resolve_qualdns (int(*dnsfn)(struct dns_transmit *, struct dns_result *out, const char *), struct dns_result *out, const char *name)

## Variables

int | __resolve_error

## Detailed Description

## Macro Definition Documentation

## resolve_error

#define resolve_error | ( |  | ) |

Value:
(__resolve_error)
__resolve_error
int __resolve_error
Definition resolve_calldns.c:5

Look up the last resolve error code.

## resolve_ipv4name

#define resolve_ipv4name | ( |  | N,
|  |  | A )

Value:
resolve_ipv4name_n((N),(A),1)
resolve_ipv4name_n
int resolve_ipv4name_n(const char *name, ipv4addr *addr, int maxaddrs)
Definition resolve_ipv4name.c:5

Compatibility macro for resolve_ipv4name_n

## RESOLVE_NOADDR

#define RESOLVE_NOADDR 2

Domain name exists, but has no address.

## RESOLVE_NOTFOUND

#define RESOLVE_NOTFOUND 1

Domain name not found.

Referenced by resolve_calldns(), and resolve_qualdns().

## RESOLVE_NSERROR

#define RESOLVE_NSERROR 3

Non-recoverable name server error.

## RESOLVE_OK

#define RESOLVE_OK 0

No error.

## RESOLVE_TEMPFAIL

#define RESOLVE_TEMPFAIL 4

Temporary failure.

Referenced by resolve_calldns(), and resolve_qualdns().

## Function Documentation

## resolve_calldns()

int resolve_calldns | ( | int(* | dnsfn )(struct dns_result *, const void *),
|  | struct dns_result * | out,
|  | const void * | param )

extern

Call a dns_* function and save an error code if necessary.

References __resolve_error, dns_result::count, RESOLVE_NOTFOUND, and RESOLVE_TEMPFAIL.

Referenced by resolve_ipv4addr().

## resolve_ipv4addr()

const char * resolve_ipv4addr | ( | const ipv4addr * | addr | ) |

extern

Look up the domain name corresponding to an IPv4 address.

References resolve_calldns(), and dns_result::rr.

## resolve_ipv4name_n()

int resolve_ipv4name_n | ( | const char * | name,
|  | ipv4addr * | addr,
|  | int | maxaddrs )

extern

Look up the IPv4 address(es) corresponding to a domain name.

References dns_result::count, dns_ip4_r(), resolve_qualdns(), and dns_result::rr.

## resolve_qualdns()

int resolve_qualdns | ( | int(* | dnsfn )(struct dns_transmit *, struct dns_result *out, const char *),
|  | struct dns_result * | out,
|  | const char * | name )

extern

Call a dns_* function using `dns_qualify` and save an error code if necessary.

References __resolve_error, dns_result::count, dns_qualify(), RESOLVE_NOTFOUND, RESOLVE_TEMPFAIL, and str_free().

Referenced by resolve_ipv4name_n().

## Variable Documentation

## __resolve_error

int __resolve_error

extern

Saved error code from last dns call.

Referenced by resolve_calldns(), and resolve_qualdns().