Data Structures | Public Member Functions | Data Fields

DNSProcessor Struct Reference

#include <I_DNSProcessor.h>

Inherits Processor.

Collaboration diagram for DNSProcessor:
Collaboration graph
[legend]

Data Structures

struct  Options
 Options for host name resolution. More...

Public Member Functions

Actiongethostbyname (Continuation *cont, const char *name, Options const &opt)
ActiongetSRVbyname (Continuation *cont, const char *name, Options const &opt)
Actiongethostbyname (Continuation *cont, const char *name, int len, Options const &opt)
Actiongethostbyaddr (Continuation *cont, IpAddr const *ip, Options const &opt)
int start (int no_of_extra_dns_threads=0, size_t stacksize=DEFAULT_STACKSIZE)
 Starts execution of the processor.
void open (sockaddr const *ns=0, int options=_res.options)
 DNSProcessor ()
Actiongetby (const char *x, int len, int type, Continuation *cont, Options const &opt)
 Internal implementation for all getXbyY methods.
void dns_init ()

Data Fields

EThreadthread
DNSHandlerhandler
ts_imp_res_state l_res
IpEndpoint local_ipv6
IpEndpoint local_ipv4

Detailed Description

Definition at line 66 of file I_DNSProcessor.h.


Constructor & Destructor Documentation

DNSProcessor::DNSProcessor (  ) 

Definition at line 341 of file DNS.cc.

References l_res, local_ipv4, and local_ipv6.


Member Function Documentation

void DNSProcessor::dns_init (  ) 
Action * DNSProcessor::getby ( const char *  x,
int  len,
int  type,
Continuation cont,
Options const &  opt 
)

Internal implementation for all getXbyY methods.

For host resolution queries pass T_A for type. It will be adjusted as needed based on opt.host_res_style.

For address resolution ( type is T_PTR ), x should be a sockaddr cast to char const* .

Definition at line 1091 of file DNS.cc.

References DNSEntry::action, Debug, dns_retries, dnsEntryAllocator, EVENT_IMMEDIATE, Continuation::handleEvent(), DNSEntry::init(), Continuation::mutex, MUTEX_TRY_LOCK, DNSEntry::retries, EThread::schedule_imm(), this_ethread(), thread, and DNSProcessor::Options::timeout.

Referenced by gethostbyaddr(), gethostbyname(), and getSRVbyname().

Action * DNSProcessor::gethostbyaddr ( Continuation cont,
IpAddr const *  ip,
Options const &  opt 
) [inline]

Definition at line 178 of file I_DNSProcessor.h.

References getby().

Referenced by HostDBContinuation::do_dns().

Action * DNSProcessor::gethostbyname ( Continuation cont,
const char *  name,
Options const &  opt 
) [inline]
Action * DNSProcessor::gethostbyname ( Continuation cont,
const char *  name,
int  len,
Options const &  opt 
) [inline]

Definition at line 172 of file I_DNSProcessor.h.

References getby().

Action * DNSProcessor::getSRVbyname ( Continuation cont,
const char *  name,
Options const &  opt 
) [inline]

Definition at line 160 of file I_DNSProcessor.h.

References getby().

Referenced by HostDBContinuation::do_dns().

void DNSProcessor::open ( sockaddr const *  ns = 0,
int  options = _res.options 
)
int DNSProcessor::start ( int  number_of_threads = 0,
size_t  stacksize = DEFAULT_STACKSIZE 
) [virtual]

Starts execution of the processor.

Attempts to start the number of threads specified for the processor, initializes their states and sets them running. On failure it returns a negative value.

Parameters:
number_of_threads Positive value indicating the number of threads to spawn for the processor.
stacksize The thread stack size to use for this processor.

Reimplemented from Processor.

Definition at line 167 of file DNS.cc.

References dns_failover_number, dns_failover_period, dns_failover_try_period, dns_init(), dns_local_ipv4, dns_local_ipv6, dns_max_dns_in_flight, dns_ns_list, dns_ns_rr, dns_resolv_conf, dns_retries, dns_search, dns_thread, dns_timeout, dns_validate_qname, ET_CALL, ET_DNS, eventProcessor, EventProcessor::eventthread, SplitDNSConfig::gsplit_dns_enabled, initialize_thread_for_net(), open(), REC_EstablishStaticConfigInt32, REC_ReadConfigStringAlloc, SplitDNSConfig::reconfigure(), EventProcessor::spawn_event_threads(), and thread.

Referenced by main().


Field Documentation

Definition at line 132 of file I_DNSProcessor.h.

Referenced by DNSEntry::delayEvent(), DNSEntry::init(), DNSEntry::mainEvent(), and open().

Definition at line 133 of file I_DNSProcessor.h.

Referenced by dns_init(), DNSProcessor(), and open().

Definition at line 135 of file I_DNSProcessor.h.

Referenced by dns_init(), DNSProcessor(), and open().

Definition at line 134 of file I_DNSProcessor.h.

Referenced by dns_init(), DNSProcessor(), and open().


The documentation for this struct was generated from the following files: