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

mass.c File Reference

Ad detection. More...

#include "services.h"
#include "log.h"
#include "nickserv.h"
#include "mass.h"

Go to the source code of this file.

Functions

void insert_ad (aMassAd *insert_this)
 Insert a new ad structure into a user mass list.

 LIST_HEAD (, _mass_ad) masslist
void detect_mass (UserList *nl_from, char *buf, int which)
 handle an incoming message to a MassServ fake client

aMassAdfind_ad (UserList *u, int rcv)
 Cancel mass ad cache from a user.

void expire_ads (void)
void flush_ad (UserList *foo)
void remove_ad (aMassAd *zap)
void unlink_ad (aMassAd *zap)
char ranchar (int typ)
char * ranstring (char *inbuf, int maxlen, int typ)
char * make_clone ()
 Make a fake mass client.

void adCloneMaintenance ()
 Maintain the advert detection bots' presence and expire old advert information periodically.

int adCheck (UserList *nl_from, char *nm_target, char *args[], int numargs)
 Check if a message is addressed to an ad bot.

void timed_advert_maint (char *a)
 Timed maintenance of the ad detection system, every 5 minutes.


Variables

char * massAdClones [5] = {}
const char s_MassBot [] = "MassServ"


Detailed Description

Ad detection.

Procedures to help rid a network of unauthorized mass ads!

Author:
James Hess
Date:
2001-2002
Id
mass.c,v 1.1.1.1 2003/07/04 02:54:29 Mysid Exp

Definition in file mass.c.


Function Documentation

int adCheck UserList nl_from,
char *  nm_target,
char *  args[],
int  numargs
 

Check if a message is addressed to an ad bot.

Returns:
0=no, 1=yes

Definition at line 421 of file mass.c.

References detect_mass(), and parse_str().

Referenced by parseLine().

void detect_mass UserList nl_from,
char *  buf,
int  which
 

handle an incoming message to a MassServ fake client

Parameters:
source Sender nickname
buf Message text
which Value indicating which client received the message

Definition at line 59 of file mass.c.

References corelog, expire_ads(), find_ad(), flush_ad(), insert_ad(), logDump(), _userlist::nick, oalloc(), _mass_ad::rcvd_by, _mass_ad::sender, sSend(), and _mass_ad::utc.

Referenced by adCheck().

void expire_ads void   ) 
 

executed on every db expire to flush out mass ads older than 5 minutes

Definition at line 134 of file mass.c.

References LIST_FIRST, LIST_NEXT, remove_ad(), and _mass_ad::utc.

Referenced by detect_mass(), and timed_advert_maint().

aMassAd* find_ad UserList u,
int  rcv
 

Cancel mass ad cache from a user.

Parameters:
u User to flush out
rcv -1 = cancel all, or cancel where ad->rcvd_by == rcv

Definition at line 106 of file mass.c.

References LIST_FIRST, LIST_NEXT, _mass_ad::rcvd_by, and _mass_ad::sender.

Referenced by detect_mass().

void flush_ad UserList foo  ) 
 

flush_ad(<user>): called when a user quits IRC so we dont leave a dangling ->sender pointer

Definition at line 160 of file mass.c.

References LIST_FIRST, LIST_NEXT, remove_ad(), and _mass_ad::sender.

Referenced by delNick(), and detect_mass().

char ranchar int  typ  ) 
 

used by ranstring

Definition at line 208 of file mass.c.

Referenced by ranstring().

char* ranstring char *  inbuf,
int  maxlen,
int  typ
 

this is fun (generate a random string) to be used for massmsg detectors ircname/nicknames/hosts 0 = random nick 1 = random ircname 2 = random user 3 = random host

Definition at line 255 of file mass.c.

References MIN, and ranchar().

Referenced by make_clone().

void remove_ad aMassAd zap  ) 
 

quickly remove a massad from the list and free it.

Definition at line 182 of file mass.c.

References LIST_REMOVE.

Referenced by expire_ads(), and flush_ad().

void unlink_ad aMassAd zap  ) 
 

unlink a mass ad entry from the masslist without freeing the memory better keep a pointer to it unless you wanna just memleak...

Definition at line 197 of file mass.c.

References LIST_REMOVE.


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.