Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CSecurity Class Reference

#include <Security.h>

List of all members.

Public Member Functions

 CSecurity ()
virtual ~CSecurity ()
POSITION GetIterator () const
CSecureRuleGetNext (POSITION &pos) const
int GetCount ()
BOOL Check (CSecureRule *pRule) const
CSecureRuleGetGUID (const GUID &pGUID) const
void Add (CSecureRule *pRule)
void Remove (CSecureRule *pRule)
void MoveUp (CSecureRule *pRule)
void MoveDown (CSecureRule *pRule)
void Ban (IN_ADDR *pAddress, int nBanLength, BOOL bMessage=TRUE)
void Clear ()
BOOL IsDenied (IN_ADDR *pAddress, LPCTSTR pszContent=NULL)
BOOL IsAccepted (IN_ADDR *pAddress, LPCTSTR pszContent=NULL)
void Expire ()
BOOL Load ()
BOOL Save (BOOL bLock=FALSE)
BOOL Import (LPCTSTR pszFile)
CXMLElementToXML (BOOL bRules=TRUE)
BOOL FromXML (CXMLElement *pXML)

Public Attributes

BOOL m_bDenyPolicy

Static Public Attributes

static LPCTSTR xmlns = _T("http://www.shareaza.com/schemas/Security.xsd")

Protected Member Functions

void Serialize (CArchive &ar)

Protected Attributes

CPtrList m_pRules


Constructor & Destructor Documentation

CSecurity::CSecurity  ) 
 

Definition at line 44 of file Security.cpp.

References m_bDenyPolicy.

CSecurity::~CSecurity  )  [virtual]
 

Definition at line 49 of file Security.cpp.

References Clear().


Member Function Documentation

void CSecurity::Add CSecureRule pRule  ) 
 

Definition at line 91 of file Security.cpp.

References m_pRules, and NULL.

Referenced by Ban(), and CSecureRuleDlg::OnOK().

void CSecurity::Ban IN_ADDR *  pAddress,
int  nBanLength,
BOOL  bMessage = TRUE
 

Definition at line 148 of file Security.cpp.

References Add(), ban2Hours, ban30Mins, ban5Mins, banForever, banSession, banWeek, GetIterator(), GetNext(), IDS_NETWORK_SECURITY_ALREADY_BLOCKED, IDS_NETWORK_SECURITY_BLOCKED, CSecureRule::m_nAction, CSecureRule::m_nExpire, CSecureRule::m_nIP, CNetwork::m_pSection, CSecureRule::m_sComment, CSecureRule::Match(), CShareazaApp::Message(), MSG_SYSTEM, Network, NULL, CSecureRule::srDeny, CSecureRule::srIndefinite, CSecureRule::srSession, and theApp.

Referenced by CShakeNeighbour::OnHeaderLine(), CUploadTransferHTTP::OnHeadersComplete(), CEDClient::OnMessage(), CUploadsWnd::OnSecurityBan(), CNeighboursWnd::OnSecurityBan(), and CBaseMatchWnd::OnSecurityBan().

BOOL CSecurity::Check CSecureRule pRule  )  const
 

Definition at line 72 of file Security.cpp.

References m_pRules, and NULL.

Referenced by CSecurityWnd::GetItem(), CSecureRuleDlg::OnInitDialog(), and CSecureRuleDlg::OnOK().

void CSecurity::Clear  ) 
 

Definition at line 136 of file Security.cpp.

References GetIterator(), GetNext(), and m_pRules.

Referenced by Serialize(), and ~CSecurity().

void CSecurity::Expire  ) 
 

Definition at line 342 of file Security.cpp.

References GetIterator(), GetNext(), CSecureRule::IsExpired(), CSecureRule::m_nExpire, m_pRules, and NULL.

Referenced by CSecurityWnd::Update().

BOOL CSecurity::FromXML CXMLElement pXML  ) 
 

Definition at line 469 of file Security.cpp.

References GUIDX::Decode(), CSecureRule::FromXML(), CXMLElement::GetAttributeValue(), CXMLElement::GetElementIterator(), GetGUID(), CXMLElement::GetNextElement(), CXMLNode::IsNamed(), CSecureRule::m_pGUID, m_pRules, and NULL.

Referenced by Import().

int CSecurity::GetCount  ) 
 

Definition at line 67 of file Security.cpp.

References m_pRules.

Referenced by CSecurityWnd::OnTimer(), and Serialize().

CSecureRule * CSecurity::GetGUID const GUID &  pGUID  )  const
 

Definition at line 77 of file Security.cpp.

References CSecureRule::m_pGUID, m_pRules, and NULL.

Referenced by FromXML().

POSITION CSecurity::GetIterator  )  const
 

Definition at line 57 of file Security.cpp.

References m_pRules.

Referenced by Ban(), Clear(), Expire(), IsDenied(), Serialize(), ToXML(), and CSecurityWnd::Update().

CSecureRule * CSecurity::GetNext POSITION &  pos  )  const
 

Definition at line 62 of file Security.cpp.

References m_pRules.

Referenced by Ban(), Clear(), Expire(), IsDenied(), Serialize(), ToXML(), and CSecurityWnd::Update().

