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

Public Member Functions

 ModuleDNS (const Anope::string &modname, const Anope::string &creator)
 
 ~ModuleDNS ()
 
void OnReload (Configuration::Conf *conf) anope_override
 
void OnNewServer (Server *s) anope_override
 
void OnServerQuit (Server *s) anope_override
 
void OnUserConnect (User *u, bool &exempt) anope_override
 
void OnPreUserLogoff (User *u) anope_override
 
void OnDnsRequest (DNS::Query &req, DNS::Query *packet) anope_override
 
 ModuleDNS (const Anope::string &modname, const Anope::string &creator)
 
 ~ModuleDNS ()
 
void OnReload (Configuration::Conf *conf) anope_override
 
void OnModuleUnload (User *u, Module *m) anope_override
 
- Public Member Functions inherited from Module
 Module (const Anope::string &modname, const Anope::string &loadernick, ModType type=THIRD)
 
virtual ~Module ()
 
void SetPermanent (bool state)
 
bool GetPermanent () const
 
void SetVersion (const Anope::string &version)
 
void SetAuthor (const Anope::string &author)
 
ModuleVersion GetVersion () const
 
virtual void OnPreUserKicked (const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg)
 
virtual void OnUserKicked (const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg)
 
virtual EventReturn OnPreBotAssign (User *sender, ChannelInfo *ci, BotInfo *bi)
 
virtual void OnBotAssign (User *sender, ChannelInfo *ci, BotInfo *bi)
 
virtual EventReturn OnBotUnAssign (User *sender, ChannelInfo *ci)
 
virtual void OnUserNickChange (User *u, const Anope::string &oldnick)
 
virtual EventReturn OnPreHelp (CommandSource &source, const std::vector< Anope::string > &params)
 
virtual void OnPostHelp (CommandSource &source, const std::vector< Anope::string > &params)
 
virtual EventReturn OnPreCommand (CommandSource &source, Command *command, std::vector< Anope::string > &params)
 
virtual void OnPostCommand (CommandSource &source, Command *command, const std::vector< Anope::string > &params)
 
virtual void OnSaveDatabase ()
 
virtual EventReturn OnLoadDatabase ()
 
virtual EventReturn OnEncrypt (const Anope::string &src, Anope::string &dest)
 
virtual EventReturn OnDecrypt (const Anope::string &hashm, const Anope::string &src, Anope::string &dest)
 
