Anope IRC Services  Version 2.0
Public Member Functions | Data Fields | Private Types | Private Member Functions | Private Attributes
MyManager Class Reference
Inheritance diagram for MyManager:
Inheritance graph
[legend]
Collaboration diagram for MyManager:
Collaboration graph
[legend]

Public Member Functions

 MyManager (Module *creator)
 
 ~MyManager ()
 
void SetIPPort (const Anope::string &nameserver, const Anope::string &ip, unsigned short port, std::vector< std::pair< Anope::string, short > > n)
 
void Process (Request *req) anope_override
 
void RemoveRequest (Request *req) anope_override
 
bool HandlePacket (ReplySocket *s, const unsigned char *const packet_buffer, int length, sockaddrs *from) anope_override
 
void UpdateSerial () anope_override
 
void Notify (const Anope::string &zone) anope_override
 
uint32_t GetSerial () const anope_override
 
void Tick (time_t now) anope_override
 
- Public Member Functions inherited from DNS::Manager
 Manager (Module *creator)
 
virtual ~Manager ()
 
- Public Member Functions inherited from Service
 Service (Module *o, const Anope::string &t, const Anope::string &n)
 
virtual ~Service ()
 
void Register ()
 
void Unregister ()
 
- Public Member Functions inherited from Base
 Base ()
 
virtual ~Base ()
 
void AddReference (ReferenceBase *r)
 
void DelReference (ReferenceBase *r)
 
- 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
 

Data Fields

std::map< unsigned short,
Request * > 
requests
 
- Data Fields inherited from Service
Moduleowner
 
Anope::string type
 
Anope::string name
 

Private Types

typedef TR1NS::unordered_map
< Question, Query,
Question::hash
cache_map
 

Private Member Functions

unsigned short GetID ()
 
void AddCache (Query &r)
 
bool CheckCache (Request *request)
 

Private Attributes

uint32_t serial
 
cache_map cache
 
TCPSockettcpsock
 
UDPSocketudpsock
 
bool listen
 
sockaddrs addrs
 
std::vector< std::pair
< Anope::string, short > > 
notify
 
unsigned short cur_id
 

Additional Inherited Members

- Static Public Member Functions inherited from Service
static ServiceFindService (const Anope::string &t, const Anope::string &n)
 
static std::vector< Anope::stringGetServiceKeys (const Anope::string &t)
 
static void AddAlias (const Anope::string &t, const Anope::string &n, const Anope::string &v)
 
static void DelAlias (const Anope::string &t, const Anope::string &n)
 

Detailed Description

Definition at line 647 of file m_dns.cpp.

Member Typedef Documentation

typedef TR1NS::unordered_map<Question, Query, Question::hash> MyManager::cache_map
private

Definition at line 651 of file m_dns.cpp.

Constructor & Destructor Documentation

MyManager::MyManager ( Module creator)
inline

Definition at line 664 of file m_dns.cpp.

MyManager::~MyManager ( )
inline

Definition at line 669 of file m_dns.cpp.

References DNS::Query::error, DNS::ERROR_UNKNOWN, and DNS::Request::OnError().

Member Function Documentation

void MyManager::AddCache ( Query r)
inlineprivate

Add a record to the dns cache

Parameters
rThe record

Definition at line 980 of file m_dns.cpp.

References DNS::Query::answers, LOG_DEBUG_3, DNS::Question::name, DNS::Query::questions, DNS::ResourceRecord::rdata, and DNS::ResourceRecord::ttl.

bool MyManager::CheckCache ( Request request)
inlineprivate

Check the DNS cache to see if request can be handled by a cached result

Returns
true if a cached result was found.

Definition at line 990 of file m_dns.cpp.

References LOG_DEBUG_3, DNS::Question::name, and DNS::Request::OnLookupComplete().

unsigned short MyManager::GetID ( )
inlineprivate

Definition at line 722 of file m_dns.cpp.

References UDPSocket::GetPackets().

uint32_t MyManager::GetSerial ( ) const
inlinevirtual

Implements DNS::Manager.

Definition at line 955 of file m_dns.cpp.

bool MyManager::HandlePacket ( ReplySocket s,
const unsigned char *const  packet_buffer,
int  length,
sockaddrs from 
)
inlinevirtual
void MyManager::Notify ( const Anope::string zone)
inlinevirtual
void MyManager::Process ( Request req)
inlinevirtual
void MyManager::RemoveRequest ( Request req)
inlinevirtual

Implements DNS::Manager.

Definition at line 762 of file m_dns.cpp.

void MyManager::SetIPPort ( const Anope::string nameserver,
const Anope::string ip,
unsigned short  port,
std::vector< std::pair< Anope::string, short > >  n 
)
inline
void MyManager::Tick ( time_t  ctime)
inlinevirtual

Called when the timer ticks This should be overridden with something useful

Implements Timer.

Definition at line 960 of file m_dns.cpp.

References DNS::Query::answers, DNS::ResourceRecord::created, LOG_DEBUG_2, and DNS::ResourceRecord::ttl.

void MyManager::UpdateSerial ( )
inlinevirtual

Implements DNS::Manager.

Definition at line 919 of file m_dns.cpp.

References Anope::CurTime.

Field Documentation

sockaddrs MyManager::addrs
private

Definition at line 658 of file m_dns.cpp.

cache_map MyManager::cache
private

Definition at line 652 of file m_dns.cpp.

unsigned short MyManager::cur_id
private

Definition at line 720 of file m_dns.cpp.

bool MyManager::listen
private

Definition at line 657 of file m_dns.cpp.

std::vector<std::pair<Anope::string, short> > MyManager::notify
private

Definition at line 660 of file m_dns.cpp.

std::map<unsigned short, Request *> MyManager::requests

Definition at line 662 of file m_dns.cpp.

Referenced by ModuleDNS::OnModuleUnload().

uint32_t MyManager::serial
private

Definition at line 649 of file m_dns.cpp.

TCPSocket* MyManager::tcpsock
private

Definition at line 654 of file m_dns.cpp.

UDPSocket* MyManager::udpsock
private

Definition at line 655 of file m_dns.cpp.


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