BOOL CSecurity::Import LPCTSTR  pszFile  ) 
 

Definition at line 519 of file Security.cpp.

References CBuffer::EnsureBuffer(), CXMLElement::FromBytes(), CSecureRule::FromGnucleusString(), FromXML(), CBuffer::m_nLength, CBuffer::m_pBuffer, m_pRules, CNetwork::m_pSection, Network, NULL, and CBuffer::ReadLine().

Referenced by CSecurityWnd::OnSecurityImport().

BOOL CSecurity::IsAccepted IN_ADDR *  pAddress,
LPCTSTR  pszContent = NULL
 

Definition at line 334 of file Security.cpp.

References IsDenied().

Referenced by CDatagrams::TryRead().

BOOL CSecurity::IsDenied IN_ADDR *  pAddress,
LPCTSTR  pszContent = NULL
 

Definition at line 304 of file Security.cpp.

References GetIterator(), GetNext(), CSecureRule::IsExpired(), m_bDenyPolicy, CSecureRule::m_nAction, CSecureRule::m_nEver, CSecureRule::m_nExpire, CSecureRule::m_nToday, m_pRules, CNetwork::m_pSection, CSecureRule::Match(), Network, NULL, CSecureRule::srAccept, and CSecureRule::srDeny.

Referenced by CHandshakes::AcceptCheck(), CHandshakes::AcceptConnection(), CHostCacheList::Add(), CMatchList::AddHits(), CEDClients::Connect(), CNeighboursWithConnect::ConnectTo(), CConnection::ConnectTo(), IsAccepted(), CNeighbour::OnCommonHit(), CEDClient::OnFileRequest(), CDatagrams::OnHit(), CG1Neighbour::OnPong(), CG2Neighbour::OnPush(), CG1Neighbour::OnPush(), CDatagrams::OnPush(), CDatagrams::OnQuery(), and CDatagrams::Send().

BOOL CSecurity::Load  ) 
 

Definition at line 362 of file Security.cpp.

References CSettings::General, Serialize(), Settings, and CSettings::sGeneral::UserPath.

Referenced by CShareazaApp::InitInstance().

void CSecurity::MoveDown CSecureRule pRule  ) 
 

Definition at line 121 of file Security.cpp.

References m_pRules, and NULL.

Referenced by CSecurityWnd::OnSecurityMoveDown().

void CSecurity::MoveUp CSecureRule pRule  ) 
 

Definition at line 106 of file Security.cpp.

References m_pRules, and NULL.

Referenced by CSecurityWnd::OnSecurityMoveUp().

void CSecurity::Remove CSecureRule pRule  ) 
 

Definition at line 99 of file Security.cpp.

References m_pRules.

Referenced by CSecurityWnd::OnSecurityRemove(), and CSecureRule::Remove().

BOOL CSecurity::Save BOOL  bLock = FALSE  ) 
 

Definition at line 386 of file Security.cpp.

References CSettings::General, CNetwork::m_pSection, Network, Serialize(), Settings, and CSettings::sGeneral::UserPath.

Referenced by CShareazaApp::ExitInstance(), CSecurityWnd::OnDestroy(), CSecurityWnd::OnSecurityAdd(), CSecurityWnd::OnSecurityEdit(), CSecurityWnd::OnSecurityImport(), CSecurityWnd::OnSecurityMoveDown(), CSecurityWnd::OnSecurityMoveUp(), CSecurityWnd::OnSecurityRemove(), and CSecurityWnd::OnSecurityReset().

void CSecurity::Serialize CArchive &  ar  )  [protected]
 

Definition at line 409 of file Security.cpp.

References Clear(), GetCount(), GetIterator(), GetNext(), CSecureRule::IsExpired(), m_bDenyPolicy, m_pRules, NULL, and CSecureRule::Serialize().

Referenced by Load(), and Save().

CXMLElement * CSecurity::ToXML BOOL  bRules = TRUE  ) 
 

Definition at line 453 of file Security.cpp.

References CXMLElement::AddAttribute(), CXMLElement::AddElement(), GetIterator(), GetNext(), NULL, and xmlns.


Member Data Documentation

BOOL CSecurity::m_bDenyPolicy
 

Definition at line 40 of file Security.h.

Referenced by CSecureRule::CSecureRule(), CSecurity(), IsDenied(), CSecurityWnd::OnSecurityPolicyAccept(), CSecurityWnd::OnSecurityPolicyDeny(), CSecurityWnd::OnUpdateSecurityPolicyAccept(), CSecurityWnd::OnUpdateSecurityPolicyDeny(), Serialize(), and CSecurityWnd::Update().

CPtrList CSecurity::m_pRules [protected]
 

Definition at line 42 of file Security.h.

Referenced by Add(), Check(), Clear(), Expire(), FromXML(), GetCount(), GetGUID(), GetIterator(), GetNext(), Import(), IsDenied(), MoveDown(), MoveUp(), Remove(), and Serialize().

LPCTSTR CSecurity::xmlns = _T("http://www.shareaza.com/schemas/Security.xsd") [static]
 

Definition at line 451 of file Security.cpp.

Referenced by CSecurityWnd::OnSecurityExport(), and ToXML().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:11 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2