Example #1
0
boolean MaskedMemHash::HashMatch(list<idmer>& match_list){
	//check that there is at least one forward component
	match_list.sort(&idmer_id_lessthan);
	// initialize the hash entry
	MatchHashEntry mhe = MatchHashEntry(seq_count, GetSar(0)->SeedLength());
	mhe.SetLength(GetSar(0)->SeedLength());
	
	//Fill in the new Match and set direction parity if needed.
	list<idmer>::iterator iter = match_list.begin();
	for(; iter != match_list.end(); iter++)
		mhe.SetStart(iter->id, iter->position + 1);
	SetDirection(mhe);
	mhe.CalculateOffset();
	uint64 match_number = 0;
	// compute "MatchNumber"
	for( uint seqI = 0; seqI < mhe.SeqCount(); seqI++ )
	{
		match_number <<= 1;
		if( mhe.Start(seqI) != NO_MATCH )
			match_number |= 1;
	}
	if( seq_mask == 0 || match_number == seq_mask )
		AddHashEntry(mhe);

	return true;
}
/** We use this constructor only to create the 'root' item, Utils->TreeRoot, which
 * represents our own server. Therefore, it has no route, no parent, and
 * no socket associated with it. Its version string is our own local version.
 */
TreeServer::TreeServer()
	: Server(ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc)
	, Parent(NULL), Route(NULL)
	, VersionString(ServerInstance->GetVersionString())
	, fullversion(ServerInstance->GetVersionString(true))
	, Socket(NULL), sid(ServerInstance->Config->GetSID()), ServerUser(ServerInstance->FakeClient)
	, age(ServerInstance->Time()), Warned(false), bursting(false), UserCount(ServerInstance->Users.GetLocalUsers().size())
	, OperCount(0), rtt(0), StartBurst(0), Hidden(false)
{
	AddHashEntry();
}
Example #3
0
/** We use this constructor only to create the 'root' item, Utils->TreeRoot, which
 * represents our own server. Therefore, it has no route, no parent, and
 * no socket associated with it. Its version string is our own local version.
 */
TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc) : ServerInstance(Instance), ServerName(Name.c_str()), ServerDesc(Desc), Utils(Util)
{
	Parent = NULL;
	VersionString.clear();
	UserCount = ServerInstance->UserCount();
	OperCount = ServerInstance->OperCount();
	VersionString = ServerInstance->GetVersionString();
	Route = NULL;
	Socket = NULL; /* Fix by brain */
	rtt = LastPing = 0;
	Hidden = false;
	AddHashEntry();
}
Example #4
0
/** We use this constructor only to create the 'root' item, Utils->TreeRoot, which
 * represents our own server. Therefore, it has no route, no parent, and
 * no socket associated with it. Its version string is our own local version.
 */
TreeServer::TreeServer()
	: Server(ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc)
	, Parent(NULL), Route(NULL)
	, VersionString(ServerInstance->GetVersionString())
	, fullversion(ServerInstance->GetVersionString(true))
	, rawversion(INSPIRCD_VERSION)
	, Socket(NULL), sid(ServerInstance->Config->GetSID()), behind_bursting(0), isdead(false)
	, pingtimer(this)
	, ServerUser(ServerInstance->FakeClient)
	, age(ServerInstance->Time()), UserCount(ServerInstance->Users.LocalUserCount())
	, OperCount(0), rtt(0), StartBurst(0), Hidden(false)
{
	AddHashEntry();
}
Example #5
0
/** We use this constructor only to create the 'root' item, Utils->TreeRoot, which
 * represents our own server. Therefore, it has no route, no parent, and
 * no socket associated with it. Its version string is our own local version.
 */
TreeServer::TreeServer(SpanningTreeUtilities* Util, std::string Name, std::string Desc, const std::string &id)
	: ServerName(Name.c_str()), ServerDesc(Desc), Utils(Util), ServerUser(ServerInstance->FakeClient)
{
	age = ServerInstance->Time();
	bursting = false;
	Parent = NULL;
	VersionString.clear();
	UserCount = OperCount = 0;
	VersionString = ServerInstance->GetVersionString();
	Route = NULL;
	Socket = NULL; /* Fix by brain */
	StartBurst = rtt = 0;
	Warned = Hidden = false;
	AddHashEntry();
	SetID(id);
}