Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
cat::DNSClient Class Reference

#include <DNSClient.hpp>

Inheritance diagram for cat::DNSClient:

List of all members.

Public Member Functions

bool Initialize ()
bool Resolve (const char *hostname, DNSResultCallback, ThreadRefObject *holdRef=0)
void Shutdown ()
virtual ~DNSClient ()

Protected Member Functions

void NotifyRequesters (DNSRequest *req)
virtual void OnClose ()
virtual void OnRead (ThreadPoolLocalStorage *tls, const NetAddr &src, u8 *data, u32 bytes)
virtual void OnUnreachable (const NetAddr &src)
void ProcessDNSResponse (DNSRequest *req, int qdcount, int ancount, u8 *data, u32 bytes)

Private Member Functions

bool BindToRandomPort (bool ignoreUnreachable)
void CacheAdd (DNSRequest *req)
DNSRequestCacheGet (const char *hostname)
void CacheKill (DNSRequest *req)
 CAT_SINGLETON (DNSClient)
bool GetServerAddr ()
bool GetUnusedID (u16 &id)
bool IsValidHostname (const char *hostname)
bool PerformLookup (DNSRequest *req)
bool PostDNSPacket (DNSRequest *req, u32 now)
DNSRequestPullRequest (u16 id)
bool ThreadFunction (void *param)

Private Attributes

DNSRequest_cache_head
Mutex _cache_lock
int _cache_size
DNSRequest_cache_tail
FortunaOutput_csprng
volatile bool _dns_unavailable
WaitableFlag _kill_flag
DNSRequest_request_head
Mutex _request_lock
int _request_queue_size
DNSRequest_request_tail
NetAddr _server_addr

Static Private Attributes

static const int DNS_THREAD_KILL_TIMEOUT = 10000
static const int TICK_RATE = 200

Detailed Description

Definition at line 90 of file DNSClient.hpp.


Constructor & Destructor Documentation

virtual cat::DNSClient::~DNSClient ( ) [virtual]

Member Function Documentation

bool cat::DNSClient::BindToRandomPort ( bool  ignoreUnreachable) [private]
void cat::DNSClient::CacheAdd ( DNSRequest req) [private]
DNSRequest* cat::DNSClient::CacheGet ( const char *  hostname) [private]
void cat::DNSClient::CacheKill ( DNSRequest req) [private]
cat::DNSClient::CAT_SINGLETON ( DNSClient  ) [inline, private]
bool cat::DNSClient::GetServerAddr ( ) [private]
bool cat::DNSClient::GetUnusedID ( u16 id) [private]
bool cat::DNSClient::Initialize ( )
bool cat::DNSClient::IsValidHostname ( const char *  hostname) [private]
void cat::DNSClient::NotifyRequesters ( DNSRequest req) [protected]
virtual void cat::DNSClient::OnClose ( ) [protected, virtual]

Implements cat::UDPEndpoint.

virtual void cat::DNSClient::OnRead ( ThreadPoolLocalStorage tls,
const NetAddr src,
u8 data,
u32  bytes 
) [protected, virtual]

Implements cat::UDPEndpoint.

virtual void cat::DNSClient::OnUnreachable ( const NetAddr src) [protected, virtual]

Reimplemented from cat::UDPEndpoint.

bool cat::DNSClient::PerformLookup ( DNSRequest req) [private]
bool cat::DNSClient::PostDNSPacket ( DNSRequest req,
u32  now 
) [private]
void cat::DNSClient::ProcessDNSResponse ( DNSRequest req,
int  qdcount,
int  ancount,
u8 data,
u32  bytes 
) [protected]
DNSRequest* cat::DNSClient::PullRequest ( u16  id) [private]
bool cat::DNSClient::Resolve ( const char *  hostname,
DNSResultCallback  ,
ThreadRefObject holdRef = 0 
)
void cat::DNSClient::Shutdown ( )
bool cat::DNSClient::ThreadFunction ( void *  param) [private, virtual]

Implements cat::Thread.


Member Data Documentation

Definition at line 158 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

Definition at line 157 of file DNSClient.hpp.

Definition at line 160 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

Definition at line 159 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

Definition at line 144 of file DNSClient.hpp.

Definition at line 143 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

Definition at line 183 of file DNSClient.hpp.

Definition at line 148 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

Definition at line 147 of file DNSClient.hpp.

Definition at line 150 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

Definition at line 149 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

Definition at line 142 of file DNSClient.hpp.

Referenced by CAT_SINGLETON().

const int cat::DNSClient::DNS_THREAD_KILL_TIMEOUT = 10000 [static, private]

Definition at line 93 of file DNSClient.hpp.

const int cat::DNSClient::TICK_RATE = 200 [static, private]

Definition at line 92 of file DNSClient.hpp.


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

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net