#include "services.h"
#include "nickserv.h"
#include "hash.h"
Go to the source code of this file.
Classes | |
| struct | pending_alert |
Functions | |
| pending_alert * | find_palert (HostClone *hc) |
| Find a pending clone alert. | |
| pending_alert * | make_palert () |
| Create a new clone alert. | |
| void | free_palert (struct pending_alert *pArg) |
| void | add_palert (struct pending_alert *pArg) |
| Add a clone alert to the list. | |
| void | remove_palert (struct pending_alert *pZap) |
| A clone alert is removed from the list. | |
| void | listCloneAlerts (UserList *nick) |
| Send the list of clone alerts to a user /OS TRIGGER LIST. | |
| time_t | updateCloneAlerts (time_t aval) |
| Update clone alerts. | |
| CloneRule * | GetCrule (char *mask) |
| Retrieve a clone rule by mask or number for oper edit purposes. | |
| CloneRule * | GetCruleMatch (char *host) |
| Find any matching rules. | |
| CloneRule * | NewCrule () |
| Creates a new clone rule object. | |
| void | AddCrule (CloneRule *rule, int n) |
| Add an alocated rule rule to the linked list at point 'n'. | |
| char * | MakeUserHost (char *user, char *host) |
| Build a user mask for the purpose of crule checking. | |
| void | UpdateCrule (CloneRule orig, CloneRule *rule) |
| void | RemoveCrule (CloneRule *zap) |
| Remove a clone rule from the linked list. | |
| void | initCloneData (HostClone *hc) |
| Initializes a clone host detection structure. | |
| int | addClone (char *nick, char *user, char *host) |
| Registers an online user with the clone detection system. | |
| UserClone * | addUserClone (HostClone *hc, char *user) |
| Adds a user's username information to the user clone database for their hostname. | |
| void | delClone (char *user, char *host) |
| Remove a client from the clone database. | |
| void | delUserClone (HostClone *hc, UserClone *uc) |
| Delete information on a user@ from a cloneinfo machine item. | |
| HostClone * | getCloneData (char *host) |
| Retrieves the clone information for a machine. | |
| UserClone * | getUserCloneData (HostClone *hc, char *user) |
| Get clone-detection-related information on a user from a host clone record and knowledge of a username. | |
Variables | |
| HostClone * | firstClone = NULL |
| HostClone * | lastClone = NULL |
| CloneRule * | first_crule = NULL |
| pending_alert * | pendingAlerts |
| List of pending clone alerts. | |
Procedures found in this module are used for tracking and alerting the network to the presence of possible clonebots.
Max Byrd
Greg Poma
James Hess
Definition in file clone.c.
|
|
Add a clone alert to the list.
Definition at line 130 of file clone.c. References pending_alert::next, and pendingAlerts. Referenced by addClone(). |
|
||||||||||||||||
|
||||||||||||
|
Add an alocated rule rule to the linked list at point 'n'.
Definition at line 344 of file clone.c. References CloneRule, first_crule, and trigger_rule::next. Referenced by readTriggerData(). |
|
||||||||||||
|
Adds a user's username information to the user clone database for their hostname.
Definition at line 614 of file clone.c. References CloneRule, userclonestruct::clones, hostclonestruct::firstUser, hostclonestruct::flags, trigger_rule::flags, GetCruleMatch(), getUserCloneData(), hostclonestruct::host, HostClone, hostclonestruct::lastUser, MakeUserHost(), userclonestruct::next, oalloc(), userclonestruct::previous, userclonestruct::trigger, hostclonestruct::trigger, trigger_rule::trigger, userclonestruct::user, UserClone, and trigger_rule::utrigger. Referenced by addClone(). |
|
||||||||||||
|
Remove a client from the clone database.
Definition at line 663 of file clone.c. References clonehashent::clone, CLONE_ALERT, CloneHash, hostclonestruct::clones, userclonestruct::clones, CTime, delUserClone(), find_palert(), firstClone, hostclonestruct::flags, free_palert(), getCloneData(), getHashKey(), getUserCloneData(), hostclonestruct::hashnext, hostclonestruct::hashprev, hostclonestruct::host, HostClone, lastClone, clonehashent::lastclone, hostclonestruct::next, hostclonestruct::previous, remove_palert(), hostclonestruct::trigger, userclonestruct::trigger, userclonestruct::uflags, and UserClone. Referenced by addClone(), and remUser(). |
|
|
Find a pending clone alert.
Definition at line 86 of file clone.c. References HostClone, pending_alert::next, and pendingAlerts. Referenced by addClone(), and delClone(). |
|
|
Definition at line 118 of file clone.c. Referenced by delClone(). |
|
|
Retrieves the clone information for a machine.
Definition at line 752 of file clone.c. References clonehashent::clone, CloneHash, getHashKey(), hostclonestruct::hashnext, hostclonestruct::host, and HostClone. Referenced by addClone(), and delClone(). |
|
|
Retrieve a clone rule by mask or number for oper edit purposes.
Definition at line 289 of file clone.c. References CloneRule, first_crule, mask(), trigger_rule::mask, and trigger_rule::next. |
|
|
Find any matching rules.
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(). |
|
|
Initializes a clone host detection structure.
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(). |
|
|
Send the list of clone alerts to a user /OS TRIGGER LIST.
Definition at line 170 of file clone.c. References CLONE_ALERT, CLONE_OK, hostclonestruct::clones, userclonestruct::clones, CTime, hostclonestruct::firstUser, hostclonestruct::host, HostClone, pending_alert::next, userclonestruct::next, _userlist::nick, OperServ, pendingAlerts, sSend(), hostclonestruct::trigger, userclonestruct::trigger, userclonestruct::uflags, userclonestruct::user, and UserClone. |
|
|
Create a new clone alert.
Definition at line 100 of file clone.c. References trigger_rule::next, and oalloc(). Referenced by addClone(). |
|
||||||||||||
|
Build a user mask for the purpose of crule checking.
Definition at line 379 of file clone.c. Referenced by addClone(), addUserClone(), and UpdateCrule(). |
|
|
Creates a new clone rule object.
Definition at line 334 of file clone.c. References CloneRule, and oalloc(). Referenced by readTriggerData(). |
|
|
A clone alert is removed from the list.
Definition at line 146 of file clone.c. References trigger_rule::next, pending_alert::next, and pendingAlerts. Referenced by delClone(). |
|
|
Remove a clone rule from the linked list.
Definition at line 444 of file clone.c. References CloneRule, first_crule, and trigger_rule::next. |
|
|
Update clone alerts.
Definition at line 219 of file clone.c. References CLONE_ALERT, CLONE_OK, hostclonestruct::clones, userclonestruct::clones, CTime, hostclonestruct::firstUser, hostclonestruct::flags, hostclonestruct::host, HostClone, pending_alert::next, userclonestruct::next, OperServ, pendingAlerts, sSend(), hostclonestruct::trigger, userclonestruct::trigger, userclonestruct::uflags, userclonestruct::user, and UserClone. Referenced by addClone(), and main(). |
|
||||||||||||
|
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, hostclonestruct::flags, trigger_rule::flags, hostclonestruct::host, HostClone, MakeUserHost(), trigger_rule::mask, match(), hostclonestruct::next, userclonestruct::next, hostclonestruct::trigger, trigger_rule::trigger, userclonestruct::trigger, userclonestruct::user, UserClone, and trigger_rule::utrigger. |
|
|
First clone rule item Definition at line 52 of file clone.c. Referenced by AddCrule(), GetCrule(), GetCruleMatch(), RemoveCrule(), and saveTriggerData(). |
|
|
List of clone info items Definition at line 50 of file clone.c. Referenced by addClone(), delClone(), and UpdateCrule(). |
|
|
Last entry in clone info items Definition at line 51 of file clone.c. Referenced by addClone(), and delClone(). |
|
|
List of pending clone alerts. A pending clone alert item To be valid 'hc' must point to a valid hostclone record and next must be a null pointer or point to a valid pending_alert record. Referenced by add_palert(), find_palert(), listCloneAlerts(), remove_palert(), and updateCloneAlerts(). |