Yate
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Resolver Class Reference

DNS services. More...

#include <yateclass.h>

Public Types

enum  Type {
  Unknown, Srv, Naptr, A4,
  A6, Txt
}
 

Static Public Member Functions

static bool available (Type type=Unknown)
 
static bool init (int timeout=-1, int retries=-1)
 
static int query (Type type, const char *dname, ObjList &result, String *error=0)
 
static int srvQuery (const char *dname, ObjList &result, String *error=0)
 
static int naptrQuery (const char *dname, ObjList &result, String *error=0)
 
static int a4Query (const char *dname, ObjList &result, String *error=0)
 
static int a6Query (const char *dname, ObjList &result, String *error=0)
 
static int txtQuery (const char *dname, ObjList &result, String *error=0)
 

Static Public Attributes

static const TokenDict s_types []
 

Detailed Description

DNS services.

This class offers DNS query services

Member Enumeration Documentation

enum Type

Resolver handled types

Member Function Documentation

static int a4Query ( const char *  dname,
ObjList result,
String error = 0 
)
static

Make an A (IPv4 Address) query

Parameters
dnameDomain to query
resultList of resulting TxtRecord items
errorOptional string to be filled with error string
Returns
0 on success, error code otherwise (h_errno value on Linux)
static int a6Query ( const char *  dname,
ObjList result,
String error = 0 
)
static

Make an AAAA (IPv6 Address) query

Parameters
dnameDomain to query
resultList of resulting TxtRecord items
errorOptional string to be filled with error string
Returns
0 on success, error code otherwise (h_errno value on Linux)
static bool available ( Type  type = Unknown)
static

Runtime check for resolver availability

Parameters
typeOptional type to check. Set it to Unknown (default) to check general resolver availability
Returns
True if the resolver is available on current platform
static bool init ( int  timeout = -1,
int  retries = -1 
)
static

Initialize the resolver in the current thread

Parameters
timeoutQuery timeout. Negative to use default
retriesThe number of query retries. Negative to use default
Returns
True on success
static int naptrQuery ( const char *  dname,
ObjList result,
String error = 0 
)
static

Make a NAPTR (Naming Authority Pointer) query

Parameters
dnameDomain to query
resultList of resulting NaptrRecord items
errorOptional string to be filled with error string
Returns
0 on success, error code otherwise (h_errno value on Linux)
static int query ( Type  type,
const char *  dname,
ObjList result,
String error = 0 
)
static

Make a query

Parameters
typeQuery type as enumeration
dnameDomain to query
resultList of resulting record items
errorOptional string to be filled with error string
Returns
0 on success, error code otherwise (h_errno value on Linux)
static int srvQuery ( const char *  dname,
ObjList result,
String error = 0 
)
static

Make a SRV (Service Location) query

Parameters
dnameDomain to query
resultList of resulting SrvRecord items
errorOptional string to be filled with error string
Returns
0 on success, error code otherwise (h_errno value on Linux)
static int txtQuery ( const char *  dname,
ObjList result,
String error = 0 
)
static

Make a TXT (Text) query

Parameters
dnameDomain to query
resultList of resulting TxtRecord items
errorOptional string to be filled with error string
Returns
0 on success, error code otherwise (h_errno value on Linux)

Member Data Documentation

const TokenDict s_types[]
static

Resolver type names


The documentation for this class was generated from the following file: