Anope IRC Services  Version 2.0
Public Member Functions | Data Fields | Private Attributes
DNS::Request Class Referenceabstract

#include <dns.h>

Inheritance diagram for DNS::Request:
Inheritance graph
Collaboration diagram for DNS::Request:
Collaboration graph

Public Member Functions

 Request (Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache=false)
virtual ~Request ()
virtual void OnLookupComplete (const Query *r)=0
virtual void OnError (const Query *r)
void Tick (time_t) anope_override
- Public Member Functions inherited from Timer
 Timer (long time_from_now, time_t now=Anope::CurTime, bool repeating=false)
 Timer (Module *creator, long time_from_now, time_t now=Anope::CurTime, bool repeating=false)
virtual ~Timer ()
void SetTimer (time_t t)
time_t GetTimer () const
bool GetRepeat () const
void SetSecs (time_t t)
long GetSecs () const
time_t GetSetTime () const
ModuleGetOwner () const
- Public Member Functions inherited from DNS::Question
 Question ()
 Question (const Anope::string &n, QueryType t, unsigned short c=1)
bool operator== (const Question &other) const

Data Fields

bool use_cache
unsigned short id
- Data Fields inherited from DNS::Question
Anope::string name
QueryType type
unsigned short qclass

Private Attributes


Detailed Description

A DNS query.

Definition at line 136 of file dns.h.

Constructor & Destructor Documentation

DNS::Request::Request ( Manager mgr,
Module c,
const Anope::string addr,
QueryType  qt,
bool  cache = false 

Definition at line 147 of file dns.h.

virtual DNS::Request::~Request ( )

Definition at line 150 of file dns.h.

References DNS::Manager::RemoveRequest().

Member Function Documentation

virtual void DNS::Request::OnError ( const Query r)

Called when this request fails or times out.

rThe query sent back from the nameserver, check the error code.

Definition at line 163 of file dns.h.

Referenced by MyManager::HandlePacket(), ModuleDNS::OnModuleUnload(), Tick(), and MyManager::~MyManager().

virtual void DNS::Request::OnLookupComplete ( const Query r)
pure virtual

Called when this request succeeds

rThe query sent back from the nameserver

Implemented in DNSBLResolver.

Referenced by MyManager::CheckCache(), and MyManager::HandlePacket().

void DNS::Request::Tick ( time_t  )

Used to time out the query, xalls OnError and lets the TimerManager delete this request.

Implements Timer.

Definition at line 168 of file dns.h.

References DNS::Query::error, DNS::ERROR_TIMEDOUT, LOG_DEBUG_2, DNS::Question::name, and OnError().

Field Documentation

Module* DNS::Request::creator

Definition at line 145 of file dns.h.

Referenced by ModuleDNS::OnModuleUnload().

unsigned short DNS::Request::id

Definition at line 143 of file dns.h.

Manager* DNS::Request::manager

Definition at line 138 of file dns.h.

bool DNS::Request::use_cache

Definition at line 141 of file dns.h.

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