Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

clone.h File Reference

Clone system headers. More...

Go to the source code of this file.

Classes

struct  hostclonestruct
struct  trigger_rule
 Trigger rewrite rule database item structure. More...

struct  userclonestruct
 Structure describing a username trigger. More...


Typedefs

typedef userclonestruct UserClone
 A user@ clone trigger element.

typedef hostclonestruct HostClone
 clone trigger element

typedef trigger_rule CloneRule
 A clonerule element.


Functions

CloneRuleGetCrule (char *)
 Retrieve a clone rule by mask or number for oper edit purposes.

CloneRuleGetCruleMatch (char *)
 Find any matching rules.

CloneRuleNewCrule ()
 Creates a new clone rule object.

void AddCrule (CloneRule *, int)
 Add an alocated rule rule to the linked list at point 'n'.

void RemoveCrule (CloneRule *)
 Remove a clone rule from the linked list.

void UpdateCrule (CloneRule, CloneRule *)
int addClone (char *, char *, char *)
 Registers an online user with the clone detection system.

void delClone (char *, char *)
 Remove a client from the clone database.

HostClonegetCloneData (char *)
 Retrieves the clone information for a machine.

UserCloneaddUserClone (HostClone *, char *)
 Adds a user's username information to the user clone database for their hostname.

void delUserClone (HostClone *, UserClone *)
 Delete information on a user@ from a cloneinfo machine item.

UserClonegetUserCloneData (HostClone *, char *)
 Get clone-detection-related information on a user from a host clone record and knowledge of a username.

void initCloneData (HostClone *)
 Initializes a clone host detection structure.


Variables

CloneRulefirst_crule


Detailed Description

Clone system headers.

Constants and structure data used by clone detection

Author:
Chip Norkus

Max Byrd

Greg Poma

James Hess

Date:
1996-1997, 2000-2001
Id
clone.h,v 1.1.1.1 2003/07/04 02:51:58 Mysid Exp

Definition in file clone.h.


Function Documentation

int addClone char *  nick,
char *  user,
char *  host
 

Registers an online user with the clone detection system.

Parameters:
nick Nickname of client signing on
user Username of client signing on
host Hostname of client signing on
Returns:
Normally returns 0, returns 1 if clones are killed and should not be registered with the online users database.
Warning:
If 1 is returned then no online user structure has been affected, only a KILL message has been dispatched, and the user has not been registered with the clone database but instead been rejected.

Definition at line 486 of file clone.c.

References add_palert(), addUserClone(), clonehashent::clone, CLONE_ALERT, CLONE_IGNOREFLAG, CLONE_KILLFLAG, CLONE_OK, CloneHash, CloneRule, userclonestruct::clones, hostclonestruct::clones, delClone(), find_palert(), firstClone, trigger_rule::flags, hostclonestruct::flags, getCloneData(), GetCruleMatch(), getHashKey(), hostclonestruct::hashnext, hostclonestruct::hashprev, hostclonestruct::host, HostClone, initCloneData(), trigger_rule::kill_msg, clonehashent::lastclone, lastClone, make_palert(), MakeUserHost(), hostclonestruct::next, NickServ, oalloc(), OperServ, hostclonestruct::previous, sSend(), userclonestruct::trigger, hostclonestruct::trigger, trigger_rule::trigger, userclonestruct::uflags, updateCloneAlerts(), UserClone, and trigger_rule::warn_msg.

Referenced by addNewUser().

void AddCrule CloneRule rule,
int  n
 

Add an alocated rule rule to the linked list at point 'n'.

Parameters:
rule Item to add to rule linklist
n Point to insert item into list at

Definition at line 344 of file clone.c.

References CloneRule, first_crule, and trigger_rule::next.

Referenced by readTriggerData().

UserClone* addUserClone HostClone hc,
char *  user
 

Adds a user's username information to the user clone database for their hostname.

Parameters:
hc Host-wide clone information
user Userid of the person being added
Returns:
The user clone object created or found is returned.
Bug:
There may be a problem in the logic handling of user@ rules verses rules maybe mask should be changed to simply 'host' instead of [<user>]host

Definition at line 614 of file clone.c.

