DDraceNetwork Documentation
Loading...
Searching...
No Matches
CNetBan Class Reference

#include <netban.h>

Inheritance diagram for CNetBan:
[legend]
Collaboration diagram for CNetBan:
[legend]

Classes

class  CNetHash
struct  CBanInfo
struct  CBan
class  CBanPool

Public Types

enum  { MSGTYPE_PLAYER = 0 , MSGTYPE_LIST , MSGTYPE_BANADD , MSGTYPE_BANREM }

Public Member Functions

class IConsoleConsole () const
class IStorageStorage () const
virtual ~CNetBan ()=default
void Init (class IConsole *pConsole, class IStorage *pStorage)
void Update ()
virtual int BanAddr (const NETADDR *pAddr, int Seconds, const char *pReason, bool VerbatimReason)
virtual int BanRange (const CNetRange *pRange, int Seconds, const char *pReason)
int UnbanByAddr (const NETADDR *pAddr)
int UnbanByRange (const CNetRange *pRange)
int UnbanByIndex (int Index)
void UnbanAll ()
bool IsBanned (const NETADDR *pOrigAddr, char *pBuf, unsigned BufferSize) const

Static Public Member Functions

static void ConBan (class IConsole::IResult *pResult, void *pUser)
static void ConBanRange (class IConsole::IResult *pResult, void *pUser)
static void ConUnban (class IConsole::IResult *pResult, void *pUser)
static void ConUnbanRange (class IConsole::IResult *pResult, void *pUser)
static void ConUnbanAll (class IConsole::IResult *pResult, void *pUser)
static void ConBans (class IConsole::IResult *pResult, void *pUser)
static void ConBansFind (class IConsole::IResult *pResult, void *pUser)
static void ConBansSave (class IConsole::IResult *pResult, void *pUser)

Protected Types

typedef CBanPool< NETADDR, 1 > CBanAddrPool
typedef CBanPool< CNetRange, 16 > CBanRangePool
typedef CBan< NETADDRCBanAddr
typedef CBan< CNetRangeCBanRange

Protected Member Functions

bool NetMatch (const NETADDR *pAddr1, const NETADDR *pAddr2) const
bool NetMatch (const CNetRange *pRange, const NETADDR *pAddr, int Start, int Length) const
bool NetMatch (const CNetRange *pRange, const NETADDR *pAddr) const
const char * NetToString (const NETADDR *pData, char *pBuffer, unsigned BufferSize) const
const char * NetToString (const CNetRange *pData, char *pBuffer, unsigned BufferSize) const
template<class T>
void MakeBanInfo (const CBan< T > *pBan, char *pBuf, unsigned BuffSize, int Type) const
template<class T>
int Ban (T *pBanPool, const typename T::CDataType *pData, int Seconds, const char *pReason, bool VerbatimReason)
template<class T>
int Unban (T *pBanPool, const typename T::CDataType *pData)

Protected Attributes

class IConsolem_pConsole
class IStoragem_pStorage
CBanAddrPool m_BanAddrPool
CBanRangePool m_BanRangePool
NETADDR m_LocalhostIpV4
NETADDR m_LocalhostIpV6

Member Typedef Documentation

◆ CBanAddr

typedef CBan<NETADDR> CNetBan::CBanAddr
protected

◆ CBanAddrPool

typedef CBanPool<NETADDR, 1> CNetBan::CBanAddrPool
protected

◆ CBanRange

typedef CBan<CNetRange> CNetBan::CBanRange
protected

◆ CBanRangePool

typedef CBanPool<CNetRange, 16> CNetBan::CBanRangePool
protected

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MSGTYPE_PLAYER 
MSGTYPE_LIST 
MSGTYPE_BANADD 
MSGTYPE_BANREM 

Constructor & Destructor Documentation

◆ ~CNetBan()

virtual CNetBan::~CNetBan ( )
virtualdefault

Member Function Documentation

◆ Ban()

template<class T>
int CNetBan::Ban ( T * pBanPool,
const typename T::CDataType * pData,
int Seconds,
const char * pReason,
bool VerbatimReason )
protected

