Yate: Resolver Class Reference

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

## ◆ Type

enum Type

Resolver handled types

## Member Function Documentation

## ◆ a4Query()

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

Make an A (IPv4 Address) query

Parameters

  dname | Domain to query
  result | List of resulting TxtRecord items
  error | Optional string to be filled with error string

Returns
  0 on success, error code otherwise (h_errno value on Linux)

## ◆ a6Query()

static int a6Query | ( | const char * | dname,
|  | ObjList & | result,
|  | String * | error = 0 )
| static

Make an AAAA (IPv6 Address) query

Parameters

  dname | Domain to query
  result | List of resulting TxtRecord items
  error | Optional string to be filled with error string

Returns
  0 on success, error code otherwise (h_errno value on Linux)

## ◆ available()

static bool available | ( | Type | type = Unknown | ) |
| static

Runtime check for resolver availability

Parameters

  type | Optional type to check. Set it to Unknown (default) to check general resolver availability

Returns
  True if the resolver is available on current platform

## ◆ init()

static bool init | ( | int | timeout = -1,
|  | int | retries = -1 )
| static

Initialize the resolver in the current thread

Parameters

  timeout | Query timeout. Negative to use default
  retries | The number of query retries. Negative to use default

Returns
  True on success

## ◆ naptrQuery()

static int naptrQuery | ( | const char * | dname,
|  | ObjList & | result,
|  | String * | error = 0 )
| static

Make a NAPTR (Naming Authority Pointer) query

Parameters

  dname | Domain to query
  result | List of resulting NaptrRecord items
  error | Optional string to be filled with error string

Returns
  0 on success, error code otherwise (h_errno value on Linux)

## ◆ query()

static int query | ( | Type | type,
|  | const char * | dname,
|  | ObjList & | result,
|  | String * | error = 0 )
| static

Make a query

Parameters

  type | Query type as enumeration
  dname | Domain to query
  result | List of resulting record items
  error | Optional string to be filled with error string

Returns
  0 on success, error code otherwise (h_errno value on Linux)

## ◆ srvQuery()

static int srvQuery | ( | const char * | dname,
|  | ObjList & | result,
|  | String * | error = 0 )
| static

Make a SRV (Service Location) query

Parameters

  dname | Domain to query
  result | List of resulting SrvRecord items
  error | Optional string to be filled with error string

Returns
  0 on success, error code otherwise (h_errno value on Linux)

## ◆ txtQuery()

static int txtQuery | ( | const char * | dname,
|  | ObjList & | result,
|  | String * | error = 0 )
| static

Make a TXT (Text) query

Parameters

  dname | Domain to query
  result | List of resulting TxtRecord items
  error | Optional string to be filled with error string

Returns
  0 on success, error code otherwise (h_errno value on Linux)

## Member Data Documentation

## ◆ s_types

const TokenDict s_types[]
| static

Resolver type names

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

- yateclass.h