summaryrefslogtreecommitdiff
path: root/include/users.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/users.h')
-rw-r--r--include/users.h58
1 files changed, 18 insertions, 40 deletions
diff --git a/include/users.h b/include/users.h
index 23a520fe0..624017eee 100644
--- a/include/users.h
+++ b/include/users.h
@@ -80,21 +80,23 @@ class CoreExport ConnectClass : public classbase
/** Type of line, either CC_ALLOW or CC_DENY
*/
char type;
+
/** Connect class name
*/
std::string name;
+
/** Max time to register the connection in seconds
*/
unsigned int registration_timeout;
- /** Number of lines in buffer before excess flood is triggered
- */
- unsigned int flood;
+
/** Host mask for this line
*/
std::string host;
+
/** Number of seconds between pings for this line
*/
unsigned int pingtime;
+
/** (Optional) Password for this line
*/
std::string pass;
@@ -103,10 +105,6 @@ class CoreExport ConnectClass : public classbase
*/
std::string hash;
- /** Threshold value for flood disconnect
- */
- unsigned int threshold;
-
/** Maximum size of sendq for users in this class (bytes)
*/
unsigned long sendqmax;
@@ -136,8 +134,8 @@ public:
/** Create a new connect class based on an existing connect class. This is required for std::vector (at least under windows).
*/
ConnectClass(const ConnectClass* source) : classbase(), type(source->type), name(source->name),
- registration_timeout(source->registration_timeout), flood(source->flood), host(source->host),
- pingtime(source->pingtime), pass(source->pass), hash(source->hash), threshold(source->threshold), sendqmax(source->sendqmax),
+ registration_timeout(source->registration_timeout), host(source->host),
+ pingtime(source->pingtime), pass(source->pass), hash(source->hash), sendqmax(source->sendqmax),
recvqmax(source->recvqmax), maxlocal(source->maxlocal), maxglobal(source->maxglobal), maxchans(source->maxchans),
port(source->port), RefCount(0), disabled(false), limit(source->limit)
{
@@ -145,37 +143,35 @@ public:
/** Create a new connect class with no settings.
*/
- ConnectClass() : type(CC_DENY), name("unnamed"), registration_timeout(0), flood(0), host(""), pingtime(0), pass(""), hash(""),
- threshold(0), sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0), RefCount(0), disabled(false), limit(0)
+ ConnectClass() : type(CC_DENY), name("unnamed"), registration_timeout(0), host(""), pingtime(0), pass(""), hash(""),
+ sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0), RefCount(0), disabled(false), limit(0)
{
}
/** Create a new connect class to ALLOW connections.
* @param thename Name of the connect class
* @param timeout The registration timeout
- * @param fld The flood value
* @param hst The IP mask to allow
* @param ping The ping frequency
* @param pas The password to be used
* @param hsh The hash to be used
- * @param thres The flooding threshold
* @param sendq The maximum sendq value
* @param recvq The maximum recvq value
* @param maxl The maximum local sessions
* @param maxg The maximum global sessions
*/
- ConnectClass(const std::string &thename, unsigned int timeout, unsigned int fld, const std::string &hst, unsigned int ping,
- const std::string &pas, const std::string &hsh, unsigned int thres, unsigned long sendq, unsigned long recvq,
+ ConnectClass(const std::string &thename, unsigned int timeout,const std::string &hst, unsigned int ping,
+ const std::string &pas, const std::string &hsh, unsigned long sendq, unsigned long recvq,
unsigned long maxl, unsigned long maxg, unsigned int maxc, int p = 0) :
- type(CC_ALLOW), name(thename), registration_timeout(timeout), flood(fld), host(hst), pingtime(ping), pass(pas), hash(hsh),
- threshold(thres), sendqmax(sendq), recvqmax(recvq), maxlocal(maxl), maxglobal(maxg), maxchans(maxc), port(p), RefCount(0), disabled(false), limit(0) { }
+ type(CC_ALLOW), name(thename), registration_timeout(timeout), host(hst), pingtime(ping), pass(pas), hash(hsh),
+ sendqmax(sendq), recvqmax(recvq), maxlocal(maxl), maxglobal(maxg), maxchans(maxc), port(p), RefCount(0), disabled(false), limit(0) { }
/** Create a new connect class to DENY connections
* @param thename Name of the connect class
* @param hst The IP mask to deny
*/
ConnectClass(const std::string &thename, const std::string &hst) : type(CC_DENY), name(thename), registration_timeout(0),
- flood(0), host(hst), pingtime(0), pass(""), hash(""), threshold(0), sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0), maxchans(0), port(0), RefCount(0), disabled(false), limit(0)
+ host(hst), pingtime(0), pass(""), hash(""), sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0), maxchans(0), port(0), RefCount(0), disabled(false), limit(0)
{
}
@@ -184,8 +180,8 @@ public:
* @param source Another connect class to inherit all but the name from
*/
ConnectClass(const std::string &thename, const ConnectClass* source) : type(source->type), name(thename),
- registration_timeout(source->registration_timeout), flood(source->flood), host(source->host),
- pingtime(source->pingtime), pass(source->pass), hash(source->hash), threshold(source->threshold), sendqmax(source->sendqmax),
+ registration_timeout(source->registration_timeout), host(source->host),
+ pingtime(source->pingtime), pass(source->pass), hash(source->hash), sendqmax(source->sendqmax),
recvqmax(source->recvqmax), maxlocal(source->maxlocal), maxglobal(source->maxglobal), maxchans(source->maxchans),
port(source->port), RefCount(0), disabled(false), limit(source->limit)
{
@@ -203,22 +199,18 @@ public:
/* Update an existing entry with new values
*/
- void Update(unsigned int timeout, unsigned int fld, const std::string &hst, unsigned int ping,
- const std::string &pas, unsigned int thres, unsigned long sendq, unsigned long recvq,
+ void Update(unsigned int timeout, const std::string &hst, unsigned int ping,
+ const std::string &pas, unsigned long sendq, unsigned long recvq,
unsigned long maxl, unsigned long maxg, unsigned int maxc, int p, unsigned long llimit)
{
if (timeout)
registration_timeout = timeout;
- if (fld)
- flood = fld;
if (!hst.empty())
host = hst;
if (ping)
pingtime = ping;
if (!pas.empty())
pass = pas;
- if (thres)
- threshold = thres;
if (sendq)
sendqmax = sendq;
if (recvq)
@@ -279,13 +271,6 @@ public:
return (registration_timeout ? registration_timeout : 90);
}
- /** Returns the flood limit
- */
- unsigned int GetFlood()
- {
- return (threshold ? flood : 999);
- }
-
/** Returns the allowed or denied IP mask
*/
const std::string& GetHost()
@@ -328,13 +313,6 @@ public:
return hash;
}
- /** Returns the flood threshold value
- */
- unsigned int GetThreshold()
- {
- return (threshold ? threshold : 1);
- }
-
/** Returns the maximum sendq value
*/
unsigned long GetSendqMax()