◆ BanAddr()

int CNetBan::BanAddr ( const NETADDR * pAddr,
int Seconds,
const char * pReason,
bool VerbatimReason )
virtual

Reimplemented in CServerBan.

◆ BanRange()

int CNetBan::BanRange ( const CNetRange * pRange,
int Seconds,
const char * pReason )
virtual

Reimplemented in CServerBan.

◆ ConBan()

void CNetBan::ConBan ( class IConsole::IResult * pResult,
void * pUser )
static

◆ ConBanRange()

void CNetBan::ConBanRange ( class IConsole::IResult * pResult,
void * pUser )
static

◆ ConBans()

void CNetBan::ConBans ( class IConsole::IResult * pResult,
void * pUser )
static

◆ ConBansFind()

void CNetBan::ConBansFind ( class IConsole::IResult * pResult,
void * pUser )
static

◆ ConBansSave()

void CNetBan::ConBansSave ( class IConsole::IResult * pResult,
void * pUser )
static

◆ Console()

class IConsole * CNetBan::Console ( ) const
inline

◆ ConUnban()

void CNetBan::ConUnban ( class IConsole::IResult * pResult,
void * pUser )
static

◆ ConUnbanAll()

void CNetBan::ConUnbanAll ( class IConsole::IResult * pResult,
void * pUser )
static

◆ ConUnbanRange()

void CNetBan::ConUnbanRange ( class IConsole::IResult * pResult,
void * pUser )
static

◆ Init()

void CNetBan::Init ( class IConsole * pConsole,
class IStorage * pStorage )

◆ IsBanned()

bool CNetBan::IsBanned ( const NETADDR * pOrigAddr,
char * pBuf,
unsigned BufferSize ) const

◆ MakeBanInfo()

template<class T>
void CNetBan::MakeBanInfo ( const CBan< T > * pBan,
char * pBuf,
unsigned BuffSize,
int Type ) const
protected

◆ NetMatch() [1/3]

bool CNetBan::NetMatch ( const CNetRange * pRange,
const NETADDR * pAddr ) const
inlineprotected

◆ NetMatch() [2/3]

bool CNetBan::NetMatch ( const CNetRange * pRange,
const NETADDR * pAddr,
int Start,
int Length ) const
inlineprotected

◆ NetMatch() [3/3]

bool CNetBan::NetMatch ( const NETADDR * pAddr1,
const NETADDR * pAddr2 ) const
inlineprotected

◆ NetToString() [1/2]

const char * CNetBan::NetToString ( const CNetRange * pData,
char * pBuffer,
unsigned BufferSize ) const
inlineprotected

◆ NetToString() [2/2]

const char * CNetBan::NetToString ( const NETADDR * pData,
char * pBuffer,
unsigned BufferSize ) const
inlineprotected

◆ Storage()

class IStorage * CNetBan::Storage ( ) const
inline

◆ Unban()

template<class T>
int CNetBan::Unban ( T * pBanPool,
const typename T::CDataType * pData )
protected

◆ UnbanAll()

void CNetBan::UnbanAll ( )

◆ UnbanByAddr()

int CNetBan::UnbanByAddr ( const NETADDR * pAddr)

◆ UnbanByIndex()

int CNetBan::UnbanByIndex ( int Index)

◆ UnbanByRange()

int CNetBan::UnbanByRange ( const CNetRange * pRange)

◆ Update()

void CNetBan::Update ( )

Member Data Documentation

◆ m_BanAddrPool

CBanAddrPool CNetBan::m_BanAddrPool
protected

◆ m_BanRangePool

CBanRangePool CNetBan::m_BanRangePool
protected

◆ m_LocalhostIpV4

NETADDR CNetBan::m_LocalhostIpV4
protected

◆ m_LocalhostIpV6

NETADDR CNetBan::m_LocalhostIpV6
protected

◆ m_pConsole

class IConsole* CNetBan::m_pConsole
protected

◆ m_pStorage

class IStorage* CNetBan::m_pStorage
protected

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