Qsmtp  0.30dev
Functions
qdns.c File Reference

DNS query functions. More...

#include <qdns.h>
#include <libowfatconn.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

Functions

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...
 

Detailed Description

DNS query functions.

Function Documentation

int ask_dnsa ( const char *  name,
struct in6_addr **  result 
)

get A record from of the DNS

Parameters
namethe name to look up
resultfirst 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
0no entries found
>0how many entries were returned in result
DNS_ERROR_LOCALon error (errno is set)
DNS_ERROR_TEMPtemporary DNS error
DNS_ERROR_PERMpermanent DNS error
int ask_dnsaaaa ( const char *  name,
struct in6_addr **  result 
)

get AAAA record from of the DNS

Parameters
namethe name to look up
resultfirst element of a list of results will be placed
Return values
0no entries found
>0how many entries were returned in result
DNS_ERROR_TEMPif temporary DNS error
DNS_ERROR_PERMif permanent DNS error
DNS_ERROR_LOCALon error (errno is set)
int ask_dnsmx ( const char *  name,
struct ips **  result 
)

get info out of the DNS

Parameters
namethe name to look up
resultfirst element of a list of results will be placed
Return values
0on success
1if host is not existent
DNS_ERROR_TEMPif temporary DNS error
DNS_ERROR_PERMif permanent DNS error
DNS_ERROR_LOCALon error (errno is set)
int ask_dnsname ( const struct in6_addr *  ip,
char **  result 
)

get host name for IP address

Parameters
ipthe IP to look up
resultname will be stored here
Returns
how many names were found, negative on error
Return values
0host not found
DNS_ERROR_LOCALlocal error (errno is set)
DNS_ERROR_TEMPtemporary DNS error
DNS_ERROR_PERMpermanent DNS error