The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CloakUser Class Reference

Handles user mode +x. More...

Inheritance diagram for CloakUser:

Inheritance graph
[legend]
Collaboration diagram for CloakUser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

std::string LastTwoDomainParts (const std::string &host)
 This function takes a domain name string and returns just the last two domain parts, or the last domain part if only two are available.
 CloakUser (InspIRCd *Instance, Module *source, Module *Hash)
ModeAction OnModeChange (User *source, User *dest, Channel *channel, std::string &parameter, bool adding, bool)
 Called when a mode change for your mode occurs.
std::string Cloak4 (const char *ip)
std::string Cloak6 (const char *ip)
void DoRehash ()

Public Attributes

std::string prefix
 Mode prefix, or 0.
unsigned int key1
unsigned int key2
unsigned int key3
unsigned int key4
bool ipalways
ModuleSender
ModuleHashProvider
const char * xtab [4]

Detailed Description

Handles user mode +x.

Definition at line 22 of file m_cloaking.cpp.


Constructor & Destructor Documentation

CloakUser::CloakUser InspIRCd Instance,
Module source,
Module Hash
[inline]
 

Definition at line 66 of file m_cloaking.cpp.


Member Function Documentation

std::string CloakUser::Cloak4 const char *  ip  )  [inline]
 

Definition at line 128 of file m_cloaking.cpp.

References irc::sepstream::GetToken(), HashProvider, key1, key2, key3, key4, Sender, and xtab.

Referenced by Cloak6(), and ModuleCloaking::OnUserConnect().

std::string CloakUser::Cloak6 const char *  ip  )  [inline]
 

Definition at line 160 of file m_cloaking.cpp.

References Cloak4(), HashProvider, key1, key2, key3, key4, Sender, and xtab.

Referenced by ModuleCloaking::OnUserConnect().

void CloakUser::DoRehash  )  [inline]
 

Definition at line 199 of file m_cloaking.cpp.

References Conf, InspIRCd::Config, ipalways, key1, key2, key3, key4, ServerConfig::Network, prefix, ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), ConfigReader::ReadValue(), ModeHandler::ServerInstance, and xtab.

Referenced by ModuleCloaking::OnRehash().

std::string CloakUser::LastTwoDomainParts const std::string host  )  [inline]
 

This function takes a domain name string and returns just the last two domain parts, or the last domain part if only two are available.

Failing that it just returns what it was given.

For example, if it is passed "svn.inspircd.org" it will return ".inspircd.org". If it is passed "brainbox.winbot.co.uk" it will return ".co.uk", and if it is passed "localhost.localdomain" it will return ".localdomain".

This is used to ensure a significant part of the host is always cloaked (see Bug #216)

Definition at line 44 of file m_cloaking.cpp.

Referenced by ModuleCloaking::OnUserConnect().

ModeAction CloakUser::OnModeChange User source,
User dest,
Channel channel,
std::string parameter,
bool  adding,
bool 
[inline, virtual]
 

Called when a mode change for your mode occurs.

Parameters:
source Contains the user setting the mode.
dest For usermodes, contains the destination user the mode is being set on. For channelmodes, this is an undefined value.
channel For channel modes, contains the destination channel the modes are being set on. For usermodes, this is an undefined value.
parameter The parameter for your mode, if you indicated that your mode requires a parameter when being set or unset. Note that if you alter this value, the new value becomes the one displayed and send out to the network, also, if you set this to an empty string but you specified your mode REQUIRES a parameter, this is equivalent to returning MODEACTION_DENY and will prevent the mode from being displayed.
adding This value is true when the mode is being set, or false when it is being unset.
Returns:
MODEACTION_ALLOW to allow the mode, or MODEACTION_DENY to prevent the mode, also see the description of 'parameter'.

Reimplemented from ModeHandler.

Definition at line 70 of file m_cloaking.cpp.

References User::ChangeDisplayedHost(), Extensible::GetExt(), connection::host, User::IncreasePenalty(), IS_LOCAL, User::IsModeSet(), MODEACTION_ALLOW, MODEACTION_DENY, and User::SetMode().


Member Data Documentation

Module* CloakUser::HashProvider
 

Definition at line 32 of file m_cloaking.cpp.

Referenced by Cloak4(), Cloak6(), and ModuleCloaking::OnUserConnect().

bool CloakUser::ipalways
 

Definition at line 30 of file m_cloaking.cpp.

Referenced by DoRehash(), and ModuleCloaking::OnUserConnect().

unsigned int CloakUser::key1
 

Definition at line 26 of file m_cloaking.cpp.

Referenced by Cloak4(), Cloak6(), DoRehash(), and ModuleCloaking::OnUserConnect().

unsigned int CloakUser::key2
 

Definition at line 27 of file m_cloaking.cpp.

Referenced by Cloak4(), Cloak6(), DoRehash(), and ModuleCloaking::OnUserConnect().

unsigned int CloakUser::key3
 

Definition at line 28 of file m_cloaking.cpp.

Referenced by Cloak4(), Cloak6(), DoRehash(), and ModuleCloaking::OnUserConnect().

unsigned int CloakUser::key4
 

Definition at line 29 of file m_cloaking.cpp.

Referenced by Cloak4(), Cloak6(), DoRehash(), and ModuleCloaking::OnUserConnect().

std::string CloakUser::prefix
 

Mode prefix, or 0.

Reimplemented from ModeHandler.

Definition at line 25 of file m_cloaking.cpp.

Referenced by DoRehash(), and ModuleCloaking::OnUserConnect().

Module* CloakUser::Sender
 

Definition at line 31 of file m_cloaking.cpp.

Referenced by Cloak4(), and Cloak6().

const char* CloakUser::xtab[4]
 

Definition at line 33 of file m_cloaking.cpp.

Referenced by Cloak4(), Cloak6(), DoRehash(), and ModuleCloaking::OnUserConnect().


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