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
Collaboration diagram for MyManager:
Collaboration graph

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
Anope::string type
Anope::string name

Private Types

typedef TR1NS::unordered_map< Question, Query, Question::hashcache_map

Private Member Functions

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

Private Attributes

uint32_t serial
cache_map cache
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

◆ cache_map

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

Definition at line 651 of file m_dns.cpp.

Constructor & Destructor Documentation

◆ MyManager()

MyManager::MyManager ( Module creator)

Definition at line 664 of file m_dns.cpp.

◆ ~MyManager()

MyManager::~MyManager ( )

Definition at line 669 of file m_dns.cpp.

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

Member Function Documentation

◆ AddCache()

void MyManager::AddCache ( Query r)

Add a record to the dns cache

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.

◆ CheckCache()

bool MyManager::CheckCache ( Request request)

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

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().

◆ GetID()

unsigned short MyManager::GetID ( )

Definition at line 722 of file m_dns.cpp.

References UDPSocket::GetPackets().

◆ GetSerial()

uint32_t MyManager::GetSerial ( ) const

Implements DNS::Manager.

Definition at line 955 of file m_dns.cpp.

◆ HandlePacket()

bool MyManager::HandlePacket ( ReplySocket s,
const unsigned char *const  packet_buffer,
int  length,
sockaddrs from 

◆ Notify()

void MyManager::Notify ( const Anope::string zone)

◆ Process()

void MyManager::Process ( Request req)

◆ RemoveRequest()

void MyManager::RemoveRequest ( Request req)

Implements DNS::Manager.

Definition at line 762 of file m_dns.cpp.

◆ SetIPPort()

void MyManager::SetIPPort ( const Anope::string nameserver,
const Anope::string ip,
unsigned short  port,
std::vector< std::pair< Anope::string, short > >  n 

◆ Tick()

void MyManager::Tick ( time_t  ctime)

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.

◆ UpdateSerial()

void MyManager::UpdateSerial ( )

Implements DNS::Manager.

Definition at line 919 of file m_dns.cpp.

References Anope::CurTime.

Field Documentation

◆ addrs

sockaddrs MyManager::addrs

Definition at line 658 of file m_dns.cpp.

◆ cache

cache_map MyManager::cache

Definition at line 652 of file m_dns.cpp.

◆ cur_id

unsigned short MyManager::cur_id

Definition at line 720 of file m_dns.cpp.

◆ listen

bool MyManager::listen

Definition at line 657 of file m_dns.cpp.

◆ notify

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

Definition at line 660 of file m_dns.cpp.

◆ requests

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

Definition at line 662 of file m_dns.cpp.

Referenced by ModuleDNS::OnModuleUnload().

◆ serial

uint32_t MyManager::serial

Definition at line 649 of file m_dns.cpp.

◆ tcpsock

TCPSocket* MyManager::tcpsock

Definition at line 654 of file m_dns.cpp.

◆ udpsock

UDPSocket* MyManager::udpsock

Definition at line 655 of file m_dns.cpp.

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