virtual EventReturn OnBotFantasy (CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
 
virtual EventReturn OnBotNoFantasyAccess (CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
 
virtual void OnBotBan (User *u, ChannelInfo *ci, const Anope::string &mask)
 
virtual void OnBadWordAdd (ChannelInfo *ci, const BadWord *bw)
 
virtual void OnBadWordDel (ChannelInfo *ci, const BadWord *bw)
 
virtual void OnCreateBot (BotInfo *bi)
 
virtual void OnDelBot (BotInfo *bi)
 
virtual EventReturn OnBotKick (BotInfo *bi, Channel *c, User *u, const Anope::string &reason)
 
virtual void OnPrePartChannel (User *u, Channel *c)
 
virtual void OnPartChannel (User *u, Channel *c, const Anope::string &channel, const Anope::string &msg)
 
virtual void OnLeaveChannel (User *u, Channel *c)
 
virtual void OnJoinChannel (User *u, Channel *c)
 
virtual void OnTopicUpdated (Channel *c, const Anope::string &user, const Anope::string &topic)
 
virtual void OnPreChanExpire (ChannelInfo *ci, bool &expire)
 
virtual void OnChanExpire (ChannelInfo *ci)
 
virtual void OnPreServerConnect ()
 
virtual void OnServerConnect ()
 
virtual void OnPreUplinkSync (Server *serv)
 
virtual void OnServerDisconnect ()
 
virtual void OnRestart ()
 
virtual void OnShutdown ()
 
virtual void OnPreNickExpire (NickAlias *na, bool &expire)
 
virtual void OnNickExpire (NickAlias *na)
 
virtual void OnDefconLevel (int level)
 
virtual EventReturn OnExceptionAdd (Exception *ex)
 
virtual void OnExceptionDel (CommandSource &source, Exception *ex)
 
virtual EventReturn OnAddXLine (CommandSource &source, const XLine *x, XLineManager *xlm)
 
virtual void OnDelXLine (CommandSource &source, const XLine *x, XLineManager *xlm)
 
virtual EventReturn IsServicesOper (User *u)
 
virtual void OnUserQuit (User *u, const Anope::string &msg)
 
virtual void OnPostUserLogoff (User *u)
 
virtual void OnBotCreate (BotInfo *bi)
 
virtual void OnBotChange (BotInfo *bi)
 
virtual void OnBotDelete (BotInfo *bi)
 
virtual void OnAccessDel (ChannelInfo *ci, CommandSource &source, ChanAccess *access)
 
virtual void OnAccessAdd (ChannelInfo *ci, CommandSource &source, ChanAccess *access)
 
virtual void OnAccessClear (ChannelInfo *ci, CommandSource &source)
 
virtual void OnLevelChange (CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what)
 
virtual EventReturn OnChanDrop (CommandSource &source, ChannelInfo *ci)
 
virtual void OnChanRegistered (ChannelInfo *ci)
 
virtual void OnChanSuspend (ChannelInfo *ci)
 
virtual void OnChanUnsuspend (ChannelInfo *ci)
 
virtual void OnCreateChan (ChannelInfo *ci)
 
virtual void OnDelChan (ChannelInfo *ci)
 
virtual void OnChannelCreate (Channel *c)
 
virtual void OnChannelDelete (Channel *c)
 
virtual void OnAkickAdd (CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
 
virtual void OnAkickDel (CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
 
virtual EventReturn OnCheckKick (User *u, Channel *c, Anope::string &mask, Anope::string &reason)
 
virtual void OnChanInfo (CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden)
 
virtual EventReturn OnCheckPriv (const ChanAccess *access, const Anope::string &priv)
 
virtual EventReturn OnGroupCheckPriv (const AccessGroup *group, const Anope::string &priv)
 
virtual void OnNickDrop (CommandSource &source, NickAlias *na)
 
virtual void OnNickGroup (User *u, NickAlias *target)
 
virtual void OnNickIdentify (User *u)
 
virtual void OnUserLogin (User *u)
 
virtual void OnNickLogout (User *u)
 
virtual void OnNickRegister (User *user, NickAlias *na, const Anope::string &pass)
 
virtual void OnNickSuspend (NickAlias *na)
 
virtual void OnNickUnsuspended (NickAlias *na)
 
virtual void OnDelNick (NickAlias *na)
 
virtual void OnNickCoreCreate (NickCore *nc)
 
virtual void OnDelCore (NickCore *nc)
 
virtual void OnChangeCoreDisplay (NickCore *nc, const Anope::string &newdisplay)
 
virtual void OnNickClearAccess (NickCore *nc)
 
virtual void OnNickAddAccess (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickEraseAccess (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickClearCert (NickCore *nc)
 
virtual void OnNickAddCert (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickEraseCert (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickInfo (CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden)
 
virtual void OnBotInfo (CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info)
 
virtual void OnCheckAuthentication (User *u, IdentifyRequest *req)
 
virtual void OnNickUpdate (User *u)
 
virtual void OnFingerprint (User *u)
 
virtual void OnUserAway (User *u, const Anope::string &message)
 
virtual void OnInvite (User *source, Channel *c, User *targ)
 
virtual void OnDeleteVhost (NickAlias *na)
 
virtual void OnSetVhost (NickAlias *na)
 
virtual void OnSetDisplayedHost (User *)
 
virtual void OnMemoSend (const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m)
 
virtual void OnMemoDel (const Anope::string &target, MemoInfo *mi, const Memo *m)
 
virtual EventReturn OnChannelModeSet (Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param)
 
virtual EventReturn OnChannelModeUnset (Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param)
 
virtual void OnUserModeSet (const MessageSource &setter, User *u, const Anope::string &mname)
 
virtual void OnUserModeUnset (const MessageSource &setter, User *u, const Anope::string &mname)
 
virtual void OnChannelModeAdd (ChannelMode *cm)
 
virtual void OnUserModeAdd (UserMode *um)
 
virtual EventReturn OnMLock (ChannelInfo *ci, ModeLock *lock)
 
virtual EventReturn OnUnMLock (ChannelInfo *ci, ModeLock *lock)
 
virtual void OnModuleLoad (User *u, Module *m)
 
virtual void OnServerSync (Server *s)
 
virtual void OnUplinkSync (Server *s)
 
virtual EventReturn OnBotPrivmsg (User *u, BotInfo *bi, Anope::string &message)
 
virtual void OnBotNotice (User *u, BotInfo *bi, Anope::string &message)
 
virtual void OnPrivmsg (User *u, Channel *c, Anope::string &msg)
 
virtual void OnLog (Log *l)
 
virtual void OnLogMessage (LogInfo *li, const Log *l, const Anope::string &msg)
 
virtual void OnCheckModes (Reference< Channel > &c)
 
virtual void OnChannelSync (Channel *c)
 
virtual void OnSetCorrectModes (User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes)
 
virtual void OnSerializeCheck (Serialize::Type *)
 
virtual void OnSerializableConstruct (Serializable *)
 
virtual void OnSerializableDestruct (Serializable *)
 
virtual void OnSerializableUpdate (Serializable *)
 
virtual void OnSerializeTypeCreate (Serialize::Type *)
 
virtual EventReturn OnSetChannelOption (CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting)
 
virtual EventReturn OnSetNickOption (CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting)
 
virtual EventReturn OnMessage (MessageSource &source, Anope::string &command, std::vector< Anope::string > &param)
 
virtual EventReturn OnCanSet (User *u, const ChannelMode *cm)
 
virtual EventReturn OnCheckDelete (Channel *)
 
virtual void OnExpireTick ()
 
virtual EventReturn OnNickValidate (User *u, NickAlias *na)
 
- Public Member Functions inherited from Extensible
virtual ~Extensible ()
 
template<typename T >
T * GetExt (const Anope::string &name) const
 
bool HasExt (const Anope::string &name) const
 
template<typename T >
T * Extend (const Anope::string &name, const T &what)
 
template<typename T >
T * Extend (const Anope::string &name)
 
template<typename T >
T * Require (const Anope::string &name)
 
template<typename T >
void Shrink (const Anope::string &name)
 
template<>
bool * Extend (const Anope::string &name, const bool &what)
 

Private Attributes

Serialize::Type zone_type
 
Serialize::Type dns_type
 
CommandOSDNS commandosdns
 
time_t ttl
 
int user_drop_mark
 
time_t user_drop_time
 
time_t user_drop_readd_time
 
bool remove_split_servers
 
bool readd_connected_servers
 
time_t last_warn
 
MyManager manager
 
Anope::string nameserver
 
Anope::string ip
 
int port
 
std::vector< std::pair
< Anope::string, short > > 
notify
 

Additional Inherited Members

- Static Public Member Functions inherited from Extensible
static void ExtensibleSerialize (const Extensible *, const Serializable *, Serialize::Data &data)
 
static void ExtensibleUnserialize (Extensible *, Serializable *, Serialize::Data &data)
 
- Data Fields inherited from Module
Anope::string name
 
ModType type
 
Anope::string filename
 
void * handle
 
time_t created
 
Anope::string version
 
Anope::string author
 
- Data Fields inherited from Extensible
std::set< ExtensibleBase * > extension_items
 

Detailed Description

Definition at line 718 of file os_dns.cpp.

Constructor & Destructor Documentation

ModuleDNS::ModuleDNS ( const Anope::string modname,
const Anope::string creator 
)
inline
ModuleDNS::~ModuleDNS ( )
inline

Definition at line 747 of file os_dns.cpp.

References dns_servers, and zones.

ModuleDNS::ModuleDNS ( const Anope::string modname,
const Anope::string creator 
)
inline

Definition at line 1017 of file m_dns.cpp.

ModuleDNS::~ModuleDNS ( )
inline

Definition at line 1022 of file m_dns.cpp.

References SocketEngine::Sockets.

Member Function Documentation

void ModuleDNS::OnDnsRequest ( DNS::Query req,
DNS::Query reply 
)
inlinevirtual

Called when a DNS request (question) is recieved.

Parameters
reqThe dns request
replyThe reply that will be sent

Reimplemented from Module.

Definition at line 853 of file os_dns.cpp.

References DNSServer::Active(), Anope::CurTime, dns_servers, DNSZone::Find(), DNSServer::Find(), DNSServer::GetIPs(), DNS::Question::name, Anope::string::npos, DNS::QUERY_A, DNS::QUERY_AAAA, DNS::QUERY_ANY, DNS::QUERY_AXFR, DNS::ResourceRecord::rdata, DNSZone::servers, DNS::ResourceRecord::ttl, ttl, and DNS::Question::type.

void ModuleDNS::OnModuleUnload ( User u,
Module m 
)
inlinevirtual

Called before a module is unloaded

Parameters
uThe user, can be NULL
mThe module

Reimplemented from Module.

Definition at line 1100 of file m_dns.cpp.

References DNS::Request::creator, DNS::Query::error, DNS::ERROR_UNLOADED, DNS::Request::OnError(), and MyManager::requests.

void ModuleDNS::OnNewServer ( Server s)
inlinevirtual

Called when a new server connects to the network.

Parameters
sThe server that has connected to the network

Reimplemented from Module.

Definition at line 766 of file os_dns.cpp.

References DNSServer::Active(), DNSServer::Find(), DNSServer::GetIPs(), Server::IsJuped(), Server::IsSynced(), Me, DNSServer::Pooled(), readd_connected_servers, and DNSServer::SetActive().

void ModuleDNS::OnPreUserLogoff ( User u)
inlinevirtual

Called when a user is quit, before and after being internally removed from This is different from OnUserQuit, which takes place at the time of the quit. This happens shortly after when all message processing is finished. all lists (channels, user list, etc)

Parameters
uThe user

Reimplemented from Module.

Definition at line 808 of file os_dns.cpp.

References DNSServer::Active(), Anope::CurTime, DNSServer::Find(), DNSServer::GetLimit(), DNSServer::GetName(), DNSServer::Pooled(), DNSServer::repool, server_quit_times, DNSServer::SetActive(), user_drop_mark, user_drop_readd_time, and user_drop_time.

void ModuleDNS::OnReload ( Configuration::Conf conf)
inlinevirtual

Called when Services' configuration is being (re)loaded.

Parameters
confThe config that is being built now and will replace the global Config object
Exceptions
AConfigException to abort the config (re)loading process.

Reimplemented from Module.

Definition at line 755 of file os_dns.cpp.

References Configuration::Block::Get().

void ModuleDNS::OnReload ( Configuration::Conf conf)
inlinevirtual

Called when Services' configuration is being (re)loaded.

Parameters
confThe config that is being built now and will replace the global Config object
Exceptions
AConfigException to abort the config (re)loading process.

Reimplemented from Module.

Definition at line 1034 of file m_dns.cpp.

References Anope::string::c_str(), Configuration::Block::CountBlock(), Configuration::Block::Get(), Configuration::Block::GetBlock(), CoreException::GetReason(), Anope::IsFile(), LOG_DEBUG, Anope::string::npos, MyManager::SetIPPort(), Anope::string::substr(), and timeout.

void ModuleDNS::OnServerQuit ( Server server)
inlinevirtual

Called when a server quits

Parameters
serverThe server

Reimplemented from Module.

Definition at line 781 of file os_dns.cpp.

References DNSServer::Active(), DNSServer::Find(), DNSServer::Pool(), DNSServer::Pooled(), and DNSServer::SetActive().

void ModuleDNS::OnUserConnect ( User u,
bool &  exempt 
)
inlinevirtual

Called when a new user connects to the network.

Parameters
uThe connecting user.
exemptset to true/is true if the user should be excepted from bans etc

Reimplemented from Module.

Definition at line 794 of file os_dns.cpp.

References DNSServer::Active(), DNSServer::Find(), DNSServer::GetLimit(), DNSServer::GetName(), DNSServer::Pooled(), and DNSServer::SetActive().

Field Documentation

CommandOSDNS ModuleDNS::commandosdns
private

Definition at line 721 of file os_dns.cpp.

Serialize::Type ModuleDNS::dns_type
private

Definition at line 720 of file os_dns.cpp.

Anope::string ModuleDNS::ip
private

Definition at line 1011 of file m_dns.cpp.

time_t ModuleDNS::last_warn
private

Definition at line 730 of file os_dns.cpp.

MyManager ModuleDNS::manager
private

Definition at line 1008 of file m_dns.cpp.

Anope::string ModuleDNS::nameserver
private

Definition at line 1010 of file m_dns.cpp.

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

Definition at line 1014 of file m_dns.cpp.

int ModuleDNS::port
private

Definition at line 1012 of file m_dns.cpp.

bool ModuleDNS::readd_connected_servers
private

Definition at line 728 of file os_dns.cpp.

Referenced by OnNewServer().

bool ModuleDNS::remove_split_servers
private

Definition at line 727 of file os_dns.cpp.

time_t ModuleDNS::ttl
private

Definition at line 723 of file os_dns.cpp.

Referenced by OnDnsRequest().

int ModuleDNS::user_drop_mark
private

Definition at line 724 of file os_dns.cpp.

Referenced by OnPreUserLogoff().

time_t ModuleDNS::user_drop_readd_time
private

Definition at line 726 of file os_dns.cpp.

Referenced by OnPreUserLogoff().

time_t ModuleDNS::user_drop_time
private

Definition at line 725 of file os_dns.cpp.

Referenced by OnPreUserLogoff().

Serialize::Type ModuleDNS::zone_type
private

Definition at line 720 of file os_dns.cpp.


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