ReplicaNet and RNLobby  1
Security.h
1 /* START_LICENSE_HEADER
2 
3 Copyright (C) 2000 Martin Piper, original design and program code
4 Copyright (C) 2001 Replica Software
5 
6 This program file is copyright (C) Replica Software and can only be used under license.
7 For more information visit: http://www.replicanet.com/
8 Or email: info@replicanet.com
9 
10 END_LICENSE_HEADER */
11 #include "RNPlatform/Inc/MemoryTracking.h"
12 #ifndef _RNLOBBY_SECURITY_H_
13 #define _RNLOBBY_SECURITY_H_
14 #include "RNODBCSQL/Inc/ODBCSQL.h"
15 #include "RNODBCSQL/Inc/Prepare.h"
16 #include "RNLog/Inc/Log.h"
17 #include "RNXPSockets/Inc/XPSockets.h"
18 
19 namespace RNReplicaNet
20 {
21 
22 namespace RNLobby
23 {
24 
29 class Security : public ThreadClass , public Thread
30 {
31 public:
32  Security(const char *lobbyDSN);
33  virtual ~Security();
34 
35  bool Start(void);
36 
37  bool Stop(void);
38 
39  int GetTotalNumBlocked( void );
40 
41  void SetSecurityRoute( const char *securityRoute );
42  void SetMaxCurrentBlocks( const int maxCurrentBlocks = 1000 );
43 
44  static int GetNumBlockedThisSession(void);
45 
46  void RemoveAllBlocksNow(void);
47 
48 protected:
49  int ThreadEntry(void);
50 
51 private:
52  void ThreadExiting(const int returnCode);
53 
54  RNReplicaNet::RNLog::Log mLog;
55  RNReplicaNet::RNODBCSQL::ODBCSQL mRead , mWrite;
56  RNReplicaNet::RNODBCSQL::Prepare mPreparedInsertIPBlock;
57  RNReplicaNet::RNODBCSQL::Prepare mPreparedDeleteIPBlock;
58 
59  std::string mSecurityRoute;
60  size_t mMaxCurrentBlocks;
61 
62  void AddOrRemoveRouting( const XPAddress &addr , const bool add , const std::string &naughtyIP , const std::string &textBlock , const std::string &triedLogin );
63 };
64 
65 
66 } // namespace RNLobby
67 
68 } // namespace RNReplicaNet
69 
70 #endif
Definition: XPSocket.h:91
Definition: Security.h:29
Definition: ThreadClass.h:96
Definition: Thread.h:29