References CloneRule, userclonestruct::clones, hostclonestruct::firstUser, trigger_rule::flags, hostclonestruct::flags, GetCruleMatch(), getUserCloneData(), hostclonestruct::host, HostClone, hostclonestruct::lastUser, MakeUserHost(), userclonestruct::next, oalloc(), userclonestruct::previous, trigger_rule::trigger, hostclonestruct::trigger, userclonestruct::trigger, userclonestruct::user, UserClone, and trigger_rule::utrigger.

Referenced by addClone().

void delClone char *  user,
char *  host
 

Remove a client from the clone database.

Parameters:
user Username of client logging off
host Hostname of client logging off

Definition at line 663 of file clone.c.

References clonehashent::clone, CLONE_ALERT, CloneHash, userclonestruct::clones, hostclonestruct::clones, CTime, delUserClone(), find_palert(), firstClone, hostclonestruct::flags, free_palert(), getCloneData(), getHashKey(), getUserCloneData(), hostclonestruct::hashnext, hostclonestruct::hashprev, hostclonestruct::host, HostClone, clonehashent::lastclone, lastClone, hostclonestruct::next, hostclonestruct::previous, remove_palert(), userclonestruct::trigger, hostclonestruct::trigger, userclonestruct::uflags, and UserClone.

Referenced by addClone(), and remUser().

HostClone* getCloneData char *  host  ) 
 

Retrieves the clone information for a machine.

Parameters:
host Hostname to retrieve information on

Definition at line 752 of file clone.c.

References clonehashent::clone, CloneHash, getHashKey(), hostclonestruct::hashnext, hostclonestruct::host, and HostClone.

Referenced by addClone(), and delClone().

CloneRule* GetCrule char *  mask  ) 
 

Retrieve a clone rule by mask or number for oper edit purposes.

Parameters:
mask Name of mask or index number to search for
Returns:
A clone rule object or a NULL pointer indicating that the sought item could not be found.

Definition at line 289 of file clone.c.

References CloneRule, first_crule, trigger_rule::mask, mask(), and trigger_rule::next.

CloneRule* GetCruleMatch char *  host  ) 
 

Find any matching rules.

Parameters:
host Address of user
Returns:
A matching clone rule object or a null pointer for no match conditions

Definition at line 315 of file clone.c.

References CloneRule, first_crule, trigger_rule::mask, match(), and trigger_rule::next.

Referenced by addClone(), and addUserClone().

void initCloneData HostClone hc  ) 
 

Initializes a clone host detection structure.

Parameters:
hc Pointer to clone host object to initialize

Definition at line 463 of file clone.c.

References hostclonestruct::clones, hostclonestruct::firstUser, hostclonestruct::flags, hostclonestruct::hashnext, hostclonestruct::hashprev, hostclonestruct::host, HostClone, hostclonestruct::lastUser, hostclonestruct::next, hostclonestruct::previous, and hostclonestruct::trigger.

Referenced by addClone().

CloneRule* NewCrule  ) 
 

Creates a new clone rule object.

Returns:
A pointer to a newly created clone rule item, any failure is fatal.

Definition at line 334 of file clone.c.

References CloneRule, and oalloc().

Referenced by readTriggerData().

void RemoveCrule CloneRule zap  ) 
 

Remove a clone rule from the linked list.

Parameters:
zap Rule to remove

Definition at line 444 of file clone.c.

References CloneRule, first_crule, and trigger_rule::next.

void UpdateCrule CloneRule  orig,
CloneRule rule
 

Apply a crule to a trigger if they are in sync

'orig' is what the rule looked like before the update and is used for the 'sync' determination

A rule that is in sync with a trigger either completely matches the trigger or if the trigger completely matches the defaults.

Definition at line 399 of file clone.c.

References CloneRule, firstClone, hostclonestruct::firstUser, trigger_rule::flags, hostclonestruct::flags, hostclonestruct::host, HostClone, MakeUserHost(), trigger_rule::mask, match(), userclonestruct::next, hostclonestruct::next, userclonestruct::trigger, trigger_rule::trigger, hostclonestruct::trigger, userclonestruct::user, UserClone, and trigger_rule::utrigger.


Variable Documentation

CloneRule* first_crule
 

First clone rule item

Definition at line 132 of file clone.h.

Referenced by AddCrule(), GetCrule(), GetCruleMatch(), RemoveCrule(), and saveTriggerData().


Generated at Sat Oct 25 20:56:11 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.