Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

OW32::CAsyncResolverOptions Class Reference

Class encapsulating the configuration for the asynchronous resolver. More...

#include <AsyncResolverOptions.h>

List of all members.

Public Types

enum  OptionFlagValues {
  ARES_FLAG_USEVC = (1 << 0), ARES_FLAG_PRIMARY = (1 << 1), ARES_FLAG_IGNTC = (1 << 2), ARES_FLAG_NORECURSE = (1 << 3),
  ARES_FLAG_STAYOPEN = (1 << 4), ARES_FLAG_NOSEARCH = (1 << 5), ARES_FLAG_NOALIASES = (1 << 6), ARES_FLAG_NOCHECKRESP = (1 << 7)
}
 Option flag values. More...

Public Member Functions

 CAsyncResolverOptions ()
 Construct an unconfigured options object.
AsyncResolverError init (const TCHAR *confPath=NULL)
 Initialise from all available configuration sources, in prefence order:.
AsyncResolverError setSearch (const char *domain_list)
 Set search domains, space separated list.
AsyncResolverError setDomain (const char *domain)
 Set a single search domain.
const std::vector< std::string > & getSearch () const
 Get the domains search list.
AsyncResolverError setLookup (const char *lookups)
 Set lookup order.
const std::string & getLookup () const
 Get the lookup order.
AsyncResolverError setNameServer (const char *ns)
 Set a nameserver, appends to the current list.
void clearNameServers ()
 Clear the nameservers list.
const std::vector< in_addr > & getServers () const
 Get the nameservers servers list.
AsyncResolverError setSortList (const char *sl)
 Set the IP sort list, which is a list of IPs/masks The masks are optional and the natural mask for the address class is computed if omitted.
const std::vector< apatterngetSortList () const
 Get the IP sort list.
void setHostsPath (const TCHAR *path)
 Set the hosts file path.
const std::_tstring & getHostsPath () const
 Get the hosts file path.
void setDots (int ndots)
 Set the number of dots threshold for trying the name 'as-is', i.e.
int getDots () const
 Get the number of dots threshold for trying the name 'as-is'.
void setTries (int tries)
 Set the number of resolution attempts to make for UDP queries.
const int getTries () const
 Get the number of resolution attempts to make for UDP queries.
void setTimeout (int timeout)
 Set the query timeout (s), defaults to 5s.
const int getTimeout () const
 Get the query timeout (s).
void setUDPPort (unsigned short udp_port)
 Set the nameserver UDP port, defaults to 53.
const unsigned short getUDPPort () const
 Get the nameserver UDP port.
void setTCPPort (unsigned short tcp_port)
const unsigned short getTCPPort () const
 Get the nameserver TCP port.
void setFlags (int flags)
 Set the global options mask.
const int getFlags () const
 Get the resolver global flags.


Detailed Description

Class encapsulating the configuration for the asynchronous resolver.


Member Enumeration Documentation

enum OW32::CAsyncResolverOptions::OptionFlagValues
 

Option flag values.

Enumeration values:
ARES_FLAG_USEVC  always use TCP
ARES_FLAG_PRIMARY  only use the first configured nameserver
ARES_FLAG_IGNTC  ignore truncated UDP packets in responses
ARES_FLAG_NORECURSE  set queries as non-recursive
ARES_FLAG_STAYOPEN  keep UDP/TCP ports open (not supported at present)
ARES_FLAG_NOSEARCH  don't use the domain search list
ARES_FLAG_NOALIASES  don't use the HOSTALIASES file
ARES_FLAG_NOCHECKRESP  don't check the query response


Constructor & Destructor Documentation

OW32::CAsyncResolverOptions::CAsyncResolverOptions  ) 
 

Construct an unconfigured options object.

To use this object, either all options should be set, or init should be called. Calling init() is the preferred method.


Member Function Documentation

int OW32::CAsyncResolverOptions::getDots  )  const [inline]
 

Get the number of dots threshold for trying the name 'as-is'.

const int OW32::CAsyncResolverOptions::getFlags  )  const [inline]
 

Get the resolver global flags.

Set setFlags for flag descriptions.

AsyncResolverError OW32::CAsyncResolverOptions::init const TCHAR *  confPath = NULL  ) 
 

Initialise from all available configuration sources, in prefence order:.

  • User set options are retained
  • The environment variables LOCALDOMAIN and RES_OPTIONS are parsed
  • The specified configuration file is parsed
  • The windows registry is searched for applicable information

void OW32::CAsyncResolverOptions::setDots int  ndots  )  [inline]
 

Set the number of dots threshold for trying the name 'as-is', i.e.

without appending the default search domain. By default this is 1.

void OW32::CAsyncResolverOptions::setFlags int  flags  )  [inline]
 

Set the global options mask.

The option flags are as listed above.

All options default to off.

void OW32::CAsyncResolverOptions::setHostsPath const TCHAR *  path  ) 
 

Set the hosts file path.

By default this is derived from the OS.

AsyncResolverError OW32::CAsyncResolverOptions::setLookup const char *  lookups  ) 
 

Set lookup order.

This can include 'b' for DNS, 'f' for the hosts file and methods are tried in the specified order. The default is 'fb' (hosts, DNS).

AsyncResolverError OW32::CAsyncResolverOptions::setSortList const char *  sl  ) 
 

Set the IP sort list, which is a list of IPs/masks The masks are optional and the natural mask for the address class is computed if omitted.

Entries are ; separated and any previous list is overwritten.

void OW32::CAsyncResolverOptions::setUDPPort unsigned short  udp_port  )  [inline]
 

Set the nameserver UDP port, defaults to 53.


The documentation for this class was generated from the following file:
Generated on Sun Jun 5 01:29:21 2005 for OW32 by  doxygen 1.3.9.1